X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=chroot-script;h=367ed9b7ff7fb8c28f113a53344c0f221adf8599;hb=dc0052a90daceefe39aad25ff51b2bfb5abc9c4f;hp=5cff4847a6a6ea6810af3f211d24ee9b3753e343;hpb=b379e2401637be5569cd87f26e39bc54549fa834;p=grml-debootstrap.git diff --git a/chroot-script b/chroot-script index 5cff484..367ed9b 100755 --- a/chroot-script +++ b/chroot-script @@ -11,6 +11,7 @@ # error_handler {{{ if [ "$REPORT_TRAP_ERR" = "yes" ] || [ "$FAIL_TRAP_ERR" = "yes" ]; then + set -e set -E set -o pipefail trap "error_handler" ERR @@ -269,14 +270,21 @@ packages() { } if [ "$PACKAGES" = 'yes' ] ; then - if ! [ -r /etc/debootstrap/packages ] ; then - echo "Error: /etc/debootstrap/packages (inside chroot) not found, exiting." >&2 - exit 1 - else - $APTUPDATE - # shellcheck disable=SC2086,SC2046 - DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL $(grep -v '^#' /etc/debootstrap/packages) $GRMLPACKAGES - fi + PACKAGES_FILE="/etc/debootstrap/packages" + + if [ "$ARCH" = 'arm64' ]; then + PACKAGES_FILE="/etc/debootstrap/packages-arm64" + fi + + if ! [ -r "${PACKAGES_FILE}" ] ; then + echo "Error: ${PACKAGES_FILE} (inside chroot) not found, exiting." >&2 + exit 1 + else + $APTUPDATE + + # shellcheck disable=SC2086,SC2046 + DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL $(grep -v '^#' "${PACKAGES_FILE}") $GRMLPACKAGES + fi fi } # }}} @@ -316,17 +324,16 @@ get_kernel_version() { # shellcheck disable=SC2153 case "$ARCH" in i386) - case "$RELEASE" in - lenny|squeeze|wheezy) KARCH='686' ;; - # since jessie the linux-image-686 image doesn't exist any longer - *) KARCH='686-pae' ;; - esac + KARCH='686-pae' ;; amd64) KARCH='amd64' ;; + arm64) + KARCH='arm64' + ;; *) - echo "Only i386 and amd64 are currently supported" >&2 + echo "Only i386, amd64 and arm64 are currently supported" >&2 return 1 esac @@ -653,7 +660,7 @@ available_ids() { echo "${ids}" } -# helper function to report corresponding /dev/disk/by-id/… for a given device name, +# helper function to report corresponding /dev/disk/by-id/ for a given device name, # based on GRUB's postinst script device_to_id() { local id