summarylogtreecommitdiffstats
path: root/subdir_hook
diff options
context:
space:
mode:
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 00000000000..19cb8fe3635
--- /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
+}