summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-01-06 21:19:41 +0100
committerDave Reisner <dreisner@archlinux.org>2012-01-13 00:26:31 +0100
commit47531b5050e82f361a35c670f14f542cdce25d74 (patch)
treec7875ce74c7290dcb7e13f6fe2e16fc10b73aadb /init
parent60780cbbf2cf06514ae4cfe25fe337e6762b8ede (diff)
downloadmkinitcpio-47531b5050e82f361a35c670f14f542cdce25d74.tar.gz
mkinitcpio-47531b5050e82f361a35c670f14f542cdce25d74.tar.xz
init: mount separate /usr
Use findmnt to detect the existance of a separate /usr partition existing in the real root. If it does exist, fetch the options for it and mount it. This currently makes a lot of assumptions and won't be very friendly towards something such as a dm-crypt device. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'init')
-rw-r--r--init9
1 files changed, 9 insertions, 0 deletions
diff --git a/init b/init
index 571a11a..8cf90b1 100644
--- a/init
+++ b/init
@@ -98,6 +98,15 @@ elif [ ! -x "/new_root${init}" ]; then
launch_interactive_shell --exec
fi
+# mount /usr if it exists
+if [ -f /new_root/etc/fstab ]; then
+ if usr_source=$(findmnt -nero source -s/new_root/etc/fstab /usr); then
+ mountopts=$(findmnt -nero options -s/new_root/etc/fstab /usr)
+ fsck_device "$usr_source"
+ mount "$usr_source" /new_root/usr -o "$mountopts"
+ fi
+fi
+
if [ "${break}" = "postmount" ]; then
echo ":: Post-mount break requested, type 'exit' to resume operation"
launch_interactive_shell