summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsegfault <segfault@riseup.net>2018-11-22 20:56:48 +0100
committersegfault <segfault@riseup.net>2018-11-22 20:56:48 +0100
commiteb4a6a57b5d0f0defc9c419b6421f6b061f1ca67 (patch)
tree94b49c87d5a9d959f58df29b8fbaf420a5cb396f
parent3adb896dd75e3b9a50875dc3e8ee33552cd52f5f (diff)
Reset timestamps on disk image (refs: #15985)
-rwxr-xr-xauto/scripts/create-usb-image-from-iso24
1 files changed, 16 insertions, 8 deletions
diff --git a/auto/scripts/create-usb-image-from-iso b/auto/scripts/create-usb-image-from-iso
index 41c65ea..7831b38 100755
--- a/auto/scripts/create-usb-image-from-iso
+++ b/auto/scripts/create-usb-image-from-iso
@@ -111,14 +111,15 @@ class ImageCreator(object):
self.install_mbr()
self.copy_syslinux_modules()
- # This sleep is a workaround for a race condition which causes the
- # syslinux installation to return without errors, even though the
- # bootloader isn't actually installed
- # XXX: Investigate and report this race condition
- # Might it be https://bugs.chromium.org/p/chromium/issues/detail?id=508713 ?
- time.sleep(1)
- self.install_syslinux()
- self.set_guids()
+ # This sleep is a workaround for a race condition which causes the
+ # syslinux installation to return without errors, even though the
+ # bootloader isn't actually installed
+ # XXX: Investigate and report this race condition
+ # Might it be https://bugs.chromium.org/p/chromium/issues/detail?id=508713 ?
+ time.sleep(1)
+ self.install_syslinux()
+ self.set_guids()
+ self.reset_timestamps()
def extract_iso(self):
logger.info("Extracting ISO contents to the partition")
@@ -318,6 +319,13 @@ class ImageCreator(object):
as_root=True # XXX: Why does this only work as root?
)
+ def reset_timestamps(self):
+ logger.info("Resetting timestamps")
+ for root, dirs, files in os.walk(self.mountpoint):
+ os.utime(root, (0, 0))
+ for file in files:
+ os.utime(os.path.join(root, file), (0, 0))
+
def set_guids(self):
execute(["/sbin/sgdisk", "--disk-guid", "17B81DA0-8B1E-4269-9C39-FE5C7B9B58A3",
"--partition-guid", "1:34BF027A-8001-4B93-8243-1F9D3DCE7DE7", self.image])