Re: XFS and Anaconda

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2003-11-08 at 06:01, Ajay Ramaswamy wrote:
> I have been hacking away ata anaconda ever since FC1 got released and I have 
> come up with theses patches to get XFS support going in the installer. Please 
> take a look at hem and let me know if this is the right way to go.

General comments included below

> The last one (booty-grub-slow.patch) 
> modifies booty so that it waits for XFS to finish the sync before doing 
> anything more, without this tall previous XFS installers would hang at the 
> "installing bootloader" stage,

This feels very very very much like a hack.  Without better
justification as to why this helps, I'm going to mostly ignore this one
;-)

anaconda-xfs.patch
> --- 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!"

Not going to apply this bit, ext3 is going to remain the default for the
forseeable future :)
 
>  def fileSystemTypeGet(key):
> @@ -397,9 +399,7 @@
> -        # we don't even have the module, so it won't be mountable... but
> -        # just in case
> -        self.supported = 0
> +        self.supported = 1

Also not going to set as supported unconditionally at present. 
Surrounded to handle a boot parameter just like jfs and reiserfs for
now.

> --- 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

Something similar at least already applied from Forrest. 

With those changes, applied to CVS.

anaconda-xfs-label.patch
> 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
> @@ -2213,6 +2213,23 @@
> +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

This could traceback because buf might be less than 4 -- adjusted to
check the size of the buffer and return 0 early if it's not long enough.

> 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 
> +def readXFSLabel_int(device):
> +    if len(buf) != 128:
> +        xfslabel = None
> +
> +    if buf[0:4] == "XFSB":
> +        xfslabel = string.rstrip(buf[108:120],"\0x00")

Want to ensure xfslabel exists, so just define it as None and then do
if len(buf) == 128 and buf[0:4] == "XFSB"

> +def readFSLabel(device, makeDevNode = 1):
> +    label = readXFSLabel(device, makeDevNode)
> +    if (label == None):
> +        label = readExt2Label(device, makeDevNode)
> +    return label

Checking equality vs None can cause spurious results, you really want to
use label is None.  Also, I'd prefer to only check for the filesystem
type it is.  Will probably end up moving the isValidFoo() functions into
isys.py to be able to do so.
 
> 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 *typetry[] = {"ext2", "vfat", NULL};
> +    char *typetry[] = {"ext2", "xfs", "jfs", "reiserfs", "vfat",
> NULL};


This isn't going to work as the modules don't exist in the first stage
initrd.  

Otherwise, also basically applied.  Thanks for the patches.

Cheers,

Jeremy




[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux