[patch] anaconda-10.1.0.2-quotefstype.patch

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

 



Here's a quick patch for two related bugs that caught me until I found
the post here:
http://linux.derkeiler.com/Mailing-Lists/RedHat/2004-04/0332.html

Anaconda produces an incorrect anaconda-ks.cfg for LVM+MD by not quoting
the argument to --fstype. As the post suggests, you can simply remove
the --fstype <arg> part all together and anaconda will guess that the
fstype for anything starting with pv. should have the "physical volume
(LVM)" type. But, this patch makes it work as the ks file is currently
generated.

Also, treating the return from fstype.find( " " ) as a boolean doesn't
work because if the substring doesn't exits, it returns -1 which evals
true, so even fstypes without spaces would get quoted. Non-fatal, but I
think the generated ks file should be close to what is documented. So,
the patch checks that it returns a value > 0 instead. It could be > -1
if ever an fstype starting with a " " (space) would be valid, but I
doubt that would happen.

As the subject suggests, the patch is against 10.1.0.2 (FC3) as I don't
have Python 2.4 installed to build cvs HEAD, but it appears to apply
cleanly to the later.

-- 
Danen Br�Modwest Sr. Engineer
Powerful, Affordable Web Hosting
diff -ruN anaconda-10.1.0.2.orig/partitions.py anaconda-10.1.0.2.mod/partitions.py
--- anaconda-10.1.0.2.orig/partitions.py	2004-10-17 15:52:01.000000000 -0600
+++ anaconda-10.1.0.2.mod/partitions.py	2004-12-14 13:34:29.342492984 -0700
@@ -972,7 +972,7 @@
                 args.extend(["prepboot", "--fstype", "\"PPC PReP Boot\""])
             elif request.mountpoint:
                 fstype = request.fstype.getName()
-                if fstype.find(" "):
+                if fstype.find(" ") > 0:
                     fstype = "\"%s\"" %(fstype,)
                 args.append(request.mountpoint)
                 args.append("--fstype")
@@ -1042,8 +1042,11 @@
             if not request.format:
                 args.append("--noformat")
             if request.fstype:
+                fstype = request.fstype.getName()
+                if fstype.find(" ") > 0:
+                    fstype = "\"%s\"" %(fstype,)
                 args.append("--fstype")
-                args.append(request.fstype.getName())
+                args.append(fstype)
             if request.badblocks:
                 args.append("--badblocks")
 

[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