X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=grml-debootstrap;h=0489c52228223913c421bad9d2efa15905427df0;hb=d275bdfe5ba2b9abcf67687311110ae2dc5ac90f;hp=f52b8cb48af735f1a7b6486e71ef7e7bbaa7aa1a;hpb=98b64b8ed6e64e005de4fbbcabc0a8ca775ed9f9;p=grml-debootstrap.git diff --git a/grml-debootstrap b/grml-debootstrap index f52b8cb..0489c52 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -5,6 +5,7 @@ # Bug-Reports: see https://grml.org/bugs/ # License: This file is licensed under the GPL v2+ ################################################################################ +# shellcheck disable=SC2001,SC2181 # error_handler {{{ [ -n "$REPORT_TRAP_ERR" ] || REPORT_TRAP_ERR='no' @@ -42,7 +43,7 @@ fi # variables {{{ PN="$(basename "$0")" if [[ -d "$(dirname "$(command -v "$0")")"/.git ]]; then - VERSION="$(git --git-dir $(dirname "$(command -v "$0")")/.git describe | sed 's|^v||')" + VERSION="$(git --git-dir "$(dirname "$(command -v "$0")")"/.git describe | sed 's|^v||')" else VERSION="$(dpkg-query --show --showformat='${Version}' "$PN")" fi @@ -1028,14 +1029,16 @@ efi_support() { checkconfiguration() { -if efi_support ; then - if [ -z "$_opt_efi" ] ; then - ewarn "EFI support detected but no --efi option given, please consider enabling it." - fi -else - if [ -n "$_opt_efi" ] ; then - eerror "EFI option used but no EFI support detected." - bailout 1 +if [ -z "$VIRTUAL" ] ; then + if efi_support ; then + if [ -z "$_opt_efi" ] ; then + ewarn "EFI support detected but no --efi option given, please consider enabling it." + fi + else + if [ -n "$_opt_efi" ] ; then + eerror "EFI option used but no EFI support detected." + bailout 1 + fi fi fi @@ -1947,11 +1950,13 @@ iface ${interface} inet dhcp einfo "Installing default /etc/network/interfaces as requested via --defaultinterfaces options." mkdir -p "${MNTPOINT}/etc/network" echo "$DEFAULT_INTERFACES" > "${MNTPOINT}/etc/network/interfaces" + # shellcheck disable=SC2320 eend $? elif [ -n "$VIRTUAL" ] ; then einfo "Setting up Virtual Machine, installing default /etc/network/interfaces" mkdir -p "${MNTPOINT}/etc/network" echo "$DEFAULT_INTERFACES" > "${MNTPOINT}/etc/network/interfaces" + # shellcheck disable=SC2320 eend $? elif [ -r /etc/network/interfaces ] ; then einfo "Copying /etc/network/interfaces from host to target system" @@ -1962,6 +1967,7 @@ iface ${interface} inet dhcp ewarn "Couldn't read /etc/network/interfaces, installing default /etc/network/interfaces" mkdir -p "${MNTPOINT}/etc/network" echo "$DEFAULT_INTERFACES" > "${MNTPOINT}/etc/network/interfaces" + # shellcheck disable=SC2320 eend $? fi