bootloader.add_argument('--configfile')
bootloader.add_argument('--ptable', choices=('msdos', 'gpt', 'gpt-hybrid'),
default='msdos')
+ bootloader.add_argument('--diskid', type=lambda x: int(x, 0))
bootloader.add_argument('--timeout', type=int)
bootloader.add_argument('--source')
break
image_path = self._full_path(self.workdir, self.parts[0].disk, "direct")
- self._image = PartitionedImage(image_path, self.ptable_format,
+ self._image = PartitionedImage(image_path, self.ptable_format, self.ks.bootloader.diskid,
self.parts, self.native_sysroot,
options.extra_space)
Partitioned image in a file.
"""
- def __init__(self, path, ptable_format, partitions, native_sysroot=None, extra_space=0):
+ def __init__(self, path, ptable_format, disk_id, partitions, native_sysroot=None, extra_space=0):
self.path = path # Path to the image file
self.numpart = 0 # Number of allocated partitions
self.realpart = 0 # Number of partitions in the partition table
# all partitions (in bytes)
self.ptable_format = ptable_format # Partition table format
# Disk system identifier
- if os.getenv('SOURCE_DATE_EPOCH'):
+ if disk_id:
+ self.identifier = disk_id
+ elif os.getenv('SOURCE_DATE_EPOCH'):
self.identifier = random.Random(int(os.getenv('SOURCE_DATE_EPOCH'))).randint(1, 0xffffffff)
else:
self.identifier = random.SystemRandom().randint(1, 0xffffffff)