bunch of fixes, change sy host, deploy some new stuff
[distro-setup] / iboot
diff --git a/iboot b/iboot
new file mode 100644 (file)
index 0000000..78805bf
--- /dev/null
+++ b/iboot
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+[[ $EUID == 0 ]] || exec sudo -E "$script" "$@"
+
+if ! test "$BASH_VERSION"; then echo "error: shell is not bash" >&2; exit 1; fi
+shopt -s inherit_errexit 2>/dev/null ||: # ignore fail in bash < 4.4
+set -eE -o pipefail
+trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${PIPESTATUS[*]}" >&2' ERR
+
+set -x
+
+
+boot_part=$(awk '$2 == "/boot" {print $1}' /etc/mtab)
+boot_dev=${boot_part%[0-9]*}
+# from partition.DEFAULT
+new_boot_part=${boot_dev}4
+mount -o subvol=debianbuster_bootstrap $new_boot_part /mnt
+
+cd /mnt
+mount -o bind /dev dev
+mount -o bind /proc proc
+mount -o bind /sys sys
+mkdir -p boot/efi
+mount $(awk '$2 == "/boot/efi" {print $1}' /etc/mtab) boot/efi