#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-if [ "${root%%:*}" = "live" ]; then
+case "$root" in
+ live:/dev/*)
{
printf 'KERNEL=="%s", SYMLINK+="live"\n' \
${root#live:/dev/}
${root#live:/dev/}
} >> /etc/udev/rules.d/99-live-squash.rules
echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh
-fi
+ ;;
+ live:*)
+ if [ -f "${root#live:}" ]; then
+ /sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root "${root#live:}"
+ echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh
+ fi
+ ;;
+esac
[ -z "$liverw" ] && liverw=ro
# mount the backing of the live image first
mkdir -p /dev/.initramfs/live
-mount -n -t $fstype -o $liverw $livedev /dev/.initramfs/live
-RES=$?
-if [ "$RES" != "0" ]; then
- die "Failed to mount block device of live image"
- exit 1
+if [ -f $livedev ]; then
+ # no mount needed - we've already got the LiveOS image in initramfs
+ case $livedev in
+ *squashfs.img) SQUASHED=$livedev ;;
+ *ext3fs.img|*btrfs.img) FSIMG=$livedev ;;
+ esac
+else
+ mount -n -t $fstype -o $liverw $livedev /dev/.initramfs/live
+ RES=$?
+ if [ "$RES" != "0" ]; then
+ die "Failed to mount block device of live image"
+ exit 1
+ fi
fi
# overlay setup helper function