Reformat and simplify device profiles

This commit is contained in:
2024-12-05 21:21:02 -05:00
parent 7dbc7fc3ef
commit be5dfb2832

296
profiles
View File

@@ -1,218 +1,110 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2034 # shellcheck disable=SC2034
# This file contains a set of device profiles for openwrtbuilder # Device profiles for openwrtbuilder
# bash doesn't like nested arrays so we use strings instead
# Packages to install for all profiles # Default packages
default_packages="\ default_packages="luci luci-ssl luci-proto-wireguard luci-app-statistics \
luci \ collectd-mod-sensors collectd-mod-thermal collectd-mod-conntrack \
luci-ssl \ collectd-mod-cpu nano htop diffutils tar iperf3 zsh rsync \
luci-proto-wireguard \ openssh-sftp-server"
luci-app-statistics \
collectd-mod-sensors \
collectd-mod-thermal \
collectd-mod-conntrack \
collectd-mod-cpu \
nano \
htop \
diffutils \
tar \
iperf3 \
zsh \
rsync \
openssh-sftp-server \
"
# Current devices # Current devices
# Main router declare -Ag r4s=(
declare -Ag r4s [device]="friendlyarm_nanopi-r4s"
r4s['device']="friendlyarm_nanopi-r4s" [target]="rockchip/armv8"
r4s['target']="rockchip/armv8" [filesystem]="ext4"
r4s['filesystem']="ext4" [packages]="$default_packages luci-app-ddns luci-app-sqm irqbalance \
r4s['packages']="\ collectd-mod-df usbutils kmod-usb-storage kmod-usb-storage-uas \
$default_packages \ kmod-fs-btrfs btrfs-progs block-mount smcroute avahi-daemon \
luci-app-ddns \ curl ethtool ca-bundle"
luci-app-sqm \ [config]="CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y CONFIG_BTRFS_PROGS_ZSTD=y \
irqbalance \ CONFIG_TARGET_ROOTFS_PARTSIZE=512 CONFIG_TARGET_KERNEL_PARTSIZE=32 \
collectd-mod-df \
usbutils \
kmod-usb-storage \
kmod-usb-storage-uas \
kmod-fs-btrfs \
btrfs-progs \
block-mount \
smcroute \
avahi-daemon \
curl \
ethtool \
ca-bundle"
# The following only work in --source mode
r4s['config']="\
CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y \
CONFIG_BTRFS_PROGS_ZSTD=y \
CONFIG_TARGET_ROOTFS_PARTSIZE=512 \
CONFIG_TARGET_KERNEL_PARTSIZE=32 \
CONFIG_BUILDBOT=n" CONFIG_BUILDBOT=n"
r4s['files']="\ [files]="/mnt/backup"
/mnt/backup" )
# Access point declare -Ag ax6000=(
declare -Ag ax6000 [device]="xiaomi_redmi-router-ax6000-stock"
ax6000['device']="xiaomi_redmi-router-ax6000-stock" [target]="mediatek/filogic"
ax6000['target']="mediatek/filogic" [release]="snapshot"
ax6000['release']="snapshot" [filesystem]="squashfs"
ax6000['filesystem']="squashfs" [packages]="$default_packages -dnsmasq -odhcpd-ipv6only -nftables -firewall4"
ax6000['packages']="\ )
$default_packages \
-dnsmasq \
-odhcpd-ipv6only \
-nftables \
-firewall4"
# For uboot'd access points declare -Ag ax6000_uboot=(
declare -Ag ax6000_uboot [device]="xiaomi_redmi-router-ax6000-ubootmod"
ax6000_uboot['device']="xiaomi_redmi-router-ax6000-ubootmod" [target]="mediatek/filogic"
ax6000_uboot['target']="mediatek/filogic" [release]="snapshot"
ax6000_uboot['release']="snapshot" [filesystem]="squashfs"
ax6000_uboot['filesystem']="squashfs" [packages]="$default_packages -dnsmasq -odhcpd-ipv6only -nftables -firewall4"
ax6000_uboot['packages']="\ )
$default_packages \
-dnsmasq \
-odhcpd-ipv6only \
-nftables \
-firewall4"
# Remote NAS declare -Ag n5100=(
declare -Ag n5100 [device]="generic"
n5100['device']="generic" [target]="x86/64"
n5100['target']="x86/64" [filesystem]="squashfs"
n5100['filesystem']="squashfs" [packages]="$default_packages luci-app-ddns irqbalance collectd-mod-df \
n5100['packages']="\ usbutils kmod-usb-storage kmod-usb-storage-uas kmod-fs-btrfs \
$default_packages \ btrfs-progs block-mount cryptsetup kmod-crypto-xts smcroute \
luci-app-ddns \ avahi-daemon curl ethtool ca-bundle smartmontools intel-microcode \
irqbalance \ lm-sensors samba4-server luci-app-samba4 tailscale shadow-useradd"
collectd-mod-df \ [config]="CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y CONFIG_BTRFS_PROGS_ZSTD=y \
usbutils \ CONFIG_TARGET_ROOTFS_PARTSIZE=512 CONFIG_TARGET_KERNEL_PARTSIZE=32"
kmod-usb-storage \ [files]="/mnt/backup"
kmod-usb-storage-uas \ )
kmod-fs-btrfs \
btrfs-progs \
block-mount \
cryptsetup \
kmod-crypto-xts \
smcroute \
avahi-daemon \
curl \
ethtool \
ca-bundle \
smartmontools \
intel-microcode \
lm-sensors \
samba4-server \
luci-app-samba4 \
tailscale \
shadow-useradd"
# The following are source mode only
n5100['config']="\
CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y \
CONFIG_BTRFS_PROGS_ZSTD=y \
CONFIG_TARGET_ROOTFS_PARTSIZE=512 \
CONFIG_TARGET_KERNEL_PARTSIZE=32"
n5100['files']="\
/mnt/backup"
# Dusty drawer declare -Ag rpi4=(
declare -Ag rpi4 [device]="rpi-4"
rpi4['device']="rpi-4" [target]="bcm27xx/bcm2711"
rpi4['target']="bcm27xx/bcm2711" [filesystem]="ext4"
rpi4['filesystem']="ext4" [packages]="$default_packages kmod-usb-net-asix-ax88179 kmod-usb-net-rtl8152 \
rpi4['packages']="\ luci-app-upnp luci-app-pbr -dnsmasq dnsmasq-full luci-app-ddns luci-app-sqm"
$default_packages \ )
kmod-usb-net-asix-ax88179 \
kmod-usb-net-rtl8152 \
luci-app-upnp \
luci-app-pbr \
-dnsmasq \
dnsmasq-full \
luci-app-ddns \
luci-app-sqm"
# Stock builds declare -Ag r4s_stock=(
declare -Ag r4s_stock [device]="friendlyarm_nanopi-r4s"
r4s_stock['device']="friendlyarm_nanopi-r4s" [target]="rockchip/armv8"
r4s_stock['target']="rockchip/armv8" [filesystem]="ext4"
r4s_stock['filesystem']="ext4" [release]="snapshot"
r4s_stock['release']="snapshot" )
# Old devices declare -Ag totolink=(
declare -Ag totolink [device]="totolink_x5000r"
totolink['device']="totolink_x5000r" [target]="ramips/mt7621"
totolink['target']="ramips/mt7621" [filesystem]="squashfs"
totolink['filesystem']="squashfs" [packages]="$default_packages -dnsmasq -odhcpd-ipv6only -nftables -firewall4 \
totolink['packages']="\ -kmod-nft-offload collectd-mod-iwinfo"
$default_packages \ )
-dnsmasq \
-odhcpd-ipv6only \
-nftables \
-firewall4 \
-kmod-nft-offload \
collectd-mod-iwinfo"
declare -Ag archer declare -Ag archer=(
archer['device']="tplink_archer-c7-v2" [device]="tplink_archer-c7-v2"
archer['target']="ath79/generic" [target]="ath79/generic"
archer['filesystem']="squashfs" [filesystem]="squashfs"
archer['packages']="\ [packages]="$default_packages -dnsmasq -odhcpd -iptables \
$default_packages \ -ath10k-firmware-qca988x-ct ath10k-firmware-qca988x-ct-full-htt"
-dnsmasq \ )
-odhcpd \
-iptables \
-ath10k-firmware-qca988x-ct \
ath10k-firmware-qca988x-ct-full-htt"
declare -Ag linksys declare -Ag linksys=(
linksys['device']="linksys_ea8300" [device]="linksys_ea8300"
linksys['target']="ipq40xx/generic" [target]="ipq40xx/generic"
linksys['filesystem']="squashfs" [filesystem]="squashfs"
linksys['packages']="\ [packages]="$default_packages -dnsmasq -odhcpd -iptables"
$default_packages \ )
-dnsmasq \
-odhcpd \
-iptables"
declare -Ag r2s declare -Ag r2s=(
r2s['device']="friendlyarm_nanopi-r2s" [device]="friendlyarm_nanopi-r2s"
r2s['target']="rockchip/armv8" [target]="rockchip/armv8"
r2s['filesystem']="ext4" [filesystem]="ext4"
r2s['packages']="\ [packages]="$default_packages luci-app-upnp luci-app-pbr -dnsmasq dnsmasq-full \
$default_packages \ luci-app-ddns luci-app-sqm luci-app-statistics collectd-mod-sensors \
luci-app-upnp \ collectd-mod-thermal collectd-mod-conntrack smcroute curl ethtool"
luci-app-pbr \ )
-dnsmasq \
dnsmasq-full \
luci-app-ddns \
luci-app-sqm \
luci-app-statistics \
collectd-mod-sensors \
collectd-mod-thermal \
collectd-mod-conntrack \
smcroute \
curl \
ethtool"
declare -Ag r2s_tr declare -Ag r2s_tr=(
r2s_tr['device']="friendlyarm_nanopi-r2s" [device]="friendlyarm_nanopi-r2s"
r2s_tr['target']="rockchip/armv8" [target]="rockchip/armv8"
r2s_tr['filesystem']="ext4" [filesystem]="ext4"
r2s_tr['packages']="\ [packages]="$default_packages luci-app-upnp luci-app-pbr luci-app-ddns \
$default_packages \ luci-app-statistics collectd-mod-sensors collectd-mod-thermal \
luci-app-upnp \ collectd-mod-conntrack curl ethtool travelmate"
luci-app-pbr \ )
luci-app-ddns \
luci-app-statistics \
collectd-mod-sensors \
collectd-mod-thermal \
collectd-mod-conntrack \
curl \
ethtool \
travelmate"