wic: add attribute parameter to parted
PATCH 1/1 wic: add attribute parameter to parted
Add argument parameter which will use sgdisk to set argument
Certain bootloaders use attribute to recognize correct boot partitions and having the option via wic tool would remove the need to do via external scripts
--- scripts/lib/wic/help.py | 3 +++ scripts/lib/wic/ksparser.py | 1 + scripts/lib/wic/partition.py | 1 + scripts/lib/wic/plugins/imager/direct.py | 5 +++++ 4 files changed, 10 insertions(+)
scripts/lib/wic/help.py +3 -0
@@ -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
scripts/lib/wic/ksparser.py +1 -0
@@ -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')
scripts/lib/wic/partition.py +1 -0
@@ -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 = ""
scripts/lib/wic/plugins/imager/direct.py +5 -0
@@ -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
Quoted 18 lines · Mohammed via lists.openembedded.org
Add argument parameter which will use sgdisk to set argument
Certain bootloaders use attribute to recognize correct boot partitions and having the option via wic tool would remove the need to do via external scriptsSigned-off-by Mohammed <[email protected]>--- scripts/lib/wic/help.py | 3 +++ scripts/lib/wic/ksparser.py | 1 + scripts/lib/wic/partition.py | 1 + scripts/lib/wic/plugins/imager/direct.py | 5 +++++ 4 files changed, 10 insertions(+)scripts/lib/wic/help.py +0
-0
scripts/lib/wic/help.py DESCRIPTION · line 1073
Quoted 4 lines
scripts/lib/wic/help.py +1
-0@@ -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
Drop the line "This option is specific to wic."
secondly as mentioned to prior version please add a selftest for this option
Quoted 54 lines
scripts/lib/wic/help.py +2
-0+ the partition attribute. + * bootloader This command allows the user to specify various bootloaderscripts/lib/wic/ksparser.py +1
-0@@ -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')scripts/lib/wic/partition.py +1
-0@@ -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 = ""scripts/lib/wic/plugins/imager/direct.py +5
-1@@ -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 -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group.
View/Reply Online (#222110): https://lists.openembedded.org/g/openembedded-core/message/222110
Mute This Topic: https://lists.openembedded.org/mt/114750349/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-