From 548597bbff4a2df845f1f967b4107416367a4e14 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Thu, 7 Feb 2008 16:28:49 -0500 Subject: Check the fstype of the live image Need to make sure that the filesystem type of / matches what the live image is set up with as its rootfs --- livecd.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'livecd.py') diff --git a/livecd.py b/livecd.py index 2955a9e6a..3473c1131 100644 --- a/livecd.py +++ b/livecd.py @@ -40,6 +40,7 @@ from constants import * import backend import isys import iutil +import fsset import packages @@ -112,7 +113,7 @@ class LiveCDCopyBackend(backend.AnacondaBackend): sys.exit(0) def _getLiveBlockDevice(self): - return self.osimg + return os.path.normpath(self.osimg) def _getLiveSizeMB(self): def parseField(output, field): @@ -173,6 +174,13 @@ class LiveCDCopyBackend(backend.AnacondaBackend): rootfs = r.device.getDevice() rootfd = os.open("/dev/" + rootfs, os.O_WRONLY) + # set the rootfs to have the right type. this lets things work + # given ext2 or ext3 (and in the future, ext4) + # FIXME: should we try to migrate if there isn't a match? + roottype = isys.readFSType(osimg) + if roottype is not None: + r.fsystem = fsset.fileSystemTypeGet(roottype) + readamt = 1024 * 1024 * 8 # 8 megs at a time size = float(self._getLiveSizeMB() * 1024 * 1024) copied = 0 -- cgit