[SoaS] /dev/live, /mnt/live, LiveOS/home.img unavailable in Fedora-17

Frederick Grose fgrose at gmail.com
Thu Mar 29 20:51:20 EDT 2012


On Mon, Mar 26, 2012 at 12:02 PM, Frederick Grose <fgrose at gmail.com> wrote:

> Please note that the current Fedora-17-Beta-TC2-Live images lack
> some traditional Live CD/USB features.
>
> See this bug report.
> https://bugzilla.redhat.com/show_bug.cgi?id=740280
>
> /dev/live was a link to the installation partition on the Live USB, such
> as /dev/sdc1,
> or /dev/sr0 on a Live CD/DVD.
>
> How would a script determine this partition without human input?
>
> /mnt/live was a convenient mounting of the installation partition
> filesystem.
> It allowed easy access to pre-existing content on the Live USB device or to
> the /LiveOS and /syslinux directories.
>
> The --home-size-mb NNN option of livecd-iso-to-disk produced a
> /LiveOS/home.img
> filesystem for the liveuser's home directory.
>
> This feature made possible the --encrypted-home option, which would secure
> the privacy of a user directory on a Live USB system.
>
> 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.
>
> Is there a workaround for these (missing) features?
>
>        --Fred
>

This patch restores the lost features:

commit 1580cddaea504efd68c5e10fee70e09d7e81d86b
Author: Frederick Grose <fgrose at sugarlabs.org>
Date:   Thu Mar 29 16:27:30 2012 -0400

    Mount live device on /mnt/live, link it to /dev/live

    This enables the mounting of /LiveOS/home.img, if present.

diff --git a/fedora-live-base.ks b/fedora-live-base.ks
index 0b14fec..0cf0fb2 100644
--- a/fedora-live-base.ks
+++ b/fedora-live-base.ks
@@ -88,10 +88,22 @@ touch /.liveimg-configured
 # Make sure we don't mangle the hardware clock on shutdown
 ln -sf /dev/null /etc/systemd/system/hwclock-save.service

+findmount() {
+    local info=()
+    while read -a info; do
+        if [[ ${info[4]} == $1 ]]; then
+            echo ${info[8]}
+            break;
+        fi
+        done < /proc/self/mountinfo
+}
+
 # mount live image
-if [ -b \`readlink -f /dev/live\` ]; then
+livedev=$(findmount /run/initramfs/live)
+if [[ -b $livedev ]]; then
    mkdir -p /mnt/live
-   mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live
+   mount -o ro $livedev /mnt/live 2>/dev/null || mount $livedev /mnt/live
+   ln -s $livedev /dev/live
 fi

 livedir="LiveOS"
@@ -220,7 +232,7 @@ if strstr "\`cat /proc/cmdline\`" CDLABEL= ; then
 # io errors due to not being able to get files...
 #cat /sbin/halt > /dev/null
 #cat /sbin/reboot > /dev/null
-#/usr/sbin/eject -p -m \$(readlink -f /dev/live) >/dev/null 2>&1
+#/usr/sbin/eject -p -m \$livedev >/dev/null 2>&1
 #echo "Please remove the CD from your drive and press Enter to finish
restarting"
 #read -t 30 < /dev/console
 FOE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/soas/attachments/20120329/0d253210/attachment.html>


More information about the SoaS mailing list