Compare commits
7 Commits
e556d282d6
...
433e4bf971
| Author | SHA1 | Date | |
|---|---|---|---|
| 433e4bf971 | |||
| d2f17da948 | |||
| 3f4a3c7d7e | |||
| 764ffe11d1 | |||
| 43c5a632b1 | |||
| 45009cc73f | |||
| 69f76bb290 |
@@ -36,12 +36,14 @@ printHelp() {
|
||||
Example: /dev/sdX
|
||||
--reset
|
||||
Cleanup all source and output files
|
||||
--yes,-y
|
||||
Assume yes for all questions (automatic mode)
|
||||
--debug,-d
|
||||
--help,-h
|
||||
|
||||
EXAMPLES
|
||||
./openwrtbuilder -p r4s -r snapshot
|
||||
./openwrtbuilder -p ax6000_stock -r 22.03.3 --source --debug
|
||||
./openwrtbuilder -p ax6000 -r 23.05.0-rc2 --source --debug
|
||||
./openwrtbuilder -p rpi4 -r 22.03.3 --flash /dev/sdX
|
||||
./openwrtbuilder -p linksys -r snapshot --ssh-upgrade root@192.168.1.1
|
||||
EOF
|
||||
@@ -143,13 +145,13 @@ init() {
|
||||
readInput() {
|
||||
debug "${FUNCNAME[0]}"
|
||||
|
||||
unset RESET
|
||||
unset RESET YES
|
||||
|
||||
declare -ga PROFILES
|
||||
declare long_opts='release:,version:,profile:,buildroot:,source,'
|
||||
long_opts+='ssh-upgrade:,ssh-backup:,flash:,reset,debug,help'
|
||||
long_opts+='ssh-upgrade:,ssh-backup:,flash:,reset,yes,debug,help'
|
||||
|
||||
if _input=$(getopt -o +r:v:p:b:sf:dh -l $long_opts -- "$@"); then
|
||||
if _input=$(getopt -o +r:v:p:b:sf:ydh -l $long_opts -- "$@"); then
|
||||
eval set -- "$_input"
|
||||
while true; do
|
||||
case "$1" in
|
||||
@@ -177,6 +179,9 @@ readInput() {
|
||||
--reset)
|
||||
RESET=1
|
||||
;;
|
||||
--yes|-y)
|
||||
YES=1
|
||||
;;
|
||||
--debug|-d)
|
||||
echo "Debugging on"
|
||||
DEBUG=1
|
||||
@@ -538,7 +543,7 @@ fromSource() {
|
||||
|
||||
declare src_url="https://github.com/openwrt/openwrt.git"
|
||||
declare seed_file="$GITWORKTREEDIR/.config"
|
||||
declare pkg kopt opt commit seed_file wt_cmd
|
||||
declare pkg kopt opt commit seed_file wt_cmd wt_commit description
|
||||
declare -a make_opts config_opts
|
||||
|
||||
echo "Building from source is under development"
|
||||
@@ -557,33 +562,43 @@ fromSource() {
|
||||
--detach
|
||||
"$GITWORKTREEDIR")
|
||||
|
||||
# Generate commitish for git worktree
|
||||
case "$RELEASE" in
|
||||
snapshot)
|
||||
execute "${wt_cmd[@]}" origin/main
|
||||
wt_commit="origin/main"
|
||||
;;
|
||||
[0-9][0-9].[0-9][0-9].*)
|
||||
local branch="openwrt-${RELEASE%.*}"
|
||||
local tag="v$RELEASE"
|
||||
local r
|
||||
read -r -p "Use HEAD of $branch branch (y, recommended) or $tag tag (n)? (Y/n): " r
|
||||
r=${r,,}
|
||||
if [[ "$r" =~ ^(no|n)$ ]]; then
|
||||
execute "${wt_cmd[@]}" "$tag"
|
||||
if askOk "Use HEAD of $branch branch (y, recommended) or $tag tag (n)?"; then
|
||||
wt_commit="origin/$branch"
|
||||
else
|
||||
execute "${wt_cmd[@]}" "origin/$branch"
|
||||
wt_commit="$tag"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
debug "Passing '$RELEASE' commit-ish to git worktree"
|
||||
execute "${wt_cmd[@]}" "$RELEASE"
|
||||
wt_commit="$RELEASE"
|
||||
;;
|
||||
esac
|
||||
|
||||
[[ -d "$GITWORKTREEDIR" ]] && rm -rf "$GITWORKTREEDIR"
|
||||
|
||||
execute "${wt_cmd[@]}" "$wt_commit"
|
||||
|
||||
# Print commit information
|
||||
commit=$(git -C "$GITWORKTREEDIR" rev-parse HEAD)
|
||||
description=$(git -C "$GITWORKTREEDIR" describe)
|
||||
echo "Current commit hash: $commit"
|
||||
(( DEBUG )) && git -C "$GITWORKTREEDIR" log -1
|
||||
(( DEBUG )) && git -C "$GITWORKTREEDIR" describe
|
||||
echo "Git worktree description: $description"
|
||||
|
||||
if (( DEBUG )); then
|
||||
if (( YES )); then
|
||||
git --no-pager -C "$GITWORKTREEDIR" log -1
|
||||
else
|
||||
git -C "$GITWORKTREEDIR" log -1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Enter worktree
|
||||
pushd "$GITWORKTREEDIR" || return 1
|
||||
@@ -652,10 +667,10 @@ fromSource() {
|
||||
# Make image
|
||||
(( DEBUG )) && make_opts+=("V=s")
|
||||
execute make "${make_opts[@]}" defconfig
|
||||
execute make "${make_opts[@]}" targetclean
|
||||
execute make "${make_opts[@]}" dirclean
|
||||
execute make "${make_opts[@]}" download
|
||||
execute make -f Makefile.aperl inst_perl MAP_TARGET=perl
|
||||
execute make -f Makefile.aperl map_clean
|
||||
#execute make -f Makefile.aperl inst_perl MAP_TARGET=perl
|
||||
#execute make -f Makefile.aperl map_clean
|
||||
execute make "${make_opts[@]}" "-j$(nproc)" world
|
||||
|
||||
popd || return 1
|
||||
@@ -673,6 +688,7 @@ fromSource() {
|
||||
# Generic helpers
|
||||
debug() { (( DEBUG )) && echo "Debug: $*"; }
|
||||
askOk() {
|
||||
(( YES )) && return
|
||||
local r
|
||||
read -r -p "$* [y/N]: " r
|
||||
r=${r,,}
|
||||
|
||||
254
profiles
254
profiles
@@ -21,83 +21,11 @@ default_packages="\
|
||||
collectd-mod-conntrack \
|
||||
collectd-mod-cpu"
|
||||
|
||||
# declare -Ag archer
|
||||
# archer['device']="tplink_archer-c7-v2"
|
||||
# archer['target']="ath79/generic"
|
||||
# archer['filesystem']="squashfs"
|
||||
# archer['packages']="\
|
||||
# $default_packages \
|
||||
# -dnsmasq \
|
||||
# -odhcpd \
|
||||
# -iptables \
|
||||
# -ath10k-firmware-qca988x-ct \
|
||||
# ath10k-firmware-qca988x-ct-full-htt"
|
||||
|
||||
# declare -Ag linksys
|
||||
# linksys['device']="linksys_ea8300"
|
||||
# linksys['target']="ipq40xx/generic"
|
||||
# linksys['filesystem']="squashfs"
|
||||
# linksys['packages']="\
|
||||
# $default_packages \
|
||||
# -dnsmasq \
|
||||
# -odhcpd \
|
||||
# -iptables"
|
||||
|
||||
declare -Ag rpi4
|
||||
rpi4['device']="rpi-4"
|
||||
rpi4['target']="bcm27xx/bcm2711"
|
||||
rpi4['filesystem']="ext4"
|
||||
rpi4['packages']="\
|
||||
$default_packages \
|
||||
kmod-usb-net-asix-ax88179 \
|
||||
kmod-usb-net-rtl8152 \
|
||||
luci-app-upnp \
|
||||
luci-app-wireguard \
|
||||
luci-app-pbr \
|
||||
-dnsmasq \
|
||||
dnsmasq-full \
|
||||
luci-app-ddns \
|
||||
luci-app-sqm"
|
||||
|
||||
# declare -Ag r2s
|
||||
# r2s['device']="friendlyarm_nanopi-r2s"
|
||||
# r2s['target']="rockchip/armv8"
|
||||
# r2s['filesystem']="ext4"
|
||||
# r2s['packages']="\
|
||||
# $default_packages \
|
||||
# luci-app-upnp \
|
||||
# luci-app-wireguard \
|
||||
# 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
|
||||
# r2s_tr['device']="friendlyarm_nanopi-r2s"
|
||||
# r2s_tr['target']="rockchip/armv8"
|
||||
# r2s_tr['filesystem']="ext4"
|
||||
# r2s_tr['packages']="\
|
||||
# $default_packages \
|
||||
# luci-app-upnp \
|
||||
# luci-app-wireguard \
|
||||
# luci-app-pbr \
|
||||
# luci-app-ddns \
|
||||
# luci-app-statistics \
|
||||
# collectd-mod-sensors \
|
||||
# collectd-mod-thermal \
|
||||
# collectd-mod-conntrack \
|
||||
# curl \
|
||||
# ethtool \
|
||||
# travelmate"
|
||||
#################
|
||||
# Current devices
|
||||
#################
|
||||
|
||||
# Main router
|
||||
declare -Ag r4s
|
||||
r4s['device']="friendlyarm_nanopi-r4s"
|
||||
r4s['target']="rockchip/armv8"
|
||||
@@ -125,16 +53,12 @@ r4s['packages']="\
|
||||
r4s['kopts']="\
|
||||
CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y \
|
||||
CONFIG_BTRFS_PROGS_ZSTD=y \
|
||||
CONFIG_TARGET_ROOTFS_PARTSIZE=1024"
|
||||
CONFIG_TARGET_ROOTFS_PARTSIZE=1024 \
|
||||
CONFIG_TARGET_KERNEL_PARTSIZE=128"
|
||||
r4s['files']="\
|
||||
/mnt/backup"
|
||||
|
||||
# declare -Ag r4s_stock
|
||||
# r4s_stock['device']="friendlyarm_nanopi-r4s"
|
||||
# r4s_stock['target']="rockchip/armv8"
|
||||
# r4s_stock['filesystem']="ext4"
|
||||
# r4s_stock['release']="snapshot"
|
||||
|
||||
# WDS mesh nodes
|
||||
declare -Ag ax6000
|
||||
ax6000['device']="xiaomi_redmi-router-ax6000-stock"
|
||||
ax6000['target']="mediatek/filogic"
|
||||
@@ -145,13 +69,13 @@ ax6000['packages']="\
|
||||
-dnsmasq \
|
||||
-odhcpd-ipv6only \
|
||||
-nftables \
|
||||
-firewall4 \
|
||||
-kmod-nft-offload \
|
||||
collectd-mod-iwinfo \
|
||||
mesh11sd \
|
||||
-wpad-basic-mbedtls \
|
||||
wpad-mesh-mbedtls"
|
||||
-firewall4"
|
||||
# for 802.11s
|
||||
# mesh11sd \
|
||||
# -wpad-basic-mbedtls \
|
||||
# wpad-mesh-mbedtls"
|
||||
|
||||
# For converted uboots
|
||||
# declare -Ag ax6000_uboot
|
||||
# ax6000_uboot['device']="xiaomi_redmi-router-ax6000-ubootmod"
|
||||
# ax6000_uboot['target']="mediatek/filogic"
|
||||
@@ -166,15 +90,143 @@ ax6000['packages']="\
|
||||
# -kmod-nft-offload \
|
||||
# collectd-mod-iwinfo"
|
||||
|
||||
# declare -Ag totolink
|
||||
# totolink['device']="totolink_x5000r"
|
||||
# totolink['target']="ramips/mt7621"
|
||||
# totolink['filesystem']="squashfs"
|
||||
# totolink['packages']="\
|
||||
# $default_packages \
|
||||
# -dnsmasq \
|
||||
# -odhcpd-ipv6only \
|
||||
# -nftables \
|
||||
# -firewall4 \
|
||||
# -kmod-nft-offload \
|
||||
# collectd-mod-iwinfo"
|
||||
# Remote NAS
|
||||
declare -Ag n5100
|
||||
n5100['device']="generic"
|
||||
n5100['target']="x86/64"
|
||||
n5100['filesystem']="ext4"
|
||||
n5100['packages']="\
|
||||
$default_packages \
|
||||
luci-app-wireguard \
|
||||
luci-proto-wireguard \
|
||||
luci-app-ddns \
|
||||
irqbalance \
|
||||
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 \
|
||||
smartmontools \
|
||||
intel-microcode \
|
||||
lm-sensors \
|
||||
-libustream-wolfssl"
|
||||
# The following are source mode only
|
||||
n5100['kopts']="\
|
||||
CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y \
|
||||
CONFIG_BTRFS_PROGS_ZSTD=y \
|
||||
CONFIG_TARGET_ROOTFS_PARTSIZE=1024 \
|
||||
CONFIG_TARGET_KERNEL_PARTSIZE=128"
|
||||
n5100['files']="\
|
||||
/mnt/backup"
|
||||
|
||||
# Dusty drawer
|
||||
declare -Ag rpi4
|
||||
rpi4['device']="rpi-4"
|
||||
rpi4['target']="bcm27xx/bcm2711"
|
||||
rpi4['filesystem']="ext4"
|
||||
rpi4['packages']="\
|
||||
$default_packages \
|
||||
kmod-usb-net-asix-ax88179 \
|
||||
kmod-usb-net-rtl8152 \
|
||||
luci-app-upnp \
|
||||
luci-app-wireguard \
|
||||
luci-app-pbr \
|
||||
-dnsmasq \
|
||||
dnsmasq-full \
|
||||
luci-app-ddns \
|
||||
luci-app-sqm"
|
||||
|
||||
|
||||
#################
|
||||
# Stock builds
|
||||
#################
|
||||
declare -Ag r4s_stock
|
||||
r4s_stock['device']="friendlyarm_nanopi-r4s"
|
||||
r4s_stock['target']="rockchip/armv8"
|
||||
r4s_stock['filesystem']="ext4"
|
||||
r4s_stock['release']="snapshot"
|
||||
|
||||
|
||||
#################
|
||||
# Old devices
|
||||
#################
|
||||
declare -Ag totolink
|
||||
totolink['device']="totolink_x5000r"
|
||||
totolink['target']="ramips/mt7621"
|
||||
totolink['filesystem']="squashfs"
|
||||
totolink['packages']="\
|
||||
$default_packages \
|
||||
-dnsmasq \
|
||||
-odhcpd-ipv6only \
|
||||
-nftables \
|
||||
-firewall4 \
|
||||
-kmod-nft-offload \
|
||||
collectd-mod-iwinfo"
|
||||
|
||||
declare -Ag archer
|
||||
archer['device']="tplink_archer-c7-v2"
|
||||
archer['target']="ath79/generic"
|
||||
archer['filesystem']="squashfs"
|
||||
archer['packages']="\
|
||||
$default_packages \
|
||||
-dnsmasq \
|
||||
-odhcpd \
|
||||
-iptables \
|
||||
-ath10k-firmware-qca988x-ct \
|
||||
ath10k-firmware-qca988x-ct-full-htt"
|
||||
|
||||
declare -Ag linksys
|
||||
linksys['device']="linksys_ea8300"
|
||||
linksys['target']="ipq40xx/generic"
|
||||
linksys['filesystem']="squashfs"
|
||||
linksys['packages']="\
|
||||
$default_packages \
|
||||
-dnsmasq \
|
||||
-odhcpd \
|
||||
-iptables"
|
||||
|
||||
declare -Ag r2s
|
||||
r2s['device']="friendlyarm_nanopi-r2s"
|
||||
r2s['target']="rockchip/armv8"
|
||||
r2s['filesystem']="ext4"
|
||||
r2s['packages']="\
|
||||
$default_packages \
|
||||
luci-app-upnp \
|
||||
luci-app-wireguard \
|
||||
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
|
||||
r2s_tr['device']="friendlyarm_nanopi-r2s"
|
||||
r2s_tr['target']="rockchip/armv8"
|
||||
r2s_tr['filesystem']="ext4"
|
||||
r2s_tr['packages']="\
|
||||
$default_packages \
|
||||
luci-app-upnp \
|
||||
luci-app-wireguard \
|
||||
luci-app-pbr \
|
||||
luci-app-ddns \
|
||||
luci-app-statistics \
|
||||
collectd-mod-sensors \
|
||||
collectd-mod-thermal \
|
||||
collectd-mod-conntrack \
|
||||
curl \
|
||||
ethtool \
|
||||
travelmate"
|
||||
|
||||
Reference in New Issue
Block a user