<font color="#000099"><font><font face="trebuchet ms,sans-serif"></font></font></font>On Thu, Mar 29, 2012 at 8:51 PM, Frederick Grose <span dir="ltr"><<a href="mailto:fgrose@gmail.com" target="_blank">fgrose@gmail.com</a>></span> wrote:<br>

<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><font color="#000099"><font><font face="trebuchet ms,sans-serif"></font></font></font>On Mon, Mar 26, 2012 at 12:02 PM, Frederick Grose <span dir="ltr"><<a href="mailto:fgrose@gmail.com" target="_blank">fgrose@gmail.com</a>></span> wrote:<br>


</div></div><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font><font face="trebuchet ms,sans-serif">Please note that the current Fedora-17-Beta-TC2-Live images lack</font></font><div>


<font><font face="trebuchet ms,sans-serif">some traditional </font></font><span style="font-family:'trebuchet ms',sans-serif">Live CD/USB features.</span><div>

<font><font face="trebuchet ms,sans-serif"><br></font></font></div><div><font><font face="trebuchet ms,sans-serif">See this bug report.</font></font></div><div><div><a href="https://bugzilla.redhat.com/show_bug.cgi?id=740280" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=740280</a></div>




</div><div><br></div><div>/dev/live was a link to the installation partition on the Live USB, such as /dev/sdc1,</div><div>or /dev/sr0 on a Live CD/DVD.</div><div><br></div><div>How would a script determine this partition without human input?</div>




<div><br></div><div>/mnt/live was a convenient mounting of the installation partition filesystem.</div><div>It allowed easy access to pre-existing content on the Live USB device or to</div><div>the /LiveOS and /syslinux directories.</div>




<div><br></div><div>The --home-size-mb NNN option of livecd-iso-to-disk produced a /LiveOS/home.img</div><div>filesystem for the liveuser's home directory.</div><div><br></div><div>This feature made possible the --encrypted-home option, which would secure the privacy of a user directory on a Live USB system.</div>




<div><br></div><div>The home.img filesystem was also read/write/delete without consuming the LiveOS overlay.  This is important for non-short-term Live USB deployments, such as Sugar on a Stick, where overlay exhaustion can be a significant problem.</div>




<div><br></div><div>Is there a workaround for these (missing) features?</div><div><br></div><div>       --Fred</div></div></blockquote></div></div><div><br>This patch restores the lost features:<br><br><span style="font-family:courier new,monospace">commit 1580cddaea504efd68c5e10fee70e09d7e81d86b</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">Author: Frederick Grose <<a href="mailto:fgrose@sugarlabs.org" target="_blank">fgrose@sugarlabs.org</a>></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">Date:   Thu Mar 29 16:27:30 2012 -0400</span><br style="font-family:courier new,monospace">


<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    Mount live device on /mnt/live, link it to /dev/live</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    </span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">    This enables the mounting of /LiveOS/home.img, if present.</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">diff --git a/fedora-live-base.ks b/fedora-live-base.ks</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">index 0b14fec..0cf0fb2 100644</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">--- a/fedora-live-base.ks</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">+++ b/fedora-live-base.ks</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">@@ -88,10 +88,22 @@ touch /.liveimg-configured</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace"> # Make sure we don't mangle the hardware clock on shutdown</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> ln -sf /dev/null /etc/systemd/system/hwclock-save.service</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace"> </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+findmount() {</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+    local info=()</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">+    while read -a info; do</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+        if [[ ${info[4]} == $1 ]]; then</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">+            echo ${info[8]}</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+            break;</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">+        fi</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+        done < /proc/self/mountinfo</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">+}</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # mount live image</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">-if [ -b \`readlink -f /dev/live\` ]; then</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+livedev=$(findmount /run/initramfs/live)</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">+if [[ -b $livedev ]]; then</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    mkdir -p /mnt/live</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">-   mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+   mount -o ro $livedev /mnt/live 2>/dev/null || mount $livedev /mnt/live</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">+   ln -s $livedev /dev/live</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fi</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace"> </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> livedir="LiveOS"</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">@@ -220,7 +232,7 @@ if strstr "\`cat /proc/cmdline\`" CDLABEL= ; then</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # io errors due to not being able to get files...</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace"> #cat /sbin/halt > /dev/null</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #cat /sbin/reboot > /dev/null</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">-#/usr/sbin/eject -p -m \$(readlink -f /dev/live) >/dev/null 2>&1</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+#/usr/sbin/eject -p -m \$livedev >/dev/null 2>&1</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace"> #echo "Please remove the CD from your drive and press Enter to finish restarting"</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #read -t 30 < /dev/console</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace"> FOE </span><br></div></div></blockquote><div><br><pre style="font-family:courier new,monospace" class="bz_comment_text" id="comment_text_23"><font>With Fedora-17.TC2-x86_64-Live-Desktop.iso we have
/run/initramfs/livedev as a symlink to the block device for the source
partition &
/run/initramfs/live as the mount point for that filesystem.

