Hiyas,

I would like to create a usb device that contains several live mediums. 
Afaics, this is currently not possible, unless I use a separate partition for 
each live medium, because they all expect LiveOS to be the directory 
containing some images. Attached is a patch agains mkliveinitrd from the 
current rawhide cvs repository that makes it possible to pass a "live_dir" 
kernel parameter, that is then used instead of LiveOS.

How do you like this patch and do I have to submit it via bugzilla to the 
mkinitrd component to get it included? Do you know other places on the live 
medium that use a hardcoded LiveOS directory?

Regards,
Till
diff -up mkinitrd-6.0.69/mkliveinitrd.liveOS_kernel_param mkinitrd-6.0.69/mkliveinitrd
--- mkinitrd-6.0.69/mkliveinitrd.liveOS_kernel_param	2008-10-29 22:31:43.000000000 +0100
+++ mkinitrd-6.0.69/mkliveinitrd	2008-11-04 10:03:15.000000000 +0100
@@ -256,6 +256,7 @@ eshell=0
 live_ram=0
 check_iso=0
 live_locale=""
+live_dir="LiveOS"
 overlay="off"
 
 # Parse kernel commandline options
@@ -286,6 +287,9 @@ for o in `cat /proc/cmdline` ; do
     live_locale=*)
         live_locale=${o#live_locale=}
         ;;
+    live_dir=*)
+        live_dir=${o#live_dir=}
+        ;;
     overlay)
         overlay=auto
         ;;
@@ -625,11 +629,11 @@ do_live_overlay() {
         # pathspec specified, extract
         pathspec=$( echo $overlay | sed -e 's/^.*://' )
     elif [ "x${overlay}" != "xoff" ]; then
-        pathspec="/LiveOS/overlay-$l-$u"
+        pathspec="/${live_dir}/overlay-$l-$u"
     fi
 
     if [ -z "$pathspec" -o "$pathspec" == "auto" ]; then
-        pathspec="/LiveOS/overlay-$l-$u"
+        pathspec="/${live_dir}/overlay-$l-$u"
     fi
     devspec=$( echo $overlay | sed -e 's/:.*$//' )
 
@@ -730,8 +734,8 @@ do_live_from_base_loop() {
 }
 
 # we might have a genMinInstDelta delta file for anaconda to take advantage of
-if [ -e /sysroot/LiveOS/osmin.img ]; then
-    OSMINSQFS=/sysroot/LiveOS/osmin.img
+if [ -e /sysroot/${live_dir}/osmin.img ]; then
+    OSMINSQFS=/sysroot/${live_dir}/osmin.img
 fi
 
 if [ -n "$OSMINSQFS" ]; then
@@ -748,8 +752,8 @@ fi
 
 # we might have an uncompressed embedded ext3  to use as rootfs (uncompressed live)
 #
-if [ -e /sysroot/LiveOS/ext3fs.img ]; then
-  EXT3FS="/sysroot/LiveOS/ext3fs.img"
+if [ -e /sysroot/${live_dir}/ext3fs.img ]; then
+  EXT3FS="/sysroot/${live_dir}/ext3fs.img"
 fi
 
 if [ -n "$EXT3FS" ] ; then
@@ -770,8 +774,8 @@ fi
 
 # we might have an embedded ext3 on squashfs to use as rootfs (compressed live)
 #
-if [ -e /sysroot/LiveOS/squashfs.img ]; then
-  SQUASHED="/sysroot/LiveOS/squashfs.img"
+if [ -e /sysroot/${live_dir}/squashfs.img ]; then
+  SQUASHED="/sysroot/${live_dir}/squashfs.img"
 fi
 
 if [ -e "$SQUASHED" ] ; then
@@ -800,7 +804,7 @@ if [ -e "$SQUASHED" ] ; then
     mount -n -t squashfs -o ro $SQUASHED_LOOPDEV /squashfs
 
     BASE_LOOPDEV=$( losetup -f )
-    losetup -r $BASE_LOOPDEV /squashfs/LiveOS/ext3fs.img
+    losetup -r $BASE_LOOPDEV /squashfs/${live_dir}/ext3fs.img
 
     umount -l /squashfs
     if [ "$live_ram" == "0" ] ; then

Attachment: signature.asc
Description: This is a digitally signed message part.

--
Fedora-livecd-list mailing list
Fedora-livecd-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-livecd-list

Reply via email to