[Fedora-livecd-list] 3 commits - creator/livecd-creator creator/mayflower

Jeremy Katz katzj at fedoraproject.org
Wed Oct 10 15:58:04 UTC 2007


 creator/livecd-creator |   13 +++++++++++++
 creator/mayflower      |   17 +++++++++++++++++
 2 files changed, 30 insertions(+)

New commits:
commit 347f2c4fb3bdefd3a4a9ea20ac470b3a46e05f87
Author: Jeremy Katz <katzj at redhat.com>
Date:   Wed Oct 10 11:57:59 2007 -0400

    handle module options passed on the kernel command line as though built-in

diff --git a/creator/mayflower b/creator/mayflower
index 4b8cbe5..32cbaeb 100755
--- a/creator/mayflower
+++ b/creator/mayflower
@@ -78,6 +78,7 @@ cp /sbin/losetup sbin
 cp /sbin/blockdev sbin
 cp /sbin/dmsetup sbin
 cp /bin/dd bin
+cp /bin/cut bin
 
 # we explicitly load these, so should be sure they're present
 MODULES="loop dm_snapshot "
@@ -291,6 +292,19 @@ for o in \`cat /proc/cmdline\` ; do
     check)
         check_iso=1
         ;;
+    *)
+        m=\$(echo \$o |cut -s -d . -f 1)
+        opt=\$(echo \$o |cut -s -d . -f 2-)
+        if [ -z "\$m" -o -z "\$opt" ]; then
+          continue
+        fi
+        p=\$(echo \$opt |cut -s -d = -f 1)
+        v=\$(echo \$opt |cut -s -d = -f 2-)
+        if [ -z "\$p" -o -z "\$v" ]; then
+          continue
+        fi
+        echo "options \$m \$p=\$v" >> /etc/modprobe.conf
+        ;;
     esac
 done
 
@@ -603,6 +617,9 @@ do_live_from_base_loop() {
         echo "LANG=\$live_locale" > /sysroot/etc/sysconfig/i18n
     fi
 
+    # copy over module options
+    [ -f /etc/modprobe.conf ] && cat /etc/modprobe.conf >> /sysroot/etc/modprobe.conf
+
     # create rule so udev creates /dev/live symlink on real rootfs
     if [ -n "\$CDLABEL" ]; then
        echo "KERNEL==\"hd[a-z]\", BUS==\"ide\", SYSFS{removable}==\"1\", ATTRS{media}==\"cdrom\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"\$CDLABEL\", SYMLINK+=\"live\"" >> /sysroot/etc/udev/rules.d/50-udev*


commit 72d2c7c117b2b0da62f3fba5ad071fd24c9c0afb
Author: Jeremy Katz <katzj at redhat.com>
Date:   Wed Oct 10 11:57:47 2007 -0400

    make sure that /etc/resolv.conf and /etc/modprobe.conf are present on the image

diff --git a/creator/livecd-creator b/creator/livecd-creator
index dd4c6d6..bc1917f 100755
--- a/creator/livecd-creator
+++ b/creator/livecd-creator
@@ -823,6 +823,12 @@ class ImageCreator(object):
             f.write(buf)
             f.close()
 
+        # touch some files which get unhappy if they're not labeled correctly
+        for fn in ("/etc/modprobe.conf", "/etc/resolv.conf"):
+            path = instroot + fn
+            f = file(path, "w+")
+            os.chmod(path, 0644)
+
     def runPost(self):
         instroot = "%s/install_root" %(self.build_dir,)        
         # and now, for arbitrary %post scripts


commit 7b03209c5b689caf5377a7997eaa0ad64ff36c2e
Author: Jeremy Katz <katzj at redhat.com>
Date:   Tue Oct 9 12:57:31 2007 -0400

    remove the lingering yum.conf

diff --git a/creator/livecd-creator b/creator/livecd-creator
index 34885af..dd4c6d6 100755
--- a/creator/livecd-creator
+++ b/creator/livecd-creator
@@ -218,6 +218,13 @@ class LiveCDYum(yum.YumBase):
         # being left and an inability to clean up after ourself
         pass
 
+    def close(self):
+        try:
+            os.unlink(self.conf.installroot + "/yum.conf")
+        except:
+            pass
+        yum.YumBase.close(self)
+
     def _writeConf(self, datadir, installroot):
         conf  = "[main]\n"
         conf += "installroot=%s\n" % installroot





More information about the Fedora-livecd-list mailing list