Run shellfmt to complete code

This commit is contained in:
Igor Pecovnik
2024-06-22 17:54:22 +02:00
committed by Igor
parent 1341c19ef4
commit 75ce67f329
32 changed files with 87 additions and 103 deletions

View File

@@ -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
}

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

View File

@@ -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() {

View File

@@ -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]

View File

@@ -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]

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -15,4 +15,3 @@ fi
[[ -z $CPUMIN ]] && CPUMIN=480000
[[ -z $CPUMAX ]] && CPUMAX=1400000

View File

@@ -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}

View File

@@ -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

View File

@@ -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"

View File

@@ -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" ""

View File

@@ -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"
}
}

View File

@@ -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

View File

@@ -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

View File

@@ -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}

View File

@@ -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
}

View File

@@ -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[@]}"

View File

@@ -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

View File

@@ -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

View File

@@ -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"
}

View File

@@ -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() {

View File

@@ -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
}

View File

@@ -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

View File

@@ -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}

View File

@@ -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

View File

@@ -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
;;
*)