From fd043d707a88d94642a32a623aa74be36348ea98 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Tue, 13 Dec 2022 18:36:24 +0100 Subject: [PATCH] armbian-next: squash some `warn` loggings that were undue; remove `$SUDO_USER` handling in prepare-host.sh - squash warning about `NO_APT_CACHER` when in Docker --- lib/functions/compilation/uboot.sh | 6 +++--- lib/functions/host/prepare-host.sh | 19 +++---------------- lib/functions/main/config-prepare.sh | 2 +- lib/functions/rootfs/distro-agnostic.sh | 2 +- lib/functions/rootfs/distro-specific.sh | 2 +- 5 files changed, 9 insertions(+), 22 deletions(-) diff --git a/lib/functions/compilation/uboot.sh b/lib/functions/compilation/uboot.sh index 84018f68b9..e3b8fee565 100644 --- a/lib/functions/compilation/uboot.sh +++ b/lib/functions/compilation/uboot.sh @@ -112,18 +112,18 @@ function compile_uboot_target() { # $BOOTDELAY can be set in board family config, ensure autoboot can be stopped even if set to 0 if [[ $BOOTDELAY == 0 ]]; then - display_alert "Adding CONFIG_ZERO_BOOTDELAY_CHECK=y u-boot config" "BOOTDELAY==0 for ${target}" "warn" + display_alert "Adding CONFIG_ZERO_BOOTDELAY_CHECK=y u-boot config" "BOOTDELAY==0 for ${target}" "info" run_host_command_logged scripts/config --enable CONFIG_ZERO_BOOTDELAY_CHECK fi # If BOOTDELAY is set, either change a preexisting CONFIG_BOOTDELAY or add it if [[ -n $BOOTDELAY ]]; then - display_alert "Hacking autoboot delay in u-boot config" "BOOTDELAY=${BOOTDELAY} for ${target}" "warn" + display_alert "Hacking autoboot delay in u-boot config" "BOOTDELAY=${BOOTDELAY} for ${target}" "info" run_host_command_logged scripts/config --set-val CONFIG_BOOTDELAY "${BOOTDELAY}" fi # Hack, up the log level to 6: "info" (default is 4: "warning") - display_alert "Hacking log level in u-boot config" "LOGLEVEL=6 for ${target}" "warn" + display_alert "Hacking log level in u-boot config" "LOGLEVEL=6 for ${target}" "info" run_host_command_logged scripts/config --set-val CONFIG_LOGLEVEL 6 fi diff --git a/lib/functions/host/prepare-host.sh b/lib/functions/host/prepare-host.sh index 32cfe88008..a1591c1b6a 100644 --- a/lib/functions/host/prepare-host.sh +++ b/lib/functions/host/prepare-host.sh @@ -91,16 +91,14 @@ prepare_host() { if armbian_is_running_in_container; then display_alert "Running in container" "Adding provisions for container building" "info" declare -g CONTAINER_COMPAT=yes # this controls mknod usage for loop devices. - # disable apt-cacher unless NO_APT_CACHER=no is not specified explicitly - if [[ $NO_APT_CACHER != no ]]; then - display_alert "apt-cacher is disabled in containers, set NO_APT_CACHER=no to override" "" "wrn" - NO_APT_CACHER=yes - fi + declare -g NO_APT_CACHER=yes # disable apt-cacher; we use local cache in Docker volumes. + # trying to use nested containers is not a good idea, so don't permit EXTERNAL_NEW=compile if [[ $EXTERNAL_NEW == compile ]]; then display_alert "EXTERNAL_NEW=compile is not available when running in container, setting to prebuilt" "" "wrn" EXTERNAL_NEW=prebuilt fi + SYNC_CLOCK=no else display_alert "NOT running in container" "No special provisions for container building" "debug" @@ -122,17 +120,6 @@ prepare_host() { # create directory structure # @TODO: this should be close to DEST, otherwise super-confusing mkdir -p "${SRC}"/{cache,output} "${USERPATCHES_PATH}" - # @TODO: rpardini: wtf? - if [[ -n $SUDO_USER ]]; then - display_alert "ARMBIAN-NEXT UNHANDLED! SUDO_USER variable" "ARMBIAN-NEXT UNHANDLED! SUDO_USER: $SUDO_USER" "wrn" - chgrp --quiet sudo cache output "${USERPATCHES_PATH}" - # SGID bit on cache/sources breaks kernel dpkg packaging - chmod --quiet g+w,g+s output "${USERPATCHES_PATH}" - # fix existing permissions - find "${SRC}"/output "${USERPATCHES_PATH}" -type d ! -group sudo -exec chgrp --quiet sudo {} \; - find "${SRC}"/output "${USERPATCHES_PATH}" -type d ! -perm -g+w,g+s -exec chmod --quiet g+w,g+s {} \; - fi - # @TODO: original: mkdir -p "${DEST}"/debs-beta/extra "${DEST}"/debs/extra "${DEST}"/{config,debug,patch} "${USERPATCHES_PATH}"/overlay "${SRC}"/cache/{sources,hash,hash-beta,toolchain,utility,rootfs} "${SRC}"/.tmp mkdir -p "${USERPATCHES_PATH}"/overlay "${SRC}"/cache/{sources,hash,hash-beta,toolchain,utility,rootfs} "${SRC}"/.tmp diff --git a/lib/functions/main/config-prepare.sh b/lib/functions/main/config-prepare.sh index 075cb52858..36dd16a56b 100644 --- a/lib/functions/main/config-prepare.sh +++ b/lib/functions/main/config-prepare.sh @@ -65,7 +65,7 @@ function prepare_and_config_main_build_single() { interactive_config_ask_branch [[ -z $BRANCH ]] && exit_with_error "No kernel branch selected: BRANCH" - [[ $KERNEL_TARGET != *$BRANCH* ]] && display_alert "Kernel branch not defined for this board" "$BRANCH for ${BOARD}" "warn" + [[ ${KERNEL_TARGET} != *${BRANCH}* && ${BRANCH} != "ddk" ]] && display_alert "Kernel branch not defined for this board" "${BRANCH} for ${BOARD}" "warn" interactive_config_ask_release [[ -z $RELEASE && ${KERNEL_ONLY} != yes ]] && exit_with_error "No release selected: RELEASE" diff --git a/lib/functions/rootfs/distro-agnostic.sh b/lib/functions/rootfs/distro-agnostic.sh index e34331205d..5009d49b44 100644 --- a/lib/functions/rootfs/distro-agnostic.sh +++ b/lib/functions/rootfs/distro-agnostic.sh @@ -179,7 +179,7 @@ function install_distribution_agnostic() { else # ... not extlinux ... if [[ -n "${BOOTSCRIPT}" ]]; then # @TODO: && "${BOOTCONFIG}" != "none" - display_alert "Deploying boot script" "$bootscript_src" "warn" + display_alert "Deploying boot script" "$bootscript_src" "info" if [ -f "${USERPATCHES_PATH}/bootscripts/${bootscript_src}" ]; then run_host_command_logged cp -pv "${USERPATCHES_PATH}/bootscripts/${bootscript_src}" "${SDCARD}/boot/${bootscript_dst}" else diff --git a/lib/functions/rootfs/distro-specific.sh b/lib/functions/rootfs/distro-specific.sh index 5ed2a034b7..1487939f38 100644 --- a/lib/functions/rootfs/distro-specific.sh +++ b/lib/functions/rootfs/distro-specific.sh @@ -173,7 +173,7 @@ create_sources_list() { # disable repo if SKIP_ARMBIAN_REPO=yes if [[ "${SKIP_ARMBIAN_REPO}" == "yes" ]]; then - display_alert "Disabling armbian repo" "${ARCH}-${RELEASE}" "wrn" + display_alert "Disabling Armbian repo due to SKIP_ARMBIAN_REPO=yes" "${ARCH}-${RELEASE}" "info" mv "${SDCARD}"/etc/apt/sources.list.d/armbian.list "${SDCARD}"/etc/apt/sources.list.d/armbian.list.disabled fi