This substitute patch enables the mounting of home.img and swap.img filesystems
with the substitute paths:<br><br>(Tested as applied to /etc/rc.d/init.d/livesys on an installed Live USB.)<br></font></pre><font><span style="font-family:courier new,monospace"></span></font></div></div><br><span style="font-family:courier new,monospace">commit e2a04b06093fcea1b0c6ecfc59847adc08d08137</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">Author: Frederick Grose <<a href="mailto:fgrose@sugarlabs.org">fgrose@sugarlabs.org</a>></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">Date:   Mon Apr 30 00:03:02 2012 -0400</span><br style="font-family:courier new,monospace">

<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    Substitute /run/initramfs/live for /mnt/live.</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    </span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">    This is needed to enable mounting of home.img and swap.img in</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    Fedora 17 LiveOS installations.</span><br style="font-family:courier new,monospace">

<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">diff --git a/fedora-live-base.ks b/fedora-live-base.ks</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">index 0b14fec..54df915 100644</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">--- a/fedora-live-base.ks</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+++ b/fedora-live-base.ks</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">@@ -88,12 +88,6 @@ touch /.liveimg-configured</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # Make sure we don't mangle the hardware clock on shutdown</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace"> ln -sf /dev/null /etc/systemd/system/hwclock-save.service</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> </span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">-# mount live image</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">-if [ -b \`readlink -f /dev/live\` ]; then</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">-   mkdir -p /mnt/live</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">-   mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">-fi</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">-</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> livedir="LiveOS"</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace"> for arg in \`cat /proc/cmdline\` ; do</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">   if [ "\${arg##live_dir=}" != "\${arg}" ]; then</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">@@ -109,8 +103,9 @@ if ! strstr "\`cat /proc/cmdline\`" noswap && [ -n "\$swaps" ] ; then</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">     action "Enabling swap partition \$s" swapon \$s</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">   done</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fi</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">-if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /mnt/live/\${livedir}/swap.img ] ; then</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">-  action "Enabling swap file" swapon /mnt/live/\${livedir}/swap.img</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+if ! strstr "$(cat /proc/cmdline)" noswap &&</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">+    [[ -f /run/initramfs/live/${livedir}/swap.img ]] ; then</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+  action "Enabling swap file" swapon /run/initramfs/live/${livedir}/swap.img</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace"> fi</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> mountPersistentHome() {</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">@@ -125,8 +120,8 @@ mountPersistentHome() {</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">     mountopts="-t jffs2"</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">   elif [ ! -b "\$homedev" ]; then</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">     loopdev=\`losetup -f\`</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">-    if [ "\${homedev##/mnt/live}" != "\${homedev}" ]; then</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">-      action "Remounting live store r/w" mount -o remount,rw /mnt/live</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">+    if [[ ${homedev##/run/initramfs/live} != ${homedev} ]]; then</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+      action "Remounting live store r/w" mount -o remount,rw /run/initramfs/live</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">     fi</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">     losetup \$loopdev \$homedev</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">     homedev=\$loopdev</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">@@ -160,8 +155,8 @@ findPersistentHome() {</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace"> </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> if strstr "\`cat /proc/cmdline\`" persistenthome= ; then</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">   findPersistentHome</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">-elif [ -e /mnt/live/\${livedir}/home.img ]; then</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">-  homedev=/mnt/live/\${livedir}/home.img</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+elif [[ -e /run/initramfs/live/${livedir}/home.img ]]; then</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">+  homedev=/run/initramfs/live/${livedir}/home.img</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> fi</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace"> </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # if we have a persistent /home, then we want to go ahead and mount it</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">@@ -220,7 +215,7 @@ if strstr "\`cat /proc/cmdline\`" CDLABEL= ; then</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> # io errors due to not being able to get files...</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace"> #cat /sbin/halt > /dev/null</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #cat /sbin/reboot > /dev/null</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace">-#/usr/sbin/eject -p -m \$(readlink -f /dev/live) >/dev/null 2>&1</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">+#/usr/sbin/eject -p -m \$(readlink -f /run/initramfs/livedev) >/dev/null 2>&1</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace"> #echo "Please remove the CD from your drive and press Enter to finish restarting"</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> #read -t 30 < /dev/console</span><br style="font-family:courier new,monospace">

<span style="font-family:courier new,monospace"> FOE</span><br>