fix live device location for mini as well as base (#740280)

This commit is contained in:
Adam Williamson 2012-05-14 15:37:48 -07:00
parent 702a45903d
commit ae38214a8b

View File

@ -156,12 +156,6 @@ touch /.liveimg-configured
# Make sure we don't mangle the hardware clock on shutdown # Make sure we don't mangle the hardware clock on shutdown
ln -sf /dev/null /etc/systemd/system/hwclock-save.service ln -sf /dev/null /etc/systemd/system/hwclock-save.service
# mount live image
if [ -b \`readlink -f /dev/live\` ]; then
mkdir -p /mnt/live
mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live
fi
livedir="LiveOS" livedir="LiveOS"
for arg in \`cat /proc/cmdline\` ; do for arg in \`cat /proc/cmdline\` ; do
if [ "\${arg##live_dir=}" != "\${arg}" ]; then if [ "\${arg##live_dir=}" != "\${arg}" ]; then
@ -177,8 +171,8 @@ if ! strstr "\`cat /proc/cmdline\`" noswap && [ -n "\$swaps" ] ; then
action "Enabling swap partition \$s" swapon \$s action "Enabling swap partition \$s" swapon \$s
done done
fi fi
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /mnt/live/\${livedir}/swap.img ] ; then if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f /run/initramfs/live/\${livedir}/swap.img ] ; then
action "Enabling swap file" swapon /mnt/live/\${livedir}/swap.img action "Enabling swap file" swapon /run/initramfs/live/\${livedir}/swap.img
fi fi
mountPersistentHome() { mountPersistentHome() {
@ -193,8 +187,8 @@ mountPersistentHome() {
mountopts="-t jffs2" mountopts="-t jffs2"
elif [ ! -b "\$homedev" ]; then elif [ ! -b "\$homedev" ]; then
loopdev=\`losetup -f\` loopdev=\`losetup -f\`
if [ "\${homedev##/mnt/live}" != "\${homedev}" ]; then if [ "\${homedev##/run/initramfs/live}" != "\${homedev}" ]; then
action "Remounting live store r/w" mount -o remount,rw /mnt/live action "Remounting live store r/w" mount -o remount,rw /run/initramfs/live
fi fi
losetup \$loopdev \$homedev losetup \$loopdev \$homedev
homedev=\$loopdev homedev=\$loopdev
@ -228,8 +222,8 @@ findPersistentHome() {
if strstr "\`cat /proc/cmdline\`" persistenthome= ; then if strstr "\`cat /proc/cmdline\`" persistenthome= ; then
findPersistentHome findPersistentHome
elif [ -e /mnt/live/\${livedir}/home.img ]; then elif [ -e /run/initramfs/live/\${livedir}/home.img ]; then
homedev=/mnt/live/\${livedir}/home.img homedev=/run/initramfs/live/\${livedir}/home.img
fi fi
# if we have a persistent /home, then we want to go ahead and mount it # if we have a persistent /home, then we want to go ahead and mount it
@ -296,7 +290,7 @@ if strstr "\`cat /proc/cmdline\`" CDLABEL= ; then
# io errors due to not being able to get files... # io errors due to not being able to get files...
cat /sbin/halt > /dev/null cat /sbin/halt > /dev/null
cat /sbin/reboot > /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 \$(readlink -f /run/initramfs/livedev) >/dev/null 2>&1
echo "Please remove the CD from your drive and press Enter to finish restarting" echo "Please remove the CD from your drive and press Enter to finish restarting"
read -t 30 < /dev/console read -t 30 < /dev/console
FOE FOE