bugGNU GRUB - Bugs: bug #60805, 'grub-install -v' can report an...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #60805: 'grub-install -v' can report an unusable grub-mkimage command

Submitter:  Corey Hickey <bugfood>
Submitted:  Sun 20 Jun 2021 07:49:49 PM UTC
   
 
Category:  User Interface Severity:  Major
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Release:  Git master
Release:  Reproducibility:  Every Time
Planned Release:  None

Sun 20 Jun 2021 07:49:49 PM UTC, original submission:  

Note: I am reporting this based on the Debian package version 2.04-19, but the relevant code appears present in upstream git.

If I run a verbose-grub-install, that reports a grub-mkimage command:

$ sudo grub-install -v /dev/sda 2>&1 | grep grub-mkimage
grub-install: info: grub-mkimage --directory '/usr/lib/grub/i386-pc' --prefix '(mduuid/90aa34c17bd7b3502690763c289ebaf1)/boot/grub' --output '/boot/grub/i386-pc/core.img'  --dtb '' --sbat '' --format 'i386-pc' --compression 'auto'  'ext2' 'part_msdos' 'part_msdos' 'diskfilter' 'mdraid1x' 'biosdisk'


...yet that command cannot be run:

$ sudo grub-mkimage --directory '/usr/lib/grub/i386-pc' --prefix '(mduuid/90aa34c17bd7b3502690763c289ebaf1)/boot/grub' --output '/boot/grub/i386-pc/core.img'  --dtb '' --sbat '' --format 'i386-pc' --compression 'auto'  'ext2' 'part_msdos' 'part_msdos' 'diskfilter' 'mdraid1x' 'biosdisk'
grub-mkimage: error: cannot open `': No such file or directory.


The problem is the "--dtb ''" and "--sbat ''" parts. When grub-install runs, it calls grub_install_generate_image() directly and passes NULL pointers for those options, yet when grub-mkimage is run from the command line, those options are pointers to empty strings. grub_install_generate_image() checks for NULL pointers, but not for empty strings.

I do not know the best solution; either grub-install should omit those options when they are unset or grub-mkimage should accept them and consider empty strings to mean "disabled".

Thanks,
Corey

Corey Hickey <bugfood>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bugfood (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-8ccc.
    Corresponding source code