diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/wic/canned-wks/common.wks.inc | 2 | ||||
-rw-r--r-- | scripts/lib/wic/canned-wks/directdisk-gpt.wks | 2 | ||||
-rw-r--r-- | scripts/lib/wic/canned-wks/mkefidisk.wks | 2 | ||||
-rw-r--r-- | scripts/lib/wic/misc.py | 1 | ||||
-rw-r--r-- | scripts/lib/wic/partition.py | 38 |
5 files changed, 42 insertions, 3 deletions
diff --git a/scripts/lib/wic/canned-wks/common.wks.inc b/scripts/lib/wic/canned-wks/common.wks.inc index 89880b417b..4fd29fa8c1 100644 --- a/scripts/lib/wic/canned-wks/common.wks.inc +++ b/scripts/lib/wic/canned-wks/common.wks.inc | |||
@@ -1,3 +1,3 @@ | |||
1 | # This file is included into 3 canned wks files from this directory | 1 | # This file is included into 3 canned wks files from this directory |
2 | part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024 | 2 | part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024 |
3 | part / --source rootfs --use-uuid --fstype=ext4 --label platform --align 1024 | 3 | part / --source rootfs --use-uuid --fstype=ext4 --mkfs-extraopts "-T default" --label platform --align 1024 |
diff --git a/scripts/lib/wic/canned-wks/directdisk-gpt.wks b/scripts/lib/wic/canned-wks/directdisk-gpt.wks index 8d7d8de6ea..cf16c0c30b 100644 --- a/scripts/lib/wic/canned-wks/directdisk-gpt.wks +++ b/scripts/lib/wic/canned-wks/directdisk-gpt.wks | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | 5 | ||
6 | part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024 | 6 | part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024 |
7 | part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid | 7 | part / --source rootfs --ondisk sda --fstype=ext4 --mkfs-extraopts "-T default" --label platform --align 1024 --use-uuid |
8 | 8 | ||
9 | bootloader --ptable gpt --timeout=0 --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8" | 9 | bootloader --ptable gpt --timeout=0 --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8" |
10 | 10 | ||
diff --git a/scripts/lib/wic/canned-wks/mkefidisk.wks b/scripts/lib/wic/canned-wks/mkefidisk.wks index 9f534fe184..d1878e23e5 100644 --- a/scripts/lib/wic/canned-wks/mkefidisk.wks +++ b/scripts/lib/wic/canned-wks/mkefidisk.wks | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024 | 5 | part /boot --source bootimg-efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024 |
6 | 6 | ||
7 | part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid | 7 | part / --source rootfs --ondisk sda --fstype=ext4 --mkfs-extraopts "-T default" --label platform --align 1024 --use-uuid |
8 | 8 | ||
9 | part swap --ondisk sda --size 44 --label swap1 --fstype=swap | 9 | part swap --ondisk sda --size 44 --label swap1 --fstype=swap |
10 | 10 | ||
diff --git a/scripts/lib/wic/misc.py b/scripts/lib/wic/misc.py index 75b219cd3f..57c042c503 100644 --- a/scripts/lib/wic/misc.py +++ b/scripts/lib/wic/misc.py | |||
@@ -26,6 +26,7 @@ logger = logging.getLogger('wic') | |||
26 | 26 | ||
27 | # executable -> recipe pairs for exec_native_cmd | 27 | # executable -> recipe pairs for exec_native_cmd |
28 | NATIVE_RECIPES = {"bmaptool": "bmap-tools", | 28 | NATIVE_RECIPES = {"bmaptool": "bmap-tools", |
29 | "dumpe2fs": "e2fsprogs", | ||
29 | "grub-mkimage": "grub-efi", | 30 | "grub-mkimage": "grub-efi", |
30 | "isohybrid": "syslinux", | 31 | "isohybrid": "syslinux", |
31 | "mcopy": "mtools", | 32 | "mcopy": "mtools", |
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index e574f40c47..85f9847047 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py | |||
@@ -298,6 +298,8 @@ class Partition(): | |||
298 | mkfs_cmd = "fsck.%s -pvfD %s" % (self.fstype, rootfs) | 298 | mkfs_cmd = "fsck.%s -pvfD %s" % (self.fstype, rootfs) |
299 | exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo) | 299 | exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo) |
300 | 300 | ||
301 | self.check_for_Y2038_problem(rootfs, native_sysroot) | ||
302 | |||
301 | def prepare_rootfs_btrfs(self, rootfs, cr_workdir, oe_builddir, rootfs_dir, | 303 | def prepare_rootfs_btrfs(self, rootfs, cr_workdir, oe_builddir, rootfs_dir, |
302 | native_sysroot, pseudo): | 304 | native_sysroot, pseudo): |
303 | """ | 305 | """ |
@@ -388,6 +390,8 @@ class Partition(): | |||
388 | (self.fstype, extraopts, label_str, self.fsuuid, rootfs) | 390 | (self.fstype, extraopts, label_str, self.fsuuid, rootfs) |
389 | exec_native_cmd(mkfs_cmd, native_sysroot) | 391 | exec_native_cmd(mkfs_cmd, native_sysroot) |
390 | 392 | ||
393 | self.check_for_Y2038_problem(rootfs, native_sysroot) | ||
394 | |||
391 | def prepare_empty_partition_btrfs(self, rootfs, oe_builddir, | 395 | def prepare_empty_partition_btrfs(self, rootfs, oe_builddir, |
392 | native_sysroot): | 396 | native_sysroot): |
393 | """ | 397 | """ |
@@ -449,3 +453,37 @@ class Partition(): | |||
449 | 453 | ||
450 | mkswap_cmd = "mkswap %s -U %s %s" % (label_str, self.fsuuid, path) | 454 | mkswap_cmd = "mkswap %s -U %s %s" % (label_str, self.fsuuid, path) |
451 | exec_native_cmd(mkswap_cmd, native_sysroot) | 455 | exec_native_cmd(mkswap_cmd, native_sysroot) |
456 | |||
457 | def check_for_Y2038_problem(self, rootfs, native_sysroot): | ||
458 | """ | ||
459 | Check if the filesystem is affected by the Y2038 problem | ||
460 | (Y2038 problem = 32 bit time_t overflow in January 2038) | ||
461 | """ | ||
462 | def get_err_str(part): | ||
463 | err = "The {} filesystem {} has no Y2038 support." | ||
464 | if part.mountpoint: | ||
465 | args = [part.fstype, "mounted at %s" % part.mountpoint] | ||
466 | elif part.label: | ||
467 | args = [part.fstype, "labeled '%s'" % part.label] | ||
468 | elif part.part_name: | ||
469 | args = [part.fstype, "in partition '%s'" % part.part_name] | ||
470 | else: | ||
471 | args = [part.fstype, "in partition %s" % part.num] | ||
472 | return err.format(*args) | ||
473 | |||
474 | # ext2 and ext3 are always affected by the Y2038 problem | ||
475 | if self.fstype in ["ext2", "ext3"]: | ||
476 | logger.warn(get_err_str(self)) | ||
477 | return | ||
478 | |||
479 | ret, out = exec_native_cmd("dumpe2fs %s" % rootfs, native_sysroot) | ||
480 | |||
481 | # if ext4 is affected by the Y2038 problem depends on the inode size | ||
482 | for line in out.splitlines(): | ||
483 | if line.startswith("Inode size:"): | ||
484 | size = int(line.split(":")[1].strip()) | ||
485 | if size < 256: | ||
486 | logger.warn("%s Inodes (of size %d) are too small." % | ||
487 | (get_err_str(self), size)) | ||
488 | break | ||
489 | |||