2 tool
=$
(readlink
-e "${0%/*}/..")
5 "$tool"/host
/disk-mount
6 "$tool"/host
/part-lvm-mount
7 "$tool"/host
/part-root-mount
8 "$tool"/host
/part-boot-mount
9 "$tool"/host
/part-var-mount
10 #"$tool"/host/part-home-mount
12 mountpoint
-q /mnt
/$local_fqdn/proc ||
13 sudo mount
-t proc proc
/mnt
/$local_fqdn/proc
14 mountpoint
-q /mnt
/$local_fqdn/sys ||
15 sudo mount
-t sysfs sys
/mnt
/$local_fqdn/sys
16 mountpoint
-q /mnt
/$local_fqdn/dev ||
17 sudo mount
--bind /dev
/mnt
/$local_fqdn/dev
18 if test -d /mnt
/$local_fqdn/root
/src
/vm
/.git
20 mountpoint
-q /mnt
/$local_fqdn/root
/src
/vm ||
21 sudo mount
--bind "$tool" /mnt
/$local_fqdn/root
/src
/vm
23 sudo rsync
-a "$tool"/ /mnt
/$local_fqdn/root
/src
/vm
25 sudo chroot
/mnt
/$local_fqdn /bin
/bash || true
26 "$tool"/host
/chroot-clean