main-config: fix: avoid errors when BRANCH contains a dash; convert to underscore

This commit is contained in:
Ricardo Pardini 2024-04-01 18:40:19 +02:00 committed by monkaBlyat
parent 1074c969e8
commit 5e943dede7
2 changed files with 6 additions and 3 deletions

View File

@ -301,7 +301,8 @@ function do_extra_configuration() {
[[ -z $UBOOT_USE_GCC ]] && exit_with_error "Error in configuration: UBOOT_USE_GCC is unset"
[[ -z $KERNEL_USE_GCC ]] && exit_with_error "Error in configuration: KERNEL_USE_GCC is unset"
declare BOOTCONFIG_VAR_NAME="BOOTCONFIG_${BRANCH^^}"
declare BOOTCONFIG_VAR_NAME="BOOTCONFIG_${BRANCH^^}" # Branch name, uppercase
BOOTCONFIG_VAR_NAME=${BOOTCONFIG_VAR_NAME//-/_} # Replace dashes with underscores
[[ -n ${!BOOTCONFIG_VAR_NAME} ]] && BOOTCONFIG=${!BOOTCONFIG_VAR_NAME}
[[ -z $BOOTPATCHDIR ]] && BOOTPATCHDIR="u-boot-$LINUXFAMILY" # @TODO move to hook
[[ -z $ATFPATCHDIR ]] && ATFPATCHDIR="atf-$LINUXFAMILY"

View File

@ -19,7 +19,8 @@ function install_distribution_agnostic() {
echo "/dev/mmcblk0p2 /usr $ROOTFS_TYPE defaults 0 2" >> "${SDCARD}"/etc/fstab
# create modules file
local modules=MODULES_${BRANCH^^}
local modules=MODULES_${BRANCH^^} # BRANCH, uppercase
modules=${modules//-/_} # replace dashes with underscores
if [[ -n "${!modules}" ]]; then
tr ' ' '\n' <<< "${!modules}" > "${SDCARD}"/etc/modules
elif [[ -n "${MODULES}" ]]; then
@ -27,7 +28,8 @@ function install_distribution_agnostic() {
fi
# create blacklist files
local blacklist=MODULES_BLACKLIST_${BRANCH^^}
local blacklist=MODULES_BLACKLIST_${BRANCH^^} # BRANCH, uppercase
blacklist=${blacklist//-/_} # replace dashes with underscores
if [[ -n "${!blacklist}" ]]; then
tr ' ' '\n' <<< "${!blacklist}" | sed -e 's/^/blacklist /' > "${SDCARD}/etc/modprobe.d/blacklist-${BOARD}.conf"
elif [[ -n "${MODULES_BLACKLIST}" ]]; then