From 60bb05e19a90340276fb582614a4e2c5e10d84ca Mon Sep 17 00:00:00 2001 From: bryan Date: Fri, 13 Jan 2023 15:13:06 -0500 Subject: [PATCH] Support user packages in --source --- openwrtbuilder | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/openwrtbuilder b/openwrtbuilder index 66e7218..e92de7d 100755 --- a/openwrtbuilder +++ b/openwrtbuilder @@ -538,7 +538,7 @@ fromSource() { if [[ ! -d "$src_dir" ]]; then mkdir -p "$src_dir" - git clone "$src_url" "$src_dir" + git clone "$src_url" "$src_dir" fi pushd "$src_dir" || return 1 @@ -552,14 +552,27 @@ fromSource() { ./scripts/feeds update -a ./scripts/feeds install -a - # Grab the release config.seed - k_options=$(curl -s "$SEED_URL") - debug "$k_options" + # Grab the release seed config + if [[ ! -f .config ]]; then + if ! curl -so .config "$SEED_URL"; then + echo "Could not obtain seed config" + fi + else + echo "Reusing existing .config" + fi + # Update .config with profile packages + for package in ${P_ARR[packages]}; do + if [[ $package == -* ]]; then + echo "CONFIG_PACKAGE_${package#-}=n" >> .config + else + echo "CONFIG_PACKAGE_$package=y" >> .config + fi + done - - make distclean - make download + make defconfig # normalize .config and remove dupes + make targetclean + make download && make -j"$(nproc)" world popd || return 1