diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-03-25 00:36:26 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-03-25 00:36:26 +0000 |
commit | 92f518209b7550c78843bc2dcaa2b2f677be0908 (patch) | |
tree | 6e84839dd8eff484b8122246a49dc823cdbea45b /fs-root | |
parent | 9905994b04e05b51fec788857740bf365aed1d73 (diff) | |
download | live-2013-03-25.tar.gz |
Can create bootable CD again2013-03-25
Diffstat (limited to 'fs-root')
-rwxr-xr-x | fs-root | 36 |
1 files changed, 23 insertions, 13 deletions
@@ -6,44 +6,54 @@ set -u MOUNTPOINT="/cdrom" USR='##USR_IMG##' -export PATH=/sbin:/usr/sbin:/usr/bin +export PATH=/sbin:/usr1/sbin:/usr1/bin +exec >/dev/msglog 2>&1 # First, remount / read-write to update /dev -mount -o remount / >/dev/msglog 2>&1 +mount -o remount / -# Second, update /dev +# The sd nodes are not created till you try to access them. +echo "Probing for device nodes ..." +ls -lR /devices/* >/dev/null devfsadm -C -c disk +echo "Mounting /usr image ..." # Now, search removable media for $USR found='no' for dfile in /dev/removable-media/dsk/*s2; do if [ -e "$dfile" ]; then - echo "Probing \`$dfile' ..." >/dev/msglog - if mount -F hsfs -o ro "$dfile" "${MOUNTPOINT}" >/dev/msglog 2>&1 + if mount -F hsfs -o ro "$dfile" "${MOUNTPOINT}" then if [ -f "${MOUNTPOINT}/${USR}" ]; then found='yes' - echo "Found ${USR}" >/dev/msglog break else - echo "${USR} not found" >/dev/msglog umount "${MOUNTPOINT}" fi - else - echo "Failed to mount \`$dfile'" >/dev/msglog fi fi done if [ "$found" != 'yes' ]; then - echo "$USR not found" >/dev/msglog + echo "FATAL: /usr image ($USR) not found" exit 1 fi +lofiadm -a "${MOUNTPOINT}/${USR}" >/dev/null & +for n in 1 2 3 4 5 6 7; do + sleep 1 + devfsadm || true + if [ -e /dev/lofi/1 ]; then + break + fi +done +if [ ! -e /dev/lofi/1 ]; then + echo "FATAL: Loopback device not created" + umount /cdrom + exit 1 +fi -echo "Mounting \`${MOUNTPOINT}/${USR}' on /usr2 ..." >/dev/msglog -mount -F hsfs -o ro -O "${MOUNTPOINT}/${USR}" /usr2 >/dev/msglog 2>&1 -echo "Switching /usr to /usr2 ..." >/dev/msglog +mount -F hsfs -o ro /dev/lofi/1 /usr2 rm -f /usr ln -sf /usr2 /usr |