Improved handling of dd failure

master
Thomas Schmitt 3 years ago
parent f6c56febbf
commit a3a351bb59
  1. 9
      xorriso-dd-target/xorriso-dd-target
  2. 9
      xorriso-dd-target/xorriso-dd-target.xdt

@ -670,7 +670,14 @@ write_image() {
else
echo "Performing:"
echo " $sudo_cmd $dd_cmd if='${1}' bs=1M of=/dev/'${2}' ; sync"
$sudo_cmd "$dd_cmd" if="${1}" bs=1M of=/dev/"${2}" ; sync
$sudo_cmd "$dd_cmd" if="${1}" bs=1M of=/dev/"${2}"
ret="$?"
sync
if test "$ret" -ne 0
then
echo "FAILURE: $sudo_cmd $dd_cmd was not successful" >&2
return 18
fi
fi
# >>> ??? Erase possible GPT backup table at end of device ?

@ -706,7 +706,14 @@ xdt_write_image() {
else
echo "Performing:"
echo " $xdt_sudo_cmd $xdt_dd_cmd if='${1}' bs=1M of=/dev/'${2}' ; sync"
$xdt_sudo_cmd "$xdt_dd_cmd" if="${1}" bs=1M of=/dev/"${2}" ; sync
$xdt_sudo_cmd "$xdt_dd_cmd" if="${1}" bs=1M of=/dev/"${2}"
xdt_ret="$?"
sync
if test "$xdt_ret" -ne 0
then
echo "FAILURE: $xdt_sudo_cmd $xdt_dd_cmd was not successful" >&2
return 18
fi
fi
# >>> ??? Erase possible GPT backup table at end of device ?

Loading…
Cancel
Save