From 2adfda1626a0f5c7d3be011a6be14eb0b715b594 Mon Sep 17 00:00:00 2001 From: Samuel Dolt Date: Mon, 15 May 2023 18:14:08 +0200 Subject: [PATCH] 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 --- .../include/coreos-generic-features/efi.inc | 8 ++++---- .../classes/coreos-image-uki.bbclass | 8 ++++---- layers/meta-belden-coreos/files/sw-description | 14 +++++++------- .../lib/devtool/coreos-efibootguard.py | 4 ++-- .../swupdate/swupdate/sw-collections-config.sh | 4 ++-- .../swupdate/swupdate_2022.12.bbappend | 2 +- .../classes/coreos-image-swupdate-cn913x.bbclass | 4 +++- 7 files changed, 23 insertions(+), 21 deletions(-) diff --git a/layers/meta-belden-coreos-bsp/conf/machine/include/coreos-generic-features/efi.inc b/layers/meta-belden-coreos-bsp/conf/machine/include/coreos-generic-features/efi.inc index 19e10d4..274a6e5 100644 --- a/layers/meta-belden-coreos-bsp/conf/machine/include/coreos-generic-features/efi.inc +++ b/layers/meta-belden-coreos-bsp/conf/machine/include/coreos-generic-features/efi.inc @@ -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"' diff --git a/layers/meta-belden-coreos/classes/coreos-image-uki.bbclass b/layers/meta-belden-coreos/classes/coreos-image-uki.bbclass index 5558acc..5a7baea 100644 --- a/layers/meta-belden-coreos/classes/coreos-image-uki.bbclass +++ b/layers/meta-belden-coreos/classes/coreos-image-uki.bbclass @@ -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}" diff --git a/layers/meta-belden-coreos/files/sw-description b/layers/meta-belden-coreos/files/sw-description index 0a47093..0603369 100644 --- a/layers/meta-belden-coreos/files/sw-description +++ b/layers/meta-belden-coreos/files/sw-description @@ -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 diff --git a/layers/meta-belden-coreos/lib/devtool/coreos-efibootguard.py b/layers/meta-belden-coreos/lib/devtool/coreos-efibootguard.py index c6ffea7..91e6c88 100644 --- a/layers/meta-belden-coreos/lib/devtool/coreos-efibootguard.py +++ b/layers/meta-belden-coreos/lib/devtool/coreos-efibootguard.py @@ -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, ) diff --git a/layers/meta-belden-coreos/recipes-support/swupdate/swupdate/sw-collections-config.sh b/layers/meta-belden-coreos/recipes-support/swupdate/swupdate/sw-collections-config.sh index 7f54b62..c9a0166 100644 --- a/layers/meta-belden-coreos/recipes-support/swupdate/swupdate/sw-collections-config.sh +++ b/layers/meta-belden-coreos/recipes-support/swupdate/swupdate/sw-collections-config.sh @@ -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" ;; diff --git a/layers/meta-belden-coreos/recipes-support/swupdate/swupdate_2022.12.bbappend b/layers/meta-belden-coreos/recipes-support/swupdate/swupdate_2022.12.bbappend index 95d7c30..88adf3d 100644 --- a/layers/meta-belden-coreos/recipes-support/swupdate/swupdate_2022.12.bbappend +++ b/layers/meta-belden-coreos/recipes-support/swupdate/swupdate_2022.12.bbappend @@ -33,4 +33,4 @@ do_install:append() { echo "${MACHINE} 1.0" > ${D}${SWUPDATE_HW_COMPATIBILITY_FILE} } -PR = "r1" \ No newline at end of file +PR = "r2" \ No newline at end of file diff --git a/layers/meta-belden-marvell-bsp/classes/coreos-image-swupdate-cn913x.bbclass b/layers/meta-belden-marvell-bsp/classes/coreos-image-swupdate-cn913x.bbclass index 45d224c..88c7432 100644 --- a/layers/meta-belden-marvell-bsp/classes/coreos-image-swupdate-cn913x.bbclass +++ b/layers/meta-belden-marvell-bsp/classes/coreos-image-swupdate-cn913x.bbclass @@ -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]