# error_handler {{{
if [ "$REPORT_TRAP_ERR" = "yes" ] || [ "$FAIL_TRAP_ERR" = "yes" ]; then
+ set -e
set -E
set -o pipefail
trap "error_handler" ERR
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
# If you specify a string *without* /dev/ in the beginning, grml-debootstrap
# assumes you want to install Debian into a directory. MKFS, TUNE2FS, GRUB and
# FSCK will be ignored.
-# Make sure the TARGET-directory points to a filesystem which has the dev, exec
+# Make sure the TARGET-directory points to a filesystem which has the dev, exec
# options enabled.
# Default: no default.
# Usage examples:
# Default: 'yes' (if file exists)
# DEBCONF='no'
-# Run scripts from /etc/debootstrap/pre-scripts/ before creating the chroot.
+# Run scripts from /etc/debootstrap/pre-scripts/ before creating the chroot.
# Default: 'yes'
# PRE_SCRIPTS='no'
}
if [ "$REPORT_TRAP_ERR" = "yes" ] || [ "$FAIL_TRAP_ERR" = "yes" ]; then
+ set -e
set -E
set -o pipefail
trap "error_handler" ERR
bailout 1
else
einfo "Changing disk uuid for $TARGET to fixed (non-random) value $DISK_IDENTIFIER using tune2fs"
- tune2fs "$TARGET" -U "$DISK_IDENTIFIER"
+ tune2fs "$TARGET" -U "$DISK_IDENTIFIER" </dev/null
eend $?
fi
fi
tunefs() {
if [ -n "$TUNE2FS" ] && echo "$MKFS" | grep -q "mkfs.ext" ; then
einfo "Disabling automatic filesystem check on $TARGET via tune2fs"
- $TUNE2FS "$TARGET"
+ $TUNE2FS "$TARGET" </dev/null
eend $?
fi
}
preparechroot execute_pre_scripts chrootscript execute_post_scripts \
remove_configs umount_chroot grub_install umount_target fscktool ; do
if stage "${i}" ; then
- if "$i" ; then
+ "$i"
+ if [ $? -eq 0 ]; then
stage "${i}" 'done' && rm -f "${STAGES}/${i}"
else
bailout 2 "$i"