tools/livecd-iso-to-disk.sh | 36 ++++++++++++++++++++++++++++++------
1 file changed, 30 insertions(+), 6 deletions(-)
New commits:
commit 79ad977f7ae66dd4cdcbc6e3e6c224711a65eca1
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Thu Oct 2 22:24:47 2008 -0400
Set up persistent /home for the XO on the internal nand
Unless explicitly requested otherwise with --xo-no-home, use the /home
on the XO's NAND by default for /home. This helps us to keep the memory
footprint a little bit lower
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 27e59ec..5c20640 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -266,6 +266,9 @@ while [ $# -gt 2 ]; do
xo=1
xousb=1
;;
+ --xo-no-home)
+ xonohome=1
+ ;;
--extra-kernel-args)
kernelargs=$2
shift
@@ -496,6 +499,9 @@ fi
if [ -n "$xo" ]; then
echo "Setting up /olpc-usb.fth file"
args=$(egrep "^[ ]*append" $USBMNT/$SYSLINUXPATH/isolinux.cfg |head -n1 |sed -e 's/.*initrd=[^ ]*//')
+ if [ -n "$xonohome" -a ! -f $USBMNT/LiveOS/$HOMEFILE ]; then
+ args="$args persistenthome=mtd0"
+ fi
cat > $USBMNT/olpc-usb.fth <<EOF
\ Boot script for USB boot
patch 2drop erase claim-params
commit 5e8bf77037d0a83a95837111fd87263b7f5e0f9d
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Thu Oct 2 22:24:05 2008 -0400
Switch all references to home.img to be $HOMEFILE
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 7cb97af..27e59ec 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -226,6 +226,7 @@ fi
cryptedhome=1
keephome=1
+HOMEFILE="home.img"
while [ $# -gt 2 ]; do
case $1 in
--overlay-size-mb)
@@ -341,7 +342,7 @@ mount $mountopts $USBDEV $USBMNT || exitclean
trap exitclean SIGINT SIGTERM
-if [ -f "$USBMNT/LiveOS/home.img" -a -n "$keephome" -a -n "$homesizemb" ]; then
+if [ -f "$USBMNT/LiveOS/$HOMEFILE" -a -n "$keephome" -a -n "$homesizemb" ]; 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
@@ -355,7 +356,7 @@ else
fi
if [ -d $USBMNT/LiveOS ]; then
tbd=$(du -s -B 1M $USBMNT/LiveOS | awk {'print $1;'})
- [ -f $USBMNT/LiveOS/home.img ] && homesz=$(du -s -B 1M $USBMNT/LiveOS/home.img | awk {'print $1;'})
+ [ -f $USBMNT/LiveOS/$HOMEFILE ] && homesz=$(du -s -B 1M $USBMNT/LiveOS/$HOMEFILE | awk {'print $1;'})
[ -n "$homesz" -a -n "$keephome" ] && tbd=$(($tbd - $homesz))
else
tbd=0
@@ -374,7 +375,7 @@ fi
if [ -d $USBMNT/LiveOS -a -z "$force" ]; then
echo "Already set up as live image."
- if [ -z "$keephome" -a -e $USBMNT/LiveOS/home.img ]; then
+ if [ -z "$keephome" -a -e $USBMNT/LiveOS/$HOMEFILE ]; then
echo "WARNING: Persistent /home will be deleted!!!"
echo "Press Enter to continue or ctrl-c to abort"
read
@@ -382,7 +383,7 @@ if [ -d $USBMNT/LiveOS -a -z "$force" ]; then
echo "Deleting old OS in fifteen seconds..."
sleep 15
- [ -e "$USBMNT/LiveOS/home.img" -a -n "$keephome" ] && mv $USBMNT/LiveOS/home.img $USBMNT/home.img
+ [ -e "$USBMNT/LiveOS/$HOMEFILE" -a -n "$keephome" ] && mv $USBMNT/LiveOS/$HOMEFILE $USBMNT/$HOMEFILE
fi
rm -rf $USBMNT/LiveOS
@@ -392,7 +393,7 @@ echo "Copying live image to USB stick"
[ -z "$mactel" -a ! -d $USBMNT/$SYSLINUXPATH ] && mkdir -p $USBMNT/$SYSLINUXPATH
[ -n "$mactel" -a ! -d $USBMNT/EFI/boot ] && mkdir -p $USBMNT/EFI/boot
[ ! -d $USBMNT/LiveOS ] && mkdir $USBMNT/LiveOS
-[ -n "$keephome" -a -f "$USBMNT/home.img" ] && mv $USBMNT/home.img $USBMNT/LiveOS/home.img
+[ -n "$keephome" -a -f "$USBMNT/$HOMEFILE" ] && mv $USBMNT/$HOMEFILE $USBMNT/LiveOS/$HOMEFILE
# cases without /LiveOS are legacy detection, remove for F10
if [ -f $CDMNT/LiveOS/squashfs.img ]; then
cp $CDMNT/LiveOS/squashfs.img $USBMNT/LiveOS/squashfs.img || exitclean
@@ -465,7 +466,6 @@ fi
if [ -n "$homesizemb" ]; then
echo "Initializing persistent /home"
- HOMEFILE=home.img
if [ "$USBFS" = "vfat" ]; then
# vfat can't handle sparse files
dd if=/dev/zero of=$USBMNT/LiveOS/$HOMEFILE count=$homesizemb bs=1M
commit e4b03a3e249ecf550b40b659914b84210989b0e3
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue Sep 23 13:01:51 2008 -0400
Temporarily patch up ramdisk handling for XO via olpc.fth (from Mitch Bradley)
The XO firmware is loading the initrd at the wrong address which is what
was breaking the use of standard Fedora kernels. This does runtime
patching of ofw from the boot file until there's a new firmware
revision that we can require.
OFW code is from Mitch Bradley <wmb AT laptop DOT org>
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index b9b877b..7cb97af 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -498,6 +498,15 @@ if [ -n "$xo" ]; then
args=$(egrep "^[ ]*append" $USBMNT/$SYSLINUXPATH/isolinux.cfg |head -n1 |sed -e 's/.*initrd=[^ ]*//')
cat > $USBMNT/olpc-usb.fth <<EOF
\ Boot script for USB boot
+patch 2drop erase claim-params
+: high-ramdisk ( -- )
+ cv-load-ramdisk
+ h# 22c +lp l@ 1+ memory-limit umin /ramdisk - ( new-ramdisk-adr )
+ ramdisk-adr over /ramdisk move ( new-ramdisk-adr )
+ to ramdisk-adr
+;
+' high-ramdisk to load-ramdisk
+
" $args" to boot-file
" u:\syslinux\initrd0.img" to ramdisk
unfreeze
@@ -507,6 +516,15 @@ EOF
echo "Setting up /olpc-sd.fth file"
cat > $USBMNT/olpc-sd.fth <<EOF
\ Boot script for SD boot
+patch 2drop erase claim-params
+: high-ramdisk ( -- )
+ cv-load-ramdisk
+ h# 22c +lp l@ 1+ memory-limit umin /ramdisk - ( new-ramdisk-adr )
+ ramdisk-adr over /ramdisk move ( new-ramdisk-adr )
+ to ramdisk-adr
+;
+' high-ramdisk to load-ramdisk
+
" $args" to boot-file
" sd:\syslinux\initrd0.img" to ramdisk
unfreeze