aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/GLIArchitectureTemplate.py')
-rw-r--r--src/GLIArchitectureTemplate.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/GLIArchitectureTemplate.py b/src/GLIArchitectureTemplate.py
index 7c7f461..9157d9a 100644
--- a/src/GLIArchitectureTemplate.py
+++ b/src/GLIArchitectureTemplate.py
@@ -346,8 +346,11 @@ class ArchitectureTemplate:
ret = GLIUtility.spawn("mount " + partition_type + mountopts + partition + " " + self._chroot_dir + mountpoint, display_on_tty8=True, logfile=self._compile_logfile, append_log=True)
if not GLIUtility.exitsuccess(ret):
raise GLIException("MountError", 'fatal','mount_local_partitions','Could not mount a partition')
- else:
- self._mounted_devices.append(mountpoint)
+ self._mounted_devices.append(mountpoint)
+ mount_files = os.listdir(self._chroot_dir + mountpoint)
+ for mount_file in mount_files:
+ if os.path.isdir(self._chroot_dir + mountpoint + '/' + mount_file) and mount_file != "lost+found":
+ raise GLIException("MountError", "fatal", "mount_local_partition", "The partition %s (mounted at %s) already has files! The installer only supports installing to a blank filesystem" % (partition, mountpoint))
# double check in /proc/mounts
# This current code doesn't work and needs to be fixed, because there is a case that it is needed for - robbat2
#ret, output = GLIUtility.spawn('awk \'$2 == "%s" { print "Found" }\' /proc/mounts | head -n1' % (self._chroot_dir + mountpoint), display_on_tty8=True, return_output=True)