X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=iboot;fp=iboot;h=96ccdb227b0d4d7910bfbd7ee8b348aa459759ca;hp=bc84f6ca7be1b5874472c204f1abfd49e8d01bbd;hb=d67edcdca8795a4bca116aa532d02dda246a6f53;hpb=a9e3d60b4254cd5c6216c4b3e7f8cd5cc5107fad diff --git a/iboot b/iboot index bc84f6c..96ccdb2 100644 --- a/iboot +++ b/iboot @@ -1,8 +1,7 @@ #!/bin/bash ## in development, meant to be run manually - -[[ $EUID == 0 ]] || exec sudo -E "$script" "$@" +[[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@" 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 @@ -11,8 +10,8 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" exit status: $?, PIPESTATUS: ${P set -x -d=(/dev/mapper/crypt_dev*) -d=${d[0]} +da=(/dev/mapper/crypt_dev*) +d=${da[0]} mount -o subvol=root_trisquelnabia $d /mnt @@ -24,6 +23,6 @@ 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 +mount "$(awk '$2 == "/boot/efi" {print $1}' /etc/mtab)" boot/efi chroot . # then run zboot-chroot