BitJam / live-usb-maker

Create an antiX/MX LiveUSB
GNU General Public License v3.0
34 stars 13 forks source link

Check Dependencies at Beginning #1

Open jhamfler opened 5 years ago

jhamfler commented 5 years ago

Division by zero since parted printed the wrong format. Also I had to install parted. Maybe check at beginning if it is available.

Error:

./live-usb-maker: Zeile 1308: 1 + 100 * (main_needed2 + uefi_val + bios_val + MAIN_MARGIN + UEFI_MARGIN + BIOS_MARGIN)
            / total_size: Division durch 0. (Fehlerverursachendes Zeichen ist »total_size«).

Problem: total_size wasn't set

empty: sudo parted --script /dev/sdc unit MiB print 2>/dev/null | sed -rn "s/^Disk.*: ([0-9]+)MiB$/\1/p" not empty:

sudo parted --script /dev/sdc unit MiB print

Modell: SanDisk Ultra (scsi)
Festplatte  /dev/sdc:  14956MiB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: msdos
Disk-Flags: 

Nummer  Anfang   Ende      Größe     Typ      Dateisystem  Flags
 1      1,00MiB  14955MiB  14954MiB  primary  fat32
tlahn commented 3 years ago

Same problem here. I got it running by changing the console language.

LANG=en_US sudo ./live-usb-maker

Base problem is that parted did its output in German which states ... Festplatte /dev/sdb: 123456789B ...

While the sed command expects ... Disk /dev/sdb: 123456789B ...