diff mbox series

[isar-cip-core,v2,1/2] ebg-sysparts: Add filesystem UUID to fat images

Message ID 20230824104119.5464-2-venkata.pyla@toshiba-tsip.com (mailing list archive)
State Accepted
Headers show
Series [isar-cip-core,v2,1/2] ebg-sysparts: Add filesystem UUID to fat images | expand

Commit Message

Venkata Pyla Aug. 24, 2023, 10:41 a.m. UTC
From: venkata pyla <venkata.pyla@toshiba-tsip.com>

The EFI and BOOT file system images are not reproducible because it is
created with random volume-id's generated in `mkdosfs`.

To fix this assign fixed filesystem UUID to the partitions and pass it
to the `mkdosfs`.

Partially-fixes: #73

Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
---
 scripts/lib/wic/plugins/source/efibootguard-boot.py | 4 ++--
 scripts/lib/wic/plugins/source/efibootguard-efi.py  | 4 ++--
 wic/ebg-sysparts.inc                                | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/scripts/lib/wic/plugins/source/efibootguard-boot.py b/scripts/lib/wic/plugins/source/efibootguard-boot.py
index 7435b22..9892572 100644
--- a/scripts/lib/wic/plugins/source/efibootguard-boot.py
+++ b/scripts/lib/wic/plugins/source/efibootguard-boot.py
@@ -160,8 +160,8 @@  class EfibootguardBootPlugin(SourcePlugin):
         # dosfs image, created by mkdosfs
         bootimg = "%s/%s.%s.img" % (cr_workdir, part.label, part.lineno)
 
-        dosfs_cmd = "mkdosfs -F 16 -S 512 -n %s -C %s %d" % \
-            (part.label.upper(), bootimg, blocks)
+        dosfs_cmd = "mkdosfs -F 16 -S 512 -n %s -C %s %d -i %s" % \
+            (part.label.upper(), bootimg, blocks, part.fsuuid)
         exec_cmd(dosfs_cmd)
 
         mcopy_cmd = "mcopy -v -i %s -s %s/* ::/" % (bootimg, part_rootfs_dir)
diff --git a/scripts/lib/wic/plugins/source/efibootguard-efi.py b/scripts/lib/wic/plugins/source/efibootguard-efi.py
index d6cdf0f..86a22e0 100644
--- a/scripts/lib/wic/plugins/source/efibootguard-efi.py
+++ b/scripts/lib/wic/plugins/source/efibootguard-efi.py
@@ -105,8 +105,8 @@  class EfibootguardEFIPlugin(SourcePlugin):
         # dosfs image, created by mkdosfs
         efi_part_image = "%s/%s.%s.img" % (cr_workdir, part.label, part.lineno)
 
-        dosfs_cmd = "mkdosfs -S 512 -n %s -C %s %d" % \
-            (part.label.upper(), efi_part_image, blocks)
+        dosfs_cmd = "mkdosfs -S 512 -n %s -C %s %d -i %s" % \
+            (part.label.upper(), efi_part_image, blocks, part.fsuuid)
         exec_cmd(dosfs_cmd)
 
         # mtools for buster have problems with resursive mcopy.
diff --git a/wic/ebg-sysparts.inc b/wic/ebg-sysparts.inc
index 9b2c879..976735d 100644
--- a/wic/ebg-sysparts.inc
+++ b/wic/ebg-sysparts.inc
@@ -1,8 +1,8 @@ 
 # default partition layout EFI Boot Guard usage
 
 # EFI partition containing efibootguard bootloader binary
-part --source efibootguard-efi  --size 16M --extra-space 0 --overhead-factor 1 --label efi   --align 1024 --part-type=EF00 --active
+part --source efibootguard-efi  --size 16M --extra-space 0 --overhead-factor 1 --label efi   --align 1024 --part-type=EF00 --active --fsuuid "0x4321dcba"
 
 # EFI Boot Guard environment/config partitions plus Kernel files
-part --source efibootguard-boot --size 32M --extra-space 0 --overhead-factor 1 --label BOOT0 --align 1024 --part-type=0700 --sourceparams "revision=2"
-part --source efibootguard-boot --size 32M --extra-space 0 --overhead-factor 1 --label BOOT1 --align 1024 --part-type=0700 --sourceparams "revision=1"
+part --source efibootguard-boot --size 32M --extra-space 0 --overhead-factor 1 --label BOOT0 --align 1024 --part-type=0700 --sourceparams "revision=2" --fsuuid "0x4321dcbb"
+part --source efibootguard-boot --size 32M --extra-space 0 --overhead-factor 1 --label BOOT1 --align 1024 --part-type=0700 --sourceparams "revision=1" --fsuuid "0x4321dcbc"