On Friday 07 Nov 2003 2:38 am, Mike Burger wrote: > Are there any plans to include SGI's XFS filesystem support into Fedora's > kernels and/or installers? > > Such support would be incredibly appreciated. > > > -- > fedora-list mailing list > fedora-list@xxxxxxxxxx > http://www.redhat.com/mailman/listinfo/fedora-list These two patches add the necessary support to anaconda to enable XFS support, the only problem with this is that grub will hang at the end while installing the bootloader, a few of us on the linux-xfs mailing list are trying to find the answer to that problem too. As for the kernel & userspace utils oss.sgi.com is your friend. Eric Sandeen has just put out a kernel SRPM today. Now to find the reason grub hangs at the end. HTH Ajay
diff -Naur anaconda-9.2/fsset.py anaconda-9.2-patched/fsset.py --- anaconda-9.2/fsset.py 2003-10-21 04:38:12.000000000 +0530 +++ anaconda-9.2-patched/fsset.py 2003-11-06 17:46:00.000000000 +0530 @@ -1335,7 +1335,7 @@ if not entry.mountpoint or entry.mountpoint == "swap": continue try: - label = isys.readExt2Label(dev) + label = isys.readFSLabel(dev) except: continue if label: @@ -1644,7 +1644,7 @@ def getLabel(self): try: - return isys.readExt2Label(self.setupDevice(), makeDevNode = 0) + return isys.readFSLabel(self.setupDevice(), makeDevNode = 0) except: return "" @@ -2213,6 +2213,23 @@ os.close(fd) return 0 +def isValidJFS(device): + fd = getDevFD(device) + if fd == -1: + return 0 + + try: + os.lseek(fd, 32768, 0) + buf = os.read(fd, 128) + except: + buf = "" + + if (buf[0:4] == "JFS1"): + os.close(fd) + return 1 + + os.close(fd) + return 0 # this will return a list of types of filesystems which device # looks like it could be to try mounting as @@ -2225,6 +2242,9 @@ if isValidReiserFS(device): rc.append("reiserfs") + if isValidJFS(device): + rc.append("jfs") + if isValidExt2(device): if os.access(device, os.O_RDONLY): create = 0 diff -Naur anaconda-9.2/isys/isys.py anaconda-9.2-patched/isys/isys.py --- anaconda-9.2/isys/isys.py 2003-10-17 05:08:19.000000000 +0530 +++ anaconda-9.2-patched/isys/isys.py 2003-11-07 07:11:35.000000000 +0530 @@ -473,6 +473,32 @@ # otherwise return _isys.pumpnetdevice(device) +def readXFSLabel_int(device): + try: + fd = os.open(device, os.O_RDONLY) + except: + return None + + buf = os.read(fd, 128) + os.close(fd) + + if len(buf) != 128: + xfslabel = None + + if buf[0:4] == "XFSB": + xfslabel = string.rstrip(buf[108:120],"\0x00") + + return xfslabel + +def readXFSLabel(device, makeDevNode = 1): + if makeDevNode: + makeDevInode(device, "/tmp/disk") + label = readXFSLabel_int("/tmp/disk") + os.unlink("/tmp/disk") + else: + label = readXFSLabel_int(device) + return label + def readExt2Label(device, makeDevNode = 1): if makeDevNode: makeDevInode(device, "/tmp/disk") @@ -482,6 +508,21 @@ label = _isys.e2fslabel(device) return label +def readFSLabel(device, makeDevNode = 1): + label = readXFSLabel(device, makeDevNode) + if (label == None): + label = readExt2Label(device, makeDevNode) + return label + +#def readFSLabel(device, makeDevNode = 1): +# fstype = partedUtils.sniffFilesystemType(device) +# if (fstype == "ext2" or fstype == "ext3") +# return readExt2Label(device, makeDevNode) +# elif (fstype == "xfs"): +# return readXFSLabel(device, makeDevNode) +# else: +# return "" + def ext2IsDirty(device): makeDevInode(device, "/tmp/disk") label = _isys.e2dirty("/tmp/disk"); diff -Naur anaconda-9.2/partedUtils.py anaconda-9.2-patched/partedUtils.py --- anaconda-9.2/partedUtils.py 2003-10-14 04:20:10.000000000 +0530 +++ anaconda-9.2-patched/partedUtils.py 2003-11-06 17:50:56.000000000 +0530 @@ -421,6 +421,9 @@ if fsset.isValidReiserFS(dev): return "reiserfs" + if fsset.isValidJFS(dev): + return "jfs" + # FIXME: we don't look for jfs, or vfat return None @@ -530,16 +533,17 @@ or part.get_flag(parted.PARTITION_LVM)) and part.fs_type and (part.fs_type.name == "ext2" - or part.fs_type.name == "ext3")) + or part.fs_type.name == "ext3" + or part.fs_type.name == "xfs")) parts = filter_partitions(disk, func) for part in parts: node = get_partition_name(part) - label = isys.readExt2Label(node) + label = isys.readFSLabel(node) if label: labels[node] = label for dev, devices, level, numActive in DiskSet.mdList: - label = isys.readExt2Label(dev) + label = isys.readFSLabel(dev) if label: labels[dev] = label diff -Naur anaconda-9.2/loader2/hdinstall.c anaconda-9.2-patched/loader2/hdinstall.c --- anaconda-9.2/loader2/hdinstall.c 2003-10-15 01:06:32.000000000 +0530 +++ anaconda-9.2-patched/loader2/hdinstall.c 2003-11-07 18:01:19.000000000 +0530 @@ -315,7 +315,7 @@ char * url; char filespec[1024]; char * path; - char *typetry[] = {"ext2", "vfat", NULL}; + char *typetry[] = {"ext2", "xfs", "jfs", "reiserfs", "vfat", NULL}; char **type; logMessage("mounting device %s for hard drive install", device);
--- anaconda-9.0.96/scripts/upd-instroot.orig 2003-10-08 01:33:15.000000000 +0530 +++ anaconda-9.0.96/scripts/upd-instroot 2003-10-23 20:23:25.000000000 +0530 @@ -110,7 +110,8 @@ bzip2-libs dosfstools pciutils reiserfs-utils parted sed busybox-anaconda rpm-python booty hdparm lvm beecrypt rhpl pyxf86config libxml2 libxml2-python glib2 - elfutils-libelf bogl-bterm bogl krb5-libs convertdb1 jfsutils" + elfutils-libelf bogl-bterm bogl krb5-libs convertdb1 jfsutils + xfsprogs xfsdump dmapi libacl libattr attr acl" if [ $ARCH = i386 -o $ARCH = x86_64 ]; then PACKAGES="$PACKAGES kernel-pcmcia-cs kernel-utils" @@ -156,7 +157,8 @@ redhat-config-keyboard Xft fontconfig redhat-artwork ttfonts-ja ttfonts-zh_TW bitmap-fonts-cjk urw-fonts comps-extras XFree86-libs-data convertdb1 - vnc-server libjpeg tcp_wrappers redhat-config-date" + vnc-server libjpeg tcp_wrappers redhat-config-date + xfsprogs xfsdump dmapi libacl libattr attr acl" # # stuff ONLY included for rescue mode @@ -239,6 +241,9 @@ $LIBDIR/librt[-.]* $LIBDIR/libss* $LIBDIR/libtermcap* +$LIBDIR/libhandle* +$LIBDIR/libattr* +$LIBDIR/libdm* $LIBDIR/libutil* $LIBDIR/libuuid* sbin/badblocks @@ -250,6 +255,8 @@ sbin/e2label sbin/fsck.ext2 sbin/fsck.ext3 +sbin/fsck.jfs +sbin/fsck.xfs sbin/fdisk sbin/hdparm sbin/hwclock @@ -273,6 +280,7 @@ sbin/mkfs.ext2 sbin/mkfs.ext3 sbin/mkfs.jfs +sbin/mkfs.xfs sbin/mkfs.msdos sbin/mkfs.vfat sbin/mkreiserfs @@ -290,6 +298,12 @@ sbin/resize2fs sbin/sfdisk sbin/tune2fs +sbin/xfsdump +sbin/xfsrestore +sbin/xfs_repair +usr/sbin/xfs_db +usr/sbin/xfs_check +usr/sbin/xfs_copy sbin/vgcfgbackup sbin/vgcfgrestore sbin/vgchange --- anaconda-9.0.96/scripts/mk-images.i386.orig 2003-10-15 00:28:28.000000000 +0530 +++ anaconda-9.0.96/scripts/mk-images.i386 2003-10-23 20:15:27.000000000 +0530 @@ -92,7 +92,7 @@ IDEMODS="ide-cd" SCSIMODS="sd_mod sg sr_mod st" -FSMODS="msdos vfat ext3 reiserfs jfs" +FSMODS="msdos vfat ext3 reiserfs jfs xfs" SECSTAGE="agpgart md raid0 raid1 raid5 lvm-mod $FSMODS $IDEMODS $SCSIMODS $LATEUSBMODS st parport_pc parport" BTERMMODULES="vga16fb" --- anaconda-9.0.96/fsset.py.orig 2003-10-21 04:38:12.000000000 +0530 +++ anaconda-9.0.96/fsset.py 2003-10-23 20:13:19.000000000 +0530 @@ -51,12 +51,14 @@ availRaidLevels = ['RAID0', 'RAID1', 'RAID5'] def fileSystemTypeGetDefault(): - if fileSystemTypeGet('ext3').isSupported(): + if fileSystemTypeGet('xfs').isSupported(): + return fileSystemTypeGet('xfs') + elif fileSystemTypeGet('ext3').isSupported(): return fileSystemTypeGet('ext3') elif fileSystemTypeGet('ext2').isSupported(): return fileSystemTypeGet('ext2') else: - raise ValueError, "You have neither ext3 or ext2 support in your kernel!" + raise ValueError, "You have neither xfs, ext3 or ext2 support in your kernel!" def fileSystemTypeGet(key): @@ -397,9 +399,7 @@ self.name = "xfs" self.maxSizeMB = 1024 * 1024 self.maxLabelChars = 12 - # we don't even have the module, so it won't be mountable... but - # just in case - self.supported = 0 + self.supported = 1 def formatDevice(self, entry, progress, chroot='/'): devicePath = entry.device.setupDevice(chroot) --- anaconda-9.2/scripts/buildinstall.orig 2003-10-15 01:06:32.000000000 +0530 +++ anaconda-9.2/scripts/buildinstall 2003-11-07 16:10:43.000000000 +0530 @@ -122,7 +122,7 @@ if [ -x /usr/bin/runroot ]; then runroot $COMPNAME --onlyone --arch $BUILDARCH "$BUILDINSTALL --buildinstdir $BUILDINSTDIR --second $PKGORDERSTR --comp $COMPNAME --version $VERSION --release '\"$RELEASESTR\"' --product '\"$PRODUCTSTR\"' --prodpath $PRODUCTPATH $DIR" else - $BUILDINSTALL --buildinstdir $BUILDINSTDIR --second $PKGORDERSTR --comp $COMPNAME --version $VERSION --release \"$RELEASESTR\" --product \"$PRODUCTSTR\" --prodpath $PRODUCTPATH $DIR + $BUILDINSTALL --buildinstdir $BUILDINSTDIR --second $PKGORDERSTR --comp $COMPNAME --version $VERSION --release "$RELEASESTR" --product "$PRODUCTSTR" --prodpath $PRODUCTPATH $DIR fi rm -rf $BUILDINSTDIR