From 94f60e30b1f9db0644e44e3e3cf3f7960df3512a Mon Sep 17 00:00:00 2001 From: bryan Date: Wed, 22 Oct 2025 15:46:06 -0400 Subject: [PATCH] Pass BIN_DIR to make and not .config --- openwrtbuilder | 55 ++++++++++++++++++++++++++++++-------------------- profiles | 5 ----- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/openwrtbuilder b/openwrtbuilder index bc2eed6..ae9bac8 100755 --- a/openwrtbuilder +++ b/openwrtbuilder @@ -590,9 +590,6 @@ from_source() { return 1 fi - # Set compilation output dir - config_opts+=("CONFIG_BINARY_FOLDER=\"$BIN_DIR\"") - # Add custom packages for pkg in $PACKAGES; do if [[ $pkg == -* ]]; then @@ -602,31 +599,45 @@ from_source() { fi done - # Add config options from profile - for config in ${P_ARR[config]}; do - config_opts+=("$config") - done + # Disable unecessary buildbot config options + config_opts+=( + "CONFIG_BUILDBOT=n" + "CONFIG_ALL_KMODS=n" + "CONFIG_ALL_NONSHARED=n" + "CONFIG_DEVEL=n" + "CONFIG_COLLECT_KERNEL_DEBUG=n" + "CONFIG_SDK=n" + "CONFIG_SDK_LLVM_BPF=n" + "CONFIG_IB=n" + "CONFIG_MAKE_TOOLCHAIN=n" + ) # Only compile selected fs execute sed -i '/CONFIG_TARGET_ROOTFS_/d' "$seed_file" config_opts+=("CONFIG_TARGET_PER_DEVICE_ROOTFS=n") - if [[ $FILESYSTEM == "squashfs" ]]; then - config_opts+=("CONFIG_TARGET_ROOTFS_EXT4FS=n") - config_opts+=("CONFIG_TARGET_ROOTFS_SQUASHFS=y") - elif [[ $FILESYSTEM == "ext4" ]]; then - config_opts+=("CONFIG_TARGET_ROOTFS_SQUASHFS=n") - config_opts+=("CONFIG_TARGET_ROOTFS_EXT4FS=y") - fi + case "$FILESYSTEM" in + squashfs) config_opts+=( + "CONFIG_TARGET_ROOTFS_EXT4FS=n" + "CONFIG_TARGET_ROOTFS_SQUASHFS=y" + ) ;; + ext4) config_opts+=( + "CONFIG_TARGET_ROOTFS_SQUASHFS=n" + "CONFIG_TARGET_ROOTFS_EXT4FS=y" + ) ;; + esac # Only compile selected target image execute sed -i '/CONFIG_TARGET_DEVICE_/d' "$seed_file" - config_opts+=("CONFIG_TARGET_MULTI_PROFILE=n") - config_opts+=("CONFIG_TARGET_PROFILE=DEVICE_$DEVICE") - config_opts+=("CONFIG_TARGET_${TARGET//\//_}_DEVICE_$DEVICE=y") - config_opts+=("CONFIG_SDK=n") - config_opts+=("CONFIG_SDK_LLVM_BPF=n") - config_opts+=("CONFIG_IB=n") - config_opts+=("CONFIG_MAKE_TOOLCHAIN=n") + config_opts+=( + "CONFIG_TARGET_MULTI_PROFILE=n" + "CONFIG_TARGET_PROFILE=DEVICE_$DEVICE" + "CONFIG_TARGET_${TARGET//\//_}_DEVICE_$DEVICE=y" + ) + + # Add profile config options + for config in ${P_ARR[config]}; do + config_opts+=("$config") + done # Write options to config seed file for config in "${config_opts[@]}"; do @@ -641,7 +652,7 @@ from_source() { ((DEBUG)) && make_opts+=("-j1") || make_opts+=("-j$(($(nproc)-2))") # Make image - if ! execute ionice -c 3 chrt --idle 0 nice -n19 make "${make_opts[@]}" download world; then + if ! execute ionice -c 3 chrt --idle 0 nice -n19 make "${make_opts[@]}" BIN_DIR="$BIN_DIR" download world; then echo "Error: make failed" return 1 fi diff --git a/profiles b/profiles index 348db20..7245efb 100644 --- a/profiles +++ b/profiles @@ -10,11 +10,6 @@ default_packages=(nano htop diffutils tar iperf3 zsh rsync curl tcpdump # Default (but optional) kernel configs default_configs=( - "CONFIG_BUILDBOT=n" - "CONFIG_ALL_KMODS=n" - "CONFIG_ALL_NONSHARED=n" - "CONFIG_DEVEL=n" - "CONFIG_COLLECT_KERNEL_DEBUG=n" ) # Current devices