feat(wks): rename partition

Now we use fw0, fw1, efi, ebg0, ebg1, rootfs0 and rootfs1 partition
name.

BREAKING CHANGE: bootX partition are now named ebgX
BREAKING CHANGE: platformX partition are now named rootfsX
This commit is contained in:
Samuel Dolt 2023-05-15 18:14:08 +02:00
parent 952a80baa5
commit 2adfda1626
7 changed files with 23 additions and 21 deletions

View File

@ -8,7 +8,7 @@ do_image_wic[depends] += "efibootguard-native:do_populate_sysroot efibootguard:d
# Variable used in WKS file
WKS_PART_EFI ??= 'part --source efibootguard-efi --label efi --align 1024 --part-type=EF00'
WKS_PART_ROOT_A ??= 'part / --source rootfs --fstype=ext4 --label platform0 --align 1024'
WKS_PART_ROOT_B ??= 'part --fstype=ext4 --label platform1 --align 1024'
WKS_PART_EFIBOOTGUARD_A ??= 'part --source efibootguard-boot --label boot0 --align 1024 --part-type=0700 --sourceparams "watchdog=${EFIBOOTGUARD_TIMEOUT},revision=2,kernel=kernel0-${MACHINE}.efi;KERNEL0.EFI"'
WKS_PART_EFIBOOTGUARD_B ??= 'part --source efibootguard-boot --label boot1 --align 1024 --part-type=0700 --sourceparams "watchdog=${EFIBOOTGUARD_TIMEOUT},revision=1,kernel=kernel1-${MACHINE}.efi;KERNEL1.EFI"'
WKS_PART_ROOT_A ??= 'part / --source rootfs --fstype=ext4 --label rootfs0 --align 1024'
WKS_PART_ROOT_B ??= 'part --fstype=ext4 --label rootfs1 --align 1024'
WKS_PART_EFIBOOTGUARD_A ??= 'part --source efibootguard-boot --label ebg0 --align 1024 --part-type=0700 --sourceparams "watchdog=${EFIBOOTGUARD_TIMEOUT},revision=2,kernel=kernel0-${MACHINE}.efi;KERNEL.EFI"'
WKS_PART_EFIBOOTGUARD_B ??= 'part --source efibootguard-boot --label ebg1 --align 1024 --part-type=0700 --sourceparams "watchdog=${EFIBOOTGUARD_TIMEOUT},revision=1,kernel=kernel1-${MACHINE}.efi;KERNEL.EFI"'

View File

@ -21,10 +21,10 @@ COREOS_KERNEL1 ??= "${DEPLOY_DIR_IMAGE}/${COREOS_KERNEL1_FILENAME}"
# ==============================================================================
APPEND += "rootwait "
COREOS_PLATFORM0_ROOT ??= "PARTLABEL=platform0"
COREOS_PLATFORM1_ROOT ??= "PARTLABEL=platform1"
COREOS_KERNEL0_CMDLINE ??= "root=${COREOS_PLATFORM0_ROOT} ${APPEND}"
COREOS_KERNEL1_CMDLINE ??= "root=${COREOS_PLATFORM1_ROOT} ${APPEND}"
COREOS_ROOTFS0_ROOT ??= "PARTLABEL=rootfs0"
COREOS_ROOTFS1_ROOT ??= "PARTLABEL=rootfs1"
COREOS_KERNEL0_CMDLINE ??= "root=${COREOS_ROOTFS0_ROOT} ${APPEND}"
COREOS_KERNEL1_CMDLINE ??= "root=${COREOS_ROOTFS1_ROOT} ${APPEND}"
COREOS_UKI_PART_KERNEL_FILENAME ??= "${KERNEL_IMAGETYPE}-${MACHINE}${KERNEL_IMAGE_BIN_EXT}"
COREOS_UKI_PART_KERNEL ??= "${DEPLOY_DIR_IMAGE}/${COREOS_UKI_PART_KERNEL_FILENAME}"

View File

