Bug#943838: grml2usb: check_for_fat() always fails

2019-10-30 Thread Sven Joachim
Control: tags -1 + patch
Control: forwarded -1 https://github.com/grml/grml2usb/pull/24

On 2019-10-30 17:09 +0100, Sven Joachim wrote:

> Package: grml2usb
> Version: 0.16.7
> Severity: grave
>
> The check_for_fat() function always fails, no matter what:
>
> ,
> | # file -s /dev/sdc2
> | /dev/sdc2: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID
> | "mkfs.fat", sectors/cluster 64, reserved sectors 64, root entries
> | 1024, Media descriptor 0xf8, sectors/FAT 256, sectors/track 32,
> | heads 64, hidden sectors 27265024, sectors 3512319 (volumes > 32
> | MB), serial number 0xadbb, unlabeled, FAT (16 bit)
> | # sudo grml2usb grml96-full_2018.12.iso /dev/sdc2
> | Executing grml2usb version 0.16.7
> | Execution failed: Partition /dev/sdc2 does not contain a FAT16 filesystem. 
> (Use --fat16 or run mkfs.vfat /dev/sdc2)
> | # grml2usb --fat16 grml96-full_2018.12.iso /dev/sdc2
> | Executing grml2usb version 0.16.7
> | Are you sure you want to format the specified partition with fat16? y/N y
> | Note: you can skip this question using the option --force
> | Formating partition with fat16 filesystem
> | mkfs.fat 4.1 (2017-01-24)
> | Execution failed: Partition /dev/sdc2 does not contain a FAT16 filesystem. 
> (Use --fat16 or run mkfs.vfat /dev/sdc2)
> `
>
> I am not really a Python expert, but AFAICS the problem is that by
> default Subprocess.open() opens file objects in binary mode, so the
> "filesystem" variable is an array of bytes, and comparing it to a string
> always yields false.

So that was indeed the case, but after fixing it I immediately ran into
another "strings vs bytes" problem in check_boot_flag().  Fortunately
that was the last issue, and now I have a USB stick with GRML on it. :-)
Have not tested whether it actually boots yet, though.

I have sent a pull request on GitHub.

Cheers,
   Sven



Bug#943838: grml2usb: check_for_fat() always fails

2019-10-30 Thread Sven Joachim
Package: grml2usb
Version: 0.16.7
Severity: grave

The check_for_fat() function always fails, no matter what:

,
| # file -s /dev/sdc2
| /dev/sdc2: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", 
sectors/cluster 64, reserved sectors 64, root entries 1024, Media descriptor 
0xf8, sectors/FAT 256, sectors/track 32, heads 64, hidden sectors 27265024, 
sectors 3512319 (volumes > 32 MB), serial number 0xadbb, unlabeled, FAT (16 
bit)
| # sudo grml2usb grml96-full_2018.12.iso /dev/sdc2
| Executing grml2usb version 0.16.7
| Execution failed: Partition /dev/sdc2 does not contain a FAT16 filesystem. 
(Use --fat16 or run mkfs.vfat /dev/sdc2)
| # grml2usb --fat16 grml96-full_2018.12.iso /dev/sdc2
| Executing grml2usb version 0.16.7
| Are you sure you want to format the specified partition with fat16? y/N y
| Note: you can skip this question using the option --force
| Formating partition with fat16 filesystem
| mkfs.fat 4.1 (2017-01-24)
| Execution failed: Partition /dev/sdc2 does not contain a FAT16 filesystem. 
(Use --fat16 or run mkfs.vfat /dev/sdc2)
`

I am not really a Python expert, but AFAICS the problem is that by
default Subprocess.open() opens file objects in binary mode, so the
"filesystem" variable is an array of bytes, and comparing it to a string
always yields false.


-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.3.8-nouveau (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages grml2usb depends on:
ii  grub-pc-bin 2.04-3
ii  grub2-common2.04-3
ii  kmod26-3
ii  mtools  4.0.23-1+b1
ii  python3 3.7.5-1
ii  python3-parted  3.11.2-11
ii  rsync   3.1.3-8
ii  syslinux3:6.04~git20190206.bf6db5b4+dfsg1-1

Versions of packages grml2usb recommends:
ii  genisoimage 9:1.1.11-3+b2
ii  syslinux3:6.04~git20190206.bf6db5b4+dfsg1-1
pn  syslinux-utils  

grml2usb suggests no packages.

-- no debconf information