Compare commits

...

19 Commits

Author SHA1 Message Date
aeead798c3 Test explicit branch 2025-09-23 16:12:57 -04:00
72355bb65a Use fetch --all to grab wt breanches 2025-09-23 15:37:13 -04:00
3053b24063 Update default release 2025-09-23 15:13:35 -04:00
186fe21d73 Update profiles 2025-09-10 19:29:56 -04:00
d63a909d54 Simplify script dir ID 2025-09-09 16:57:22 -04:00
9128c453f3 Move pfring exclusions to r4s 2025-08-19 16:54:27 -04:00
ffbd193b79 Clarify skipping lock files for --debug 2025-08-19 16:38:03 -04:00
5259c72de4 Exclude pfring kmods 2025-08-18 07:43:09 -04:00
045f43b51f Exclude more pfring packages 2025-08-15 16:53:59 -04:00
89cc3cddeb Exclude problematic packages 2025-08-13 17:34:37 -04:00
cd7449dd7c Re-disable multicore make 2025-08-11 17:44:04 -04:00
2b35e1e017 Re-enable multicore make 2025-08-11 17:10:20 -04:00
983f9ecb04 Exclude libpfring to fix compilation 2025-08-11 15:50:20 -04:00
b5f567ce2b Attempt to mix yes and execute() 2025-08-09 00:01:34 -04:00
a16e713895 Use canonincal method for now 2025-08-08 23:56:28 -04:00
70d24d7fae Replace defconfig with oldconfig 2025-08-08 22:33:30 -04:00
d5069d4c40 Add golang dependency 2025-08-08 22:24:39 -04:00
718b29cfe8 Try to omit oldconfig 2025-08-08 22:22:35 -04:00
e3ce0b6e57 Make oldconfig to prevent upstream clobbers 2025-08-08 20:50:07 -04:00
3 changed files with 34 additions and 23 deletions

View File

@@ -13,9 +13,9 @@ Build and deploy OpenWRT images using shell-style device profiles, via source co
--release,-r,--version,-v RELEASE ("snapshot", "22.03.3") --release,-r,--version,-v RELEASE ("snapshot", "22.03.3")
--buildroot,-b PATH (Default: script directory) --buildroot,-b PATH (Default: script directory)
--source --source
Build image from source code, not from Image Builder Build image from source code, not from Image Builder.
Allows make config options to be passed in profile Allows make config options to be passed in profile.
Uses git worktree for multi-profile deduplication Uses git worktree for multi-profile deduplication.
--ssh-upgrade HOST --ssh-upgrade HOST
Example: root@192.168.1.1 Example: root@192.168.1.1
--ssh-backup SSH_PATH --ssh-backup SSH_PATH

View File