@ -12,7 +12,7 @@ software =
installed-directly = true;
# partlabel are stored inside the GPT partition table.
# The partition table is flashed only once and never updated
device = "/dev/disk/by-partlabel/rootfs1";
device = "/dev/disk/by-partlabel/rootfs0";
type = "raw";
sha256 = "$swupdate_get_sha256(@@PN@@-@@MACHINE@@.ext4.zst)";
}
@ -25,14 +25,14 @@ software =
{
filename = "@@COREOS_KERNEL0_FILENAME@@";
path = "/KERNEL.EFI";
device = "/dev/disk/by-partlabel/ebg1";
device = "/dev/disk/by-partlabel/ebg0";
filesystem = "vfat";
sha256 = "$swupdate_get_sha256(@@COREOS_KERNEL0_FILENAME@@)";
},
{
filename = "@@COREOS_EFIBOOTGUARD_FILENAME@@";
path = "@@EFIDIR@@/@@EFI_BOOT_IMAGE@@";
device = "/dev/disk/by-partlabel/platform1/efi";
device = "/dev/disk/by-partlabel/efi";
filesystem = "vfat";
sha256 = "$swupdate_get_sha256(@@COREOS_EFIBOOTGUARD_FILENAME@@)";
}
@ -52,7 +52,7 @@ software =
},
{
name = "kernelfile";
value = "C:BOOT0:KERNEL.EFI";
value = "C:EBG0:KERNEL.EFI";
}
# Don't remove the trailing whitspace on the next line otherwise
@ -69,7 +69,7 @@ software =
installed-directly = true;
# partlabel are stored inside the GPT partition table.
# The partition table is flashed only once and never updated
device = "/dev/disk/by-partlabel/rootfs0";
device = "/dev/disk/by-partlabel/rootfs1";
type = "raw";
sha256 = "$swupdate_get_sha256(@@PN@@-@@MACHINE@@.ext4.zst)";
}
@ -82,7 +82,7 @@ software =
{
filename = "@@COREOS_KERNEL1_FILENAME@@";
path = "/KERNEL.EFI";
device = "/dev/disk/by-partlabel/ebg0";
device = "/dev/disk/by-partlabel/ebg1";
filesystem = "vfat";
sha256 = "$swupdate_get_sha256(@@COREOS_KERNEL1_FILENAME@@)";
},
@ -108,7 +108,7 @@ software =
},
{
name = "kernelfile";
value = "C:BOOT1:KERNEL.EFI";
value = "C:EBG1:KERNEL.EFI";
}
# Don't remove the trailing whitspace on the next line otherwise

View File

@ -278,7 +278,7 @@ def efibootguard_generate_uki(args, config, basepath, workspace):
cmdline=rd.getVar("COREOS_KERNEL0_CMDLINE"),
dtb=dtb,
stub=stub,
root=rd.getVar("COREOS_PLATFORM0_ROOT"),
root=rd.getVar("COREOS_ROOTFS0_ROOT"),
build_binary=build_binary,
keydir=keydir,
)
@ -288,7 +288,7 @@ def efibootguard_generate_uki(args, config, basepath, workspace):
cmdline=rd.getVar("COREOS_KERNEL1_CMDLINE"),
dtb=dtb,
stub=stub,
root=rd.getVar("COREOS_PLATFORM1_ROOT"),
root=rd.getVar("COREOS_ROOTFS1_ROOT"),
build_binary=build_binary,
keydir=keydir,
)

View File

@ -24,11 +24,11 @@ fi
echo "Root partition label is ${ROOT_PARTLABEL}"
case $ROOT_PARTLABEL in
platform0 )
rootfs0 )
echo "We are running copy0 -> Use copy1 in the SWU file"
SWUPDATE_ARGS="${SWUPDATE_ARGS} -e stable,copy1"
;;
platform1 )
rootfs1 )
echo "We are running copy1 -> Use copy0 in the SWU file"
SWUPDATE_ARGS="${SWUPDATE_ARGS} -e stable,copy0"
;;

View File

@ -33,4 +33,4 @@ do_install:append() {
echo "${MACHINE} 1.0" > ${D}${SWUPDATE_HW_COMPATIBILITY_FILE}
}
PR = "r1"
PR = "r2"

View File

@ -8,11 +8,13 @@ def coreos_swupdate_extends_images_for_cn913x(d,s):
boot0 = {
"filename" : "flash-image.bin",
"installed-directly" : "true",
"device" : "/dev/mmcblk1",
"device" : "/dev/disk/by-partlabel/fw0",
"type" : "raw",
"sha256" : swupdate_get_sha256(d, s, "flash-image.bin"),
}
boot1 = boot0.copy()
boot1["device"] = "/dev/disk/by-partlabel/fw1"
return [boot0, boot1]