diff --git a/README.md b/README.md index d09d74f..79b78af 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,8 @@ VERBOSE=1 # Same as -V SILENT=1 # Same as -s OPENWRT_TAG=v22.03.3 # It would check out and use the openwrt tag before the build GIT_OPENWRT="https://github.com/openwrt/openwrt" # It would use this URL to clone openwrt +INCLUDE_PACKAGES_M="" # add packages in build config to be compiled as module package i.e i2c-tools libi2c +INCLUDE_PACKAGES_Y="" # add packages in build config to be compiled as built-in package i.e i2c-tools libi2c ``` ## All files specific to custom dist are placed under dir `onion` diff --git a/build.sh b/build.sh index 8e544ab..693531b 100755 --- a/build.sh +++ b/build.sh @@ -198,6 +198,14 @@ build_model_firmware() { "$OPENWRT_DIR"/scripts/feeds update -a -f "$OPENWRT_DIR"/scripts/feeds install -a -f + for pkg in $INCLUDE_PACKAGES_M; do + echo "CONFIG_PACKAGE_${pkg}=m" >> $OPENWRT_DIR/.config + done + + for pkg in $INCLUDE_PACKAGES_Y; do + echo "CONFIG_PACKAGE_${pkg}=y" >> $OPENWRT_DIR/.config + done + do_run make -C "$OPENWRT_DIR" defconfig if [ "$VERBOSE" == "1" ]; then diff --git a/profile b/profile index 321beda..cd56bb4 100644 --- a/profile +++ b/profile @@ -8,3 +8,5 @@ OEM=onion DEV_CLEAN_SKIP=1 VERBOSE=0 SILENT=0 +INCLUDE_PACKAGES_M="i2c-tools" +INCLUDE_PACKAGES_Y=""