<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Frederick:<br>
<br>
I have been trying to make this work...<br>
I created with liveusb-creator a 4GB USB with persistence 2400 of iso
soas--------328; using a usb 500GB HD install of f13 Beta1 Gnome + sugar<br>
rebooted with the new USB <br>
in sugar terminal:<br>
su -<br>
yum install wget gedit<br>
wget <a class="moz-txt-link-freetext" href="http://(path">http://(path</a> to soas nightly composes/soas/......328<br>
(loaded in /home/liveuser/)<br>
opened with gedit <a class="moz-txt-link-rfc2396E" href="mailto:soas@lists.sugarlabs.org">"soas@lists.sugarlabs.org"</a> from a 2nd USB in sugar
frame<br>
saved it in /home/liveuser/<br>
chmod 077 modified_livecd-iso-to-disk script<br>
If I do a "ls" I see both in /home/liveuser<br>
then I get lost on how to use your script<br>
<br>
I tried in root:<br>
/home/liveuser/ modified_livecd-iso-to-disk --noverify --delete-home
--extra-kernel-args selinux=0 --copy-overlay /dev/live /devsde1<br>
<br>
new target usb is /dev/sde1 formatted ext3 with boot flag<br>
&nbsp;I got this error msg <br>
<br>
mount:<br>
wrong fs type, bad option, bad superblock on /dev/loo5,<br>
missing codepage, or helper program, or other error<br>
<br>
Cleaning up to exit...<br>
<br>
Any help would be appreciated<br>
<br>
Do I have to use your script to create the USB? vs using graphical
liveusb-creator to make this work?<br>
<br>
Tom Gilliard<br>
satellit<br>
<br>
Frederick Grose wrote:
<blockquote
 cite="mid:f3383f811003291258p99bf9fch88159f4f50d30ed2@mail.gmail.com"
 type="cite">
  <pre wrap="">On Sun, Mar 28, 2010 at 12:55 PM, Sebastian Dziallas <a class="moz-txt-link-rfc2396E" href="mailto:sebastian@when.com">&lt;sebastian@when.com&gt;</a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi all,

it would be great if somebody could give this standard procedure a try
and confirm whether it works or not, so that we can react appropriately
upon a ticket. You'll need two USB keys for this.

(1) use Fedora's LiveUSB Creator to prepare the first key with SoaS

(2) boot the first key and apply some changes as in:

&nbsp; &nbsp; &nbsp; &nbsp;(a) change the language
&nbsp; &nbsp; &nbsp; &nbsp;(b) download a number of activities

(3) plug in the second USB key and determine its mount point

(4) run as root on the first key: yum install livecd-tools (might or
might not be already present, depending on which SoaS version you use)

(5) execute the following command from the terminal on the first key:

&nbsp; &nbsp; &nbsp; &nbsp;livecd-iso-to-disk --overlay-size-mb 300 /dev/sr0 /dev/sdc1

(in which case /dev/sdc1 would be the mount point of the second key)

Does this [ ] WORK or [ ] FAIL? Please let us know!

Thanks,
--Sebastian
_______________________________________________
SoaS mailing list
<a class="moz-txt-link-abbreviated" href="mailto:SoaS@lists.sugarlabs.org">SoaS@lists.sugarlabs.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sugarlabs.org/listinfo/soas">http://lists.sugarlabs.org/listinfo/soas</a>
    </pre>
  </blockquote>
  <pre wrap=""><!---->
I've tested a different approach with some success for customizing and
replicating a LiveUSB image:

1. Downloaded <a class="moz-txt-link-freetext" href="http://alt.fedoraproject.org/pub/alt/nightly-composes/soas/soas-i386-20100327.19.iso">http://alt.fedoraproject.org/pub/alt/nightly-composes/soas/soas-i386-20100327.19.iso</a>

2. In Fedora13 (32-bit), ran this script:
&nbsp; &nbsp;&nbsp;modified_livecd-iso-to-disk --overlay-size-mb 400 --delete-home
--extra-kernel-args selinux=0 /path_to_soas-i386-20100327.19.iso
/dev/sdb1

3. Booted the LiveUSB device1 and made a few changes.

4. Mounted a second USB device2 on an extended USB port on my monitor,
confirmed its partition name as /dev/sdc1, then unmounted it.

5. Mounted my Fedora13 partition (/dev/sda1) onto the device1 LiveUSB
image, and ran this script in the Sugar Terminal:
&nbsp; &nbsp;/mnt/F13/home/account/.../ modified_livecd-iso-to-disk --noverify
--delete-home --extra-kernel-args selinux=0 --copy-overlay /dev/live
/dev/sdc1

6. Shutdown and swapped USB devices in order to boot device2 from the
motherboard USB port.

7. Confirmed that I had a replicated image with the copied overlay file.

8. More testing needed.

