From 75ce67f329fdc695d765c7b323ff20b32f089ab2 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Sat, 22 Jun 2024 17:54:22 +0200 Subject: [PATCH] Run shellfmt to complete code --- config/sources/families/imx8m.conf | 6 ++---- .../sources/families/include/imx8_common.inc | 4 ++-- .../sources/families/include/meson_common.inc | 6 +++--- config/sources/families/jethub.conf | 8 ++----- config/sources/families/meson-s4t7.conf | 12 +++++------ config/sources/families/mt7623.conf | 1 - config/sources/families/mvebu64.conf | 1 - config/sources/families/phytium-embedded.conf | 12 +++++------ config/sources/families/rock-s0.conf | 4 ++-- config/sources/families/rockchip-rk3588.conf | 10 ++++----- config/sources/families/sm8250.conf | 4 ++-- config/sources/families/sun50iw6.conf | 4 ++-- config/sources/families/sun8i.conf | 1 - extensions/allwinner-kernel-bump.sh | 6 +++--- extensions/armbian-live-patch.sh | 2 +- extensions/cloud-init/cloud-init.sh | 11 +++++----- extensions/fs-cryptroot-support.sh | 4 ++-- extensions/lvm.sh | 21 +++++++++---------- extensions/network/net-systemd-neworkd.sh | 3 +-- extensions/network/net-systemd-timesyncd.sh | 3 +-- extensions/radxa-aic8800.sh | 2 +- extensions/xorg-lima-serverflags.sh | 3 +-- lib/functions/artifacts/artifact-uboot.sh | 10 ++++----- lib/functions/bsp/armbian-bsp-cli-deb.sh | 4 ++-- lib/functions/cli/commands.sh | 8 +++---- lib/functions/compilation/kernel-config.sh | 2 +- .../compilation/patch/drivers_network.sh | 6 ++---- .../compilation/utils-compilation.sh | 2 +- lib/functions/general/git-ref2info.sh | 4 ++-- lib/functions/image/partitioning.sh | 2 +- lib/functions/logging/display-alert.sh | 20 +++++++++--------- lib/functions/logging/logging.sh | 4 ++-- 32 files changed, 87 insertions(+), 103 deletions(-) diff --git a/config/sources/families/imx8m.conf b/config/sources/families/imx8m.conf index c5a98987d957..4b2a9fd78329 100644 --- a/config/sources/families/imx8m.conf +++ b/config/sources/families/imx8m.conf @@ -30,8 +30,7 @@ case $BOARD in esac # bootloader releated -pre_config_uboot_target() -{ +pre_config_uboot_target() { # get the firmware rm -rf ${IMX_FIRMWARE}* wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/${IMX_FIRMWARE}.bin -O ${IMX_FIRMWARE}.bin @@ -46,8 +45,7 @@ pre_config_uboot_target() export ATF_LOAD_ADDR=${ATF_ADDR} } -write_uboot_platform() -{ +write_uboot_platform() { echo ${OFFSET} dd if=$1/flash.bin of=$2 bs=1K seek=${OFFSET} status=noxfer conv=fsync > /dev/null 2>&1 } diff --git a/config/sources/families/include/imx8_common.inc b/config/sources/families/include/imx8_common.inc index d17d25f0fa6c..697c5a63beb2 100644 --- a/config/sources/families/include/imx8_common.inc +++ b/config/sources/families/include/imx8_common.inc @@ -25,13 +25,13 @@ case $BOARD in LINUXCONFIG='linux-tqma-'$BRANCH # one config for "tq arm modules" case $BRANCH in - current) # active lts mainline kernel + current) # active lts mainline kernel KERNEL_MAJOR_MINOR="6.6" KERNELBRANCH='branch:linux-6.6.y' KERNELPATCHDIR="archive/imx8m-6.6" ;; - edge|default) # use for tests with recent mainline kernels + edge | default) # use for tests with recent mainline kernels ;; esac diff --git a/config/sources/families/include/meson_common.inc b/config/sources/families/include/meson_common.inc index c08a27f45741..77e0ad5bee64 100644 --- a/config/sources/families/include/meson_common.inc +++ b/config/sources/families/include/meson_common.inc @@ -42,9 +42,9 @@ esac case $BRANCH in - legacy) - declare -g KERNEL_MAJOR_MINOR="6.1" - ;; + legacy) + declare -g KERNEL_MAJOR_MINOR="6.1" + ;; current) declare -g KERNEL_MAJOR_MINOR="6.6" diff --git a/config/sources/families/jethub.conf b/config/sources/families/jethub.conf index f2e225261d43..617928938bd3 100644 --- a/config/sources/families/jethub.conf +++ b/config/sources/families/jethub.conf @@ -35,11 +35,10 @@ elif [[ "$BOARD" == "jethubj200" ]]; then BOOTPATCHDIR="v2024.01" fi - ######## # @TODO: Put this in the board configs of the respective boards ######## -if [[ "$BOARD" == "jethubj80" ]] || [[ "$BOARD" == "jethubj100" ]] ; then +if [[ "$BOARD" == "jethubj80" ]] || [[ "$BOARD" == "jethubj100" ]]; then function family_tweaks__blacklistrtw88() { if [[ "$BOARD" == jethubj80 ]] || [[ "$BOARD" == jethubj100 ]]; then mkdir -p "${destination}"/etc/modprobe.d @@ -49,19 +48,16 @@ if [[ "$BOARD" == "jethubj80" ]] || [[ "$BOARD" == "jethubj100" ]] ; then } fi - # JetHub builds userspace tooling with c++ (gpp) toolchain in buildjethomecmds() below. # The C++ compiler is no longer included by default in the Armbian build system. # Enable the extension that brings includes it. It could've been an inline extension (eg: the function right here), # but having a core extension allows it to be pre-included in the Dockerfile generation and thus in the Docker images. enable_extension "c-plus-plus-compiler" - function fetch_sources_tools__jethub_amlogic_fip() { - fetch_from_repo "https://github.com/adeepn/amlogic-boot-fip" "amlogic-boot-fip-jethub" "branch:add_jethub_j200" + fetch_from_repo "https://github.com/adeepn/amlogic-boot-fip" "amlogic-boot-fip-jethub" "branch:add_jethub_j200" } - uboot_custom_postprocess() { if [[ "$BOARD" == "jethubj80" ]]; then uboot_gxl_postprocess_ng "$SRC/cache/sources/amlogic-boot-fip/jethub-j80" diff --git a/config/sources/families/meson-s4t7.conf b/config/sources/families/meson-s4t7.conf index 12bda00f4d01..0a5967b29a3b 100644 --- a/config/sources/families/meson-s4t7.conf +++ b/config/sources/families/meson-s4t7.conf @@ -15,9 +15,9 @@ enable_extension "bluetooth-hciattach" # E case $BRANCH in legacy) - declare -g KERNEL_MAJOR_MINOR="5.15" # Major and minor versions of this kernel. For mainline caching. + declare -g KERNEL_MAJOR_MINOR="5.15" # Major and minor versions of this kernel. For mainline caching. declare -g KERNELSOURCE="${GITHUB_SOURCE}/khadas/linux.git" # Khadas kernel - declare -g KERNELBRANCH="branch:khadas-vims-5.15.y" # Branch or tag to build from. It should match MAJOR_MINOR + declare -g KERNELBRANCH="branch:khadas-vims-5.15.y" # Branch or tag to build from. It should match MAJOR_MINOR declare -g KERNELPATCHDIR="archive/meson-s4t7-5.15" declare -g COMMON_DRIVERS_SOURCE="${GITHUB_SOURCE}/khadas/common_drivers" declare -g EXTRAWIFI=no @@ -128,7 +128,7 @@ function custom_kernel_config__add_khadas_common_drivers() { memoize_cache_ttl=$common_drivers_cache_ttl_seconds run_memoized GIT_INFO_COMMON_DRIVERS "git2info" memoized_git_ref_to_info # Hack to ensure that we will recreate kernel if common_drivers source changes - kernel_config_modifying_hashes+=( "khadas_common_drivers=${GIT_INFO_COMMON_DRIVERS[SHA1]}" ) + kernel_config_modifying_hashes+=("khadas_common_drivers=${GIT_INFO_COMMON_DRIVERS[SHA1]}") # viraniac: kernel_config_modifying_hashes is only needed during first call of this function to calculate kernel artifact version string. It serves no purpose whatsoever during second call. kernel_config_modifying_hashes+=("CONFIG_DEBUG_KERNEL=y" "CONFIG_EXPERT=y" "CONFIG_EMBEDDED=y") @@ -152,7 +152,7 @@ function kernel_copy_extra_sources__khadas_common_drivers() { rm -rf "${common_drivers_git_bare_tree}" fi - run_host_command_logged git clone --tags --no-checkout \ + run_host_command_logged git clone --tags --no-checkout \ "${COMMON_DRIVERS_SOURCE}" "${common_drivers_git_bare_tree}" touch "${common_drivers_git_bare_tree_done_marker}" @@ -196,8 +196,8 @@ function post_family_tweaks_bsp__disable_uinitrd_generation() { } function image_specific_armbian_env_ready__enable_earlycon() { - display_alert "Enabling earlycon" - run_host_command_logged echo "earlycon=on" >>${SDCARD}/boot/armbianEnv.txt + display_alert "Enabling earlycon" + run_host_command_logged echo "earlycon=on" >> ${SDCARD}/boot/armbianEnv.txt } function post_family_tweaks_bsp__add_fan_service() { diff --git a/config/sources/families/mt7623.conf b/config/sources/families/mt7623.conf index df65438295a9..81e81acec331 100644 --- a/config/sources/families/mt7623.conf +++ b/config/sources/families/mt7623.conf @@ -33,7 +33,6 @@ GOVERNOR="ondemand" function pre_install_kernel_debs__network_manager_ignore_devices() { display_alert "Board: ${BOARD}: Disabling Network-Manager for all devices" "interface-name:eth*,interface-name:wan*,interface-name:lan*,interface-name:br*" "info" - mkdir -p "${SDCARD}"/etc/NetworkManager/conf.d/ cat <<- EOF > "${SDCARD}"/etc/NetworkManager/conf.d/99-ignore-interfaces.conf [keyfile] diff --git a/config/sources/families/mvebu64.conf b/config/sources/families/mvebu64.conf index fedf63801852..637629098ab8 100644 --- a/config/sources/families/mvebu64.conf +++ b/config/sources/families/mvebu64.conf @@ -75,7 +75,6 @@ GOVERNOR=ondemand function pre_install_kernel_debs__network_manager_ignore_devices() { display_alert "Board: ${BOARD}: Disabling Network-Manager for all devices" "interface-name:eth*,interface-name:wan*,interface-name:lan*,interface-name:br*" "info" - mkdir -p "${SDCARD}"/etc/NetworkManager/conf.d/ cat <<- EOF > "${SDCARD}"/etc/NetworkManager/conf.d/99-ignore-interfaces.conf [keyfile] diff --git a/config/sources/families/phytium-embedded.conf b/config/sources/families/phytium-embedded.conf index e337e44b0749..c38ba4018910 100644 --- a/config/sources/families/phytium-embedded.conf +++ b/config/sources/families/phytium-embedded.conf @@ -22,7 +22,7 @@ case "${BRANCH}" in EXTRAWIFI="no" ;; - + current) KERNELSOURCE='https://github.com/chainsx/phytium-linux-kernel' KERNELBRANCH="branch:linux-6.6" @@ -38,11 +38,11 @@ esac write_uboot_platform() { declare ptuboot_cache_dir="${SRC}/cache/phytiumpi-uboot" mkdir -p "${ptuboot_cache_dir}" - - sfdisk --dump "$2" > "${ptuboot_cache_dir}/part.txt" # Backup partition table, command sfdisk is belong to util-linux - dd if="${SRC}/packages/blobs/phytiumpi/fip-all-sd-boot.bin" of="$2" conv=notrunc # Write non-free u-boot file - sfdisk --no-reread "$2" < "${ptuboot_cache_dir}/part.txt" # Recover partition table - + + sfdisk --dump "$2" > "${ptuboot_cache_dir}/part.txt" # Backup partition table, command sfdisk is belong to util-linux + dd if="${SRC}/packages/blobs/phytiumpi/fip-all-sd-boot.bin" of="$2" conv=notrunc # Write non-free u-boot file + sfdisk --no-reread "$2" < "${ptuboot_cache_dir}/part.txt" # Recover partition table + # Update u-boot env mkenvimage -s 0x1000 -o "${ptuboot_cache_dir}/env.bin" "${SRC}/packages/blobs/phytiumpi/env.txt" dd if="${ptuboot_cache_dir}/env.bin" of="$2" bs=1k seek=1472 conv=notrunc diff --git a/config/sources/families/rock-s0.conf b/config/sources/families/rock-s0.conf index e5ef3ed8acad..dca45de39d3f 100644 --- a/config/sources/families/rock-s0.conf +++ b/config/sources/families/rock-s0.conf @@ -32,8 +32,8 @@ IDBLOADER_BLOB=$SRC/packages/blobs/rockchip/rk3308_idbloader_ddr589MHz_uart0_m0_ case $BRANCH in legacy) - echo "Legacy not supported for rock-s0 board" - exit 99 + echo "Legacy not supported for rock-s0 board" + exit 99 ;; esac diff --git a/config/sources/families/rockchip-rk3588.conf b/config/sources/families/rockchip-rk3588.conf index 25dbcf85e1bb..f0158e088f58 100644 --- a/config/sources/families/rockchip-rk3588.conf +++ b/config/sources/families/rockchip-rk3588.conf @@ -42,16 +42,16 @@ case $BRANCH in current) # Branch based on a stable kernel release (will stay on the next LTS kernel release once released, 6.12? LTS) LINUXFAMILY=rockchip-rk3588 - KERNEL_MAJOR_MINOR="6.8" # Major and minor versions of this kernel. - LINUXCONFIG="linux-rockchip-rk3588-${KERNEL_MAJOR_MINOR}" # Attention: not -${BRANCH} (edge/current/legacy), but -${KERNEL_MAJOR_MINOR} thus 6.6 / 6.12 etc + KERNEL_MAJOR_MINOR="6.8" # Major and minor versions of this kernel. + LINUXCONFIG="linux-rockchip-rk3588-${KERNEL_MAJOR_MINOR}" # Attention: not -${BRANCH} (edge/current/legacy), but -${KERNEL_MAJOR_MINOR} thus 6.6 / 6.12 etc # No need to set KERNELPATCHDIR, since default is: KERNELPATCHDIR='archive/rockchip-rk3588-${KERNEL_MAJOR_MINOR}' ;; edge) # Branch based on the latest kernel release including RC releases, to benefit from the latest RK3588 mainline advancements. Might be unstable! LINUXFAMILY=rockchip-rk3588 - KERNEL_MAJOR_MINOR="6.10" # Major and minor versions of this kernel. - LINUXCONFIG="linux-rockchip-rk3588-${KERNEL_MAJOR_MINOR}" # Attention: not -${BRANCH} (edge/current/legacy), but -${KERNEL_MAJOR_MINOR} thus 6.8 / 6.10 etc + KERNEL_MAJOR_MINOR="6.10" # Major and minor versions of this kernel. + LINUXCONFIG="linux-rockchip-rk3588-${KERNEL_MAJOR_MINOR}" # Attention: not -${BRANCH} (edge/current/legacy), but -${KERNEL_MAJOR_MINOR} thus 6.8 / 6.10 etc # No need to set KERNELPATCHDIR, since default is: KERNELPATCHDIR='archive/rockchip-rk3588-${KERNEL_MAJOR_MINOR}' ;; @@ -59,7 +59,7 @@ case $BRANCH in # Collabora's rk3588, where the action is these days LINUXFAMILY=rockchip-rk3588 LINUXCONFIG='linux-rockchip-rk3588-'$BRANCH - KERNEL_MAJOR_MINOR="6.9" # Major and minor versions of this kernel. + KERNEL_MAJOR_MINOR="6.9" # Major and minor versions of this kernel. KERNELPATCHDIR='rockchip-rk3588-collabora' # Try to keep this as empty as possible. We won't work on top of Collabora's branch, they rebase all the time. New DTs are ok. KERNELSOURCE='https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux.git' # Directly from Collabora... KERNELBRANCH='branch:rk3588-v6.9' # Rolling kernel branch, will be rebased diff --git a/config/sources/families/sm8250.conf b/config/sources/families/sm8250.conf index b9388d67d0ce..e02bb87177c8 100644 --- a/config/sources/families/sm8250.conf +++ b/config/sources/families/sm8250.conf @@ -15,13 +15,13 @@ enable_extension "image-output-abl" case $BRANCH in current) - declare -g KERNEL_MAJOR_MINOR="6.9" # Major and minor versions of this kernel. + declare -g KERNEL_MAJOR_MINOR="6.9" # Major and minor versions of this kernel. declare -g KERNELBRANCH='branch:linux-6.9.y' declare -g -i KERNEL_GIT_CACHE_TTL=120 # 2 minutes; this is a high-traffic repo ;; edge) - declare -g KERNEL_MAJOR_MINOR="6.10" # Major and minor versions of this kernel. + declare -g KERNEL_MAJOR_MINOR="6.10" # Major and minor versions of this kernel. ;; esac diff --git a/config/sources/families/sun50iw6.conf b/config/sources/families/sun50iw6.conf index 707b690aa4ca..57d8cb9bc610 100644 --- a/config/sources/families/sun50iw6.conf +++ b/config/sources/families/sun50iw6.conf @@ -15,13 +15,13 @@ OVERLAY_PREFIX='sun50i-h6' GOVERNOR=ondemand ASOUND_STATE='asound.state.sun50iw2-dev' -function post_family_config__install_lightdm_gtk_greeter(){ +function post_family_config__install_lightdm_gtk_greeter() { if [[ ${BUILD_DESKTOP} == "yes" ]] && [[ ! ${DESKTOP_ENVIRONMENT} =~ ^(kde|gnome)$ ]]; then add_packages_to_image lightdm-gtk-greeter fi } -function post_family_tweaks__switch_to_lightdm_gtk_greeter(){ +function post_family_tweaks__switch_to_lightdm_gtk_greeter() { # Mali T720 seems to have some issues with slick-greeter. # Use gtk greeter instead if [[ ${BUILD_DESKTOP} == "yes" ]] && [[ ! ${DESKTOP_ENVIRONMENT} =~ ^(kde|gnome)$ ]]; then diff --git a/config/sources/families/sun8i.conf b/config/sources/families/sun8i.conf index 1df77a68983c..da933f315db1 100644 --- a/config/sources/families/sun8i.conf +++ b/config/sources/families/sun8i.conf @@ -15,4 +15,3 @@ fi [[ -z $CPUMIN ]] && CPUMIN=480000 [[ -z $CPUMAX ]] && CPUMAX=1400000 - diff --git a/extensions/allwinner-kernel-bump.sh b/extensions/allwinner-kernel-bump.sh index 889906d11682..92c8d4afcf31 100644 --- a/extensions/allwinner-kernel-bump.sh +++ b/extensions/allwinner-kernel-bump.sh @@ -37,7 +37,7 @@ function extension_finish_config__prepare_megous_patches() { if [[ -d ${patch_dir_base} ]]; then display_alert "allwinner-kernel-bump" "Found existing kernel patch directory" "info" - if [[ "${OVERWRITE_PATCHDIR:-no}" == "yes" ]]; then + if [[ "${OVERWRITE_PATCHDIR:-no}" == "yes" ]]; then display_alert "allwinner-kernel-bump" "Removing as requested. Any manual changes will get overwritten" "info" rm -rf ${patch_dir_base} else @@ -69,9 +69,9 @@ function extension_finish_config__prepare_megous_patches() { run_host_command_logged rm -f ${patch_dir_base}/series.{conf,megous} display_alert "allwinner-kernel-bump" "Extracting latest Megous patches" "info" - megous_trees=( "a83t-suspend" "af8133j" "anx" "audio" "axp" "cam" "drm" + megous_trees=("a83t-suspend" "af8133j" "anx" "audio" "axp" "cam" "drm" "err" "fixes" "mbus" "modem" "opi3" "pb" "pinetab" "pp" "ppkb" "samuel" - "speed" "tbs-a711" "ths" ) + "speed" "tbs-a711" "ths") run_host_command_logged mkdir -p ${patch_dir_megous} ${patch_dir_tmp} diff --git a/extensions/armbian-live-patch.sh b/extensions/armbian-live-patch.sh index a986f6e89094..f7c816aa4625 100644 --- a/extensions/armbian-live-patch.sh +++ b/extensions/armbian-live-patch.sh @@ -1,6 +1,6 @@ function post_family_tweaks_bsp__armbian-live-patch() { -display_alert "Installing Armbian Live Patch" "${EXTENSION}" "info" + display_alert "Installing Armbian Live Patch" "${EXTENSION}" "info" run_host_command_logged cat <<- 'armbian-live-patch' > "${destination}"/etc/systemd/system/armbian-live-patch.service # Armbian simple patch system service diff --git a/extensions/cloud-init/cloud-init.sh b/extensions/cloud-init/cloud-init.sh index 376457f966d9..30c89732e33d 100644 --- a/extensions/cloud-init/cloud-init.sh +++ b/extensions/cloud-init/cloud-init.sh @@ -10,23 +10,23 @@ # Implementaiton is based on the NoCLoud data source that will use # the FAT partition with armbi_boot label to source the configuration from -# The Cloud init files in the boot partition are meant to be replaced with user provided ones, they are empty +# The Cloud init files in the boot partition are meant to be replaced with user provided ones, they are empty # of configurations except for setting hostname and DHCP on ethernet adapters. # This extension also disables armbian-first-run # Cloud-Init image marker function extension_prepare_config__ci_image_suffix() { - # Add to image suffix. - EXTRA_IMAGE_SUFFIXES+=("-ci") + # Add to image suffix. + EXTRA_IMAGE_SUFFIXES+=("-ci") } -function extension_prepare_config__prepare_ci() { +function extension_prepare_config__prepare_ci() { # Cloud Init related packages selected from Ubuntu RPI distirbution add_packages_to_image cloud-init cloud-initramfs-dyn-netconf } -function extension_prepare_config__ci_compatibility_check(){ +function extension_prepare_config__ci_compatibility_check() { # We require fat boot partition, will change and if the user provided another type, will fail. if [[ -z "${BOOTFS_TYPE}" ]]; then declare -g BOOTFS_TYPE="fat" @@ -53,7 +53,6 @@ function pre_customize_image__inject_cloud_init_config() { return 0 } - # @TODO: would be better to have "armbian first run" as an extension that can be disabled function pre_customize_image__disable_armbian_first_run() { display_alert "Disabling" "armbian first run" "info" diff --git a/extensions/fs-cryptroot-support.sh b/extensions/fs-cryptroot-support.sh index 95e70f95e915..6bda8d6f395b 100644 --- a/extensions/fs-cryptroot-support.sh +++ b/extensions/fs-cryptroot-support.sh @@ -15,13 +15,13 @@ function add_host_dependencies__add_cryptroot_tooling() { fi } -function extension_prepare_config__prepare_cryptroot() { +function extension_prepare_config__prepare_cryptroot() { # Config for cryptroot, a boot partition is required. declare -g BOOTPART_REQUIRED=yes EXTRA_IMAGE_SUFFIXES+=("-crypt") } -function prepare_root_device__encrypt_root_device(){ +function prepare_root_device__encrypt_root_device() { # We encrypt the rootdevice (currently a loop device) and return the new mapped rootdevice check_loop_device "$rootdevice" display_alert "Encrypting root partition with LUKS..." "cryptsetup luksFormat $rootdevice" "" diff --git a/extensions/lvm.sh b/extensions/lvm.sh index f3e26de44233..fad48294fa69 100644 --- a/extensions/lvm.sh +++ b/extensions/lvm.sh @@ -5,26 +5,25 @@ # # This extension will place the root partition on an LVM volume. -# It is possible to customise the volume group name and the image is extended to allow +# It is possible to customise the volume group name and the image is extended to allow # for LVM headers -# In case of failed builds check for leaked logical volumes with "dmsetup list" and +# In case of failed builds check for leaked logical volumes with "dmsetup list" and # remove them with "dmsetup remove" # Additional log infomration will be created on lvm.log - # We will need to create several LVM objects: PV VG VOL on the image from the host function add_host_dependencies__lvm_host_deps() { declare -g EXTRA_BUILD_DEPS="${EXTRA_BUILD_DEPS} lvm2" } function extension_prepare_config__lvm_image_suffix() { - # Add to image suffix. - EXTRA_IMAGE_SUFFIXES+=("-lvm") + # Add to image suffix. + EXTRA_IMAGE_SUFFIXES+=("-lvm") } -function extension_prepare_config__prepare_lvm() { +function extension_prepare_config__prepare_lvm() { # Config for lvm, boot partition is required, many bootloaders do not support LVM. declare -g BOOTPART_REQUIRED=yes declare -g LVM_VG_NAME="${LVM_VG_NAME:-armbivg}" @@ -32,7 +31,7 @@ function extension_prepare_config__prepare_lvm() { add_packages_to_image lvm2 } -function post_create_partitions__setup_lvm(){ +function post_create_partitions__setup_lvm() { LOOP=$(losetup -f) [[ -z $LOOP ]] && exit_with_error "Unable to find free loop device" @@ -71,7 +70,7 @@ function post_create_partitions__setup_lvm(){ display_alert "LVM created volume group" "${EXTENSION}" "info" } -function prepare_root_device__create_volume_group(){ +function prepare_root_device__create_volume_group() { display_alert "Using LVM root" "${EXTENSION}" "info" vgscan vgchange -a y ${LVM_VG_NAME} @@ -80,15 +79,15 @@ function prepare_root_device__create_volume_group(){ display_alert "Root device is ${rootdevice}" "${EXTENSION}" "info" } -function format_partitions__format_lvm(){ +function format_partitions__format_lvm() { # Label the root volume e2label /dev/mapper/${LVM_VG_NAME}-root armbi_root blkid | grep ${LVM_VG_NAME} >> "${DEST}"/${LOG_SUBPATH}/lvm.log 2>&1 display_alert "LVM labeled partitions" "${EXTENSION}" "info" } -function post_umount_final_image__close_lvm(){ +function post_umount_final_image__close_lvm() { # Deactivat the Volume Group vgchange -a n ${LVM_VG_NAME} display_alert "LVM deactivated volume group" "${EXTENSION}" "info" -} \ No newline at end of file +} diff --git a/extensions/network/net-systemd-neworkd.sh b/extensions/network/net-systemd-neworkd.sh index 78211a0c8295..6e522c48d438 100644 --- a/extensions/network/net-systemd-neworkd.sh +++ b/extensions/network/net-systemd-neworkd.sh @@ -6,8 +6,7 @@ function add_host_dependencies__install_systemd_networkd() { add_packages_to_image netplan.io } -function pre_install_kernel_debs__configure_systemd_networkd() -{ +function pre_install_kernel_debs__configure_systemd_networkd() { display_alert "Extension: ${EXTENSION}: Enabling systemd-networkd" "" "info" # Enable networkd and resolved diff --git a/extensions/network/net-systemd-timesyncd.sh b/extensions/network/net-systemd-timesyncd.sh index af19c7db0950..f1a31c2399f8 100644 --- a/extensions/network/net-systemd-timesyncd.sh +++ b/extensions/network/net-systemd-timesyncd.sh @@ -6,8 +6,7 @@ function add_host_dependencies__install_systemd-timesyncd() { add_packages_to_image systemd-timesyncd } -function pre_install_kernel_debs__configure_systemd-timesyncd() -{ +function pre_install_kernel_debs__configure_systemd-timesyncd() { # Enable timesyncd display_alert "Extension: ${EXTENSION}: Enabling systemd-timesyncd" "" "info" chroot_sdcard systemctl enable systemd-timesyncd.service diff --git a/extensions/radxa-aic8800.sh b/extensions/radxa-aic8800.sh index ba87554df6ae..1b81374696b2 100644 --- a/extensions/radxa-aic8800.sh +++ b/extensions/radxa-aic8800.sh @@ -16,7 +16,7 @@ function post_install_kernel_debs__install_aic8800_dkms_package() { aic8800_pcie_url="https://github.com/radxa-pkg/aic8800/releases/download/${latest_version}/aic8800-pcie-dkms_${latest_version}_all.deb" aic8800_sdio_url="https://github.com/radxa-pkg/aic8800/releases/download/${latest_version}/aic8800-sdio-dkms_${latest_version}_all.deb" aic8800_usb_url="https://github.com/radxa-pkg/aic8800/releases/download/${latest_version}/aic8800-usb-dkms_${latest_version}_all.deb" - if [[ "${GITHUB_MIRROR}" == "ghproxy" ]];then + if [[ "${GITHUB_MIRROR}" == "ghproxy" ]]; then ghproxy_header="https://mirror.ghproxy.com/" aic8800_firmware_url=${ghproxy_header}${aic8800_firmware_url} aic8800_pcie_url=${ghproxy_header}${aic8800_pcie_url} diff --git a/extensions/xorg-lima-serverflags.sh b/extensions/xorg-lima-serverflags.sh index 38bef01add02..0bb54c05c13e 100644 --- a/extensions/xorg-lima-serverflags.sh +++ b/extensions/xorg-lima-serverflags.sh @@ -1,6 +1,6 @@ # # SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2023 Armbian +# Copyright (c) 2023 Armbian # This file is a part of the Armbian Build Framework https://github.com/armbian/build/ # @@ -31,4 +31,3 @@ function post_family_tweaks_bsp__install_lima_serverflags() { return 0 } - diff --git a/lib/functions/artifacts/artifact-uboot.sh b/lib/functions/artifacts/artifact-uboot.sh index 187767eb97a7..0d0947c4bb86 100644 --- a/lib/functions/artifacts/artifact-uboot.sh +++ b/lib/functions/artifacts/artifact-uboot.sh @@ -95,11 +95,11 @@ function artifact_uboot_prepare_version() { # Hash variables that affect the build and package of u-boot declare -a vars_to_hash=( "${BOOTCONFIG:-"no_bootconfig"}" - "${BOOTDELAY}" "${UBOOT_DEBUGGING}" "${UBOOT_TARGET_MAP}" # general for all families - "${BOOT_SCENARIO}" "${BOOT_SUPPORT_SPI}" "${BOOT_SOC}" # rockchip stuff, sorry. - "${DDR_BLOB}" "${BL31_BLOB}" "${BL32_BLOB}" "${MINILOADER_BLOB}" # More rockchip stuff, even more sorry. - "${ATF_COMPILE}" "${ATFBRANCH}" "${ATFPATCHDIR}" # arm-trusted-firmware stuff - "${CRUSTCONFIG}" "${CRUSTBRANCH}" "${CRUSTPATCHDIR}" # crust stuff + "${BOOTDELAY}" "${UBOOT_DEBUGGING}" "${UBOOT_TARGET_MAP}" # general for all families + "${BOOT_SCENARIO}" "${BOOT_SUPPORT_SPI}" "${BOOT_SOC}" # rockchip stuff, sorry. + "${DDR_BLOB}" "${BL31_BLOB}" "${BL32_BLOB}" "${MINILOADER_BLOB}" # More rockchip stuff, even more sorry. + "${ATF_COMPILE}" "${ATFBRANCH}" "${ATFPATCHDIR}" # arm-trusted-firmware stuff + "${CRUSTCONFIG}" "${CRUSTBRANCH}" "${CRUSTPATCHDIR}" # crust stuff ) declare hash_variables="undetermined" # will be set by calculate_hash_for_variables(), which normalizes the input calculate_hash_for_variables "${vars_to_hash[@]}" diff --git a/lib/functions/bsp/armbian-bsp-cli-deb.sh b/lib/functions/bsp/armbian-bsp-cli-deb.sh index fe3b7ef491b7..5f8897fe8dc0 100644 --- a/lib/functions/bsp/armbian-bsp-cli-deb.sh +++ b/lib/functions/bsp/armbian-bsp-cli-deb.sh @@ -195,11 +195,11 @@ function compile_armbian-bsp-cli() { # This is never run in build context; instead, it's source code is dumped inside a file that is packaged. # It is done this way so we get shellcheck and formatting instead of a huge heredoc. ### preinst - artifact_package_hook_helper_board_side_functions "preinst" board_side_bsp_cli_preinst "${preinst_functions[@]}" + artifact_package_hook_helper_board_side_functions "preinst" board_side_bsp_cli_preinst "${preinst_functions[@]}" unset board_side_bsp_cli_preinst ### postrm - artifact_package_hook_helper_board_side_functions "postrm" board_side_bsp_cli_postrm "${postrm_functions[@]}" + artifact_package_hook_helper_board_side_functions "postrm" board_side_bsp_cli_postrm "${postrm_functions[@]}" unset board_side_bsp_cli_postrm ### postinst -- a bit more complex, extendable via postinst_functions which can be customized in hook above diff --git a/lib/functions/cli/commands.sh b/lib/functions/cli/commands.sh index 6cc89a4b7035..0430ec36c9e9 100644 --- a/lib/functions/cli/commands.sh +++ b/lib/functions/cli/commands.sh @@ -40,13 +40,13 @@ function armbian_register_commands() { ["debs-to-repo-reprepro"]="json_info" # implemented in cli_json_info_pre_run and cli_json_info_run # Patch to git & patch rewrite, for kernel - ["kernel-patches-to-git"]="patch_kernel" # implemented in cli_patch_kernel_pre_run and cli_patch_kernel_run - ["rewrite-kernel-patches"]="patch_kernel" # implemented in cli_patch_kernel_pre_run and cli_patch_kernel_run + ["kernel-patches-to-git"]="patch_kernel" # implemented in cli_patch_kernel_pre_run and cli_patch_kernel_run + ["rewrite-kernel-patches"]="patch_kernel" # implemented in cli_patch_kernel_pre_run and cli_patch_kernel_run ["rewrite-kernel-patches-needing-rebase"]="patch_kernel" # implemented in cli_patch_kernel_pre_run and cli_patch_kernel_run # Patch to git & patch rewrite, for u-boot - ["uboot-patches-to-git"]="patch_uboot" # implemented in cli_patch_uboot_pre_run and cli_patch_uboot_run - ["rewrite-uboot-patches"]="patch_uboot" # implemented in cli_patch_uboot_pre_run and cli_patch_uboot_run + ["uboot-patches-to-git"]="patch_uboot" # implemented in cli_patch_uboot_pre_run and cli_patch_uboot_run + ["rewrite-uboot-patches"]="patch_uboot" # implemented in cli_patch_uboot_pre_run and cli_patch_uboot_run ["rewrite-uboot-patches-needing-rebase"]="patch_uboot" # implemented in cli_patch_uboot_pre_run and cli_patch_uboot_run ["build"]="standard_build" # implemented in cli_standard_build_pre_run and cli_standard_build_run diff --git a/lib/functions/compilation/kernel-config.sh b/lib/functions/compilation/kernel-config.sh index 4cff8d8f4a7a..6ea0e69775ea 100644 --- a/lib/functions/compilation/kernel-config.sh +++ b/lib/functions/compilation/kernel-config.sh @@ -84,7 +84,7 @@ function kernel_config_initialize() { run_host_command_logged cp -pv ".config" "${config_after_kernel_config_extension_filename}" # Check sanity of kernel config and repair the config if necessary kernel_config_check_and_repair - + display_alert "Kernel configuration" "${LINUXCONFIG}" "info" } diff --git a/lib/functions/compilation/patch/drivers_network.sh b/lib/functions/compilation/patch/drivers_network.sh index 2983d52ca27b..7453ab42e8d2 100644 --- a/lib/functions/compilation/patch/drivers_network.sh +++ b/lib/functions/compilation/patch/drivers_network.sh @@ -446,8 +446,8 @@ driver_uwe5622() { fi fi - process_patch_file "${SRC}/patch/misc/wireless-uwe5622/wireless-uwe5622-Fix-compilation-with-6.7-kernel.patch" "applying" - process_patch_file "${SRC}/patch/misc/wireless-uwe5622/wireless-uwe5622-reduce-system-load.patch" "applying" + process_patch_file "${SRC}/patch/misc/wireless-uwe5622/wireless-uwe5622-Fix-compilation-with-6.7-kernel.patch" "applying" + process_patch_file "${SRC}/patch/misc/wireless-uwe5622/wireless-uwe5622-reduce-system-load.patch" "applying" if linux-version compare "${version}" ge 6.9; then process_patch_file "${SRC}/patch/misc/wireless-uwe5622/uwe5622-v6.9.patch" "applying" @@ -643,7 +643,6 @@ driver_mt7921u_add_pids() { fi } - ### ### ### NOTICE: <=5.x BELOW ONLY @@ -654,7 +653,6 @@ driver_mt7921u_add_pids() { ### ### v v v v v v v v v v v v v v v v v v v v v v v - #_bt for blueteeth driver_rtl8822cs_bt() { diff --git a/lib/functions/compilation/utils-compilation.sh b/lib/functions/compilation/utils-compilation.sh index 50206c72dd24..7648966a8067 100644 --- a/lib/functions/compilation/utils-compilation.sh +++ b/lib/functions/compilation/utils-compilation.sh @@ -27,7 +27,7 @@ grab_version() { ver[1]=$(grep "^PATCHLEVEL" "${1}"/Makefile | head -1 | awk '{print $(NF)}' | grep -oE '^[[:digit:]]+' || true) ver[2]=$(grep "^SUBLEVEL" "${1}"/Makefile | head -1 | awk '{print $(NF)}' | grep -oE '^[[:digit:]]+' || true) ver[3]=$(grep "^EXTRAVERSION" "${1}"/Makefile | head -1 | awk '{print $(NF)}' | grep -oE '^-rc[[:digit:]]+' || true) - ver[4]=$(if [ -f localversion-next ];then echo $(cat localversion-next); fi || true) + ver[4]=$(if [ -f localversion-next ]; then echo $(cat localversion-next); fi || true) echo "${ver[0]:-0}${ver[1]:+.${ver[1]}}${ver[2]:+.${ver[2]}}${ver[3]}${ver[4]}" return 0 } diff --git a/lib/functions/general/git-ref2info.sh b/lib/functions/general/git-ref2info.sh index a2a12fe9efc5..2d0079f8100e 100644 --- a/lib/functions/general/git-ref2info.sh +++ b/lib/functions/general/git-ref2info.sh @@ -89,8 +89,8 @@ function memoized_git_ref_to_info() { else \ . + [{\"source\": \$source, \"branch\": \$branch, \"sha1\": \$sha1}] \ end" /dev/fd/5 >&6 - cat /dev/fd/6 >"${SRC}"/output/info/git_sources.json - } 5<>"${SRC}"/output/info/git_sources.json 6<>"${SRC}"/output/info/git_sources.json.new + cat /dev/fd/6 > "${SRC}"/output/info/git_sources.json + } 5<> "${SRC}"/output/info/git_sources.json 6<> "${SRC}"/output/info/git_sources.json.new fi if [[ -f "${SRC}"/config/sources/git_sources.json && ${ref_type} == "branch" ]]; then diff --git a/lib/functions/image/partitioning.sh b/lib/functions/image/partitioning.sh index 5a2d8204d340..52dbb597fc04 100644 --- a/lib/functions/image/partitioning.sh +++ b/lib/functions/image/partitioning.sh @@ -99,7 +99,7 @@ function prepare_partitions() { fi # Check if we need boot partition # Specialized storage extensions like cryptroot or lvm may require a boot partition - if [[ $BOOTSIZE != "0" && ( -n $BOOTFS_TYPE || $ROOTFS_TYPE != ext4 || $BOOTPART_REQUIRED == yes ) ]]; then + if [[ $BOOTSIZE != "0" && (-n $BOOTFS_TYPE || $ROOTFS_TYPE != ext4 || $BOOTPART_REQUIRED == yes) ]]; then local bootpart=$((next++)) local bootfs=${BOOTFS_TYPE:-ext4} [[ -z $BOOTSIZE || $BOOTSIZE -le 8 ]] && BOOTSIZE=${DEFAULT_BOOTSIZE} diff --git a/lib/functions/logging/display-alert.sh b/lib/functions/logging/display-alert.sh index d5ce75869c4e..e757f9e89683 100644 --- a/lib/functions/logging/display-alert.sh +++ b/lib/functions/logging/display-alert.sh @@ -31,8 +31,8 @@ function display_alert() { fi level_indicator="🐛" case "${background_dark_or_light}" in - light) inline_logs_color="\e[1;2;33m" ;; - *) inline_logs_color="\e[1;33m" ;; + light) inline_logs_color="\e[1;2;33m" ;; + *) inline_logs_color="\e[1;33m" ;; esac skip_logfile=1 ;; @@ -48,8 +48,8 @@ function display_alert() { info) level_indicator="🌱" case "${background_dark_or_light}" in - light) inline_logs_color="\e[1;2;32m" ;; - *) inline_logs_color="\e[1;32m" ;; + light) inline_logs_color="\e[1;2;32m" ;; + *) inline_logs_color="\e[1;32m" ;; esac ;; @@ -59,8 +59,8 @@ function display_alert() { fi level_indicator="🧽" case "${background_dark_or_light}" in - light) inline_logs_color="\e[1;2;33m" ;; - *) inline_logs_color="\e[1;33m" ;; + light) inline_logs_color="\e[1;2;33m" ;; + *) inline_logs_color="\e[1;33m" ;; esac skip_logfile=1 ;; @@ -151,8 +151,8 @@ function display_alert() { ext) level_indicator="✨" case "${background_dark_or_light}" in - light) inline_logs_color="\e[1;2;32m" ;; - *) inline_logs_color="\e[1;32m" ;; + light) inline_logs_color="\e[1;2;32m" ;; + *) inline_logs_color="\e[1;32m" ;; esac ;; @@ -165,8 +165,8 @@ function display_alert() { level="${level:-info}" # for file logging. level_indicator="🌿" case "${background_dark_or_light}" in - dark) inline_logs_color="\e[1;37m" ;; - *) inline_logs_color="\e[1;39m" ;; + dark) inline_logs_color="\e[1;37m" ;; + *) inline_logs_color="\e[1;39m" ;; esac ;; esac diff --git a/lib/functions/logging/logging.sh b/lib/functions/logging/logging.sh index 8f2cb7c67dd5..26fdc9c7aef0 100644 --- a/lib/functions/logging/logging.sh +++ b/lib/functions/logging/logging.sh @@ -21,10 +21,10 @@ function logging_init() { # detect terminal background color case "${COLORFGBG+${COLORFGBG#*;}}" in - [0-6]|8) + [0-6] | 8) declare -g background_dark_or_light=dark ;; - 7|9|1[0-5]) + 7 | 9 | 1[0-5]) declare -g background_dark_or_light=light ;; *)