diff options
author | Andrew Gaffney <agaffney@gentoo.org> | 2008-04-06 17:25:11 +0000 |
---|---|---|
committer | Andrew Gaffney <agaffney@gentoo.org> | 2008-04-06 17:25:11 +0000 |
commit | e8653448bc2683edf68211749babf47b2f8380c0 (patch) | |
tree | a62e13bd91085d60a17c8605b3a0bd2021537350 | |
parent | Update post-install networking config to use newer conf.d/net syntax (diff) | |
download | gli-e8653448bc2683edf68211749babf47b2f8380c0.tar.gz gli-e8653448bc2683edf68211749babf47b2f8380c0.tar.bz2 gli-e8653448bc2683edf68211749babf47b2f8380c0.zip |
Add checking for non-blank local filesystems after mounting
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/gli/trunk@1892 f8877401-5920-0410-a79b-8e2d7e04ca0d
-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) |