Bug#918700: grub2-common: update-grub fails with bogus error messages if it doesn't like the current dir

Russell Coker russell at coker.com.au
Tue Jan 8 13:05:53 GMT 2019


Package: grub2-common
Version: 2.02+dfsg1-9
Severity: normal

Below is one example of the problem.  A trivial fix for this sort of problem
would be to have the /usr/sbin/update-grub shell script do "cd /" before
running grub-mkconfig (as update-grub is the documented way of doing things
on Debian).  But a better solution would be to make grub-mkconfig either give
useful error messages, or even better just not care about whether it can read
the current directory.

root at server:/tmp/a# update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.19.0-1-amd64
Found initrd image: /boot/initrd.img-4.19.0-1-amd64
Found linux image: /boot/vmlinuz-4.18.0-3-amd64
Found initrd image: /boot/initrd.img-4.18.0-3-amd64
Found linux image: /boot/vmlinuz-4.18.0-2-amd64
Found initrd image: /boot/initrd.img-4.18.0-2-amd64
Found memtest86+ image: /memtest86+.bin
Found memtest86+ multiboot image: /memtest86+_multiboot.bin
done
root at server:/tmp/a# rmdir /tmp/a
root at server:/tmp/a# update-grub
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
/usr/sbin/grub-probe: error: out of memory.
root at server:/tmp/a# 



More information about the Pkg-grub-devel mailing list