Corrected computation of end block for GPT erasure

This commit is contained in:
Thomas Schmitt 2020-01-08 21:50:21 +01:00
parent 5a335e5594
commit 086a9a69fd

View File

@ -15,7 +15,7 @@
# announces.
xdt_print_version() {
echo "xorriso-dd-target , version 1.5.3 , 2020.01.07.123808"
echo "xorriso-dd-target , version 1.5.3 , 2020.01.08.204757"
}
@ -225,7 +225,6 @@ xdt_reset_job() {
xdt_sudo_cmd=
xdt_have_su_power=
xdt_end_after_setup=
xdt_dev_bytes=
xdt_dev_end=
xdt_dd_bs="bs=1M"
xdt_dd_silent=
@ -766,6 +765,7 @@ xdt_write_image() {
# Erase possible GPT backup table at end of device
# if expr can properly divide device size by 512
xdt_dev_bytes=$("$xdt_lsblk_cmd" -n -b -o SIZE /dev/"${2}" | head -1)
if test -n "$xdt_dev_bytes"
then
xdt_dev_end=$(expr "$xdt_dev_bytes" / 512 2>/dev/null)