Merge remote-tracking branch 'origin/pr/226'
authorMichael Prokop <mika@grml.org>
Wed, 25 Oct 2023 08:04:20 +0000 (10:04 +0200)
committerMichael Prokop <mika@grml.org>
Wed, 25 Oct 2023 08:04:20 +0000 (10:04 +0200)
1  2 
chroot-script
grml-debootstrap

diff --combined chroot-script
@@@ -11,6 -11,7 +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
@@@ -653,7 -654,7 +654,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
diff --combined grml-debootstrap
@@@ -31,6 -31,7 +31,7 @@@ last bash command: $last_bash_command
  }
  
  if [ "$REPORT_TRAP_ERR" = "yes" ] || [ "$FAIL_TRAP_ERR" = "yes" ]; then
+    set -e
     set -E
     set -o pipefail
     trap "error_handler" ERR
@@@ -1347,7 -1348,7 +1348,7 @@@ mkfs() 
          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
@@@ -1432,7 -1433,7 +1433,7 @@@ mountpoint_to_blockdevice() 
  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
  }
@@@ -2177,7 -2178,8 +2178,8 @@@ for i in format_efi_partition prepare_v
           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"