@@ -2,10 +2,10 @@
# Build and deploy OpenWRT images using shell-style device profiles, via source code or the official Image Builder. # Build and deploy OpenWRT images using shell-style device profiles, via source code or the official Image Builder.
# Copyright 2022-25 Bryan C. Roessler # Copyright 2022-25 Bryan C. Roessler
# Apache 2.0 License # Apache 2.0 License
# See README and profiles for device configuration # See README and ./profiles for device configuration
# Set default release # Set default release
: "${RELEASE:="24.10.2"}" : "${RELEASE:="24.10.3"}"
# @internal # @internal
print_help() { print_help() {
@@ -58,7 +58,7 @@ init() {
# Save the script directory # Save the script directory
# https://stackoverflow.com/a/4774063 # https://stackoverflow.com/a/4774063
SCRIPT_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 || exit $? ; pwd -P)" SCRIPT_DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")
if [[ -e "/etc/os-release" ]]; then if [[ -e "/etc/os-release" ]]; then
source "/etc/os-release" source "/etc/os-release"
@@ -172,7 +172,7 @@ install_dependencies() {
lock_file="$BUILD_ROOT/.dependencies_ib.lock" lock_file="$BUILD_ROOT/.dependencies_ib.lock"
fi fi
[[ -f $lock_file ]] && debug "$lock_file lock file exists" && return 0 [[ -f $lock_file ]] && debug "$lock_file lock file exists but skipping for --debug" && return 0
if [[ "$mode" == "source" ]]; then if [[ "$mode" == "source" ]]; then
# For building from source code see: # For building from source code see:
@@ -186,6 +186,7 @@ install_dependencies() {
gcc gcc
gcc-c++ gcc-c++
git git
golang
llvm15-libs # for qosify llvm15-libs # for qosify
make make
ncurses-devel ncurses-devel
@@ -204,6 +205,7 @@ install_dependencies() {
python3-devel python3-devel
python3-pyelftools python3-pyelftools
python3-setuptools python3-setuptools
quilt
rsync rsync
swig swig
tar tar
@@ -222,10 +224,12 @@ install_dependencies() {
gcc-multilib gcc-multilib
gettext gettext
git git
golang
liblzma-dev liblzma-dev
libncurses5-dev libncurses5-dev
libssl-dev libssl-dev
python3-distutils python3-distutils
quilt
rsync rsync
patch patch
unzip unzip
@@ -250,6 +254,7 @@ install_dependencies() {
gcc gcc
gettext gettext
git git
golang
grep grep
groff groff
gzip gzip
@@ -264,6 +269,7 @@ install_dependencies() {
patch patch
pkgconf pkgconf
python python
quilt
rsync rsync
sed sed
texinfo texinfo
@@ -524,7 +530,7 @@ from_source() {
# Pull or clone source repo # Pull or clone source repo
if [[ -d "$SRC_DIR" ]]; then if [[ -d "$SRC_DIR" ]]; then
execute git -C "$SRC_DIR" pull execute git -C "$SRC_DIR" fetch --all --prune --tags
else else
execute mkdir -p "$SRC_DIR" execute mkdir -p "$SRC_DIR"
execute git clone "$src_url" "$SRC_DIR" execute git clone "$src_url" "$SRC_DIR"
@@ -535,7 +541,7 @@ from_source() {
execute rm -rf "$BUILD_DIR" execute rm -rf "$BUILD_DIR"
fi fi
execute git -C "$SRC_DIR" worktree prune --verbose execute git -C "$SRC_DIR" worktree prune --verbose
execute git -C "$SRC_DIR" worktree add --detach "$BUILD_DIR" "$ref" execute git -C "$SRC_DIR" worktree add --detach "$BUILD_DIR" "origin/$ref"
# Add cherrypick commits if specified in profile # Add cherrypick commits if specified in profile
for entry in ${P_ARR[cherrypicks]}; do for entry in ${P_ARR[cherrypicks]}; do
@@ -623,21 +629,22 @@ from_source() {
config_opts+=("CONFIG_IB=n") config_opts+=("CONFIG_IB=n")
config_opts+=("CONFIG_MAKE_TOOLCHAIN=n") config_opts+=("CONFIG_MAKE_TOOLCHAIN=n")
# Serial make prep is more reliable
execute make "${make_opts[@]}" "-j1" defconfig
# Write options to config seed file # Write options to config seed file
for config in "${config_opts[@]}"; do for config in "${config_opts[@]}"; do
debug "Writing $config to $seed_file" debug "Writing $config to $seed_file"
echo "$config" >> "$seed_file" echo "$config" >> "$seed_file"
done done
# Serial make prep is more reliable execute bash -c "yes '' | make ${make_opts[*]} -j1 oldconfig"
execute make "${make_opts[@]}" "-j1" defconfig
execute make "${make_opts[@]}" "-j1" download
# make_opts+=("-j$(($(nproc)-1))") # make_opts+=("-j$(($(nproc)-2))")
((DEBUG)) && make_opts+=("-j1") || make_opts+=("-j$(($(nproc)-1))") ((DEBUG)) && make_opts+=("-j1") || make_opts+=("-j$(($(nproc)-2))")
# Make image # Make image
if ! execute ionice -c 3 chrt --idle 0 nice -n19 make "${make_opts[@]}" world; then if ! execute ionice -c 3 chrt --idle 0 nice -n19 make "${make_opts[@]}" download world; then
echo "Error: make failed" echo "Error: make failed"
return 1 return 1
fi fi
@@ -768,7 +775,7 @@ main() {
# Store profile in P_ARR nameref # Store profile in P_ARR nameref
local -n P_ARR="$profile" local -n P_ARR="$profile"
local mode="${P_ARR[mode]:="imagebuilder"}" local mode="${P_ARR[mode]:-"imagebuilder"}"
((FROM_SOURCE)) && mode="source" # allow cli override ((FROM_SOURCE)) && mode="source" # allow cli override
install_dependencies "$mode" install_dependencies "$mode"
local repo="${P_ARR[repo]:-}" local repo="${P_ARR[repo]:-}"

View File

@@ -2,13 +2,14 @@
# Device profiles for openwrtbuilder # Device profiles for openwrtbuilder
# shellcheck disable=SC2034 # shellcheck disable=SC2034
# Default (but optional) packages # Default (but optional) packages (precede with "-" to exclude)
default_packages=(nano htop diffutils tar iperf3 zsh rsync default_packages=(nano htop diffutils tar iperf3 zsh rsync curl tcpdump
openssh-sftp-server luci luci-ssl luci-proto-wireguard luci-app-statistics openssh-sftp-server luci luci-ssl luci-proto-wireguard luci-app-statistics
collectd-mod-sensors collectd-mod-thermal collectd-mod-conntrack collectd-mod-cpu) collectd-mod-sensors collectd-mod-thermal collectd-mod-conntrack collectd-mod-cpu
)
# Default (but optional) kernel configs # Default (but optional) kernel configs
default_configs=("CONFIG_ALL_KMODS=n" "CONFIG_BUILDBOT=n") default_configs=("CONFIG_BUILDBOT=n")
# Current devices # Current devices
declare -Ag r4s=( declare -Ag r4s=(
@@ -18,9 +19,10 @@ declare -Ag r4s=(
[filesystem]="ext4" [filesystem]="ext4"
[packages]="${default_packages[*]} \ [packages]="${default_packages[*]} \
luci-app-ddns luci-app-sqm irqbalance \ luci-app-ddns luci-app-sqm irqbalance \
adblock luci-app-adblock \
collectd-mod-df usbutils kmod-usb-storage kmod-usb-storage-uas \ collectd-mod-df usbutils kmod-usb-storage kmod-usb-storage-uas \
kmod-fs-btrfs btrfs-progs block-mount smcroute avahi-daemon \ kmod-fs-btrfs btrfs-progs block-mount smcroute avahi-daemon \
curl ethtool ca-bundle tailscale" ethtool ca-bundle tailscale"
[config]="${default_configs[*]} \ [config]="${default_configs[*]} \
CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y CONFIG_BTRFS_PROGS_ZSTD=y \ CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y CONFIG_BTRFS_PROGS_ZSTD=y \
CONFIG_TARGET_ROOTFS_PARTSIZE=512 CONFIG_TARGET_KERNEL_PARTSIZE=32" CONFIG_TARGET_ROOTFS_PARTSIZE=512 CONFIG_TARGET_KERNEL_PARTSIZE=32"
@@ -35,7 +37,8 @@ declare -Ag ax6000=(
[target]="mediatek/filogic" [target]="mediatek/filogic"
[release]="snapshot" [release]="snapshot"
[filesystem]="squashfs" [filesystem]="squashfs"
[packages]="${default_packages[*]} -dnsmasq -odhcpd-ipv6only -nftables -firewall4 tailscale" [packages]="${default_packages[*]} \
-dnsmasq -odhcpd-ipv6only -nftables -firewall4 tailscale"
) )
declare -Ag ax6000_uboot=( declare -Ag ax6000_uboot=(
@@ -44,7 +47,8 @@ declare -Ag ax6000_uboot=(
[target]="mediatek/filogic" [target]="mediatek/filogic"
[release]="snapshot" [release]="snapshot"
[filesystem]="squashfs" [filesystem]="squashfs"
[packages]="${default_packages[*]} -dnsmasq -odhcpd-ipv6only -nftables -firewall4" [packages]="${default_packages[*]} \
-dnsmasq -odhcpd-ipv6only -nftables -firewall4"
) )
declare -Ag n5100=( declare -Ag n5100=(