From 83db3c86f7f8fe5de9da394f9dff89df506e723e Mon Sep 17 00:00:00 2001 From: Srinuvasan Date: Tue, 5 Mar 2024 13:04:46 +0530 Subject: [PATCH] refactor: use change-dir to split rootfs parts This patch refactors the WKS script w.r.t how the rootfs is distributed across multiple partitions. Previously we used rootfs-dir with a full rootfs paths plus the sub directory. However, this is not ideal, as the relation to the rootfs folder is lost and also the new rootfs dir is technically not a rootfs. While this aparently did not create any issues in meta-iot2050, we still believe it is semantically incorrect. This patch switches that over to the WIC option --change-directory that is provided exactly for this use-case and only deploys a subdirectory without loosing the rootfs relation with the permissions pseudo dir. Signed-off-by: Srinuvasan --- wic/iot2050-swu-secure.wks.in | 4 ++-- wic/iot2050-swu.wks.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wic/iot2050-swu-secure.wks.in b/wic/iot2050-swu-secure.wks.in index 15804802c..e0af3802a 100644 --- a/wic/iot2050-swu-secure.wks.in +++ b/wic/iot2050-swu-secure.wks.in @@ -14,7 +14,7 @@ part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.verity" --align 102 part --source empty --align 1024 --fixed-size 4G --uuid "${ABROOTFS_PART_UUID_B}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 # persistent partitions -part /var --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var --label var --fstype=ext4 --mkfs-extraopts "-T default" --align 1024 --size 512M -part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --label home --fstype=ext4 --mkfs-extraopts "-T default" --align 1024 --size 1G +part /var --source rootfs --change-directory=var --label var --fstype=ext4 --mkfs-extraopts "-T default" --align 1024 --size 512M +part /home --source rootfs --change-directory=home --label home --fstype=ext4 --mkfs-extraopts "-T default" --align 1024 --size 1G bootloader --ptable gpt --append "console=ttyS3,115200n8 earlycon=ns16550a,mmio32,0x02810000 rootwait watchdog.handle_boot_enabled=0 panic=5 ${EXTRA_KERNEL_PARAMS}" diff --git a/wic/iot2050-swu.wks.in b/wic/iot2050-swu.wks.in index 4fb7faf66..c9302e438 100644 --- a/wic/iot2050-swu.wks.in +++ b/wic/iot2050-swu.wks.in @@ -14,7 +14,7 @@ part --source rawcopy --sourceparams "file=${IMAGE_FULLNAME}.squashfs" --align 1 part --source empty --align 1024 --fixed-size 4G --uuid "${ABROOTFS_PART_UUID_B}" --part-type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 # persistent partitions -part /var --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/var --label var --fstype=ext4 --mkfs-extraopts "-T default" --ondisk sda --align 1024 --size 512M -part /home --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --label home --fstype=ext4 --mkfs-extraopts "-T default" --ondisk sda --align 1024 --size 512M +part /var --source rootfs --change-directory=var --label var --fstype=ext4 --mkfs-extraopts "-T default" --ondisk sda --align 1024 --size 512M +part /home --source rootfs --change-directory=home --label home --fstype=ext4 --mkfs-extraopts "-T default" --ondisk sda --align 1024 --size 512M bootloader --ptable gpt --append "${CONSOLE_KERNEL_PARAMS} rootwait watchdog.handle_boot_enabled=0 ${EXTRA_KERNEL_PARAMS}"