? tmp Index: anaconda.spec =================================================================== RCS file: /usr/local/CVS/anaconda/anaconda.spec,v retrieving revision 1.26.2.75 diff -u -p -r1.26.2.75 anaconda.spec --- anaconda.spec 4 Apr 2007 21:45:13 -0000 1.26.2.75 +++ anaconda.spec 10 Apr 2007 20:10:59 -0000 @@ -6,12 +6,12 @@ License: GPL Summary: Graphical system installer Group: Applications/System Source: anaconda-%{PACKAGE_VERSION}.tar.bz2 -BuildPreReq: pump-devel >= 0.8.20, kudzu-devel >= 1.1.95.16, pciutils-devel, bzip2-devel, e2fsprogs-devel, python-devel gtk2-devel rpm-python >= 4.2-0.61, newt-devel, rpm-devel, gettext >= 0.11, rhpl, booty, libxml2-python, zlib-devel, bogl-devel >= 0:0.1.9-17, bogl-bterm >= 0:0.1.9-17, elfutils-devel, beecrypt-devel, libselinux-devel >= 1.6, xorg-x11-devel +BuildPreReq: pump-devel >= 0.8.20, kudzu-devel >= 1.1.95.16, pciutils-devel, bzip2-devel, e2fsprogs-devel >= 1.35-12.6.el4, python-devel gtk2-devel rpm-python >= 4.2-0.61, newt-devel, rpm-devel, gettext >= 0.11, rhpl, booty, libxml2-python, zlib-devel, bogl-devel >= 0:0.1.9-17, bogl-bterm >= 0:0.1.9-17, elfutils-devel, beecrypt-devel, libselinux-devel >= 1.6, xorg-x11-devel %ifarch i386 BuildRequires: dietlibc %endif Requires: rpm-python >= 4.2-0.61, rhpl > 0.63, parted >= 1.6.3-7, booty, kudzu -Requires: pyparted, libxml2-python +Requires: pyparted, libxml2-python, dosfstools >= 2.8-17 Requires: anaconda-help, system-logos Obsoletes: anaconda-images <= 10 Url: http://fedora.redhat.com/projects/anaconda-installer/ Index: fsset.py =================================================================== RCS file: /usr/local/CVS/anaconda/fsset.py,v retrieving revision 1.237.4.6 diff -u -p -r1.237.4.6 fsset.py --- fsset.py 12 Feb 2007 22:11:03 -0000 1.237.4.6 +++ fsset.py 10 Apr 2007 20:10:59 -0000 @@ -101,7 +101,7 @@ class LabelFactory: def __init__(self): self.labels = None - def createLabel(self, mountpoint, maxLabelChars): + def createLabel(self, mountpoint, maxLabelChars, kslabel = None): if self.labels == None: self.labels = {} @@ -112,6 +112,13 @@ class LabelFactory: labels = diskset.getLabels() del diskset self.reserveLabels(labels) + + # If a label was specified in the kickstart file, return that as + # the label - unless it's already in the reserved list. If that's + # the case, make a new one. + if kslabel and kslabel not in self.labels: + self.labels[kslabel] = 1 + return kslabel if len(mountpoint) > maxLabelChars: mountpoint = mountpoint[0:maxLabelChars] @@ -433,7 +440,8 @@ class xfsFileSystem(FileSystemType): def labelDevice(self, entry, chroot): devicePath = entry.device.setupDevice(chroot) - label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars) + label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars, + kslabel = entry.label) db_cmd = "label " + label rc = iutil.execWithRedirect("/usr/sbin/xfs_db", ["xfs_db", "-x", "-c", db_cmd, @@ -479,7 +487,8 @@ class jfsFileSystem(FileSystemType): def labelDevice(self, entry, chroot): devicePath = entry.device.setupDevice(chroot) - label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars) + label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars, + kslabel = entry.label) rc = iutil.execWithRedirect("/usr/sbin/jfs_tune", ["jfs_tune", "-L", label, devicePath], stdout = "/dev/tty5", @@ -514,7 +523,8 @@ class extFileSystem(FileSystemType): def labelDevice(self, entry, chroot): devicePath = entry.device.setupDevice(chroot) - label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars) + label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars, + kslabel = entry.label) rc = iutil.execWithRedirect("/usr/sbin/e2label", ["e2label", devicePath, label], stdout = "/dev/tty5", @@ -759,10 +769,13 @@ class FATFileSystem(FileSystemType): FileSystemType.__init__(self) self.partedFileSystemType = parted.file_system_type_get("fat32") self.formattable = 1 + self.supported = 1 self.checked = 0 self.maxSizeMB = 1024 * 1024 self.name = "vfat" self.packages = [ "dosfstools" ] + self.maxLabelChars = 11 + self.migratetofs = ['vfat'] def formatDevice(self, entry, progress, chroot='/'): devicePath = entry.device.setupDevice(chroot) @@ -775,6 +788,101 @@ class FATFileSystem(FileSystemType): stderr = "/dev/tty5") if rc: raise SystemError + + def labelDevice(self, entry, chroot): + if not iutil.getArch() == 'ia64': + return + devicePath = entry.device.setupDevice(chroot) + label = labelFactory.createLabel(entry.mountpoint, self.maxLabelChars, + kslabel = entry.label) + + rc = iutil.execWithRedirect("/usr/sbin/dosfslabel", + ["dosfslabel", devicePath, label], + stdout = "/dev/tty5", + stderr = "/dev/tty5", + searchPath = 1) + newLabel = iutil.execWithCapture("/usr/sbin/dosfslabel", + ["dosfslabel", devicePath], + stderr = "/dev/tty5") + newLabel = newLabel.strip() + if label != newLabel: + raise SystemError, "dosfslabel failed on device %s" % (devicePath,) + entry.setLabel(label) + + def _readFstab(self, path): + f = open (path, "r") + lines = f.readlines () + f.close() + + fstab = [] + for line in lines: + fields = string.split(line) + + if not fields: + fstab.append(line) + continue + + if line[0] == "#": + fstab.append(line) + # skip all comments + continue + + # all valid fstab entries have 6 fields; if the last two are + # missing they are assumed to be zero per fstab(5) + if len(fields) < 4: + fstab.append(line) + continue + elif len(fields) == 4: + fields.append(0) + fields.append(0) + elif len(fields) == 5: + fields.append(0) + elif len(fields) > 6: + fstab.append(line) + continue + fstab.append(fields) + + return fstab + + def migrateFileSystem(self, entry, message, chroot='/'): + devicePath = entry.device.setupDevice(chroot) + + if not entry.fsystem or not entry.origfsystem: + raise RuntimeError, ("Trying to migrate fs w/o fsystem or " + "origfsystem set") + if entry.fsystem.getName() != "vfat": + raise RuntimeError, ("Trying to migrate vfat to something other " + "than vfat") + + self.labelDevice(entry, chroot) + + if not entry.label: + return + + try: + os.stat(chroot + "/etc/fstab") + except: + return + mounts = self._readFstab(chroot + "/etc/fstab") + + changed = False + for mount in mounts: + if type(mount) == types.ListType: + if mount[0] == "/dev/%s" % (entry.device.getDevice(),): + mount[0] = "LABEL=%s" % (entry.label,) + changed = True + + if changed: + os.rename(chroot + "/etc/fstab", chroot + "/etc/fstab.anaconda") + f = open (chroot + "/etc/fstab", "w") + for mount in mounts: + if type(mount) == types.ListType: + mount = string.join(mount, "\t") + if mount[:-1] != "\n": + mount += "\n" + f.write(mount) + f.close() + fileSystemTypeRegister(FATFileSystem()) Index: partRequests.py =================================================================== RCS file: /usr/local/CVS/anaconda/partRequests.py,v retrieving revision 1.45.4.4 diff -u -p -r1.45.4.4 partRequests.py --- partRequests.py 6 Apr 2006 18:27:22 -0000 1.45.4.4 +++ partRequests.py 10 Apr 2007 20:10:59 -0000 @@ -194,6 +194,11 @@ class RequestSpec: if self.migrate: entry.setMigrate(self.migrate) + elif iutil.getArch() == 'ia64' \ + and entry.getMountPoint() == "/boot/efi" \ + and isinstance(self.origfstype, fsset.FATFileSystem) \ + and not entry.getFormat(): + entry.setMigrate(1) if self.badblocks: entry.setBadblocks(self.badblocks) Index: isys/isys.py =================================================================== RCS file: /usr/local/CVS/anaconda/isys/isys.py,v retrieving revision 1.136.2.14 diff -u -p -r1.136.2.14 isys.py --- isys/isys.py 4 Apr 2007 20:43:23 -0000 1.136.2.14 +++ isys/isys.py 10 Apr 2007 20:11:00 -0000 @@ -685,12 +685,31 @@ def readSwapLabel(device, makeDevNode = def readExt2Label(device, makeDevNode = 1): if makeDevNode: makeDevInode(device, "/tmp/disk") - label = _isys.e2fslabel("/tmp/disk"); + label = _isys.e2fslabel("/tmp/disk") os.unlink("/tmp/disk") else: label = _isys.e2fslabel(device) return label +def _readFATLabel(device): + label = iutil.execWithCapture("/usr/sbin/dosfslabel", + ["dosfslabel", device], stderr="/dev/tty5") + label = label.strip() + if len(label) == 0: + return None + return label + +def readFATLabel(device, makeDevNode = 1): + if not iutil.getArch() == "ia64": + return None + if makeDevNode: + makeDevInode(device, "/tmp/disk") + label = _readFATLabel("/tmp/disk") + os.unlink("/tmp/disk") + else: + label = _readFATLabel(device) + return label + def readFSLabel(device, makeDevNode = 1): label = readExt2Label(device, makeDevNode) if label is None: @@ -699,6 +718,8 @@ def readFSLabel(device, makeDevNode = 1) label = readXFSLabel(device, makeDevNode) if label is None: label = readJFSLabel(device, makeDevNode) + if label is None: + label = readFATLabel(device, makeDevNode) return label def ext2IsDirty(device): Index: scripts/upd-instroot =================================================================== RCS file: /usr/local/CVS/anaconda/scripts/upd-instroot,v retrieving revision 1.368.2.4 diff -u -p -r1.368.2.4 upd-instroot --- scripts/upd-instroot 30 Jan 2007 19:37:47 -0000 1.368.2.4 +++ scripts/upd-instroot 10 Apr 2007 20:11:00 -0000 @@ -278,6 +278,7 @@ sbin/badblocks sbin/busybox.anaconda sbin/clock sbin/debugfs +sbin/dosfslabel sbin/e2fsck sbin/e2fsadm sbin/e2label