3 [[ $EUID == 0 ]] ||
exec sudo
-E "${BASH_SOURCE[0]}" "$@"
5 set -e; .
/usr
/local
/lib
/bash-bear
; set +e
8 # Explaining this whole thing. The host amy is used by someone else,
9 # i back it up to my extra big partition on one computer.
10 # But I also want to restore it and test out the restoration on
11 # a computer I usually use. For this, I created a separate partition
12 # that has the amy encryption password, and a separate boot so
13 # that I could encrypt my own boot partition if I want. Then,
14 # I backup from this big partition into that partition in order
17 ## In order to boot and run it:
21 if [[ ! -e /mnt
/root
/root2-fstab ||
! -e /mnt
/root
/root2-crypttab
]]; then
22 echo $0: "error: create /mnt/root/root2-fstab & /mnt/root/root2-crypttab from running /a/bin/fai/fai/config/hooks/partition.DEFAULT mkroot2 or mkroot2tab"
26 mount
-o bind /mnt
/root
2/root_ubuntubionic
/mnt
/1
28 /b
/ds
/gen-amy-fstab ubuntubionic .
29 teeu
/mnt
/1/etc
/default
/grub
<<<'GRUB_DISABLE_OS_PROBER=true'
30 mount -o bind /mnt/boot2/boot_ubuntubionic boot
31 mount -o bind /dev dev
32 mount -o bind /proc proc
33 mount -o bind /sys sys
35 mount "$(awk '$2 == "/boot/efi" {print $1}' /etc/mtab)" boot/efi
37 cp /b/ds/zboot-chroot ./root
39 chroot . ./root/zboot-chroot
41 echo "check output and reboot"