1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 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 }