summaryrefslogtreecommitdiff
path: root/fs-root
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-03-24 14:28:53 +0000
committerIgor Pashev <pashev.igor@gmail.com>2013-03-24 14:28:53 +0000
commit1be28d153669275cdceb86a183c52e19558c7b5d (patch)
treec211c059a326526581dfc7b7cf786c45cb44aa06 /fs-root
parent95e6d1944459354f0cd589fdbe11fbf3a6680863 (diff)
downloadlive-1be28d153669275cdceb86a183c52e19558c7b5d.tar.gz
Cleanup
Diffstat (limited to 'fs-root')
-rwxr-xr-xfs-root48
1 files changed, 48 insertions, 0 deletions
diff --git a/fs-root b/fs-root
new file mode 100755
index 0000000..e4f6e29
--- /dev/null
+++ b/fs-root
@@ -0,0 +1,48 @@
+#!/sbin/sh
+
+set -e
+set -u
+
+MOUNTPOINT="/cdrom"
+USR='##USR_IMG##'
+
+export PATH=/sbin:/usr/sbin:/usr/bin
+
+# First, remount / read-write to update /dev
+mount -o remount / >/dev/msglog 2>&1
+
+# Second, update /dev
+devfsadm -C -c disk
+
+# 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
+ 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
+ exit 1
+fi
+
+
+echo "Mounting \`${MOUNTPOINT}/${USR}' on /usr ..." >/dev/msglog
+mount -F hsfs -o ro -O "${MOUNTPOINT}/${USR}" /usr >/dev/msglog 2>&1
+
+exit 0
+