diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/GLIArchitectureTemplate.py | 7 |
2 files changed, 9 insertions, 2 deletions
@@ -4,6 +4,10 @@ 06 Apr 2008; Andrew Gaffney <agaffney@gentoo.org> src/GLIArchitectureTemplate.py: + Add checking for non-blank local filesystems after mounting + + 06 Apr 2008; Andrew Gaffney <agaffney@gentoo.org> + src/GLIArchitectureTemplate.py: Update post-install networking config to use newer conf.d/net syntax 05 Apr 2008; Andrew Gaffney <agaffney@gentoo.org> 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) |