add more stack traces, other minor changes
[automated-distro-installer] / install-chboot
index d066101642454420d7664649dbc1f9fc88d61104..098b23220cb6355a4065b180c0f480badab0e733 100755 (executable)
 
 [[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@"
 
-set -eE -o pipefail
-trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+x="$(readlink -f "$BASH_SOURCE")"; source "${x%/*}/bash-trace"
+cd ${x%/*}
+
+usage() {
+    cat <<EOF
+Usage: ${0##*/} [-h|--help]
+reinstall chboot to /boot subvols, for chboot updates.
+
+We install to /boot in case there is an issue booting and only the /boot
+vol is readily available. For the bootstrap subvol, this is the normal
+case.
+EOF
+    exit $1
+}
+case $1 in
+    -h|--help) usage ;;
+esac
 
-# usage install-chboot: isntalls chboot to all /boot subvols,
-# in case there is an issue booting and it is needed.
-# Run this when chboot changes.
-
-x=$(readlink -f "$BASH_SOURCE"); cd ${x%/*}
 
 e() { echo "$@"; "$@"; }