imgcreate/kickstart.py | 19 +++++++++++--------
tools/livecd-iso-to-disk.sh | 40 +++++++++++++++++++++++++++++++---------
2 files changed, 42 insertions(+), 17 deletions(-)
New commits:
commit 3e8101049b2adfee2898bdf633f58671c792dd60
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Fri Oct 17 09:08:36 2008 -0400
Fix setting up persistent home on mtd for XO
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 0475b0a..0a1144d 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -513,7 +513,7 @@ fi
if [ -n "$xo" ]; then
echo "Setting up /boot/olpc.fth file"
args=$(egrep "^[ ]*append" $USBMNT/$SYSLINUXPATH/isolinux.cfg |head -n1
|sed -e 's/.*initrd=[^ ]*//')
- if [ -n "$xonohome" -a ! -f $USBMNT/LiveOS/$HOMEFILE ]; then
+ if [ -z "$xonohome" -a ! -f $USBMNT/LiveOS/$HOMEFILE ]; then
args="$args persistenthome=mtd0"
fi
if [ ! -d $USBMNT/boot ]; then mkdir -p $USBMNT/boot ; fi
commit 37a6ca3b713d23ca0da39eb501b83aab42a202e3
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Fri Oct 17 09:08:20 2008 -0400
More integer vs string munging
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 195786e..0475b0a 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -228,6 +228,7 @@ cryptedhome=1
keephome=1
homesizemb=0
swapsizemb=0
+overlaysizemb=0
HOMEFILE="home.img"
while [ $# -gt 2 ]; do
@@ -322,21 +323,21 @@ elif [ -n "$mactel" ]; then
fi
-if [ -n "$overlaysizemb" -a "$USBFS" = "vfat" ]; then
+if [ "$overlaysizemb" -gt 0 -a "$USBFS" = "vfat" ]; then
if [ "$overlaysizemb" -gt 2047 ]; then
echo "Can't have an overlay of 2048MB or greater on VFAT"
exitclean
fi
fi
-if [ -n "$homesizemb" -a "$USBFS" = "vfat" ]; then
+if [ "$homesizemb" -gt 0 -a "$USBFS" = "vfat" ]; then
if [ "$homesizemb" -gt 2047 ]; then
echo "Can't have a home overlay greater than 2048MB on VFAT"
exitclean
fi
fi
-if [ -n "$swapsizemb" -a "$USBFS" = "vfat" ]; then
+if [ "$swapsizemb" -gt 0 -a "$USBFS" = "vfat" ]; then
if [ "$swapsizemb" -gt 2047 ]; then
echo "Can't have a swap file greater than 2048MB on VFAT"
exitclean
@@ -376,7 +377,7 @@ free=$(df -B1M $USBDEV |tail -n 1 |awk {'print $4;'})
if [ $(($overlaysizemb + $homesizemb + $livesize + $swapsizemb)) -gt $(($free + $tbd)) ];
then
echo "Unable to fit live image + overlay on available space on USB stick"
echo "Size of live image: $livesize"
- [ -n "$overlaysizemb" ] && echo "Overlay size:
$overlaysizemb"
+ [ "$overlaysizemb" -gt 0 ] && echo "Overlay size:
$overlaysizemb"
[ "$homesizemb" -gt 0 ] && echo "Home overlay size:
$homesizemb"
[ "$swapsizemb" -gt 0 ] && echo "Home overlay size:
$swapsizemb"
echo "Available space: $(($free + $tbd))"
@@ -461,7 +462,7 @@ echo "Updating boot config file"
sed -i -e "s/CDLABEL=[^ ]*/$USBLABEL/" -e "s/rootfstype=[^
]*/rootfstype=$USBFS/" $BOOTCONFIG
if [ -n "$kernelargs" ]; then sed -i -e "s/liveimg/liveimg
${kernelargs}/" $BOOTCONFIG ; fi
-if [ -n "$overlaysizemb" ]; then
+if [ "$overlaysizemb" -gt 0 ]; then
echo "Initializing persistent overlay file"
OVERFILE="overlay-$( /lib/udev/vol_id -l $USBDEV )-$( /lib/udev/vol_id -u
$USBDEV )"
if [ "$USBFS" = "vfat" ]; then
commit 8b11d8f99119c4ff5f922286fbec67d8406b09a0
Author: Orion Poplawski <orion(a)cora.nwra.com>
Date: Fri Oct 17 09:07:13 2008 -0400
Support --defaultdesktop
livecd-creator ignores xconfig --defaultdesktop parameter. I have:
xconfig --startxonboot --defaultdesktop=KDE
but no /etc/sysconfig/desktop file is written.
This works for me, and seems pretty comparable to the code in anaconda.
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index d911925..01359e7 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -226,14 +226,17 @@ class ServicesConfig(KickstartConfig):
class XConfig(KickstartConfig):
"""A class to apply a kickstart X configuration to a
system."""
def apply(self, ksxconfig):
- if not ksxconfig.startX:
- return
- f = open(self.path("/etc/inittab"), "rw+")
- buf = f.read()
- buf = buf.replace("id:3:initdefault", "id:5:initdefault")
- f.seek(0)
- f.write(buf)
- f.close()
+ if ksxconfig.startX:
+ f = open(self.path("/etc/inittab"), "rw+")
+ buf = f.read()
+ buf = buf.replace("id:3:initdefault",
"id:5:initdefault")
+ f.seek(0)
+ f.write(buf)
+ f.close()
+ if ksxconfig.defaultdesktop:
+ f = open(self.path("/etc/sysconfig/desktop"), "w")
+ f.write("DESKTOP="+ksxconfig.defaultdesktop+"\n")
+ f.close()
class RPMMacroConfig(KickstartConfig):
"""A class to apply the specified rpm macros to the
filesystem"""
commit 0aadbdc442191e395ee7579716035df55c8d3ded
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Wed Oct 15 13:36:38 2008 -0400
Add support for setting up a swap
Allow setting up a swap on the usb stick/sd card. Also includes a fix from
David Zuhn <zoo AT stpaulterminal DOT org> to use ints instead of depending
on empty strings so we don't get an error from the bash math
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index d48f922..195786e 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -226,6 +226,9 @@ fi
cryptedhome=1
keephome=1
+homesizemb=0
+swapsizemb=0
+
HOMEFILE="home.img"
while [ $# -gt 2 ]; do
case $1 in
@@ -237,6 +240,10 @@ while [ $# -gt 2 ]; do
homesizemb=$2
shift
;;
+ --swap-size-mb)
+ swapsizemb=$2
+ shift
+ ;;
--crypted-home)
cryptedhome=1
;;
@@ -329,6 +336,13 @@ if [ -n "$homesizemb" -a "$USBFS" =
"vfat" ]; then
fi
fi
+if [ -n "$swapsizemb" -a "$USBFS" = "vfat" ]; then
+ if [ "$swapsizemb" -gt 2047 ]; then
+ echo "Can't have a swap file greater than 2048MB on VFAT"
+ exitclean
+ fi
+fi
+
# FIXME: would be better if we had better mountpoints
CDMNT=$(mktemp -d /media/cdtmp.XXXXXX)
mount -o loop,ro "$ISO" $CDMNT || exitclean
@@ -337,7 +351,7 @@ mount $mountopts $USBDEV $USBMNT || exitclean
trap exitclean SIGINT SIGTERM
-if [ -f "$USBMNT/LiveOS/$HOMEFILE" -a -n "$keephome" -a -n
"$homesizemb" ]; then
+if [ -f "$USBMNT/LiveOS/$HOMEFILE" -a -n "$keephome" -a
"$homesizemb" -gt 0 ]; then
echo "ERROR: Requested keeping existing /home and specified a size for
/home"
echo "Please either don't specify a size or specify --delete-home"
exitclean
@@ -359,11 +373,12 @@ fi
livesize=$(du -s -B 1M $check | awk {'print $1;'})
free=$(df -B1M $USBDEV |tail -n 1 |awk {'print $4;'})
-if [ $(($overlaysizemb + $homesizemb + $livesize)) -gt $(($free + $tbd)) ]; then
+if [ $(($overlaysizemb + $homesizemb + $livesize + $swapsizemb)) -gt $(($free + $tbd)) ];
then
echo "Unable to fit live image + overlay on available space on USB stick"
echo "Size of live image: $livesize"
[ -n "$overlaysizemb" ] && echo "Overlay size:
$overlaysizemb"
- [ -n "$homesizemb" ] && echo "Home overlay size:
$homesizemb"
+ [ "$homesizemb" -gt 0 ] && echo "Home overlay size:
$homesizemb"
+ [ "$swapsizemb" -gt 0 ] && echo "Home overlay size:
$swapsizemb"
echo "Available space: $(($free + $tbd))"
exitclean
fi
@@ -459,7 +474,13 @@ if [ -n "$overlaysizemb" ]; then
sed -i -e "s/\ ro\ /\ rw\ /" $BOOTCONFIG
fi
-if [ -n "$homesizemb" ]; then
+if [ "$swapsizemb" -gt 0 ]; then
+ echo "Initializing swap file"
+ dd if=/dev/zero of=$USBMNT/LiveOS/swap.img count=$swapsizemb bs=1M
+ mkswap -f $USBMNT/LiveOS/swap.img
+fi
+
+if [ "$homesizemb" -gt 0 ]; then
echo "Initializing persistent /home"
if [ "$USBFS" = "vfat" ]; then
# vfat can't handle sparse files
Show replies by date