Support kopts

This commit is contained in:
2023-01-14 12:43:25 -05:00
parent 423e910a04
commit 3143e5b452
2 changed files with 16 additions and 8 deletions

View File

@@ -454,7 +454,7 @@ makeImages() {
make image \ make image \
BIN_DIR="$THIS_BINDIR" \ BIN_DIR="$THIS_BINDIR" \
PROFILE="${P_ARR[profile]}" \ PROFILE="${P_ARR[profile]}" \
PACKAGES="${P_ARR[packages]}" \ PACKAGES="${P_ARR[packages]:+"${P_ARR[packages]}"}" \
FILES="${FILESDIR}" \ FILES="${FILESDIR}" \
--directory="$BUILDDIR" \ --directory="$BUILDDIR" \
--jobs="$(nproc)" \ --jobs="$(nproc)" \
@@ -537,7 +537,7 @@ fromSource() {
debug "${FUNCNAME[0]}" debug "${FUNCNAME[0]}"
declare src_url="https://github.com/openwrt/openwrt.git" declare src_url="https://github.com/openwrt/openwrt.git"
declare -a pkg_list declare pkg kopt
echo "Building from source is under development" echo "Building from source is under development"
@@ -554,7 +554,7 @@ fromSource() {
git checkout "v$RELEASE" git checkout "v$RELEASE"
fi fi
# Update packages # Update package feed
./scripts/feeds update -a && ./scripts/feeds update -a &&
./scripts/feeds install -a ./scripts/feeds install -a
@@ -571,18 +571,23 @@ fromSource() {
fi fi
# Override default .config seed with profile packages # Override default .config seed with profile packages
for package in ${P_ARR[packages]}; do for pkg in ${P_ARR[packages]:+${P_ARR[packages]}}; do
if [[ $package == -* ]]; then if [[ $pkg == -* ]]; then
echo "CONFIG_PACKAGE_${package#-}=n" >> "$SEED_FILE" echo "CONFIG_PACKAGE_${pkg#-}=n" >> "$SEED_FILE" # remove package
else else
echo "CONFIG_PACKAGE_$package=y" >> "$SEED_FILE" echo "CONFIG_PACKAGE_$pkg=y" >> "$SEED_FILE" # add package
fi fi
done done
# Add custom kernel config options
for kopt in ${P_ARR[kopts]:+${P_ARR[kopts]}}; do
echo "$kopt" >> "$SEED_FILE"
done
make defconfig # normalize .config and remove dupes make defconfig # normalize .config and remove dupes
# Only compile our target # Only compile our target
# Causes a "configuration is out of sync" error # TODO causes a "configuration is out of sync" error w/o defconfig
echo "CONFIG_TARGET_MULTI_PROFILE=n" >> "$SEED_FILE" echo "CONFIG_TARGET_MULTI_PROFILE=n" >> "$SEED_FILE"
sed -i '/CONFIG_TARGET_DEVICE_/d' "$SEED_FILE" sed -i '/CONFIG_TARGET_DEVICE_/d' "$SEED_FILE"
echo "CONFIG_TARGET_DEVICE_${P_ARR[target]//\//_}_DEVICE_${P_ARR[profile]}=y" >> "$SEED_FILE" echo "CONFIG_TARGET_DEVICE_${P_ARR[target]//\//_}_DEVICE_${P_ARR[profile]}=y" >> "$SEED_FILE"

View File

@@ -107,6 +107,9 @@ r4s['packages']="\
curl \ curl \
ethtool \ ethtool \
ca-bundle" ca-bundle"
r4s['kopts']="\
CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y"
declare -Ag ax6000_stock declare -Ag ax6000_stock
ax6000_stock['profile']="xiaomi_redmi-router-ax6000-stock" ax6000_stock['profile']="xiaomi_redmi-router-ax6000-stock"