The modified script is attached.

Here is the diff from the current tools_livecd-iso-to-disk:

--- tools_livecd-iso-to-disk.sh
+++ modified_livecd-iso-to-disk
@@ -308,6 +308,9 @@
&nbsp; &nbsp;overlaysizemb=$2
&nbsp; &nbsp;shift
&nbsp; &nbsp;;;
+ --copy-overlay)
+ &nbsp; &nbsp;copyoverlay=1
+ &nbsp; &nbsp;;;
--home-size-mb)
&nbsp; &nbsp;checkint $2
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; homesizemb=$2
@@ -481,6 +484,13 @@
&nbsp; tbd=0
fi
livesize=$(du -s -B 1M $check | awk {'print $1;'})
+if [ ! -n "$copyoverlay" ]; then
+ &nbsp;OVERLAYFILE="overlay-$( /sbin/blkid -s LABEL -o value $ISO )-$(
/sbin/blkid -s UUID -o value $ISO )"
+ &nbsp;if [ -f $check/$OVERLAYFILE ]; then
+ &nbsp; &nbsp; copyoverlaysize=$(du -s -B 1M $check/$OVERLAYFILE | awk {'print $1;'})
+ &nbsp; &nbsp; livesize=$(($livesize - $copyoverlaysize))
+ &nbsp;fi
+fi
if [ -n "$skipcompress" ]; then
&nbsp; &nbsp; if [ -e $CDMNT/LiveOS/squashfs.img ]; then
if mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT; then
@@ -572,8 +582,16 @@
&nbsp; if [ -f $CDMNT/LiveOS/osmin.img ]; then
&nbsp; &nbsp; &nbsp; cp $CDMNT/LiveOS/osmin.img $USBMNT/$LIVEOS/osmin.img || exitclean
&nbsp; fi
+ &nbsp;if [ -n "$copyoverlay" ]; then
+ &nbsp; &nbsp; &nbsp;OVERLAYFILE="overlay-$( /sbin/blkid -s LABEL -o value $ISO )-$(
/sbin/blkid -s UUID -o value $ISO )"
+ &nbsp; &nbsp; &nbsp;cp $CDMNT/LiveOS/$OVERLAYFILE $USBMNT/$LIVEOS/$OVERLAYFILE || exitclean
+ &nbsp;fi
fi

