]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
wic: add attribute parameter to parted mathieu/master-next-success
authorMohammed <mroj4n@gmail.com>
Sun, 17 Aug 2025 16:49:08 +0000 (18:49 +0200)
committerMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Mon, 18 Aug 2025 10:58:00 +0000 (12:58 +0200)
Signed-off-by: Mohammed <mroj4n@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
scripts/lib/wic/help.py
scripts/lib/wic/ksparser.py
scripts/lib/wic/partition.py
scripts/lib/wic/plugins/imager/direct.py

index 2e3061f343134b2ab35eed4b2a5aa190a9ad128a..fef856dbbba9a2521e535e2e4077c1f7976ed187 100644 (file)
@@ -1070,6 +1070,9 @@ DESCRIPTION
                 an MBR header. Partitions with this flag will be included in
                 this MBR header.
 
+        --attribute: This option is specific to wic. This option is used to set
+                      the partition attribute.
+
     * bootloader
 
       This command allows the user to specify various bootloader
index 7ef3dc83ddcef58a9a2436c5e58663ebde99c25d..af4fb91d58672ecbe14b6cbfac2278ce93ab376e 100644 (file)
@@ -189,6 +189,7 @@ class KickStart():
         part.add_argument('--fsuuid')
         part.add_argument('--no-fstab-update', action='store_true')
         part.add_argument('--mbr', action='store_true')
+        part.add_argument('--attribute')
 
         bootloader = subparsers.add_parser('bootloader')
         bootloader.add_argument('--append')
index b34691d31379d6b0132033fe59ab8768d49a8186..cf5c51f10574d33902a468dbbaf665afeb5499d9 100644 (file)
@@ -61,6 +61,7 @@ class Partition():
         self.update_fstab_in_rootfs = False
         self.hidden = args.hidden
         self.mbr = args.mbr
+        self.attribute = args.attribute
 
         self.lineno = lineno
         self.source_file = ""
index 6e1f1c8cba50e86a41ce06d1379e702d748a7e25..877a5d2a97dfe99f25e6d6231cddccb383da4f2d 100644 (file)
@@ -664,6 +664,11 @@ class PartitionedImage():
                 exec_native_cmd("sfdisk --sector-size %s --part-attrs %s %s RequiredPartition" % \
                                 (self.sector_size, self.path, part.num),
                                 self.native_sysroot)
+            
+            if part.attribute:
+                logger.debug("Set attribute:'%s' for partition '%s' on disk '%s'", part.attribute ,part.num, self.path)
+                exec_native_cmd("sgdisk -A %s:=:%s %s" % (part.num, part.attribute, self.path), \
+                self.native_sysroot)
 
         if self.ptable_format == "gpt-hybrid":
             # Write a protective GPT partition