mirror of
https://github.com/home-assistant/operating-system
synced 2024-11-14 01:54:54 +01:00
Support custom sized SPL/raw boot region (#2385)
* Support custom sized SPL/raw boot region This is required for Rockchip which by default stores the U-Boot FIT image at the 8MiB offset. * Ignore shellcheck warning
This commit is contained in:
parent
eb3e2ab003
commit
923c22ff9e
@ -4,6 +4,7 @@ CHASSIS=embedded
|
||||
BOOTLOADER=grub
|
||||
KERNEL_FILE=Image
|
||||
BOOT_SYS=efi
|
||||
BOOT_SIZE=32M
|
||||
BOOT_SPL=false
|
||||
DISK_SIZE=6
|
||||
SUPERVISOR_MACHINE=qemuarm-64
|
||||
|
@ -4,7 +4,9 @@ CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=zImage
|
||||
BOOT_SYS=hybrid
|
||||
BOOT_SIZE=24M
|
||||
BOOT_SPL=true
|
||||
BOOT_SPL_SIZE=8M
|
||||
BOOT_ENV_SIZE=0x8000
|
||||
SUPERVISOR_MACHINE=tinker
|
||||
SUPERVISOR_ARCH=armv7
|
||||
|
@ -4,7 +4,9 @@ CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=Image
|
||||
BOOT_SYS=mbr
|
||||
BOOT_SIZE=24M
|
||||
BOOT_SPL=true
|
||||
BOOT_SPL_SIZE=8M
|
||||
BOOT_ENV_SIZE=0x2000
|
||||
SUPERVISOR_MACHINE=odroid-c2
|
||||
SUPERVISOR_ARCH=aarch64
|
||||
|
@ -4,7 +4,9 @@ CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=Image
|
||||
BOOT_SYS=mbr
|
||||
BOOT_SIZE=24M
|
||||
BOOT_SPL=true
|
||||
BOOT_SPL_SIZE=8M
|
||||
BOOT_ENV_SIZE=0x2000
|
||||
SUPERVISOR_MACHINE=odroid-c4
|
||||
SUPERVISOR_ARCH=aarch64
|
||||
|
@ -4,7 +4,9 @@ CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=Image
|
||||
BOOT_SYS=mbr
|
||||
BOOT_SIZE=24M
|
||||
BOOT_SPL=true
|
||||
BOOT_SPL_SIZE=8M
|
||||
BOOT_ENV_SIZE=0x2000
|
||||
SUPERVISOR_MACHINE=odroid-n2
|
||||
SUPERVISOR_ARCH=aarch64
|
||||
|
@ -4,7 +4,9 @@ CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=zImage
|
||||
BOOT_SYS=mbr
|
||||
BOOT_SIZE=24M
|
||||
BOOT_SPL=true
|
||||
BOOT_SPL_SIZE=8M
|
||||
BOOT_ENV_SIZE=0x4000
|
||||
SUPERVISOR_MACHINE=odroid-xu
|
||||
SUPERVISOR_ARCH=armv7
|
||||
|
@ -4,7 +4,9 @@ CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=Image
|
||||
BOOT_SYS=mbr
|
||||
BOOT_SIZE=24M
|
||||
BOOT_SPL=true
|
||||
BOOT_SPL_SIZE=8M
|
||||
BOOT_ENV_SIZE=0x2000
|
||||
SUPERVISOR_MACHINE=khadas-vim3
|
||||
SUPERVISOR_ARCH=aarch64
|
||||
|
@ -4,6 +4,7 @@ CHASSIS=embedded
|
||||
BOOTLOADER=grub
|
||||
KERNEL_FILE=bzImage
|
||||
BOOT_SYS=efi
|
||||
BOOT_SIZE=32M
|
||||
BOOT_SPL=false
|
||||
DISK_SIZE=6
|
||||
SUPERVISOR_MACHINE=generic-x86-64
|
||||
|
@ -4,6 +4,7 @@ CHASSIS=vm
|
||||
BOOTLOADER=grub
|
||||
KERNEL_FILE=bzImage
|
||||
BOOT_SYS=efi
|
||||
BOOT_SIZE=32M
|
||||
BOOT_SPL=false
|
||||
DISK_SIZE=32
|
||||
SUPERVISOR_MACHINE=qemux86-64
|
||||
|
@ -4,6 +4,7 @@ CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=zImage
|
||||
BOOT_SYS=hybrid
|
||||
BOOT_SIZE=32M
|
||||
BOOT_SPL=false
|
||||
BOOT_ENV_SIZE=0x4000
|
||||
SUPERVISOR_MACHINE=raspberrypi2
|
||||
|
@ -4,6 +4,7 @@ CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=Image
|
||||
BOOT_SYS=hybrid
|
||||
BOOT_SIZE=32M
|
||||
BOOT_SPL=false
|
||||
BOOT_ENV_SIZE=0x4000
|
||||
SUPERVISOR_MACHINE=raspberrypi3-64
|
||||
|
@ -4,6 +4,7 @@ CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=zImage
|
||||
BOOT_SYS=hybrid
|
||||
BOOT_SIZE=32M
|
||||
BOOT_SPL=false
|
||||
BOOT_ENV_SIZE=0x4000
|
||||
SUPERVISOR_MACHINE=raspberrypi3
|
||||
|
@ -4,6 +4,7 @@ CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=Image
|
||||
BOOT_SYS=hybrid
|
||||
BOOT_SIZE=32M
|
||||
BOOT_SPL=false
|
||||
BOOT_ENV_SIZE=0x4000
|
||||
SUPERVISOR_MACHINE=raspberrypi4-64
|
||||
|
@ -4,6 +4,7 @@ CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=zImage
|
||||
BOOT_SYS=hybrid
|
||||
BOOT_SIZE=32M
|
||||
BOOT_SPL=false
|
||||
BOOT_ENV_SIZE=0x4000
|
||||
SUPERVISOR_MACHINE=raspberrypi4
|
||||
|
@ -4,6 +4,7 @@ CHASSIS=embedded
|
||||
BOOTLOADER=uboot
|
||||
KERNEL_FILE=Image
|
||||
BOOT_SYS=hybrid
|
||||
BOOT_SIZE=32M
|
||||
BOOT_SPL=false
|
||||
BOOT_ENV_SIZE=0x4000
|
||||
SUPERVISOR_MACHINE=yellow
|
||||
|
@ -10,7 +10,6 @@ KERNEL1_UUID="fc02a4f0-5350-406f-93a2-56cbed636b5f"
|
||||
OVERLAY_UUID="f1326040-5236-40eb-b683-aaa100a9afcf"
|
||||
DATA_UUID="a52a4597-fa3a-4851-aefd-2fbe9f849079"
|
||||
|
||||
BOOT_SIZE=(32M 24M)
|
||||
BOOTSTATE_SIZE=8M
|
||||
SYSTEM_SIZE=256M
|
||||
KERNEL_SIZE=24M
|
||||
@ -45,11 +44,8 @@ function size2sectors() {
|
||||
|
||||
|
||||
function get_boot_size() {
|
||||
if [ "${BOOT_SPL}" == "true" ]; then
|
||||
echo "${BOOT_SIZE[1]}"
|
||||
else
|
||||
echo "${BOOT_SIZE[0]}"
|
||||
fi
|
||||
# shellcheck disable=SC2153
|
||||
echo "${BOOT_SIZE}"
|
||||
}
|
||||
|
||||
|
||||
@ -57,7 +53,7 @@ function create_spl_image() {
|
||||
local boot_img="$(path_spl_img)"
|
||||
|
||||
rm -f "${boot_img}"
|
||||
truncate --size=8M "${boot_img}"
|
||||
truncate --size="${BOOT_SPL_SIZE}" "${boot_img}"
|
||||
}
|
||||
|
||||
|
||||
@ -199,7 +195,9 @@ function _create_disk_mbr() {
|
||||
local hdd_img="$(hassos_image_name img)"
|
||||
local hdd_count=${DISK_SIZE:-2}
|
||||
local disk_layout="${BINARIES_DIR}/disk.layout"
|
||||
local boot_start=$(size2sectors "8M")
|
||||
|
||||
# All boards with MBR disk layout have SPL
|
||||
local boot_start=$(size2sectors "${BOOT_SPL_SIZE}")
|
||||
|
||||
local boot_size=$(size2sectors "$(get_boot_size)")
|
||||
local kernel0_size=$(size2sectors "$KERNEL_SIZE")
|
||||
|
Loading…
Reference in New Issue
Block a user