From f88b2b53a4b2dcb177cb8b7197e2a61fd510c7ef Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 13 May 2012 20:05:50 -0400 Subject: usr: add usr mounting as a late running hook Mount separate /usr partitions voluntarily, as a late running hook. This is an unfortunate patch that will no doubt result in some hatemail, though it won't thoroughly break anyone to the point of not booting. As a side effect, findmnt is no longer a requisite of the core /init, so move it to the shutdown and usr hooks where it's required. Signed-off-by: Dave Reisner --- hooks/usr | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 hooks/usr (limited to 'hooks/usr') diff --git a/hooks/usr b/hooks/usr new file mode 100644 index 0000000..389e14c --- /dev/null +++ b/hooks/usr @@ -0,0 +1,16 @@ +#!/usr/bin/ash + +run_latehook() { + local realtab=/new_root/etc/fstab + + if [ -f "$realtab" ]; then + if usr_source=$(findmnt -snero source --tab-file="$realtab" /usr); then + mountopts=$(findmnt -snero options --tab-file="$realtab" /usr) + fsck_device "$usr_source" + msg ":: mounting '$usr_source' on /usr" + mount "$usr_source" /new_root/usr -o "$mountopts" + fi + fi +} + +# vim: set ft=sh ts=4 sw=4 et: -- cgit v1.2.3-24-g4f1b