diff options
-rw-r--r-- | hooks/usr | 16 | ||||
-rw-r--r-- | init | 11 | ||||
-rw-r--r-- | install/base | 1 | ||||
-rw-r--r-- | install/shutdown | 1 | ||||
-rw-r--r-- | install/usr | 16 |
5 files changed, 33 insertions, 12 deletions
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: @@ -67,17 +67,6 @@ run_hookfunctions 'run_latehook' 'late hook' $LATEHOOKS run_hookfunctions 'run_cleanuphook' 'cleanup hook' $CLEANUPHOOKS -# mount /usr if it exists -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 - if [ "${break}" = "postmount" ]; then echo ":: Post-mount break requested, type 'exit' to resume operation" launch_interactive_shell diff --git a/install/base b/install/base index 1df209b..30ad3fa 100644 --- a/install/base +++ b/install/base @@ -27,7 +27,6 @@ build() { add_binary blkid add_binary mount add_binary switch_root - add_binary findmnt add_symlink "/etc/mtab" "/proc/self/mounts" diff --git a/install/shutdown b/install/shutdown index 96818e1..bf20f33 100644 --- a/install/shutdown +++ b/install/shutdown @@ -3,6 +3,7 @@ build() { add_binary cp add_binary lsblk + add_binary findmnt add_file "/usr/lib/initcpio/shutdown" "/shutdown" 755 add_runscript diff --git a/install/usr b/install/usr new file mode 100644 index 0000000..cdd3ca6 --- /dev/null +++ b/install/usr @@ -0,0 +1,16 @@ +#!/bin/bash + +build() { + add_binary findmnt + add_runscript +} + +help() { + cat <<HELPEOF +This provides a support for mounting /usr via a late running hook. No +configuration is needed, as the mount options will be pulled directly from the +fstab on the real root device. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: |