From 66c81e96db286d956b23cd2b47430066efb69607 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Sat, 8 Oct 2022 13:25:04 +0200 Subject: [PATCH] armbian-next: `sources` and `sources/family` armbian-next changes - MEGASQUASH - squashed changes from c9cf3fc241cfb4c872f4aef7bbc41d5854db7ea3 to 6809de3d6063cb041205a8318e19da6a4dee68c9 ref extensions_08_10_2022_pre_v30 --- config/sources/amd64.conf | 31 +++--- config/sources/arm64.conf | 59 +++++----- config/sources/armhf.conf | 57 +++++++--- config/sources/families/bcm2711.conf | 25 +---- config/sources/families/imx6.conf | 2 + config/sources/families/imx7d.conf | 4 +- .../families/include/meson64_common.inc | 92 +++++++--------- .../sources/families/include/meson_common.inc | 2 + .../families/include/rockchip64_common.inc | 37 +++---- .../families/include/sunxi64_common.inc | 104 +++++------------- .../sources/families/include/sunxi_common.inc | 88 +++++---------- .../sources/families/include/uefi_common.inc | 10 +- config/sources/families/jethub.conf | 10 +- config/sources/families/media.conf | 10 +- config/sources/families/meson-gxbb.conf | 58 +++++----- config/sources/families/meson-gxl.conf | 6 - config/sources/families/mt7623.conf | 1 + config/sources/families/mvebu.conf | 2 + config/sources/families/mvebu64.conf | 25 +++-- config/sources/families/odroidxu4.conf | 3 +- config/sources/families/rk322x.conf | 3 + config/sources/families/rk3399.conf | 1 + config/sources/families/rk35xx.conf | 2 +- config/sources/families/rockchip-rk3588.conf | 1 + config/sources/families/rockchip.conf | 20 +++- config/sources/families/rockchip64.conf | 1 + config/sources/families/rockpis.conf | 36 +++--- config/sources/families/s5p6818.conf | 1 + config/sources/families/sun50iw6.conf | 3 - config/sources/families/sun50iw9.conf | 2 +- config/sources/families/virtual.conf | 3 +- config/sources/families/zynq.conf | 1 + 32 files changed, 323 insertions(+), 377 deletions(-) diff --git a/config/sources/amd64.conf b/config/sources/amd64.conf index ff1a9b1a5..20df57d45 100644 --- a/config/sources/amd64.conf +++ b/config/sources/amd64.conf @@ -1,20 +1,21 @@ -#!/bin/bash - -# include common config options -source "${BASH_SOURCE%/*}/common.conf" - -export ARCH='amd64' # Debian name $(dpkg-architecture -qDEB_HOST_ARCH) -export ARCHITECTURE='x86_64' # "kernel" arch -export QEMU_BINARY='qemu-x86_64-static' # Hopefully you have this installed. -export MAIN_CMDLINE='' # we set it in common, it was not set before +export ARCH=amd64 # Debian name $(dpkg-architecture -qDEB_HOST_ARCH) +export ARCHITECTURE=x86_64 # "kernel" arch +export QEMU_BINARY="qemu-x86_64-static" # Installed via 'qemu-user-static'. export KERNEL_COMPILER=' ' # hack: use single space for host gcc. won't work on arm64 hosts export KERNEL_USE_GCC=' ' # more hacks. -export KERNEL_IMAGE_TYPE='bzImage' # Ubuntu Standard -export KERNEL_EXTRA_TARGETS='modules' # default is "modules dtb" but x86_64 has no DTB -export UBOOT_USE_GCC='none' # required by configuration.sh +export KERNEL_IMAGE_TYPE="bzImage" # Passed to kernel's `make` +export KERNEL_BUILD_DTBS="no" # amd64 has no DTBs. that I know of. +#export INITRD_ARCH=amd64 # Used by u-boot for mkimage in initramfs. No u-boot for x86 yet. + +export UBOOT_USE_GCC="none" # required by configuration.sh + +# Default to mainline +[[ -z $KERNELSOURCE ]] && KERNELSOURCE=$MAINLINE_KERNEL_SOURCE if [[ "$(uname -m)" == "aarch64" ]]; then - # Explicitly disallow "reverse cross-compile". Go ask @the-Going why ;-) - display_error "Unsupported cross-compile" "aarch64 -> x86_64" "err" - exit 39 + # Allow building amd64 on aarch64, but using system toolchain only + export KERNEL_COMPILER="x86_64-linux-gnu-" + export SKIP_EXTERNAL_TOOLCHAINS=yes fi + +true # don't fail due to conditional above. diff --git a/config/sources/arm64.conf b/config/sources/arm64.conf index 2ea84019b..6bcf3306b 100644 --- a/config/sources/arm64.conf +++ b/config/sources/arm64.conf @@ -1,19 +1,24 @@ #!/bin/bash +# +# Copyright (c) 2013-2021 Igor Pecovnik, igor.pecovnik@gma**.com +# +# This file is licensed under the terms of the GNU General Public +# License version 2. This program is licensed "as is" without any +# warranty of any kind, whether express or implied. +# +# This file is a part of the Armbian build script +# https://github.com/armbian/build/ -# include common config options -source "${BASH_SOURCE%/*}/common.conf" - -export ARCH='arm64' -export ARCHITECTURE='arm64' -export QEMU_BINARY='qemu-aarch64-static' -export NAME_KERNEL='Image' -export NAME_INITRD='uInitrd' -export KERNEL_IMAGE_TYPE='Image' - - -[[ -z $KERNEL_COMPILER ]] && KERNEL_COMPILER="aarch64-linux-gnu-" +NAME_KERNEL="Image" +NAME_INITRD="uInitrd" +MAIN_CMDLINE="rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 bootsplash.bootfile=bootsplash.armbian" [[ -z $INITRD_ARCH ]] && INITRD_ARCH=arm64 -[[ -z $UBOOT_USE_GCC ]] && UBOOT_USE_GCC='> 8.0' +QEMU_BINARY="qemu-aarch64-static" +ARCHITECTURE=arm64 +ARCH=arm64 +KERNEL_IMAGE_TYPE=Image +CAN_BUILD_STRETCH=yes +FAST_CREATE_IMAGE="yes" if [ "$(uname -m)" = "aarch64" ]; then [[ $ATF_COMPILE != "no" && -z $ATF_COMPILER ]] && ATF_COMPILER="aarch64-linux-gnu-" @@ -34,19 +39,17 @@ fi [[ $ATF_COMPILE != "no" && -z $ATFBRANCH ]] && ATFBRANCH='commit:af220ebbe467aa580e6b9ba554676f78ffec930f' [[ $ATF_COMPILE != "no" && -z $ATF_USE_GCC ]] && ATF_USE_GCC='> 8.0' -if [ "$(uname -m)" = "aarch64" ]; then - case "$(lsb_release -sc)" in - "bullseye" | "bookworm" | "focal" | "hirsute" | "impish" | "jammy" | "lunar") - PKG_PREFIX="qemu-x86_64-static -L /usr/x86_64-linux-gnu " - ;; - *) - PKG_PREFIX="qemu-x86_64 -L /usr/x86_64-linux-gnu " - ;; - esac -else - PKG_PREFIX="" -fi +[[ -z $UBOOT_USE_GCC ]] && UBOOT_USE_GCC='> 8.0' +[[ -z $BOOTSOURCE ]] && BOOTSOURCE=$MAINLINE_UBOOT_SOURCE +[[ -z $BOOTDIR ]] && BOOTDIR=$MAINLINE_UBOOT_DIR +[[ -z $BOOTBRANCH ]] && BOOTBRANCH='tag:v2022.07' -# System toolchains don't have the -none- variant, remove it -[[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]] && UBOOT_COMPILER="${UBOOT_COMPILER//-none-/-}" -[[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]] && ATF_COMPILER="${ATF_COMPILER//-none-/-}" +[[ -z $KERNELDIR ]] && KERNELDIR=$MAINLINE_KERNEL_DIR +[[ -z $KERNELSOURCE ]] && KERNELSOURCE=$MAINLINE_KERNEL_SOURCE +[[ -z $KERNELBRANCH ]] && KERNELBRANCH='branch:linux-5.4.y' + +## System toolchains don't have the -none- variant, remove it +[[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]] && [[ "${UBOOT_COMPILER}" = *none* ]] && UBOOT_COMPILER="${UBOOT_COMPILER//-none-/-}" +[[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]] && [[ "${ATF_COMPILER}" = *none* ]] && ATF_COMPILER="${ATF_COMPILER//-none-/-}" + +true # don't fail due to conditional above. diff --git a/config/sources/armhf.conf b/config/sources/armhf.conf index 7a4a2efda..e70e71edd 100644 --- a/config/sources/armhf.conf +++ b/config/sources/armhf.conf @@ -1,29 +1,50 @@ #!/bin/bash +# +# Copyright (c) 2013-2021 Igor Pecovnik, igor.pecovnik@gma**.com +# +# This file is licensed under the terms of the GNU General Public +# License version 2. This program is licensed "as is" without any +# warranty of any kind, whether express or implied. +# +# This file is a part of the Armbian build script +# https://github.com/armbian/build/ -# include common config options -source "${BASH_SOURCE%/*}/common.conf" - -export ARCH='armhf' -export ARCHITECTURE='arm' -export QEMU_BINARY='qemu-arm-static' -export NAME_KERNEL='zImage' -export NAME_INITRD='uInitrd' -export INITRD_ARCH='arm' -export KERNEL_IMAGE_TYPE='Image' - -[[ -z $KERNEL_COMPILER ]] && KERNEL_COMPILER='arm-linux-gnueabihf-' -[[ -z $UBOOT_USE_GCC ]] && UBOOT_USE_GCC='> 8.0' +NAME_KERNEL="zImage" +NAME_INITRD="uInitrd" +MAIN_CMDLINE="rw no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0 bootsplash.bootfile=bootsplash.armbian" +INITRD_ARCH=arm +QEMU_BINARY="qemu-arm-static" +ARCHITECTURE=arm +ARCH=armhf +KERNEL_IMAGE_TYPE=Image +CAN_BUILD_STRETCH=yes +FAST_CREATE_IMAGE="yes" if [ "$(uname -m)" = "aarch64" ]; then - [[ -z $UBOOT_COMPILER ]] && UBOOT_COMPILER='arm-linux-gnueabihf-' + [[ -z $UBOOT_COMPILER ]] && UBOOT_COMPILER="arm-linux-gnueabihf-" +else + [[ -z $UBOOT_COMPILER ]] && UBOOT_COMPILER="arm-none-linux-gnueabihf-" +fi +[[ -z $UBOOT_USE_GCC ]] && UBOOT_USE_GCC='> 8.0' +[[ -z $BOOTSOURCE ]] && BOOTSOURCE=$MAINLINE_UBOOT_SOURCE +[[ -z $BOOTDIR ]] && BOOTDIR=$MAINLINE_UBOOT_DIR +[[ -z $BOOTBRANCH ]] && BOOTBRANCH='tag:v2022.07' + +if [ "$(uname -m)" = "aarch64" ]; then + [[ -z $KERNEL_COMPILER ]] && KERNEL_COMPILER="arm-linux-gnueabihf-" [[ -z $KERNEL_USE_GCC ]] && KERNEL_USE_GCC='> 8.0' else # > 9.2 https://armbian.atlassian.net/browse/AR-557 #[[ -z $KERNEL_COMPILER ]] && KERNEL_COMPILER="arm-none-linux-gnueabihf-" - [[ -z $UBOOT_COMPILER ]] && UBOOT_COMPILER='arm-none-linux-gnueabihf-' + [[ -z $KERNEL_COMPILER ]] && KERNEL_COMPILER="arm-linux-gnueabihf-" [[ -z $KERNEL_USE_GCC ]] && KERNEL_USE_GCC='< 9.2' fi +[[ -z $KERNELDIR ]] && KERNELDIR=$MAINLINE_KERNEL_DIR +[[ -z $KERNELSOURCE ]] && KERNELSOURCE=$MAINLINE_KERNEL_SOURCE +[[ -z $KERNELBRANCH ]] && KERNELBRANCH='branch:linux-5.4.y' -# System toolchains don't have the -none- variant, remove it -[[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]] && UBOOT_COMPILER="${UBOOT_COMPILER//-none-/-}" -[[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]] && ATF_COMPILER="${ATF_COMPILER//-none-/-}" +## System toolchains don't have the -none- variant, remove it +[[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]] && [[ "${UBOOT_COMPILER}" = *none* ]] && UBOOT_COMPILER="${UBOOT_COMPILER//-none-/-}" +[[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]] && [[ "${ATF_COMPILER}" = *none* ]] && ATF_COMPILER="${ATF_COMPILER//-none-/-}" + +true # don't fail due to conditional above. diff --git a/config/sources/families/bcm2711.conf b/config/sources/families/bcm2711.conf index d3f141528..02bb8a3ab 100644 --- a/config/sources/families/bcm2711.conf +++ b/config/sources/families/bcm2711.conf @@ -3,7 +3,6 @@ export LINUXFAMILY=bcm2711 export ARCH=arm64 export UEFI_FS_LABEL="RPICFG" # Windows/Mac users will see this if they mount the SD card. Configurable, but should be uppercase always export SKIP_BOOTSPLASH="yes" # video is init-ed before us -export KERNELDIR='linux-rpi' # Avoid sharing a source tree with others, until we know it's safe. export FK__PUBLISHED_KERNEL_VERSION="raspi" # flash kernel (FK) configuration export FK__KERNEL_PACKAGES="" export CPUMIN=500000 @@ -12,20 +11,23 @@ export GOVERNOR=ondemand case "${BRANCH}" in - legacy) + ddk) export RASPI_DISTRO_KERNEL=yes # This will cause board to include distro's prebuilt kernel, not from source ;; current) export RASPI_DISTRO_KERNEL=no export KERNELSOURCE='https://github.com/raspberrypi/linux' + export KERNEL_MAJOR_MINOR="5.15" # Major and minor versions of this kernel. For mainline caching. export KERNELBRANCH="branch:rpi-5.15.y" export KERNELPATCHDIR="${LINUXFAMILY}-${BRANCH}" export LINUXCONFIG="linux-${LINUXFAMILY}-${BRANCH}" ;; + edge) export RASPI_DISTRO_KERNEL=no export KERNELSOURCE='https://github.com/raspberrypi/linux' + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. For mainline caching. export KERNELBRANCH="branch:rpi-6.1.y" export KERNELPATCHDIR="${LINUXFAMILY}-${BRANCH}" export LINUXCONFIG="linux-${LINUXFAMILY}-${BRANCH}" @@ -40,27 +42,12 @@ pre_initramfs_flash_kernel__write_raspi_cmdline() { pre_flash_kernel__symlink_dtb_and_kernel() { if [[ "${RASPI_DISTRO_KERNEL}" != "yes" ]]; then # and firmware. - display_alert "Preparing DTBs and Kernel..." "bcm2711" "info" - mkdir -p "${MOUNT}"/etc/flash-kernel/dtbs - + display_alert "Configuring flash-kernel DB..." "bcm2711" "info" cat <<- EOD >> "${MOUNT}"/etc/flash-kernel/db # Armbian kernels don't have a 'flavour'. Ignore flavors for all rpi revisions. Machine: Raspberry Pi * Kernel-Flavors: any EOD - - ## @TODO: rpardini: a horrible hack. I'll sort this out together with overlays, later. - local oneDTB dtbBase - for oneDTB in "${MOUNT}"/boot/dtb/broadcom/*.dtb; do - dtbBase=$(basename "${oneDTB}") - cp "${MOUNT}"/boot/dtb/broadcom/"${dtbBase}" "${MOUNT}"/etc/flash-kernel/dtbs/"${dtbBase}" - done - - rm -rf "${MOUNT}"/boot/dtb* || true - - # @TODO: rpardini: packaging could maybe already use the correct names? I can't figure out how. - ln -s ./Image "${MOUNT}"/boot/vmlinuz - ln -s ./Image "${MOUNT}"/boot/vmlinuz- fi } @@ -71,7 +58,7 @@ extension_prepare_config__prepare_rpi_flash_kernel() { local usable_releases="jammy|kinetic|lunar" if [[ "$RELEASE" =~ ^(${usable_releases})$ ]]; then - export FK__EXTRA_PACKAGES="rpi-eeprom linux-firmware linux-firmware-raspi libraspberrypi-bin cloud-initramfs-growroot" + export FK__EXTRA_PACKAGES="rpi-eeprom linux-firmware linux-firmware-raspi pi-bluetooth libraspberrypi-bin cloud-initramfs-growroot" if [[ "$RELEASE" =~ ^(jammy|kinetic)$ ]]; then # Add raspi-config for those releases that have it; it might be useful. export FK__EXTRA_PACKAGES="${FK__EXTRA_PACKAGES} raspi-config" diff --git a/config/sources/families/imx6.conf b/config/sources/families/imx6.conf index 5c046e13b..e9fb2578d 100644 --- a/config/sources/families/imx6.conf +++ b/config/sources/families/imx6.conf @@ -10,12 +10,14 @@ case $BRANCH in current) + export KERNEL_MAJOR_MINOR="5.15" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-5.15.y' ;; edge) + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-6.1.y' ;; diff --git a/config/sources/families/imx7d.conf b/config/sources/families/imx7d.conf index 2b8652188..225666015 100644 --- a/config/sources/families/imx7d.conf +++ b/config/sources/families/imx7d.conf @@ -11,13 +11,15 @@ case $BRANCH in legacy) KERNELSOURCE='https://source.codeaurora.org/external/imx/linux-imx' + export KERNEL_MAJOR_MINOR="4.14" # Major and minor versions of this kernel. KERNELBRANCH='branch:imx_4.14.98_2.0.0_ga' KERNELDIR='linux-imx7' BOOTBRANCH='branch:imx_v2018.03_4.14.98_2.0.0_ga' BOOTPATCHDIR="legacy" ;; - current | default) + current) KERNELSOURCE='https://source.codeaurora.org/external/imx/linux-imx' + export KERNEL_MAJOR_MINOR="5.4" # Major and minor versions of this kernel. KERNELBRANCH='branch:imx_5.4.70_2.3.0' KERNELDIR='linux-imx7-current' BOOTBRANCH='branch:imx_v2020.04_5.4.70_2.3.0' diff --git a/config/sources/families/include/meson64_common.inc b/config/sources/families/include/meson64_common.inc index d4657ea59..a79ac68f5 100644 --- a/config/sources/families/include/meson64_common.inc +++ b/config/sources/families/include/meson64_common.inc @@ -24,59 +24,51 @@ GOVERNOR=${GOVERNOR:-ondemand} case $BRANCH in current) + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. For mainline caching. KERNELBRANCH='branch:linux-6.1.y' KERNELPATCHDIR='meson64-current' ;; edge) + export KERNEL_MAJOR_MINOR="6.2" # Major and minor versions of this kernel. For mainline caching. KERNELBRANCH='tag:v6.2-rc3' # @TODO: soon-to-be 'branch:linux-6.2.y' when it is released KERNELPATCHDIR='meson64-edge' ;; esac -#if [ "$(uname -m)" = "aarch64" ]; then -# if [[ "$(lsb_release -sc)" == "bullseye" || "$(lsb_release -sc)" == "focal" || "$(lsb_release -sc)" == "hirsute" || "$(lsb_release -sc)" == "impish" || "$(lsb_release -sc)" == "jammy" ]]; then -# PKG_PREFIX="qemu-x86_64-static -L /usr/x86_64-linux-gnu " -# else -# PKG_PREFIX="qemu-x86_64 " -# fi -#else -# PKG_PREFIX="" -#fi - # this helper function includes postprocess for p212 and its variants. # $1 PATH for uboot blob repo # $2 dir name in uboot blob repo uboot_gxl_postprocess() { - mv u-boot.bin bl33.bin + run_host_command_logged mv -v u-boot.bin bl33.bin - $1/blx_fix.sh $1/$2/bl30.bin \ + run_host_command_logged $1/blx_fix.sh $1/$2/bl30.bin \ $1/$2/zero_tmp \ $1/$2/bl30_zero.bin \ $1/$2/bl301.bin \ $1/$2/bl301_zero.bin \ $1/$2/bl30_new.bin bl30 - python $1/acs_tool.pyc $1/$2/bl2.bin \ + run_host_command_logged python $1/acs_tool.pyc $1/$2/bl2.bin \ $1/$2/bl2_acs.bin \ $1/$2/acs.bin 0 - $1/blx_fix.sh $1/$2/bl2_acs.bin \ + run_host_command_logged $1/blx_fix.sh $1/$2/bl2_acs.bin \ $1/$2/zero_tmp \ $1/$2/bl2_zero.bin \ $1/$2/bl21.bin \ $1/$2/bl21_zero.bin \ $1/$2/bl2_new.bin bl2 - $PKG_PREFIX$1/$2/aml_encrypt_gxl --bl3enc --input $1/$2/bl30_new.bin - $PKG_PREFIX$1/$2/aml_encrypt_gxl --bl3enc --input $1/$2/bl31.img - $PKG_PREFIX$1/$2/aml_encrypt_gxl --bl3enc --input bl33.bin + run_host_x86_binary_logged $1/$2/aml_encrypt_gxl --bl3enc --input $1/$2/bl30_new.bin + run_host_x86_binary_logged $1/$2/aml_encrypt_gxl --bl3enc --input $1/$2/bl31.img + run_host_x86_binary_logged $1/$2/aml_encrypt_gxl --bl3enc --input bl33.bin - $PKG_PREFIX$1/$2/aml_encrypt_gxl --bl2sig --input $1/$2/bl2_new.bin \ + run_host_x86_binary_logged $1/$2/aml_encrypt_gxl --bl2sig --input $1/$2/bl2_new.bin \ --output bl2.n.bin.sig - $PKG_PREFIX$1/$2/aml_encrypt_gxl --bootmk \ + run_host_x86_binary_logged $1/$2/aml_encrypt_gxl --bootmk \ --output u-boot.bin \ --bl2 bl2.n.bin.sig \ --bl30 $1/$2/bl30_new.bin.enc \ @@ -88,42 +80,42 @@ uboot_gxl_postprocess() { # $1 PATH for uboot blob repo # $2 dir name in uboot blob repo uboot_axg_postprocess_ng() { - mv u-boot.bin bl33.bin + run_host_command_logged mv -v u-boot.bin bl33.bin - $1/blx_fix.sh $1/$2/bl30.bin \ + run_host_command_logged $1/blx_fix.sh $1/$2/bl30.bin \ $1/$2/zero_tmp \ $1/$2/bl30_zero.bin \ $1/$2/bl301.bin \ $1/$2/bl301_zero.bin \ $1/$2/bl30_new.bin bl30 - python3 $1/acs_tool.py $1/$2/bl2.bin \ + run_host_command_logged python3 $1/acs_tool.py $1/$2/bl2.bin \ $1/$2/bl2_acs.bin \ $1/$2/acs.bin 0 - $1/blx_fix.sh $1/$2/bl2_acs.bin \ + run_host_command_logged $1/blx_fix.sh $1/$2/bl2_acs.bin \ $1/$2/zero_tmp \ $1/$2/bl2_zero.bin \ $1/$2/bl21.bin \ $1/$2/bl21_zero.bin \ $1/$2/bl2_new.bin bl2 - $PKG_PREFIX$1/$2/aml_encrypt_axg --bl3sig --input $1/$2/bl30_new.bin \ + run_host_x86_binary_logged $1/$2/aml_encrypt_axg --bl3sig --input $1/$2/bl30_new.bin \ --output bl30_new.bin.enc \ --level v3 --type bl30 - $PKG_PREFIX$1/$2/aml_encrypt_axg --bl3sig --input $1/$2/bl31.img \ + run_host_x86_binary_logged $1/$2/aml_encrypt_axg --bl3sig --input $1/$2/bl31.img \ --output bl31.img.enc \ --level v3 --type bl31 - $PKG_PREFIX$1/$2/aml_encrypt_axg --bl3sig --input bl33.bin --compress lz4 \ + run_host_x86_binary_logged $1/$2/aml_encrypt_axg --bl3sig --input bl33.bin --compress lz4 \ --output bl33.bin.enc \ --level v3 --type bl33 - $PKG_PREFIX$1/$2/aml_encrypt_axg --bl2sig --input $1/$2/bl2_new.bin \ + run_host_x86_binary_logged $1/$2/aml_encrypt_axg --bl2sig --input $1/$2/bl2_new.bin \ --output bl2.n.bin.sig - $PKG_PREFIX$1/$2/aml_encrypt_axg --bootmk \ + run_host_x86_binary_logged $1/$2/aml_encrypt_axg --bootmk \ --output u-boot.bin \ --bl2 bl2.n.bin.sig \ --bl30 bl30_new.bin.enc \ @@ -135,44 +127,44 @@ uboot_axg_postprocess_ng() { # $1 PATH for uboot blob repo # $2 family g12a or g12b uboot_g12_postprocess() { - mv u-boot.bin bl33.bin + run_host_command_logged mv -v u-boot.bin bl33.bin - $1/blx_fix.sh $1/bl30.bin \ + run_host_command_logged $1/blx_fix.sh $1/bl30.bin \ zero_tmp \ bl30_zero.bin \ $1/bl301.bin \ bl301_zero.bin \ bl30_new.bin bl30 - $1/blx_fix.sh $1/bl2.bin \ + run_host_command_logged $1/blx_fix.sh $1/bl2.bin \ zero_tmp \ bl2_zero.bin \ $1/acs.bin \ bl21_zero.bin \ bl2_new.bin bl2 - $PKG_PREFIX$1/aml_encrypt_$2 --bl30sig \ + run_host_x86_binary_logged $1/aml_encrypt_$2 --bl30sig \ --input bl30_new.bin \ --output bl30_new.bin.g12.enc \ --level v3 - $PKG_PREFIX$1/aml_encrypt_$2 --bl3sig \ + run_host_x86_binary_logged $1/aml_encrypt_$2 --bl3sig \ --input bl30_new.bin.g12.enc \ --output bl30_new.bin.enc \ --level v3 --type bl30 - $PKG_PREFIX$1/aml_encrypt_$2 --bl3sig \ + run_host_x86_binary_logged $1/aml_encrypt_$2 --bl3sig \ --input $1/bl31.img \ --output bl31.img.enc \ --level v3 --type bl31 - $PKG_PREFIX$1/aml_encrypt_$2 --bl3sig \ + run_host_x86_binary_logged $1/aml_encrypt_$2 --bl3sig \ --input bl33.bin \ --compress lz4 \ --output bl33.bin.enc \ --level v3 --type bl33 - $PKG_PREFIX$1/aml_encrypt_$2 --bl2sig \ + run_host_x86_binary_logged $1/aml_encrypt_$2 --bl2sig \ --input bl2_new.bin \ --output bl2.n.bin.sig if [ -e $1/lpddr3_1d.fw ]; then - $PKG_PREFIX$1/aml_encrypt_$2 --bootmk --output u-boot.bin \ + run_host_x86_binary_logged $1/aml_encrypt_$2 --bootmk --output u-boot.bin \ --bl2 bl2.n.bin.sig \ --bl30 bl30_new.bin.enc \ --bl31 bl31.img.enc \ @@ -188,7 +180,7 @@ uboot_g12_postprocess() { --ddrfw9 $1/lpddr3_1d.fw \ --level v3 else - $PKG_PREFIX$1/aml_encrypt_$2 --bootmk --output u-boot.bin \ + run_host_x86_binary_logged $1/aml_encrypt_$2 --bootmk --output u-boot.bin \ --bl2 bl2.n.bin.sig \ --bl30 bl30_new.bin.enc \ --bl31 bl31.img.enc \ @@ -209,31 +201,31 @@ uboot_g12_postprocess() { # this helper function includes postprocess for meson gxl and gxm. # $1 PATH for uboot blob repo uboot_gxl_postprocess_ng() { - mv u-boot.bin bl33.bin + run_host_command_logged mv -v u-boot.bin bl33.bin - $1/blx_fix.sh $1/bl30.bin \ + run_host_command_logged $1/blx_fix.sh $1/bl30.bin \ $1/zero_tmp \ $1/bl30_zero.bin \ $1/bl301.bin \ $1/bl301_zero.bin \ $1/bl30_new.bin bl30 - python3 $1/acs_tool.py $1/bl2.bin $1/bl2_acs.bin $1/acs.bin 0 + run_host_command_logged python3 $1/acs_tool.py $1/bl2.bin $1/bl2_acs.bin $1/acs.bin 0 - $1/blx_fix.sh $1/bl2_acs.bin \ + run_host_command_logged $1/blx_fix.sh $1/bl2_acs.bin \ $1/zero_tmp \ $1/bl2_zero.bin \ $1/bl21.bin \ $1/bl21_zero.bin \ $1/bl2_new.bin bl2 - $1/aml_encrypt_gxl --bl3enc --input $1/bl30_new.bin - $1/aml_encrypt_gxl --bl3enc --input $1/bl31.img - $1/aml_encrypt_gxl --bl3enc --input bl33.bin - $1/aml_encrypt_gxl --bl2sig --input $1/bl2_new.bin \ + run_host_command_logged $1/aml_encrypt_gxl --bl3enc --input $1/bl30_new.bin + run_host_command_logged $1/aml_encrypt_gxl --bl3enc --input $1/bl31.img + run_host_command_logged $1/aml_encrypt_gxl --bl3enc --input bl33.bin + run_host_command_logged $1/aml_encrypt_gxl --bl2sig --input $1/bl2_new.bin \ --output bl2.n.bin.sig - $1/aml_encrypt_gxl --bootmk --output u-boot.bin \ + run_host_command_logged $1/aml_encrypt_gxl --bootmk --output u-boot.bin \ --bl2 bl2.n.bin.sig \ --bl30 $1/bl30_new.bin.enc \ --bl31 $1/bl31.img.enc \ @@ -241,8 +233,8 @@ uboot_gxl_postprocess_ng() { } write_uboot_platform() { - dd if=$1/u-boot.bin of=$2 bs=1 count=442 conv=fsync > /dev/null 2>&1 - dd if=$1/u-boot.bin of=$2 bs=512 skip=1 seek=1 conv=fsync > /dev/null 2>&1 + dd if=$1/u-boot.bin of=$2 bs=1 count=442 conv=fsync 2>&1 + dd if=$1/u-boot.bin of=$2 bs=512 skip=1 seek=1 conv=fsync 2>&1 } family_tweaks_bsp() { @@ -251,7 +243,7 @@ family_tweaks_bsp() { mkdir -p "$destination"/etc/X11/xorg.conf.d case "${BOARD}" in - "odroidc2" | "nanopik2-s905" | "lepotato" | "lafrite" | "khadas-vim1" | "khadas-vim2" | "aml-s9xx-box" ) + "odroidc2" | "nanopik2-s905" | "lepotato" | "lafrite" | "khadas-vim1" | "khadas-vim2" | "aml-s9xx-box") cat <<- EOF > "$destination"/etc/X11/xorg.conf.d/02-driver.conf Section "OutputClass" Identifier "Amlogic" diff --git a/config/sources/families/include/meson_common.inc b/config/sources/families/include/meson_common.inc index 8c3f9cac3..6461413ed 100644 --- a/config/sources/families/include/meson_common.inc +++ b/config/sources/families/include/meson_common.inc @@ -36,6 +36,7 @@ esac case $BRANCH in current) + export KERNEL_MAJOR_MINOR="5.15" # Major and minor versions of this kernel. KERNELBRANCH="branch:linux-5.15.y" KERNELPATCHDIR='meson-'$BRANCH @@ -43,6 +44,7 @@ case $BRANCH in edge) + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. KERNELBRANCH="branch:linux-6.1.y" KERNELPATCHDIR='meson-'$BRANCH diff --git a/config/sources/families/include/rockchip64_common.inc b/config/sources/families/include/rockchip64_common.inc index d8dea54ff..1d0b3c446 100644 --- a/config/sources/families/include/rockchip64_common.inc +++ b/config/sources/families/include/rockchip64_common.inc @@ -116,6 +116,7 @@ case $BRANCH in current) + export KERNEL_MAJOR_MINOR="5.15" # Major and minor versions of this kernel. KERNELBRANCH="branch:linux-5.15.y" KERNELPATCHDIR='rockchip64-'$BRANCH LINUXFAMILY=rockchip64 @@ -125,6 +126,7 @@ case $BRANCH in edge) KERNELPATCHDIR='rockchip64-'$BRANCH + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. KERNELBRANCH="branch:linux-6.1.y" LINUXFAMILY=rockchip64 LINUXCONFIG='linux-rockchip64-'$BRANCH @@ -183,16 +185,16 @@ uboot_custom_postprocess() { if [[ $BOOT_SCENARIO == "blobless" || $BOOT_SCENARIO == "tpl-spl-blob" ]]; then : elif [[ $BOOT_SCENARIO == "spl-blobs" || $BOOT_SCENARIO == "tpl-blob-atf-mainline" ]]; then - - tools/mkimage -n $BOOT_SOC -T rksd -d $RKBIN_DIR/$DDR_BLOB:spl/u-boot-spl.bin idbloader.img + display_alert "mkimage for $BOOT_SOC with $BOOT_SCENARIO" "spl-blobs/tpl-blob-atf-mainline" "debug" + run_host_command_logged tools/mkimage -n $BOOT_SOC -T rksd -d $RKBIN_DIR/$DDR_BLOB:spl/u-boot-spl.bin idbloader.img elif [[ $BOOT_SCENARIO == "only-blobs" ]]; then local tempfile=$(mktemp) - tools/mkimage -n $BOOT_SOC -T rksd -d $RKBIN_DIR/$DDR_BLOB idbloader.bin + run_host_command_logged tools/mkimage -n $BOOT_SOC -T rksd -d $RKBIN_DIR/$DDR_BLOB idbloader.bin cat $RKBIN_DIR/$MINILOADER_BLOB >> idbloader.bin - $PKG_PREFIX$RKBIN_DIR/tools/loaderimage --pack --uboot ./u-boot-dtb.bin uboot.img 0x200000 - $PKG_PREFIX$RKBIN_DIR/tools/trust_merger --replace bl31.elf $RKBIN_DIR/$BL31_BLOB trust.ini + run_host_x86_binary_logged $RKBIN_DIR/tools/loaderimage --pack --uboot ./u-boot-dtb.bin uboot.img 0x200000 + run_host_x86_binary_logged $RKBIN_DIR/tools/trust_merger --replace bl31.elf $RKBIN_DIR/$BL31_BLOB trust.ini else echo "Unsupported u-boot processing configuration!" @@ -222,25 +224,22 @@ uboot_custom_postprocess() { } write_uboot_platform() { + # This is run board-side too, so account for the non-existance of run_host_command_logged + local logging_prelude="" + [[ $(type -t run_host_command_logged) == function ]] && logging_prelude="run_host_command_logged" + if [[ -f $1/rksd_loader.img ]]; then # legacy rk3399 loader - - dd if=$1/rksd_loader.img of=$2 seek=64 conv=notrunc status=none > /dev/null 2>&1 - + ${logging_prelude} dd if=$1/rksd_loader.img of=$2 seek=64 conv=notrunc status=none elif [[ -f $1/u-boot.itb ]]; then # $BOOT_SCENARIO == "blobless" || $BOOT_SCENARIO == "tpl-spl-blob" - - dd if=$1/idbloader.img of=$2 seek=64 conv=notrunc status=none > /dev/null 2>&1 - dd if=$1/u-boot.itb of=$2 seek=16384 conv=notrunc status=none > /dev/null 2>&1 - + ${logging_prelude} dd if=$1/idbloader.img of=$2 seek=64 conv=notrunc status=none + ${logging_prelude} dd if=$1/u-boot.itb of=$2 seek=16384 conv=notrunc status=none elif [[ -f $1/uboot.img ]]; then # $BOOT_SCENARIO == "only-blobs" - - dd if=$1/idbloader.bin of=$2 seek=64 conv=notrunc status=none > /dev/null 2>&1 - dd if=$1/uboot.img of=$2 seek=16384 conv=notrunc status=none > /dev/null 2>&1 - dd if=$1/trust.bin of=$2 seek=24576 conv=notrunc status=none > /dev/null 2>&1 - + ${logging_prelude} dd if=$1/idbloader.bin of=$2 seek=64 conv=notrunc status=none + ${logging_prelude} dd if=$1/uboot.img of=$2 seek=16384 conv=notrunc status=none + ${logging_prelude} dd if=$1/trust.bin of=$2 seek=24576 conv=notrunc status=none else echo "Unsupported u-boot processing configuration!" exit 1 - fi } @@ -484,11 +483,9 @@ family_tweaks_bsp() { fi if [[ $BOARD == rk3318-box ]]; then - # Optional board dtbo selection script mkdir -p $destination/usr/local/bin install -m 755 $SRC/packages/bsp/rk3318/rk3318-config $destination/usr/sbin - fi if [[ $BOARD == pinebook-pro ]]; then diff --git a/config/sources/families/include/sunxi64_common.inc b/config/sources/families/include/sunxi64_common.inc index 34cee70bf..b82b7559d 100644 --- a/config/sources/families/include/sunxi64_common.inc +++ b/config/sources/families/include/sunxi64_common.inc @@ -1,103 +1,55 @@ enable_extension "sunxi-tools" -ARCH=arm64 -ATF_TARGET_MAP="PLAT=$ATF_PLAT DEBUG=1 bl31;;build/$ATF_PLAT/debug/bl31.bin" -BOOTDELAY=1 +export ARCH=arm64 +export ATF_TARGET_MAP="PLAT=$ATF_PLAT DEBUG=1 bl31;;build/$ATF_PLAT/debug/bl31.bin" +export BOOTDELAY=1 -BOOTPATCHDIR='u-boot-sunxi' -BOOTENV_FILE='sunxi.txt' +export BOOTPATCHDIR='u-boot-sunxi' +export BOOTENV_FILE='sunxi.txt' UBOOT_TARGET_MAP="${UBOOT_TARGET_MAP:-;;u-boot-sunxi-with-spl.bin}" -BOOTSCRIPT='boot-sun50i-next.cmd:boot.cmd' -LINUXFAMILY=sunxi64 +export BOOTSCRIPT='boot-sun50i-next.cmd:boot.cmd' +export LINUXFAMILY=sunxi64 +export KERNELPATCHDIR='sunxi-'$BRANCH case $BRANCH in legacy) - KERNEL_VERSION_LEVEL="5.10" - KERNELSWITCHOBJ="tag=v5.10.138" + export KERNEL_MAJOR_MINOR="5.10" # Major and minor versions of this kernel. + export KERNELBRANCH="tag:v5.10.138" + export KERNELBRANCH_MEGOUS="branch:orange-pi-5.10" ;; current) - KERNEL_VERSION_LEVEL="5.15" - KERNELSWITCHOBJ="tag=v5.15.93" + export KERNEL_MAJOR_MINOR="5.15" # Major and minor versions of this kernel. + export KERNELBRANCH="tag:v5.15.93" + export KERNELBRANCH_MEGOUS="branch:orange-pi-5.15" ;; edge) - KERNEL_VERSION_LEVEL=${KERNEL_VERSION_LEVEL:-6.1} - KERNELSWITCHOBJ=${KERNELSWITCHOBJ:-'tag=v6.1.11'} + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. + export KERNELBRANCH="tag:v6.1.11" + export KERNELBRANCH_MEGOUS="branch:orange-pi-6.1" ;; esac -case "$KERNEL_VERSION_LEVEL" in +# Hack for easily using megous for tests. +if [[ "$USE_MEGOUS" == "yes" ]]; then + display_alert "Using megous/linux for kernel" "USE_MEGOUS: ${USE_MEGOUS}" "debug" + export KERNELSOURCE="https://github.com/megous/linux" + export KERNELBRANCH="${KERNELBRANCH_MEGOUS}" +fi - 5.10|5.15|5.16|5.17|5.18|5.19|6.0|6.1) - KERNELSOURCE=$MAINLINE_KERNEL_SOURCE - KERNELSOURCENAME='name=origin' - KERNELBRANCH="branch:linux-${KERNEL_VERSION_LEVEL}.y" - ;; - - *) - KERNELSOURCE="https://github.com/megous/linux" - KERNELSOURCENAME='name=megous' - KERNELBRANCH="branch:orange-pi-$KERNEL_VERSION_LEVEL" - ;; -esac - -KERNELPATCHDIR='archive/sunxi-'$KERNEL_VERSION_LEVEL - -# An optional parameter for switching to a git object such as a tag, commit, -# or a specific branch. The object must exist in the local repository. -# This optional parameter takes precedence. If it is specified, then -# the commit state corresponding to the specified git object will be extracted -# to the working directory. Otherwise, the commit corresponding to the top of -# the branch will be extracted. -# KERNELSWITCHOBJ="tag=v5.10.15" -# tag | obj | commit=v5.10.15 | [origin|megous]/$branch | $hash - -var_origin_kernel() { - url=$MAINLINE_KERNEL_SOURCE - name='origin' - branch="linux-${KERNEL_VERSION_LEVEL}.y" - start_tag="v$KERNEL_VERSION_LEVEL" - - # checking the reachability of the initial tag - if [ "$(git ls-remote --tags $url $start_tag | - awk -F'/' '{if (NR == 1) print $NF}')" != "$start_tag" ]; then - exit 177 - fi - - # Exceptions to the rule are when the desired tag is not - # a bifurcation point at which all previous merge branches converge. - # This is due to the subsequent extraction of `megous` - # [ "$KERNEL_VERSION_LEVEL" == "5.12" ] && start_tag="v5.12-rc7" -} +unset KERNELBRANCH_MEGOUS family_tweaks() { - if [[ $BOARD == nanopi-r1s-h5 ]]; then - # rename USB based network to lan0 - mkdir -p $SDCARD/etc/udev/rules.d/ - echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="r8152", KERNEL=="eth1", NAME="lan0"' > $SDCARD/etc/udev/rules.d/70-rename-lan.rules - fi - # execute specific tweaks function if present [[ $(type -t family_tweaks_s) == function ]] && family_tweaks_s cp $SRC/packages/blobs/splash/armbian-u-boot-24.bmp $SDCARD/boot/boot.bmp } -case $IMAGE_PARTITION_TABLE in - msdos) - write_uboot_platform() { - dd if=/dev/zero of=$2 bs=1k count=1023 seek=1 status=noxfer > /dev/null 2>&1 - dd if=$1/u-boot-sunxi-with-spl.bin of=$2 bs=1024 seek=8 status=noxfer > /dev/null 2>&1 - } - ;; - - gpt) # Skip 128K for writing if the partition table is GPT. - write_uboot_platform() { - dd if=/dev/zero of=$2 bs=1024 count=1023 seek=128 status=noxfer > /dev/null 2>&1 - dd if=$1/u-boot-sunxi-with-spl.bin of=$2 bs=1024 seek=128 status=noxfer > /dev/null 2>&1 - } - ;; -esac +write_uboot_platform() { + dd if=/dev/zero of=$2 bs=1k count=1023 seek=1 status=noxfer > /dev/null 2>&1 + dd if=$1/u-boot-sunxi-with-spl.bin of=$2 bs=1024 seek=8 status=noxfer > /dev/null 2>&1 +} setup_write_uboot_platform() { if grep -q "ubootpart" /proc/cmdline; then diff --git a/config/sources/families/include/sunxi_common.inc b/config/sources/families/include/sunxi_common.inc index 6d34af3fb..5f91c29eb 100644 --- a/config/sources/families/include/sunxi_common.inc +++ b/config/sources/families/include/sunxi_common.inc @@ -1,75 +1,45 @@ enable_extension "sunxi-tools" -ARCH=armhf -BOOTDELAY=1 -BOOTPATCHDIR='u-boot-sunxi' +export ARCH=armhf +export BOOTDELAY=1 +export BOOTPATCHDIR='u-boot-sunxi' UBOOT_TARGET_MAP="${UBOOT_TARGET_MAP:-;;u-boot-sunxi-with-spl.bin}" -BOOTSCRIPT="boot-sunxi.cmd:boot.cmd" -BOOTENV_FILE='sunxi.txt' -LINUXFAMILY=sunxi -UBOOT_FW_ENV='0x88000,0x20000' # /etc/fw_env.config offset and env size -ASOUND_STATE='asound.state.sunxi-next' -GOVERNOR=ondemand +export BOOTSCRIPT="boot-sunxi.cmd:boot.cmd" +export BOOTENV_FILE='sunxi.txt' +export LINUXFAMILY=sunxi +export UBOOT_FW_ENV='0x88000,0x20000' # /etc/fw_env.config offset and env size +export ASOUND_STATE='asound.state.sunxi-next' +export GOVERNOR=ondemand +export KERNELPATCHDIR='sunxi-'$BRANCH case $BRANCH in legacy) - KERNEL_VERSION_LEVEL="5.10" - KERNELSWITCHOBJ="tag=v5.10.138" + export KERNEL_MAJOR_MINOR="5.10" # Major and minor versions of this kernel. + export KERNELBRANCH="tag:v5.10.138" + export KERNELBRANCH_MEGOUS="branch:orange-pi-5.10" ;; + current) - KERNEL_VERSION_LEVEL="5.15" - KERNELSWITCHOBJ="tag=v5.15.93" + export KERNEL_MAJOR_MINOR="5.15" # Major and minor versions of this kernel. + export KERNELBRANCH="tag:v5.15.93" + export KERNELBRANCH_MEGOUS="branch:orange-pi-5.15" ;; + edge) - KERNEL_VERSION_LEVEL=${KERNEL_VERSION_LEVEL:-6.1} - KERNELSWITCHOBJ=${KERNELSWITCHOBJ:-'tag=v6.1.11'} - ;; - -esac - -case "$KERNEL_VERSION_LEVEL" in - - 5.10|5.15|5.16|5.17|5.18|5.19|6.0|6.1) - KERNELSOURCE=$MAINLINE_KERNEL_SOURCE - KERNELSOURCENAME='name=origin' - KERNELBRANCH="branch:linux-${KERNEL_VERSION_LEVEL}.y" - ;; - - *) - KERNELSOURCE="https://github.com/megous/linux" - KERNELSOURCENAME='name=megous' - KERNELBRANCH="branch:orange-pi-$KERNEL_VERSION_LEVEL" + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. + export KERNELBRANCH="tag:v6.1.11" + export KERNELBRANCH_MEGOUS="branch:orange-pi-6.1" ;; esac -KERNELPATCHDIR='archive/sunxi-'$KERNEL_VERSION_LEVEL +# Hack for easily using megous for tests. +if [[ "$USE_MEGOUS" == "yes" ]]; then + display_alert "Using megous/linux for kernel" "USE_MEGOUS: ${USE_MEGOUS}" "debug" + export KERNELSOURCE="https://github.com/megous/linux" + export KERNELBRANCH="${KERNELBRANCH_MEGOUS}" +fi -# An optional parameter for switching to a git object such as a tag, commit, -# or a specific branch. The object must exist in the local repository. -# This optional parameter takes precedence. If it is specified, then -# the commit state corresponding to the specified git object will be extracted -# to the working directory. Otherwise, the commit corresponding to the top of -# the branch will be extracted. -# KERNELSWITCHOBJ="tag=v5.10.15" -# tag | obj | commit=v5.10.15 | [origin|megous]/$branch | $hash - -var_origin_kernel() { - url=$MAINLINE_KERNEL_SOURCE - name='origin' - branch="linux-${KERNEL_VERSION_LEVEL}.y" - start_tag="v$KERNEL_VERSION_LEVEL" - - # checking the reachability of the initial tag - if [ "$(git ls-remote --tags $url $start_tag | - awk -F'/' '{if (NR == 1) print $NF}')" != "$start_tag" ]; then - exit 177 - fi - - # Exceptions to the rule are when the desired tag is not - # a bifurcation point at which all previous merge branches converge. - # This is due to the subsequent extraction of `megous` - # [ "$KERNEL_VERSION_LEVEL" == "5.12" ] && start_tag="v5.12-rc7" -} +unset KERNELBRANCH_MEGOUS family_tweaks() { # execute specific tweaks function if present @@ -81,6 +51,8 @@ family_tweaks() { family_tweaks_bsp() { # execute specific tweaks function if present [[ $(type -t family_tweaks_bsp_s) == function ]] && family_tweaks_bsp_s + + return 0 # short-circuit above, avoid errors on exit. } write_uboot_platform() { diff --git a/config/sources/families/include/uefi_common.inc b/config/sources/families/include/uefi_common.inc index 0fc460487..57db51f7e 100644 --- a/config/sources/families/include/uefi_common.inc +++ b/config/sources/families/include/uefi_common.inc @@ -4,7 +4,7 @@ export UEFI_GRUB_TIMEOUT=${UEFI_GRUB_TIMEOUT:-3} # Default 3-seconds timeout for export BOARD_FIRMWARE_INSTALL="-full" # Install full firmware for UEFI boards case "${BRANCH}" in - legacy) + ddk) # This will force `unset KERNELSOURCE` later; no kernel will be built. # Instead, the distro's default linux-generic kernel will be installed. export DISTRO_GENERIC_KERNEL=yes @@ -13,16 +13,16 @@ case "${BRANCH}" in current) export DISTRO_GENERIC_KERNEL=no export LINUXCONFIG="linux-uefi-${LINUXFAMILY}-${BRANCH}" - export KERNELBRANCH="branch:linux-5.15.y" + export KERNEL_MAJOR_MINOR="5.15" # Major and minor versions of this kernel. For mainline caching. + export KERNELBRANCH="branch:linux-5.15.y" # Branch or tag to build from. It should match MAJOR_MINOR export KERNELPATCHDIR="uefi-${LINUXFAMILY}-${BRANCH}" # Might be empty. - export KERNELDIR="linux-uefi-${LINUXFAMILY}" # Avoid sharing a source tree with others, until we know it's safe. ;; edge) export DISTRO_GENERIC_KERNEL=no export LINUXCONFIG="linux-uefi-${LINUXFAMILY}-${BRANCH}" - export KERNELBRANCH='branch:linux-6.1.y' + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. For mainline caching. + export KERNELBRANCH="branch:linux-6.1.y" # Branch or tag to build from. It should match MAJOR_MINOR export KERNELPATCHDIR="uefi-${LINUXFAMILY}-${BRANCH}" # Might be empty. - export KERNELDIR="linux-uefi-${LINUXFAMILY}" # Avoid sharing a source tree with others, until we know it's safe. ;; esac diff --git a/config/sources/families/jethub.conf b/config/sources/families/jethub.conf index b84cbec2a..fdc87e641 100644 --- a/config/sources/families/jethub.conf +++ b/config/sources/families/jethub.conf @@ -153,21 +153,21 @@ family_tweaks() { comment_default_rsyslog_rules || display_alert "Unable to comment default rsyslog rules" "${BOARD}" "wrn" # Hardware init - chroot "${SDCARD}" /bin/bash -c "systemctl --no-reload enable jethub-initer.service >/dev/null 2>&1" + chroot_sdcard systemctl --no-reload enable jethub-initer.service # AR-1098 userland fix for net interface does not up at boot - chroot "${SDCARD}" /bin/bash -c "systemctl --no-reload enable jethub-ethreset.service >/dev/null 2>&1" + chroot_sdcard systemctl --no-reload enable jethub-ethreset.service # pip3 packages - chroot "${SDCARD}" /bin/bash -c "pip3 install pyserial intelhex python-magic" >> "${DEST}"/debug/install.log 2>&1 + chroot_sdcard pip3 install pyserial intelhex python-magic if [[ "$BOARD" == jethubj80 ]]; then # Bluetooth - chroot "${SDCARD}" /bin/bash -c "systemctl --no-reload enable jethub-rtk-hciattach.service >/dev/null 2>&1" + chroot_sdcard systemctl --no-reload enable jethub-rtk-hciattach.service fi display_alert "Adding JetHome repository and authentication key" "/etc/apt/sources.list.d/jethome.list" "info" - cp "${SRC}"/packages/bsp/jethub/jethome.gpg "${SDCARD}/etc/apt/trusted.gpg.d/" + run_host_command_logged cp -pv "${SRC}"/packages/bsp/jethub/jethome.gpg "${SDCARD}/etc/apt/trusted.gpg.d/" echo "deb http://repo.jethome.ru"$([[ $BETA == yes ]] && echo "/beta")" ${RELEASE} jethome-${RELEASE}" \ >> "${SDCARD}"/etc/apt/sources.list.d/jethome.list diff --git a/config/sources/families/media.conf b/config/sources/families/media.conf index 808561cf6..1e82f630c 100644 --- a/config/sources/families/media.conf +++ b/config/sources/families/media.conf @@ -1,7 +1,7 @@ source "${BASH_SOURCE%/*}/include/rockchip64_common.inc" if [[ $BOARD = jetson-nano ]]; then - enable_extension "grub-sbc-media" + enable_extension "grub-sbc-media" fi if [[ $BOARD == station-p2 || $BOARD == station-m2 || $BOARD == bananapir2pro ]]; then @@ -34,6 +34,7 @@ case $BRANCH in if [[ $BOARD == station-p2 || $BOARD == station-m2 || $BOARD == bananapir2pro ]]; then KERNELSOURCE='https://github.com/150balbes/rockchip-kernel' + export KERNEL_MAJOR_MINOR="4.19" # Major and minor versions of this kernel. KERNELBRANCH='branch:kernel-4.19' KERNELPATCHDIR='station-p2-'$BRANCH LINUXFAMILY=station-p2 @@ -43,6 +44,7 @@ case $BRANCH in elif [[ $BOARD == jetson-nano ]]; then KERNELDIR='linux-nano' KERNELSOURCE='https://github.com/150balbes/Jetson-Nano' + export KERNEL_MAJOR_MINOR="4.9" # Major and minor versions of this kernel. KERNELBRANCH='branch:4.9.201' KERNELPATCHDIR='jetson-nano-'$BRANCH LINUXFAMILY=jetson-nano @@ -53,6 +55,7 @@ case $BRANCH in MODULES_INITRD="jetson-nano-legacy" else KERNELSOURCE='https://github.com/150balbes/rockchip-kernel' + export KERNEL_MAJOR_MINOR="5.10" # Major and minor versions of this kernel. KERNELBRANCH='branch:kernel-5.10' LINUXFAMILY=media LINUXCONFIG='linux-media-'$BRANCH @@ -61,6 +64,7 @@ case $BRANCH in ;; current) + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. KERNELBRANCH="branch:linux-6.1.y" LINUXCONFIG='linux-media-'$BRANCH KERNELPATCHDIR='media-'$BRANCH @@ -68,8 +72,8 @@ case $BRANCH in ;; edge) -# KERNELBRANCH="branch:linux-6.2.y" - KERNELBRANCH="tag:v6.2-rc8" + export KERNEL_MAJOR_MINOR="6.2" # Major and minor versions of this kernel. + KERNELBRANCH="tag:v6.2-rc8" # KERNELBRANCH="branch:linux-6.2.y" KERNELPATCHDIR='media-'$BRANCH LINUXFAMILY=media LINUXCONFIG='linux-media-'$BRANCH diff --git a/config/sources/families/meson-gxbb.conf b/config/sources/families/meson-gxbb.conf index e78c1739d..2c02fbc6d 100644 --- a/config/sources/families/meson-gxbb.conf +++ b/config/sources/families/meson-gxbb.conf @@ -5,16 +5,16 @@ fi uboot_custom_postprocess() { if [[ $BOARD == odroidc2 ]]; then - local t=$SRC/cache/sources/odroidc2-blobs/ - $PKG_PREFIX$t/fip_create --bl30 $t/gxb/bl30.bin \ - --bl301 $t/gxb/bl301.bin \ - --bl31 $t/gxb/bl31.bin \ + local fip_blobs_dir="$SRC/cache/sources/odroidc2-blobs/" + run_host_x86_binary_logged $fip_blobs_dir/fip_create --bl30 $fip_blobs_dir/gxb/bl30.bin \ + --bl301 $fip_blobs_dir/gxb/bl301.bin \ + --bl31 $fip_blobs_dir/gxb/bl31.bin \ --bl33 u-boot.bin \ fip.bin - $PKG_PREFIX$t/fip_create --dump fip.bin - cat $t/gxb/bl2.package fip.bin > boot_new.bin + run_host_x86_binary_logged $fip_blobs_dir/fip_create --dump fip.bin + cat $fip_blobs_dir/gxb/bl2.package fip.bin > boot_new.bin rm -f u-boot.img - $PKG_PREFIX$t/gxb/aml_encrypt_gxb --bootsig \ + run_host_x86_binary_logged $fip_blobs_dir/gxb/aml_encrypt_gxb --bootsig \ --input boot_new.bin \ --output u-boot.img rm -f u-boot.bin @@ -22,37 +22,37 @@ uboot_custom_postprocess() { fi if [[ $BOARD == nanopik2-s905 ]]; then - local t=$SRC/cache/sources/odroidc2-blobs/ + local fip_blobs_dir=$SRC/cache/sources/odroidc2-blobs/ mv u-boot.bin bl33.bin - $t/blx_fix.sh $t/k2/bl30.bin \ - $t/k2/zero_tmp \ - $t/k2/bl30_zero.bin \ - $t/k2/bl301.bin \ - $t/k2/bl301_zero.bin \ - $t/k2/bl30_new.bin bl30 + $fip_blobs_dir/blx_fix.sh $fip_blobs_dir/k2/bl30.bin \ + $fip_blobs_dir/k2/zero_tmp \ + $fip_blobs_dir/k2/bl30_zero.bin \ + $fip_blobs_dir/k2/bl301.bin \ + $fip_blobs_dir/k2/bl301_zero.bin \ + $fip_blobs_dir/k2/bl30_new.bin bl30 - $PKG_PREFIX$t/k2/fip_create --bl30 $t/k2/bl30_new.bin \ - --bl31 $t/k2/bl31.img \ + run_host_x86_binary_logged $fip_blobs_dir/k2/fip_create --bl30 $fip_blobs_dir/k2/bl30_new.bin \ + --bl31 $fip_blobs_dir/k2/bl31.img \ --bl33 bl33.bin \ - $t/k2/fip.bin + $fip_blobs_dir/k2/fip.bin - $PKG_PREFIX$t/k2/fip_create --dump $t/k2/fip.bin + run_host_x86_binary_logged $fip_blobs_dir/k2/fip_create --dump $fip_blobs_dir/k2/fip.bin - python $t/acs_tool.pyc $t/k2/bl2.bin \ - $t/k2/bl2_acs.bin \ - $t/k2/acs.bin 0 + python $fip_blobs_dir/acs_tool.pyc $fip_blobs_dir/k2/bl2.bin \ + $fip_blobs_dir/k2/bl2_acs.bin \ + $fip_blobs_dir/k2/acs.bin 0 - $t/blx_fix.sh $t/k2/bl2_acs.bin \ - $t/k2/zero_tmp \ - $t/k2/bl2_zero.bin \ - $t/k2/bl21.bin \ - $t/k2/bl21_zero.bin \ - $t/k2/bl2_new.bin bl2 + $fip_blobs_dir/blx_fix.sh $fip_blobs_dir/k2/bl2_acs.bin \ + $fip_blobs_dir/k2/zero_tmp \ + $fip_blobs_dir/k2/bl2_zero.bin \ + $fip_blobs_dir/k2/bl21.bin \ + $fip_blobs_dir/k2/bl21_zero.bin \ + $fip_blobs_dir/k2/bl2_new.bin bl2 - cat $t/k2/bl2_new.bin $t/k2/fip.bin > boot_new.bin + cat $fip_blobs_dir/k2/bl2_new.bin $fip_blobs_dir/k2/fip.bin > boot_new.bin - $PKG_PREFIX$t/k2/aml_encrypt_gxb --bootsig \ + run_host_x86_binary_logged $fip_blobs_dir/k2/aml_encrypt_gxb --bootsig \ --input boot_new.bin \ --output u-boot.bin diff --git a/config/sources/families/meson-gxl.conf b/config/sources/families/meson-gxl.conf index 2e03ae707..42669592c 100644 --- a/config/sources/families/meson-gxl.conf +++ b/config/sources/families/meson-gxl.conf @@ -1,23 +1,17 @@ source "${BASH_SOURCE%/*}/include/meson64_common.inc" if [[ $BOARD == lafrite ]]; then - UBOOT_TARGET_MAP="u-boot-dtb.img;;u-boot.bin:u-boot.bin u-boot-dtb.img" - fi if [[ $BOARD = khadas-vim1 ]]; then - # temporally workaround - using prebuild u-boot from https://github.com/khadas/khadas-uboot/releases/tag/0.11 UBOOT_TARGET_MAP=";;$SRC/packages/blobs/meson/u-boot-vim1-sd.bin:u-boot.bin" - fi if [[ $BOARD = khadas-vim2 ]]; then - # temporally workaround - using prebuild u-boot from https://github.com/khadas/khadas-uboot/releases/tag/0.11 UBOOT_TARGET_MAP=";;$SRC/packages/blobs/meson/u-boot-vim2-sd.bin:u-boot.bin" - fi family_tweaks() { diff --git a/config/sources/families/mt7623.conf b/config/sources/families/mt7623.conf index 09112daa4..9e7afe577 100644 --- a/config/sources/families/mt7623.conf +++ b/config/sources/families/mt7623.conf @@ -9,6 +9,7 @@ case $BRANCH in legacy) + export KERNEL_MAJOR_MINOR="4.19" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-4.19.y' ;; diff --git a/config/sources/families/mvebu.conf b/config/sources/families/mvebu.conf index f9cfba853..cf67aefb3 100644 --- a/config/sources/families/mvebu.conf +++ b/config/sources/families/mvebu.conf @@ -12,12 +12,14 @@ case $BRANCH in current) + export KERNEL_MAJOR_MINOR="5.15" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-5.15.y' ;; edge) + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-6.1.y' LINUXCONFIG='linux-mvebu-edge' diff --git a/config/sources/families/mvebu64.conf b/config/sources/families/mvebu64.conf index 25f16c439..ede909446 100644 --- a/config/sources/families/mvebu64.conf +++ b/config/sources/families/mvebu64.conf @@ -35,12 +35,13 @@ case $BRANCH in current) + export KERNEL_MAJOR_MINOR="5.15" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-5.15.y' ;; edge) - + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-6.1.y' ;; @@ -62,7 +63,7 @@ write_uboot_platform() { } family_tweaks() { - chroot $SDCARD /bin/bash -c "apt-get -y -qq remove --auto-remove linux-sound-base alsa-base alsa-utils bluez>/dev/null 2>&1" + chroot_sdcard_apt_get remove --auto-remove linux-sound-base alsa-base alsa-utils bluez [[ -f $SDCARD/etc/netplan/armbian-default.yaml ]] && sed -i "s/^ renderer.*/ renderer: networkd/" $SDCARD/etc/netplan/armbian-default.yaml cp $SRC/packages/bsp/mvebu64/networkd/10* $SDCARD/etc/systemd/network/ if [[ $BOARD = "espressobin" ]]; then @@ -99,18 +100,18 @@ uboot_custom_postprocess() { cd $atfdir if [[ $BOARD = macchiatobin-doubleshot ]]; then - make distclean >> $DEST/debug/compilation.log 2>&1 + run_host_command_logged make distclean FILENAME="flash-image.bin" display_alert "Building $FILENAME" "" "info" # http://wiki.macchiatobin.net/tiki-index.php?page=Build+from+source+-+Bootloader#Building_ATF - make distclean >> $DEST/debug/compilation.log 2>&1 - make USE_COHERENT_MEM=0 LOG_LEVEL=20 MV_DDR_PATH=$SRC/cache/sources/marvell-ddr PLAT=a80x0_mcbin CROSS_COMPILE=$ATF1 BL33=$BL33 mrvl_flash $CTHREADS >> $DEST/debug/compilation.log 2>&1 - cp build/a80x0_mcbin/release/flash-image.bin $ubootdir/$FILENAME + run_host_command_logged make distclean + run_host_command_logged make USE_COHERENT_MEM=0 LOG_LEVEL=20 MV_DDR_PATH=$SRC/cache/sources/marvell-ddr PLAT=a80x0_mcbin CROSS_COMPILE=$ATF1 BL33=$BL33 mrvl_flash $CTHREADS + run_host_command_logged cp -pv build/a80x0_mcbin/release/flash-image.bin $ubootdir/$FILENAME else cd $moxbootdir - make clean - make CROSS_CM3=$ATF2 wtmi_app.bin + make clean # @TODO: rpardini: why? + run_host_command_logged make CROSS_CM3=$ATF2 wtmi_app.bin cd $atfdir clocks=(600_600 800_800 1000_800 1200_750) @@ -122,8 +123,8 @@ uboot_custom_postprocess() { DDR_TOPOLOGY="${j##*_}" CLOCKSPRESET="CPU_${i%_*}_DDR_${i##*_}" display_alert "Building $FILENAME" "" "info" - make distclean >> $DEST/debug/compilation.log 2>&1 - make CROSS_COMPILE=$ATF1 \ + run_host_command_logged make distclean + run_host_command_logged make CROSS_COMPILE=$ATF1 \ CROSS_CM3=$ATF2 \ USE_COHERENT_MEM=0 \ PLAT=a3700 \ @@ -134,8 +135,8 @@ uboot_custom_postprocess() { BL33=$BL33 \ WTMI_IMG=$moxbootdir/wtmi_app.bin \ BOOTDEV=SPINOR PARTNUM=0 \ - LOG_LEVEL=20 all fip mrvl_flash $CTHREADS >> $DEST/debug/compilation.log 2>&1 - cp build/a3700/release/flash-image.bin $ubootdir/$FILENAME + LOG_LEVEL=20 all fip mrvl_flash $CTHREADS + run_host_command_logged cp -pv build/a3700/release/flash-image.bin $ubootdir/$FILENAME done done fi diff --git a/config/sources/families/odroidxu4.conf b/config/sources/families/odroidxu4.conf index d5c377153..37a076af1 100644 --- a/config/sources/families/odroidxu4.conf +++ b/config/sources/families/odroidxu4.conf @@ -11,12 +11,13 @@ case $BRANCH in current) KERNELSOURCE='https://github.com/hardkernel/linux' + export KERNEL_MAJOR_MINOR="5.4" # Major and minor versions of this kernel. KERNELBRANCH='branch:odroid-5.4.y' KERNELDIR='linux-odroidxu4' ;; edge) - + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-6.1.y' KERNELDIR='linux-odroidxu4' ;; diff --git a/config/sources/families/rk322x.conf b/config/sources/families/rk322x.conf index a91aa7021..8fbaf3feb 100644 --- a/config/sources/families/rk322x.conf +++ b/config/sources/families/rk322x.conf @@ -12,6 +12,7 @@ case $BRANCH in legacy) KERNELSOURCE='https://github.com/armbian/linux' + export KERNEL_MAJOR_MINOR="4.4" # Major and minor versions of this kernel. KERNELBRANCH='branch:stable-4.4-rk3288-linux-v2.x' KERNELDIR='linux-rockchip' @@ -19,12 +20,14 @@ case $BRANCH in current) + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-6.1.y' ;; edge) + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-6.1.y' ;; diff --git a/config/sources/families/rk3399.conf b/config/sources/families/rk3399.conf index b7d5ccdb7..cc1f3ba71 100644 --- a/config/sources/families/rk3399.conf +++ b/config/sources/families/rk3399.conf @@ -5,6 +5,7 @@ case $BRANCH in legacy) KERNELSOURCE='https://github.com/friendlyarm/kernel-rockchip' + export KERNEL_MAJOR_MINOR="4.4" # Major and minor versions of this kernel. KERNELBRANCH='branch:nanopi4-linux-v4.4.y' KERNELDIR='linux-rockchip64' KERNELCONFIG='linux-rockchip64' diff --git a/config/sources/families/rk35xx.conf b/config/sources/families/rk35xx.conf index 5dc1112dd..e0ccd3bb2 100644 --- a/config/sources/families/rk35xx.conf +++ b/config/sources/families/rk35xx.conf @@ -12,6 +12,7 @@ case $BRANCH in UBOOT_USE_GCC='< 8.0' BOOTDIR='u-boot-rockchip64' KERNELSOURCE='https://github.com/radxa/kernel' + export KERNEL_MAJOR_MINOR="4.19" # Major and minor versions of this kernel. KERNELBRANCH='branch:stable-4.19-rock3' KERNELDIR='linux-rockchip64' KERNELPATCHDIR='rk35xx-legacy' @@ -24,7 +25,6 @@ case $BRANCH in # temporary until kernel 5.16 is well supported for rockchip64 # it has to be its own family too edge) - SKIP_BOOTSPLASH="yes" LINUXFAMILY=rk35xx diff --git a/config/sources/families/rockchip-rk3588.conf b/config/sources/families/rockchip-rk3588.conf index 2a5a72e54..0cc14a5f1 100644 --- a/config/sources/families/rockchip-rk3588.conf +++ b/config/sources/families/rockchip-rk3588.conf @@ -14,6 +14,7 @@ case $BRANCH in BOOTDIR='u-boot-rockchip64' KERNELDIR='linux-rockchip64' KERNELSOURCE='https://github.com/radxa/kernel' + export KERNEL_MAJOR_MINOR="5.10" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-5.10-gen-rkr3.4' KERNELPATCHDIR='rockchip-rk3588-legacy' ;; diff --git a/config/sources/families/rockchip.conf b/config/sources/families/rockchip.conf index faf01c765..f08bad958 100644 --- a/config/sources/families/rockchip.conf +++ b/config/sources/families/rockchip.conf @@ -20,6 +20,7 @@ case $BRANCH in legacy) KERNELSOURCE='https://github.com/armbian/linux' + export KERNEL_MAJOR_MINOR="4.4" # Major and minor versions of this kernel. KERNELBRANCH='branch:stable-4.4-rk3288-linux' KERNELDIR='linux-rockchip' @@ -27,12 +28,14 @@ case $BRANCH in current) + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-6.1.y' ;; edge) + export KERNEL_MAJOR_MINOR="6.1" # Major and minor versions of this kernel. KERNELBRANCH='branch:linux-6.1.y' ;; @@ -68,11 +71,15 @@ uboot_custom_postprocess() { family_tweaks() { if [[ $BOARD == tinkerboard ]]; then - chroot $SDCARD /bin/bash -c "apt-get -y -qq install rfkill bluetooth bluez bluez-tools" - [[ $BRANCH == legacy ]] && chroot $SDCARD /bin/bash -c "systemctl --no-reload enable tinker-bluetooth.service >/dev/null 2>&1" - sed -i -e "/#load-module module-alsa-sink/r $SRC/packages/bsp/rockchip/pulseaudio.txt" $SDCARD/etc/pulse/default.pa > /dev/null 2>&1 + chroot_sdcard_apt_get_install rfkill bluetooth bluez bluez-tools + [[ $BRANCH == legacy ]] && chroot_sdcard systemctl --no-reload enable tinker-bluetooth.service + if [[ -f "$SDCARD/etc/pulse/default.pa" ]]; then + sed -i -e "/#load-module module-alsa-sink/r $SRC/packages/bsp/rockchip/pulseaudio.txt" "$SDCARD/etc/pulse/default.pa" 2>&1 + else + display_alert "Can't find pulseaudio config" "${BOARD} - family_tweaks" "warn" + fi fi - + return 0 } family_tweaks_bsp() { @@ -87,8 +94,8 @@ family_tweaks_bsp() { install -m 755 $SRC/packages/bsp/rockchip/hdmi-hotplug $destination/usr/local/bin # Peripheral access for specific groups - addgroup --system --quiet --gid 997 gpio - addgroup --system --quiet --gid 998 i2c + addgroup --system --quiet --gid 997 gpio || display_alert "Failed to create 997 group gid" "gpio" "warn" + addgroup --system --quiet --gid 998 i2c || display_alert "Failed to create 997 group gid" "gpio" "warn" cp $SRC/packages/bsp/rockchip/70-gpio.rules $destination/etc/udev/rules.d cp $SRC/packages/bsp/rockchip/71-i2c.rules $destination/etc/udev/rules.d @@ -107,4 +114,5 @@ family_tweaks_bsp() { mkdir -p $destination/etc/initramfs-tools/hooks install -m 550 $SRC/packages/bsp/rockchip/ap6330-initramfs-firmware $destination/etc/initramfs-tools/hooks + return 0 # exit with success } diff --git a/config/sources/families/rockchip64.conf b/config/sources/families/rockchip64.conf index 6790c35b7..7734f69a7 100644 --- a/config/sources/families/rockchip64.conf +++ b/config/sources/families/rockchip64.conf @@ -5,6 +5,7 @@ case $BRANCH in legacy) KERNELDIR='linux-rockchip64' KERNELSOURCE='https://github.com/ayufan-rock64/linux-kernel' + export KERNEL_MAJOR_MINOR="4.4" # Major and minor versions of this kernel. KERNELBRANCH='tag:4.4.202-1237-rockchip-ayufan' KERNELPATCHDIR='rockchip64-'$BRANCH ;; diff --git a/config/sources/families/rockpis.conf b/config/sources/families/rockpis.conf index f6fa5c601..cef23afba 100644 --- a/config/sources/families/rockpis.conf +++ b/config/sources/families/rockpis.conf @@ -34,40 +34,38 @@ case $BRANCH in UBOOT_USE_GCC='< 8.0' BOOTDIR='u-boot-rockchip64' KERNELSOURCE='https://github.com/piter75/rockchip-kernel' + export KERNEL_MAJOR_MINOR="4.4" # Major and minor versions of this kernel. KERNELBRANCH='branch:rockpis-develop-4.4' KERNELDIR='linux-rockchip64' unset IDBLOADER_BLOB - ;; + ;; esac prepare_boot_configuration -uboot_custom_postprocess() -{ +uboot_custom_postprocess() { # TODO: remove this diversion from common caused by different loaderimage params loaderimage --pack --uboot ./u-boot-dtb.bin uboot.img 0x600000 --size 1024 1 && - if [ -r "$IDBLOADER_BLOB" ]; then - echo "Installing $IDBLOADER_BLOB" - echo "Capable of booting from built-in SDNAND" - cp $IDBLOADER_BLOB idbloader.bin - else - [ "$IDBLOADER_BLOB" ] && echo "Missing $IDBLOADER_BLOB" - echo "WARNING: This image will not boot from built-in SDNAND" - tools/mkimage -n rk3308 -T rksd -d $RKBIN_DIR/$DDR_BLOB idbloader.bin && - cat $RKBIN_DIR/$MINILOADER_BLOB >> idbloader.bin - fi && - trust_merger --replace bl31.elf $RKBIN_DIR/$BL31_BLOB trust.ini + if [ -r "$IDBLOADER_BLOB" ]; then + echo "Installing $IDBLOADER_BLOB" + echo "Capable of booting from built-in SDNAND" + cp $IDBLOADER_BLOB idbloader.bin + else + [ "$IDBLOADER_BLOB" ] && echo "Missing $IDBLOADER_BLOB" + echo "WARNING: This image will not boot from built-in SDNAND" + tools/mkimage -n rk3308 -T rksd -d $RKBIN_DIR/$DDR_BLOB idbloader.bin && + cat $RKBIN_DIR/$MINILOADER_BLOB >> idbloader.bin + fi && + trust_merger --replace bl31.elf $RKBIN_DIR/$BL31_BLOB trust.ini } -family_tweaks_bsp() -#Install udev script that derives fixed, unique MAC addresses for net interfaces -#that are assigned random ones -- like RockPI-S's WiFi network interfaces -{ +family_tweaks_bsp() { #Install udev script that derives fixed, unique MAC addresses for net interfaces + #that are assigned random ones -- like RockPI-S's WiFi network interfaces bsp=$SRC/packages/bsp/rockpis rules=etc/udev/rules.d install -m 755 $bsp/lib/udev/fixEtherAddr $destination/lib/udev && - install -m 644 $bsp/$rules/05-fixMACaddress.rules $destination/$rules + install -m 644 $bsp/$rules/05-fixMACaddress.rules $destination/$rules } diff --git a/config/sources/families/s5p6818.conf b/config/sources/families/s5p6818.conf index 2c77ec714..c302e4683 100644 --- a/config/sources/families/s5p6818.conf +++ b/config/sources/families/s5p6818.conf @@ -10,6 +10,7 @@ ATF_COMPILE="no" case $BRANCH in legacy | current) KERNELSOURCE='https://github.com/armbian/linux' + export KERNEL_MAJOR_MINOR="4.14" # Major and minor versions of this kernel. See https://github.com/armbian/linux/blob/s5p6818/Makefile KERNELBRANCH='branch:s5p6818' KERNELDIR='linux-mainline' ;; diff --git a/config/sources/families/sun50iw6.conf b/config/sources/families/sun50iw6.conf index dc0806213..6b05a17b9 100644 --- a/config/sources/families/sun50iw6.conf +++ b/config/sources/families/sun50iw6.conf @@ -27,7 +27,6 @@ esac family_tweaks_s() { if [[ -f $SDCARD/lib/systemd/system/aw859a-bluetooth.service ]]; then - # install and enable Bluetooth chroot $SDCARD /bin/bash -c "apt-get -y -qq install rfkill bluetooth bluez bluez-tools >/dev/null 2>&1" chroot $SDCARD /bin/bash -c "systemctl --no-reload enable aw859a-bluetooth.service >/dev/null 2>&1" @@ -44,9 +43,7 @@ family_tweaks_s() { family_tweaks_bsp() { if [[ ${BOARD} == orangepi3-lts ]]; then - cp $SRC/packages/bsp/sunxi/aw859a-bluetooth.service $destination/lib/systemd/system/ - fi install -m 755 $SRC/packages/blobs/bt/hciattach/hciattach_opi_${ARCH} $destination/usr/bin/hciattach_opi diff --git a/config/sources/families/sun50iw9.conf b/config/sources/families/sun50iw9.conf index 7b8635540..dc1b83a99 100644 --- a/config/sources/families/sun50iw9.conf +++ b/config/sources/families/sun50iw9.conf @@ -8,9 +8,9 @@ case $BRANCH in legacy) - unset var_origin_kernel LINUXFAMILY=sun50iw9 KERNELSOURCE='https://github.com/orangepi-xunlong/linux-orangepi.git' + export KERNEL_MAJOR_MINOR="4.9" # Major and minor versions of this kernel. KERNELBRANCH="branch:orange-pi-4.9-sun50iw9" KERNELPATCHDIR=${BOARDFAMILY}-${BRANCH} KERNELDIR='linux-orangepi' diff --git a/config/sources/families/virtual.conf b/config/sources/families/virtual.conf index 41d36d1f9..b5be13db8 100644 --- a/config/sources/families/virtual.conf +++ b/config/sources/families/virtual.conf @@ -1,6 +1,7 @@ BOOTBRANCH='tag:v2021.04' -KERNELBRANCH='branch:linux-5.10.y' +export KERNEL_MAJOR_MINOR="5.15" # Major and minor versions of this kernel. +KERNELBRANCH='branch:linux-5.15.y' ARCH=arm64 #UBOOT_TARGET_MAP=";;u-boot.bin" diff --git a/config/sources/families/zynq.conf b/config/sources/families/zynq.conf index b69bcc347..2bc2d6e9d 100644 --- a/config/sources/families/zynq.conf +++ b/config/sources/families/zynq.conf @@ -3,6 +3,7 @@ SERIALCON='ttyPS0' LINUXFAMILY=zynq KERNELSOURCE='https://github.com/Xilinx/linux-xlnx.git' +export KERNEL_MAJOR_MINOR="5.4" # Major and minor versions of this kernel. See https://github.com/Xilinx/linux-xlnx/blob/xilinx-v2020.2/Makefile KERNELBRANCH='tag:xilinx-v2020.2' KERNELDIR='linux-xlnx' KERNELPATCHDIR='zynq-'$BRANCH