[Fedora-livecd-list] 3 commits - config/livecd-fedora-base-desktop.ks imgcreate/yuminst.py

Jeremy Katz katzj at fedoraproject.org
Tue Apr 15 03:11:49 UTC 2008


 config/livecd-fedora-base-desktop.ks |   80 +++++++++++++++++++++++------------
 imgcreate/yuminst.py                 |   20 +++-----
 2 files changed, 61 insertions(+), 39 deletions(-)

New commits:
commit 5bda5e32507cc79a7e63330491cbc45eb990e6fa
Author: Jeremy Katz <katzj at redhat.com>
Date:   Mon Apr 14 22:59:43 2008 -0400

    Add fedora-livecd-late initscript
    
    Move things which depend on hal (s-c-display and anaconda) so that they're
    run in a new initscripts which is after hal starts.

diff --git a/config/livecd-fedora-base-desktop.ks b/config/livecd-fedora-base-desktop.ks
index b3c418d..e29abdf 100644
--- a/config/livecd-fedora-base-desktop.ks
+++ b/config/livecd-fedora-base-desktop.ks
@@ -92,27 +92,6 @@ if [ -b /dev/live ]; then
    mount -o ro /dev/live /mnt/live
 fi
 
-# read some variables out of /proc/cmdline
-for o in \`cat /proc/cmdline\` ; do
-    case \$o in
-    ks=*)
-        ks="\${o#ks=}"
-        ;;
-    xdriver=*)
-        xdriver="--set-driver=\${o#xdriver=}"
-        ;;
-    esac
-done
-
-
-# if liveinst or textinst is given, start anaconda
-if strstr "\`cat /proc/cmdline\`" liveinst ; then
-   /usr/sbin/liveinst \$ks
-fi
-if strstr "\`cat /proc/cmdline\`" textinst ; then
-   /usr/sbin/liveinst --text \$ks
-fi
-
 # enable swaps unless requested otherwise
 swaps=\`blkid -t TYPE=swap -o device\`
 if ! strstr "\`cat /proc/cmdline\`" noswap -a [ -n "\$swaps" ] ; then
@@ -121,11 +100,6 @@ if ! strstr "\`cat /proc/cmdline\`" noswap -a [ -n "\$swaps" ] ; then
   done
 fi
 
-# configure X, allowing user to override xdriver
-if [ -n "\$xdriver" ]; then
-   exists system-config-display --noui --reconfig --set-depth=24 \$xdriver
-fi
-
 # add fedora user with no passwd
 useradd -c "Fedora Live" fedora
 passwd -d fedora > /dev/null
@@ -156,6 +130,56 @@ touch /media/.hal-mtab
 sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
 EOF
 
+# bah, hal starts way too late
+cat > /etc/rc.d/init.d/fedora-late-live << EOF
+#!/bin/bash
+#
+# live: Late init script for live image
+#
+# chkconfig: 345 99 01
+# description: Late init script for live image.
+
+. /etc/init.d/functions
+
+if ! strstr "\`cat /proc/cmdline\`" liveimg || [ "\$1" != "start" ] || [ -e /.liveimg-late-configured ] ; then
+    exit 0
+fi
+
+exists() {
+    which \$1 >/dev/null 2>&1 || return
+    \$*
+}
+
+touch /.liveimg-late-configured
+
+# read some variables out of /proc/cmdline
+for o in \`cat /proc/cmdline\` ; do
+    case \$o in
+    ks=*)
+        ks="\${o#ks=}"
+        ;;
+    xdriver=*)
+        xdriver="--set-driver=\${o#xdriver=}"
+        ;;
+    esac
+done
+
+
+# if liveinst or textinst is given, start anaconda
+if strstr "\`cat /proc/cmdline\`" liveinst ; then
+   /usr/sbin/liveinst \$ks
+fi
+if strstr "\`cat /proc/cmdline\`" textinst ; then
+   /usr/sbin/liveinst --text \$ks
+fi
+
+# configure X, allowing user to override xdriver
+if [ -n "\$xdriver" ]; then
+   exists system-config-display --noui --reconfig --set-depth=24 \$xdriver
+fi
+
+EOF
+
 # workaround avahi segfault (#279301)
 touch /etc/resolv.conf
 /sbin/restorecon /etc/resolv.conf
@@ -164,6 +188,10 @@ chmod 755 /etc/rc.d/init.d/fedora-live
 /sbin/restorecon /etc/rc.d/init.d/fedora-live
 /sbin/chkconfig --add fedora-live
 
+chmod 755 /etc/rc.d/init.d/fedora-late-live
+/sbin/restorecon /etc/rc.d/init.d/fedora-late-live
+/sbin/chkconfig --add fedora-late-live
+
 # save a little bit of space at least...
 rm -f /boot/initrd*
 # make sure there aren't core files lying around


commit 51c80b12c12f256982cee3f71ae5360292f60211
Author: Jeremy Katz <katzj at redhat.com>
Date:   Mon Apr 14 22:02:17 2008 -0400

    Clean up the output a little bit

diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 9ddac7e..9d585ec 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -166,4 +166,6 @@ class LiveCDYum(yum.YumBase):
         cb = callback.RPMInstallCallback()
         cb.tsInfo = self.tsInfo
         cb.filelog = False
-        return self.runTransaction(cb)
+        ret = self.runTransaction(cb)
+        print ""
+        return ret


commit f8078c51851f735a15d1b8ae5130861e36854a70
Author: Jeremy Katz <katzj at redhat.com>
Date:   Mon Apr 14 21:57:16 2008 -0400

    Fix odd traceback error on __del__ (#442443)
    
    Avoid weird (ignored) traceback when tearing things down.  We already make
    sure that the yum object gets closed, so just pass on the yum __del__

diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 23804bc..9ddac7e 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -48,18 +48,10 @@ class LiveCDYum(yum.YumBase):
             os.unlink(self.conf.installroot + "/yum.conf")
         except:
             pass
-        try:
-            yum.YumBase.close(self)
-        except AttributeError:
-            # FIXME: Make one last ditch effort to close fds still open
-            # in the install root; this is only needed when
-            # there's no way to ask yum to close its sqlite dbs,
-            # though. See https://bugzilla.redhat.com/236409
-            for i in range(3, os.sysconf("SC_OPEN_MAX")):
-                try:
-                    os.close(i)
-                except:
-                    pass
+        yum.YumBase.close(self)
+
+    def __del__(self):
+        pass
 
     def _writeConf(self, confpath, installroot):
         conf  = "[main]\n"





More information about the Fedora-livecd-list mailing list