From caa1e9aa9bc9becc2399b9e7b40c03ebd4a3b49a Mon Sep 17 00:00:00 2001 From: Matthias Klumpp Date: Fri, 11 Aug 2017 17:42:23 -0400 Subject: [PATCH] oem: Enforce formatting, warn again about data loss --- .../var/lib/pureos-oem/install-pureos-oem.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot.oem/var/lib/pureos-oem/install-pureos-oem.py b/config/includes.chroot.oem/var/lib/pureos-oem/install-pureos-oem.py index 432c70c..b4a5a58 100755 --- a/config/includes.chroot.oem/var/lib/pureos-oem/install-pureos-oem.py +++ b/config/includes.chroot.oem/var/lib/pureos-oem/install-pureos-oem.py @@ -94,7 +94,7 @@ class LibremDiskDevice(object): check_call(['udevadm', 'settle']) # create file system and labels - check_call(['mkfs.ext4', self.path + '-part1']) + check_call(['mkfs.ext4', '-F', self.path + '-part1']) check_call(['e2label', self.path + '-part1', 'rescue']) def partition_secondary_disk(self): @@ -116,7 +116,7 @@ class LibremDiskDevice(object): check_call(['udevadm', 'settle']) # create file system and labels - check_call(['mkfs.ext4', self.path + '-part1']) + check_call(['mkfs.ext4', '-F', self.path + '-part1']) def wipe_dev(self, dev_path): """ @@ -271,6 +271,13 @@ def pureos_oem_setup(): if __name__ == '__main__': import sys + print('Do you really want to continue installing the OEM image?') + run_oem = input('/!\ THIS WILL ERASE THE CONTENTS OF ALL DISKS FOUND IN THIS DEVICE [Y/n]') + if run_oem.strip.lower() != 'y' and run_oem.strip(): + print('Installation cancelled. Rebooting.') + check_call(['systemctl', 'reboot']) + sys.exit(0) + # Set up a logger for nice visibility. logger = getLogger(__name__)