bunch of fixes, change sy host, deploy some new stuff
[distro-setup] / iboot
1 #!/bin/bash
2
3 [[ $EUID == 0 ]] || exec sudo -E "$script" "$@"
4
5 if ! test "$BASH_VERSION"; then echo "error: shell is not bash" >&2; exit 1; fi
6 shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4
7 set -eE -o pipefail
8 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR
9
10 set -x
11
12
13 boot_part=$(awk '$2 == "/boot" {print $1}' /etc/mtab)
14 boot_dev=${boot_part%[0-9]*}
15 # from partition.DEFAULT
16 new_boot_part=${boot_dev}4
17 mount -o subvol=debianbuster_bootstrap $new_boot_part /mnt
18
19 cd /mnt
20 mount -o bind /dev dev
21 mount -o bind /proc proc
22 mount -o bind /sys sys
23 mkdir -p boot/efi
24 mount $(awk '$2 == "/boot/efi" {print $1}' /etc/mtab) boot/efi