diff --git a/config/sources/families/include/uefi_common.inc b/config/sources/families/include/uefi_common.inc index 5fc2d8051..60622efce 100644 --- a/config/sources/families/include/uefi_common.inc +++ b/config/sources/families/include/uefi_common.inc @@ -15,7 +15,7 @@ declare -g DISTRO_GENERIC_KERNEL=no case "${BRANCH}" in ddk) - # This will force `unset KERNELSOURCE` later; no kernel will be built. + # This will force `KERNELSOURCE='none'` later; no kernel will be built. # Instead, the distro's default linux-generic kernel will be installed. # rpardini: For some regrettable reason, most of this logic is in the grub extension. declare -g DISTRO_GENERIC_KERNEL=yes diff --git a/extensions/grub.sh b/extensions/grub.sh index a1bd72c33..71c3c3287 100644 --- a/extensions/grub.sh +++ b/extensions/grub.sh @@ -63,7 +63,7 @@ function extension_prepare_config__prepare_grub_standard() { if [[ "${DISTRO_GENERIC_KERNEL}" == "yes" ]]; then declare -g IMAGE_INSTALLED_KERNEL_VERSION="${DISTRO_KERNEL_VER}" - unset KERNELSOURCE # This should make Armbian skip most stuff. At least, I hacked it to. + declare -g KERNELSOURCE='none' # We need to be explicit we don't want a kernel built. declare -g INSTALL_ARMBIAN_FIRMWARE=no # Should skip build and install of Armbian-firmware. else declare -g KERNELDIR="linux-uefi-${LINUXFAMILY}" # Avoid sharing a source tree with others, until we know it's safe. diff --git a/lib/functions/compilation/kernel-git.sh b/lib/functions/compilation/kernel-git.sh index d8c40b6d8..75d23cb9f 100644 --- a/lib/functions/compilation/kernel-git.sh +++ b/lib/functions/compilation/kernel-git.sh @@ -8,7 +8,7 @@ # https://github.com/armbian/build/ function kernel_prepare_git() { - [[ -z $KERNELSOURCE ]] && return 0 # do nothing if no kernel source... but again, why were we called then? + [[ "${KERNELSOURCE}" == 'none' ]] && return 0 # do nothing if no kernel source... but again, why were we called then? # validate kernel_git_bare_tree is set if [[ -z "${kernel_git_bare_tree}" ]]; then diff --git a/lib/functions/image/rootfs-to-image.sh b/lib/functions/image/rootfs-to-image.sh index 729a83ec7..7585374c9 100644 --- a/lib/functions/image/rootfs-to-image.sh +++ b/lib/functions/image/rootfs-to-image.sh @@ -86,7 +86,7 @@ function create_image_from_sdcard_rootfs() { PRE_UPDATE_INITRAMFS # stage: create final initramfs - [[ -n $KERNELSOURCE ]] && { + [[ "${KERNELSOURCE}" != 'none' ]] && { update_initramfs "$MOUNT" } diff --git a/lib/functions/main/build-packages.sh b/lib/functions/main/build-packages.sh index 44e630ed4..e00b64f27 100644 --- a/lib/functions/main/build-packages.sh +++ b/lib/functions/main/build-packages.sh @@ -11,7 +11,7 @@ function determine_artifacts_to_build_for_image() { if [[ "${BOOTCONFIG}" != "none" ]]; then artifacts_to_build+=("uboot") fi - if [[ -n $KERNELSOURCE ]]; then + if [[ "${KERNELSOURCE}" != 'none' ]]; then artifacts_to_build+=("kernel") fi diff --git a/lib/functions/main/config-prepare.sh b/lib/functions/main/config-prepare.sh index c303e7625..3138e91e7 100644 --- a/lib/functions/main/config-prepare.sh +++ b/lib/functions/main/config-prepare.sh @@ -220,7 +220,7 @@ function config_post_main() { # So we gotta explictly know the major.minor to be able to do that scheme. # If we don't know, we could use BRANCH as reference, but that changes over time, and leads to wastage. if [[ "${skip_kernel:-"no"}" != "yes" ]]; then - if [[ -n "${KERNELSOURCE}" ]]; then + if [[ "${KERNELSOURCE}" != 'none' ]]; then if [[ "x${KERNEL_MAJOR_MINOR}x" == "xx" ]]; then display_alert "Problem: after configuration, there's not enough kernel info" "Might happen if you used the wrong BRANCH. Make sure 'BRANCH=${BRANCH}' is valid." "err" # if we have KERNEL_TARGET set. diff --git a/lib/functions/rootfs/distro-agnostic.sh b/lib/functions/rootfs/distro-agnostic.sh index 43f1759ac..d17a03176 100644 --- a/lib/functions/rootfs/distro-agnostic.sh +++ b/lib/functions/rootfs/distro-agnostic.sh @@ -274,14 +274,14 @@ function install_distribution_agnostic() { call_extension_method "pre_install_kernel_debs" <<- 'PRE_INSTALL_KERNEL_DEBS' *called before installing the Armbian-built kernel deb packages* - It is not too late to `unset KERNELSOURCE` here and avoid kernel install. + It is not too late to `KERNELSOURCE='none'` here and avoid kernel install. PRE_INSTALL_KERNEL_DEBS # default IMAGE_INSTALLED_KERNEL_VERSION, will be parsed from Kernel version in the installed deb package. IMAGE_INSTALLED_KERNEL_VERSION="generic" # install kernel: image/dtb/headers - if [[ -n $KERNELSOURCE ]]; then + if [[ "${KERNELSOURCE}" != "none" ]]; then install_artifact_deb_chroot "linux-image" if [[ "${KERNEL_BUILD_DTBS:-"yes"}" == "yes" ]]; then