Package: grml-rescueboot
Version: 0.5.1
Severity: important
Tags: patch

Hi Mika,

I tried to use update-grml-rescueboot to fetch the current grml-small
which is around 400 MB according to https://grml.org/download/ onto a
/boot/ partition which has over 460 MB free disk space:

  /boot/grml # df -h .
  Filesystem  Type  Size  Used  Avail  Use%  Mounted  on
  /dev/md0    ext4  923M  440M  467M   49%   /boot
  /boot/grml # ls -l
  total 0

So currently /boot/grml/ is empty and /boot has about 467 MB free disk
space. Should work fine for a 400 MB grml-small image...

  /boot/grml # update-grml-rescueboot -t small
  Finding out latest ISO image...
  ERROR: there doesn't seem to be enough free disk space in /boot.
  Note: >=512MB for grml-small recommended (use -f to force download anyway).

Ok, fair enough. Let's do that:

  /boot/grml # update-grml-rescueboot -t small -f
  ERROR: Option -f requires an argument.
  Finding out latest ISO image...
  ERROR: there doesn't seem to be enough free disk space in /boot.
  Note: >=512MB for grml-small recommended (use -f to force download anyway).

What? Why does "-f" need an argument? And why does it still argue about
the disk space and still suggests to add "-f"?

So I've read the man page. According to the man page "-f" might only
work as first option. Oh well, let's do that:

  /boot/grml # update-grml-rescueboot -f -t small
  Finding out latest ISO image...
  WARN: There might not be enough free disk space in /boot, continuing anyway 
as requested via -f.

So far so good. That's expected.

  Downloading Grml ISO to '/boot/grml/grml64-full_2021.07.iso'.

Wait, what?

  --2022-02-17 15:15:56--  http://download.grml.org/grml64-full_2021.07.iso
  Resolving download.grml.org (download.grml.org)... 83.246.69.174
  Connecting to download.grml.org (download.grml.org)|83.246.69.174|:80... 
connected.
  HTTP request sent, awaiting response... 302 Found
  Location: https://ftp.fau.de/grml//grml64-full_2021.07.iso [following]
  --2022-02-17 15:15:56--  https://ftp.fau.de/grml//grml64-full_2021.07.iso
  Resolving ftp.fau.de (ftp.fau.de)... 2001:638:a000:1021:21::1, 131.188.12.211
  Connecting to ftp.fau.de (ftp.fau.de)|2001:638:a000:1021:21::1|:443... 
connected.
  HTTP request sent, awaiting response... 200 OK
  Length: 824442880 (786M) [application/x-iso9660-image]
  Saving to: ‘/boot/grml/grml64-full_2021.07.iso’

  /boot/grml/grml64-full_2021.07.iso       
59%[=============================================>                              
  ] 466.59M  8.21MB/s    in 22s

  Cannot write to ‘/boot/grml/grml64-full_2021.07.iso’ (No space left on 
device).

*sigh*

Interestingly this worked:

  /boot/grml # rm -v grml64-full_2021.07.iso
  removed 'grml64-full_2021.07.iso'
  /boot/grml # update-grml-rescueboot -f x -t small
  Finding out latest ISO image...
  WARN: There might not be enough free disk space in /boot, continuing anyway 
as requested via -f.
  Downloading Grml ISO to '/boot/grml/grml64-small_2021.07.iso'.
  --2022-02-17 15:23:11--  http://download.grml.org/grml64-small_2021.07.iso
  […]
  Found iso image: /boot/images/grml64-small_2021.07.iso
  done
  Successfully finished grml-rescueboot integration.
  update-grml-rescueboot -f x -t small  7.68s user 9.66s system 52% cpu 32.956 
total

So as the error message above already suggested, "-f" swallows the next
parameter despite the man page says otherwise. So in my second try it
swallowed the "-t" and hence still downloaded the full image.

This seems due to the ":" behind "f" in the "getopts" call in
update-grml-rescueboot. I think that colon is the bug.

And indeed: With this patch…

--- /usr/sbin/update-grml-rescueboot~   2022-02-17 15:32:08.486274113 +0100
+++ /usr/sbin/update-grml-rescueboot    2022-02-17 15:30:35.937732355 +0100
@@ -34,7 +34,7 @@
   echo "Usage: $(basename "$0") [-f] [-a <32|64|96>] [-t <small|full>]"
 }
 
-while getopts ":a::t::f:h" opt ; do
+while getopts ":a::t::fh" opt ; do
   case ${opt} in
     a)
       if [ "${OPTARG}" = 32 ] || [ "${OPTARG}" = 64 ] || [ "${OPTARG}" = 96 ] 
; then

… it works again as expected:

  /boot/grml # update-grml-rescueboot -t small -f
  Finding out latest ISO image...
  WARN: There might not be enough free disk space in /boot, continuing anyway 
as requested via -f.
  Downloading Grml ISO to '/boot/grml/grml64-small_2021.07.iso'.
  --2022-02-17 15:30:57--  http://download.grml.org/grml64-small_2021.07.iso
  […]
  Found iso image: /boot/images/grml64-small_2021.07.iso
  done
  Successfully finished grml-rescueboot integration.
  update-grml-rescueboot -t small -f  7.82s user 9.94s system 63% cpu 27.762 
total

So I'd be happy if you could apply that patch for the next release of
grml-rescueboot. Thanks in advance!

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (600, 'testing'), (500, 'unstable-debug'), 
(500, 'buildd-unstable'), (110, 'experimental'), (1, 'experimental-debug'), (1, 
'buildd-experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.16.0-1-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_CPU_OUT_OF_SPEC, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages grml-rescueboot depends on:
ii  grub-efi-amd64  2.06-2

Versions of packages grml-rescueboot recommends:
ii  debian-keyring  2021.12.24
ii  gpgv            2.2.27-3
ii  wget            1.21.2-2+b1

grml-rescueboot suggests no packages.

-- no debconf information

Reply via email to