core: semantic change, KERNELSOURCE must be explicitly 'none' to avoid kernel compilation (not unset)

This commit is contained in:
Ricardo Pardini
2023-12-27 14:53:48 +01:00
committed by Igor
parent 32fecdd9cc
commit c434c3613c
7 changed files with 8 additions and 8 deletions

View File

@@ -15,7 +15,7 @@ declare -g DISTRO_GENERIC_KERNEL=no
case "${BRANCH}" in case "${BRANCH}" in
ddk) 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. # 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. # rpardini: For some regrettable reason, most of this logic is in the grub extension.
declare -g DISTRO_GENERIC_KERNEL=yes declare -g DISTRO_GENERIC_KERNEL=yes

View File

@@ -63,7 +63,7 @@ function extension_prepare_config__prepare_grub_standard() {
if [[ "${DISTRO_GENERIC_KERNEL}" == "yes" ]]; then if [[ "${DISTRO_GENERIC_KERNEL}" == "yes" ]]; then
declare -g IMAGE_INSTALLED_KERNEL_VERSION="${DISTRO_KERNEL_VER}" 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. declare -g INSTALL_ARMBIAN_FIRMWARE=no # Should skip build and install of Armbian-firmware.
else else
declare -g KERNELDIR="linux-uefi-${LINUXFAMILY}" # Avoid sharing a source tree with others, until we know it's safe. declare -g KERNELDIR="linux-uefi-${LINUXFAMILY}" # Avoid sharing a source tree with others, until we know it's safe.

View File

@@ -8,7 +8,7 @@
# https://github.com/armbian/build/ # https://github.com/armbian/build/
function kernel_prepare_git() { 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 # validate kernel_git_bare_tree is set
if [[ -z "${kernel_git_bare_tree}" ]]; then if [[ -z "${kernel_git_bare_tree}" ]]; then

View File

@@ -86,7 +86,7 @@ function create_image_from_sdcard_rootfs() {
PRE_UPDATE_INITRAMFS PRE_UPDATE_INITRAMFS
# stage: create final initramfs # stage: create final initramfs
[[ -n $KERNELSOURCE ]] && { [[ "${KERNELSOURCE}" != 'none' ]] && {
update_initramfs "$MOUNT" update_initramfs "$MOUNT"
} }

View File

@@ -11,7 +11,7 @@ function determine_artifacts_to_build_for_image() {
if [[ "${BOOTCONFIG}" != "none" ]]; then if [[ "${BOOTCONFIG}" != "none" ]]; then
artifacts_to_build+=("uboot") artifacts_to_build+=("uboot")
fi fi
if [[ -n $KERNELSOURCE ]]; then if [[ "${KERNELSOURCE}" != 'none' ]]; then
artifacts_to_build+=("kernel") artifacts_to_build+=("kernel")
fi fi

View File

@@ -220,7 +220,7 @@ function config_post_main() {
# So we gotta explictly know the major.minor to be able to do that scheme. # 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 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 [[ "${skip_kernel:-"no"}" != "yes" ]]; then
if [[ -n "${KERNELSOURCE}" ]]; then if [[ "${KERNELSOURCE}" != 'none' ]]; then
if [[ "x${KERNEL_MAJOR_MINOR}x" == "xx" ]]; 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" 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. # if we have KERNEL_TARGET set.

View File

@@ -274,14 +274,14 @@ function install_distribution_agnostic() {
call_extension_method "pre_install_kernel_debs" <<- 'PRE_INSTALL_KERNEL_DEBS' call_extension_method "pre_install_kernel_debs" <<- 'PRE_INSTALL_KERNEL_DEBS'
*called before installing the Armbian-built kernel deb packages* *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 PRE_INSTALL_KERNEL_DEBS
# default IMAGE_INSTALLED_KERNEL_VERSION, will be parsed from Kernel version in the installed deb package. # default IMAGE_INSTALLED_KERNEL_VERSION, will be parsed from Kernel version in the installed deb package.
IMAGE_INSTALLED_KERNEL_VERSION="generic" IMAGE_INSTALLED_KERNEL_VERSION="generic"
# install kernel: image/dtb/headers # install kernel: image/dtb/headers
if [[ -n $KERNELSOURCE ]]; then if [[ "${KERNELSOURCE}" != "none" ]]; then
install_artifact_deb_chroot "linux-image" install_artifact_deb_chroot "linux-image"
if [[ "${KERNEL_BUILD_DTBS:-"yes"}" == "yes" ]]; then if [[ "${KERNEL_BUILD_DTBS:-"yes"}" == "yes" ]]; then