summarylogtreecommitdiffstats
path: root/subdir_hook
diff options
context:
space:
mode:
authorCsaba Henk2015-09-12 17:59:47 +0200
committerCsaba Henk2015-09-12 18:29:18 +0200
commit9e6c3e9c022cb0c0b6dd68013d766161286530da (patch)
tree9bfc8e6d15e8c8f46aba79a0419bba19aa701f29 /subdir_hook
downloadaur-mkinitcpio-loop-subdir.tar.gz
Initial commit
Diffstat (limited to 'subdir_hook')
-rw-r--r--subdir_hook16
1 files changed, 16 insertions, 0 deletions
diff --git a/subdir_hook b/subdir_hook
new file mode 100644
index 000000000000..19cb8fe36351
--- /dev/null
+++ b/subdir_hook
@@ -0,0 +1,16 @@
+run_hook() {
+ if [ ! -z "$rootdir" ]; then
+ mv /new_root /new_rootimg
+ ln -s new_rootimg /new_root
+ fi
+}
+
+run_latehook() {
+ local _rootpath _postfix _d
+ if [ ! -z "$rootdir" -a -L /new_root ]; then
+ _rootpath=/`readlink /new_root`
+ rm /new_root
+ mkdir /new_root
+ mount --bind $_rootpath/"$rootdir" /new_root
+ fi
+}