[arch-projects] [PATCH mkinitcpio] hooks: add usr hook

Tom Gundersen teg at jklm.no
Tue Aug 2 12:47:33 EDT 2011


This allows /usr to be mounted from within the initrd. Advanced setups
might not work. It is recommended to move /usr to the rootfs.

Signed-off-by: Tom Gundersen <teg at jklm.no>
---
 hooks/usr |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
 create mode 100644 hooks/usr

diff --git a/hooks/usr b/hooks/usr
new file mode 100644
index 0000000..b1090ae
--- /dev/null
+++ b/hooks/usr
@@ -0,0 +1,17 @@
+# vim: set ft=sh:
+run_hook ()
+{
+    mount_handler=usr_monut_handler
+}
+
+usr_mount_handler () {
+    # mount /
+    default_mount_handler "$@"
+
+    # mount /usr
+    msg -n ":: Mounting /usr..."
+    cp /new_root/etc/fstab /etc/fstab
+    mount /usr
+    mount --move /usr /new_root/usr
+    msg "done."
+}
-- 
1.7.6



More information about the arch-projects mailing list