Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Genimage for declarative image layout #3388

Merged
merged 19 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions buildroot-external/board/arm-uefi/generic-aarch64/meta
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ BOARD_NAME="Generic aarch64"
CHASSIS=embedded
BOOTLOADER=grub
KERNEL_FILE=Image
BOOT_SYS=efi
PARTITION_TABLE_TYPE=gpt
BOOT_SIZE=32M
BOOT_SPL=false
DISK_SIZE=6
DISK_SIZE=6G
SUPERVISOR_MACHINE=qemuarm-64
SUPERVISOR_ARCH=aarch64
6 changes: 0 additions & 6 deletions buildroot-external/board/asus/hassos-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local SPL_IMG="$(path_spl_img)"

cp -t "${BOOT_DATA}" \
"${BINARIES_DIR}/boot.scr" \
Expand All @@ -15,11 +14,6 @@ function hassos_pre_image() {
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"

echo "console=tty1" > "${BOOT_DATA}/cmdline.txt"

# SPL
create_spl_image

dd if="${BINARIES_DIR}/u-boot-rockchip.bin" of="${SPL_IMG}" conv=notrunc bs=512 seek=64
}


Expand Down
13 changes: 13 additions & 0 deletions buildroot-external/board/asus/tinker/image-spl-spl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
image spl.img {
size = ${BOOT_SPL_SIZE}

hdimage {
partition-table-type = "none"
fill = "yes"
}

partition uboot {
offset = 32k
image = "u-boot-rockchip.bin"
}
}
2 changes: 1 addition & 1 deletion buildroot-external/board/asus/tinker/meta
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BOARD_NAME="Asus TinkerBoard"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=zImage
BOOT_SYS=hybrid
PARTITION_TABLE_TYPE=hybrid
BOOT_SIZE=24M
BOOT_SPL=true
BOOT_SPL_SIZE=8M
Expand Down
7 changes: 7 additions & 0 deletions buildroot-external/board/asus/tinker/partition-spl-spl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(0; 17k)"}
}
10 changes: 0 additions & 10 deletions buildroot-external/board/hardkernel/odroid-c2/hassos-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local BL1="${BINARIES_DIR}/bl1.bin.hardkernel"
local UBOOT_GXBB="${BINARIES_DIR}/u-boot.gxbb"
local SPL_IMG="$(path_spl_img)"

cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}/meson-gxbb-odroidc2.dtb" "${BOOT_DATA}/meson-gxbb-odroidc2.dtb"
Expand All @@ -14,13 +11,6 @@ function hassos_pre_image() {
cp "${BINARIES_DIR}"/*.dtbo "${BOOT_DATA}/overlays/"
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"

# SPL
create_spl_image

dd if="${BL1}" of="${SPL_IMG}" conv=notrunc bs=1 count=440
dd if="${BL1}" of="${SPL_IMG}" conv=notrunc bs=512 skip=1 seek=1
dd if="${UBOOT_GXBB}" of="${SPL_IMG}" conv=notrunc bs=512 seek=97
}


Expand Down
20 changes: 20 additions & 0 deletions buildroot-external/board/hardkernel/odroid-c2/image-spl-spl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
image spl.img {
size = ${BOOT_SPL_SIZE}

hdimage {
partition-table-type = "none"
fill = "yes"
}

partition bl1 {
in-partition-table = "no"
image = "bl1.bin.hardkernel"
offset = 0
}

partition u-boot {
in-partition-table = "no"
image = "u-boot.gxbb"
offset = 97s
}
}
2 changes: 1 addition & 1 deletion buildroot-external/board/hardkernel/odroid-c2/meta
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BOARD_NAME="Hardkernel ODROID-C2"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_SYS=mbr
PARTITION_TABLE_TYPE=mbr
BOOT_SIZE=24M
BOOT_SPL=true
BOOT_SPL_SIZE=8M
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(440; 512)"}
agners marked this conversation as resolved.
Show resolved Hide resolved
}

7 changes: 0 additions & 7 deletions buildroot-external/board/hardkernel/odroid-c4/hassos-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local UBOOT_SM1="${BINARIES_DIR}/u-boot.sm1"
local SPL_IMG="$(path_spl_img)"

cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}/meson-sm1-odroid-c4.dtb" "${BOOT_DATA}/meson-sm1-odroid-c4.dtb"
Expand All @@ -13,11 +11,6 @@ function hassos_pre_image() {
cp "${BINARIES_DIR}"/*.dtbo "${BOOT_DATA}/overlays/"
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"

# SPL
create_spl_image

dd if="${UBOOT_SM1}" of="${SPL_IMG}" conv=notrunc bs=512 seek=1
}


Expand Down
13 changes: 13 additions & 0 deletions buildroot-external/board/hardkernel/odroid-c4/image-spl-spl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
image spl.img {
size = ${BOOT_SPL_SIZE}

hdimage {
partition-table-type = "none"
fill = "yes"
}

partition uboot {
offset = 512
image = "u-boot.sm1"
}
}
2 changes: 1 addition & 1 deletion buildroot-external/board/hardkernel/odroid-c4/meta
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BOARD_NAME="Hardkernel ODROID-C4"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_SYS=mbr
PARTITION_TABLE_TYPE=mbr
BOOT_SIZE=24M
BOOT_SPL=true
BOOT_SPL_SIZE=8M
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(0; 512)"}
}
6 changes: 0 additions & 6 deletions buildroot-external/board/hardkernel/odroid-m1/hassos-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@

function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local SPL_IMG="$(path_spl_img)"

cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}"/*.dtb "${BOOT_DATA}/"

cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"

# SPL
create_spl_image

dd if="${BINARIES_DIR}/u-boot-rockchip.bin" of="${SPL_IMG}" conv=notrunc bs=512 seek=64
agners marked this conversation as resolved.
Show resolved Hide resolved
}


Expand Down
13 changes: 13 additions & 0 deletions buildroot-external/board/hardkernel/odroid-m1/image-spl-spl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
image spl.img {
size = ${BOOT_SPL_SIZE}

hdimage {
partition-table-type = "none"
fill = "yes"
}

partition uboot {
offset = 32k
image = "u-boot-rockchip.bin"
}
}
2 changes: 1 addition & 1 deletion buildroot-external/board/hardkernel/odroid-m1/meta
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BOARD_NAME="Hardkernel ODROID-M1"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_SYS=gpt
PARTITION_TABLE_TYPE=hybrid
BOOT_SIZE=16M
BOOT_SPL=true
BOOT_SPL_SIZE=16M
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(0; 17k)", "(8M; 16M)"}
}

partition uboot {
size = 8M
offset = 8M
# FIXME: hdd-image intended to use the following, but the next one
# is in the img because of the _fix_disk_spl_gpt function
# partition-type-uuid = "21686148-6449-6e6f-744e-656564454649"
partition-type-uuid = "e3c9e316-0b5c-4db8-817d-f92df00215ae"
# no image here - already contains data from spl.img
}
6 changes: 0 additions & 6 deletions buildroot-external/board/hardkernel/odroid-m1s/hassos-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@

function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local SPL_IMG="$(path_spl_img)"

cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}"/*.dtb "${BOOT_DATA}/"

cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"

# SPL
create_spl_image

dd if="${BINARIES_DIR}/u-boot-rockchip.bin" of="${SPL_IMG}" conv=notrunc bs=512 seek=64
}


Expand Down
13 changes: 13 additions & 0 deletions buildroot-external/board/hardkernel/odroid-m1s/image-spl-spl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
image spl.img {
size = ${BOOT_SPL_SIZE}

hdimage {
partition-table-type = "none"
fill = "yes"
}

partition uboot {
offset = 32k
image = "u-boot-rockchip.bin"
}
}
2 changes: 1 addition & 1 deletion buildroot-external/board/hardkernel/odroid-m1s/meta
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BOARD_NAME="Hardkernel ODROID-M1S"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_SYS=gpt
PARTITION_TABLE_TYPE=hybrid
BOOT_SIZE=16M
BOOT_SPL=true
BOOT_SPL_SIZE=16M
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(0; 17k)", "(8M; 16M)"}
}

partition uboot {
size = 8M
offset = 8M
# FIXME: hdd-image intended to use the following, but the next one
# is in the img because of the _fix_disk_spl_gpt function
# partition-type-uuid = "21686148-6449-6e6f-744e-656564454649"
partition-type-uuid = "e3c9e316-0b5c-4db8-817d-f92df00215ae"
# no image here - already contains data from spl.img
}
7 changes: 0 additions & 7 deletions buildroot-external/board/hardkernel/odroid-n2/hassos-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local UBOOT_G12B="${BINARIES_DIR}/u-boot.g12b"
local SPL_IMG="$(path_spl_img)"

cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}"/*.dtb "${BOOT_DATA}/"
Expand All @@ -13,11 +11,6 @@ function hassos_pre_image() {
cp "${BINARIES_DIR}"/*.dtbo "${BOOT_DATA}/overlays/"
cp "${BOARD_DIR}/boot-env.txt" "${BOOT_DATA}/haos-config.txt"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"

# SPL
create_spl_image

dd if="${UBOOT_G12B}" of="${SPL_IMG}" conv=notrunc bs=512 seek=1
}


Expand Down
13 changes: 13 additions & 0 deletions buildroot-external/board/hardkernel/odroid-n2/image-spl-spl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
image spl.img {
size = ${BOOT_SPL_SIZE}

hdimage {
partition-table-type = "none"
fill = "yes"
}

partition uboot {
offset = 512
image = "u-boot.g12b"
}
}
2 changes: 1 addition & 1 deletion buildroot-external/board/hardkernel/odroid-n2/meta
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ BOARD_NAME="Hardkernel ODROID-N2"
CHASSIS=embedded
BOOTLOADER=uboot
KERNEL_FILE=Image
BOOT_SYS=mbr
PARTITION_TABLE_TYPE=mbr
BOOT_SIZE=24M
BOOT_SPL=true
BOOT_SPL_SIZE=8M
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
partition spl {
size = ${BOOT_SPL_SIZE}
image = "spl.img"
in-partition-table = "no"
offset = 0
holes = {"(0; 512)"}
}
14 changes: 0 additions & 14 deletions buildroot-external/board/hardkernel/odroid-xu4/hassos-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,10 @@

function hassos_pre_image() {
local BOOT_DATA="$(path_boot_dir)"
local BL1="${BINARIES_DIR}/bl1.bin.hardkernel"
local BL2="${BINARIES_DIR}/bl2.bin.hardkernel.720k_uboot"
local BLTZ="${BINARIES_DIR}/tzsw.bin.hardkernel"
local UBOOT="${BINARIES_DIR}/u-boot.bin"
local spl_img="$(path_spl_img)"

cp "${BINARIES_DIR}/boot.scr" "${BOOT_DATA}/boot.scr"
cp "${BINARIES_DIR}/exynos5422-odroidxu4.dtb" "${BOOT_DATA}/exynos5422-odroidxu4.dtb"
cp "${BOARD_DIR}/cmdline.txt" "${BOOT_DATA}/cmdline.txt"

# SPL
create_spl_image

dd if="${BL1}" of="${spl_img}" conv=notrunc bs=512 seek=1
dd if="${BL2}" of="${spl_img}" conv=notrunc bs=512 seek=31
dd if="${UBOOT}" of="${spl_img}" conv=notrunc bs=512 seek=63
dd if="${BLTZ}" of="${spl_img}" conv=notrunc bs=512 seek=1503
dd if=/dev/zero of="${spl_img}" conv=notrunc bs=512 count=32 seek=2015
}


Expand Down
Loading