+# copy this installer script to enable the new installation to
replicate the image
+SCRIPT=$(readlink -f $0)
+cp -f $SCRIPT $USBMNT/$LIVEOS/livecd-iso-to-disk
+
# DVD installer copy
if [ "$isotype" = "installer" ] &amp;&amp; [ -z "$skipcopy" ]; then
&nbsp; &nbsp; &nbsp; echo "Copying DVD image to USB stick<a class="moz-txt-link-rfc2396E" href="mailto:@@-582,7+600,18@@&nbsp;&nbsp;&nbsp;cp$ISO$USBMNT/fi-cp$CDMNT/isolinux/*$USBMNT/$SYSLINUXPATH+#adjustsyslinuxsourcesforreplicationofinstalledimagesbetweenfilesystemtypes+if[-d$CDMNT/isolinux/];then+&nbsp;&nbsp;cp$CDMNT/isolinux/*$USBMNT/$SYSLINUXPATH+elif[-d$CDMNT/syslinux/];then+&nbsp;&nbsp;cp$CDMNT/syslinux/*$USBMNT/$SYSLINUXPATH+&nbsp;&nbsp;if[-f$CDMNT/syslinux/extlinux.conf];then+&nbsp;&nbsp;&nbsp;&nbsp;mv$USBMNT/$SYSLINUXPATH/extlinux.conf$USBMNT/$SYSLINUXPATH/isolinux.cfg+&nbsp;&nbsp;elif[-f$CDMNT/syslinux/syslinux.cfg];then+&nbsp;&nbsp;&nbsp;&nbsp;mv$USBMNT/$SYSLINUXPATH/syslinux.cfg$USBMNT/$SYSLINUXPATH/isolinux.cfg+&nbsp;&nbsp;fi+fi+BOOTCONFIG=$USBMNT/$SYSLINUXPATH/isolinux.cfg#Setthistonothingsoseddoesn'tcareBOOTCONFIG_EFI=@@-594,6+623,9@@&nbsp;rm-f$USBMNT/EFI/boot/grub.conffi+#restorebootconfigfiletobasestatebeforeupdating+sed-i-e">"
@@ -582,7 +600,18 @@
&nbsp; &nbsp; &nbsp; cp $ISO $USBMNT/
fi

-cp $CDMNT/isolinux/* $USBMNT/$SYSLINUXPATH
+# adjust syslinux sources for replication of installed images between
filesystem types
+if [ -d $CDMNT/isolinux/ ]; then
+ &nbsp; &nbsp;cp $CDMNT/isolinux/* $USBMNT/$SYSLINUXPATH
+elif [ -d $CDMNT/syslinux/ ]; then
+ &nbsp; &nbsp;cp $CDMNT/syslinux/* $USBMNT/$SYSLINUXPATH
+ &nbsp; &nbsp;if [ -f $CDMNT/syslinux/extlinux.conf ]; then
+ &nbsp; &nbsp; &nbsp; &nbsp;mv $USBMNT/$SYSLINUXPATH/extlinux.conf
$USBMNT/$SYSLINUXPATH/isolinux.cfg
+ &nbsp; &nbsp;elif [ -f $CDMNT/syslinux/syslinux.cfg ]; then
+ &nbsp; &nbsp; &nbsp; &nbsp;mv $USBMNT/$SYSLINUXPATH/syslinux.cfg
$USBMNT/$SYSLINUXPATH/isolinux.cfg
+ &nbsp; &nbsp;fi
+fi
+
BOOTCONFIG=$USBMNT/$SYSLINUXPATH/isolinux.cfg
# Set this to nothing so sed doesn't care
BOOTCONFIG_EFI=
@@ -594,6 +623,9 @@
&nbsp; rm -f $USBMNT/EFI/boot/grub.conf
fi

+# restore boot config file to base state before updating
+sed -i -e "</a>s/root=[^ ]*/root=CDLABEL=name/" -e "s/liveimg .*
quiet/liveimg quiet/" $BOOTCONFIG $BOOTCONFIG_EFI
+
echo "Updating boot config file"
# adjust label and fstype
sed -i -e "s/CDLABEL=[^ ]*/$USBLABEL/" -e "s/rootfstype=[^
]*/rootfstype=$USBFS/" -e "s/LABEL=[^ ]*/$USBLABEL/" $BOOTCONFIG
$BOOTCONFIG_EFI
@@ -617,6 +649,11 @@
&nbsp; &nbsp; fi
&nbsp; &nbsp; sed -i -e "s/liveimg/liveimg overlay=${USBLABEL}/" $BOOTCONFIG
$BOOTCONFIG_EFI
&nbsp; &nbsp; sed -i -e "s/\ ro\ /\ rw\ /" $BOOTCONFIG &nbsp;$BOOTCONFIG_EFI
+elif [ -n "$copyoverlay" ]; then
+ &nbsp; &nbsp;OVERFILE="overlay-$( /sbin/blkid -s LABEL -o value $USBDEV )-$(
/sbin/blkid -s UUID -o value $USBDEV )"
+ &nbsp; &nbsp;mv $USBMNT/$LIVEOS/$OVERLAYFILE $USBMNT/$LIVEOS/$OVERFILE
+ &nbsp; &nbsp;sed -i -e "s/liveimg/liveimg overlay=${USBLABEL}/" $BOOTCONFIG
$BOOTCONFIG_EFI
+ &nbsp; &nbsp;sed -i -e "s/\ ro\ /\ rw\ /" $BOOTCONFIG $BOOTCONFIG_EFI
fi

if [ "$swapsizemb" -gt 0 ]; then

*********************End of diff***************************

Notes:

The script changes deal with the different location and names
(syslinux.cfg/extlinux.conf/isolinux.cfg) used by the syslinux
convention that would confuse an installation from one LiveUSB
filesystem type to another, for example, vfat to ext23.
(I'm not familiar with the sources for the configuration files, so
there may be some better way to address this.)

This script allows one to use the optional installation parameters of
livecd-iso-to-disk to customize the new installation structure.  I
have examined or tested all the possible code paths, so close
examination and testing is needed before it could be accepted
upstream.

Note, there is a --skipcompress option that might be of interest to
those who would rather have a full ext23 embedded on the LiveUSB.  The
relavent code is here:
  if [ -n "$skipcompress" -a -f $CDMNT/LiveOS/squashfs.img ]; then
      mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT || exitclean
      cp $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img ||
(umount $CDMNT ; exitclean)
      umount $CDMNT
  elif [ -f $CDMNT/LiveOS/squashfs.img ]; then
      cp $CDMNT/LiveOS/squashfs.img $USBMNT/$LIVEOS/squashfs.img || exitclean
  elif [ -f $CDMNT/LiveOS/ext3fs.img ]; then
      cp $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || exitclean
  fi

More work is needed to protect the
/home/liveuser/.sugar/default/owner.key files from the copy.

Hope this helps advance the easy customization and replication of
LiveUSB images.

          --Fred
  </pre>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
SoaS mailing list
<a class="moz-txt-link-abbreviated" href="mailto:SoaS@lists.sugarlabs.org">SoaS@lists.sugarlabs.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sugarlabs.org/listinfo/soas">http://lists.sugarlabs.org/listinfo/soas</a>
  </pre>
</blockquote>
</body>
</html>