|
|
|
|
@ -156,11 +156,40 @@ for nic in `echo "$nicdevices"`; do
|
|
|
|
|
echo " - ${nic}" >> /mnt/etc/netplan/bridge.yaml
|
|
|
|
|
done
|
|
|
|
|
echo "Done."
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Mounting chroot mounts..."
|
|
|
|
|
mount --rbind /dev /mnt/dev
|
|
|
|
|
mount --rbind /proc /mnt/proc
|
|
|
|
|
mount --rbind /sys /mnt/sys
|
|
|
|
|
echo "Done."
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Downloading chroot configuration script..."
|
|
|
|
|
wget -qO - https://code.totosearch.org/Sean/ServerSetup/raw/branch/master/setup-chroot.sh > /mnt/setup-chroot.sh
|
|
|
|
|
echo "Done."
|
|
|
|
|
chroot /mnt /setup-chroot.sh --login
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Clearing chroot configuration script..."
|
|
|
|
|
rm /mnt/setup-chroot.sh
|
|
|
|
|
echo "Done."
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Unmounting chroot mounts..."
|
|
|
|
|
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -i{} umount -lf {}
|
|
|
|
|
echo "Done."
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Exporting zpools..."
|
|
|
|
|
errors=`zpool export -a 2>&1 1>/dev/null`
|
|
|
|
|
if ! [ "$?" = "0" ]; then
|
|
|
|
|
echo "Couldn't export mounted zpools - $errors"
|
|
|
|
|
exit 8
|
|
|
|
|
fi
|
|
|
|
|
echo "Done."
|
|
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
# mount --rbind /dev /mnt/dev
|
|
|
|
|
# mount --rbind /proc /mnt/proc
|
|
|
|
|
# mount --rbind /sys /mnt/sys
|
|
|
|
|
# chroot /mnt /bin/bash --login
|
|
|
|
|
|
|
|
|
|
# ln -s /proc/self/mounts /etc/mtab
|
|
|
|
|
# apt update
|
|
|
|
|
|