#!/bin/sh -eu tool=$(readlink -e "${0%/*}/..") . "$tool"/host/lib.sh "$tool"/host/disk-mount "$tool"/host/part-lvm-mount "$tool"/host/part-root-mount "$tool"/host/part-boot-mount "$tool"/host/part-var-mount #"$tool"/host/part-home-mount mountpoint -q /mnt/$local_fqdn/proc || sudo mount -t proc proc /mnt/$local_fqdn/proc mountpoint -q /mnt/$local_fqdn/sys || sudo mount -t sysfs sys /mnt/$local_fqdn/sys mountpoint -q /mnt/$local_fqdn/dev || sudo mount --bind /dev /mnt/$local_fqdn/dev if test -d /mnt/$local_fqdn/root/src/$local_hostname/.git then mountpoint -q /mnt/$local_fqdn/root/src/$local_hostname || sudo mount --bind "$tool" /mnt/$local_fqdn/root/src/$local_hostname else sudo rsync -a "$tool"/ /mnt/$local_fqdn/root/src/$local_hostname fi sudo chroot /mnt/$local_fqdn /bin/bash || true "$tool"/host/chroot-clean