summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/kickstart/custom_commands/partition.py42
1 files changed, 34 insertions, 8 deletions
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py
index 315c612884..4f5a1e5ce4 100644
--- a/scripts/lib/wic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/wic/kickstart/custom_commands/partition.py
@@ -246,8 +246,12 @@ class Wic_PartData(Mic_PartData):
246 246
247 extra_imagecmd = "-i 8192" 247 extra_imagecmd = "-i 8192"
248 248
249 mkfs_cmd = "mkfs.%s -F %s %s -d %s" % \ 249 label_str = ""
250 (self.fstype, extra_imagecmd, rootfs, image_rootfs) 250 if (self.label):
251 label_str = "-L %s" % self.label
252
253 mkfs_cmd = "mkfs.%s -F %s %s %s -d %s" % \
254 (self.fstype, extra_imagecmd, rootfs, label_str, image_rootfs)
251 (rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) 255 (rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
252 if rc: 256 if rc:
253 print "rootfs_dir: %s" % rootfs_dir 257 print "rootfs_dir: %s" % rootfs_dir
@@ -291,8 +295,12 @@ class Wic_PartData(Mic_PartData):
291 (rootfs, rootfs_size) 295 (rootfs, rootfs_size)
292 exec_cmd(dd_cmd) 296 exec_cmd(dd_cmd)
293 297
294 mkfs_cmd = "mkfs.%s -b %d -r %s %s" % \ 298 label_str = ""
295 (self.fstype, rootfs_size * 1024, image_rootfs, rootfs) 299 if (self.label):
300 label_str = "-L %s" % self.label
301
302 mkfs_cmd = "mkfs.%s -b %d -r %s %s %s" % \
303 (self.fstype, rootfs_size * 1024, image_rootfs, label_str, rootfs)
296 (rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) 304 (rc, out) = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
297 if rc: 305 if rc:
298 msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details) when creating filesystem from rootfs directory: %s" % (self.fstype, rc, rootfs_dir)) 306 msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details) when creating filesystem from rootfs directory: %s" % (self.fstype, rc, rootfs_dir))
@@ -334,7 +342,11 @@ class Wic_PartData(Mic_PartData):
334 if blocks % 16 != 0: 342 if blocks % 16 != 0:
335 blocks += (16 - (blocks % 16)) 343 blocks += (16 - (blocks % 16))
336 344
337 dosfs_cmd = "mkdosfs -n boot -S 512 -C %s %d" % (rootfs, blocks) 345 label_str = "-n boot"
346 if (self.label):
347 label_str = "-n %s" % self.label
348
349 dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks)
338 exec_native_cmd(dosfs_cmd, native_sysroot) 350 exec_native_cmd(dosfs_cmd, native_sysroot)
339 351
340 mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, image_rootfs) 352 mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, image_rootfs)
@@ -405,7 +417,12 @@ class Wic_PartData(Mic_PartData):
405 417
406 extra_imagecmd = "-i 8192" 418 extra_imagecmd = "-i 8192"
407 419
408 mkfs_cmd = "mkfs.%s -F %s %s" % (self.fstype, extra_imagecmd, fs) 420 label_str = ""
421 if (self.label):
422 label_str = "-L %s" % self.label
423
424 mkfs_cmd = "mkfs.%s -F %s %s %s" % \
425 (self.fstype, extra_imagecmd, label_str, fs)
409 (rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot) 426 (rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot)
410 if rc: 427 if rc:
411 msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details)" % (self.fstype, rc)) 428 msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details)" % (self.fstype, rc))
@@ -425,7 +442,12 @@ class Wic_PartData(Mic_PartData):
425 (fs, self.size) 442 (fs, self.size)
426 exec_cmd(dd_cmd) 443 exec_cmd(dd_cmd)
427 444
428 mkfs_cmd = "mkfs.%s -b %d %s" % (self.fstype, self.size * 1024, fs) 445 label_str = ""
446 if (self.label):
447 label_str = "-L %s" % self.label
448
449 mkfs_cmd = "mkfs.%s -b %d %s %s" % \
450 (self.fstype, self.size * 1024, label_str, fs)
429 (rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot) 451 (rc, out) = exec_native_cmd(mkfs_cmd, native_sysroot)
430 if rc: 452 if rc:
431 msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details)" % (self.fstype, rc)) 453 msger.error("ERROR: mkfs.%s returned '%s' instead of 0 (which you probably don't want to ignore, use --debug for details)" % (self.fstype, rc))
@@ -443,7 +465,11 @@ class Wic_PartData(Mic_PartData):
443 465
444 blocks = self.size 466 blocks = self.size
445 467
446 dosfs_cmd = "mkdosfs -n boot -S 512 -C %s %d" % (fs, blocks) 468 label_str = "-n boot"
469 if (self.label):
470 label_str = "-n %s" % self.label
471
472 dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, fs, blocks)
447 exec_native_cmd(dosfs_cmd, native_sysroot) 473 exec_native_cmd(dosfs_cmd, native_sysroot)
448 474
449 chmod_cmd = "chmod 644 %s" % fs 475 chmod_cmd = "chmod 644 %s" % fs