Guided fixing of grub configuration errors

Registered by Brian Murray

We receive a multitude of package installation failure bug reports because people have misconfigured their /etc/default/grub file. These are often due to simple syntax errors which we should guide users into fixing for themselves.

Blueprint information

Steve Langasek
Brian Murray
Brian Murray
Series goal:
Accepted for quantal
Milestone target:
milestone icon ubuntu-12.10-beta-1
Started by
Kate Stewart

Related branches



The concept was briefly discussed at an Ubuntu Foundations' team meeting:

People use unicode quotes instead of ascii quotes, put kernel comand line parameters outside of the quotes or forget quotation marks.
We can detect the situation where people have made an error, but what can we do about it?
- pop up a debconf error when the error is detected (but debconf questions are often considered errors themselves)
- displayed when update-grub is run, block the upgrade until something is fixed
send one of those notifications‽ (hardware/ well software)
Colin put work into the grub apport hook to check for the syntax of /etc/default/grub so these should not be reported.
When update-grub is run by hand it's ok for it to just error out, but if its run by maintainer scripts or other processes, that's less good. But we don't want to just do nothing, because it'll just error elsewhere.
this contains a python module for modifying grub for debugging gpu errors
- It includes turning off "quiet, nosplash"
- perhaps it should be extended to add in other common options for changing grubs people will use it instead of editing the text files directly
For the, Brian Murray wrote some scripts that harvested to get xorg.confs and validate them. Perhaps these could be modified to do the same for grub.conf.
Canonical Support does not get these kind of problems. So this issue applies to a narrow kind of user type/profile.
Autofixing of unicode quotes is probably something we can do automatically and adding in missing final quote.


Work Items

Work items:
[brian-murray] find out statistics of what people edit in /etc/default/grub and provide that data to cjwatson: DONE
[bryce] Make xdiagnose handle grub.confs that have single quotes and syntax for escaping things: POSTPONED
[cjwatson] silently fixing cases where people have misedited /etc/default/grub: POSTPONED
[cjwatson] detect syntax errors in /etc/default/grub when update-grub is run and if we can't autofix them raise an error: POSTPONED
[brian-murray] move /etc/default/grub gathering from grub's apport package hook to apport's so it can be used by other packages: DONE
[brian-murray] have the ubuntu general hook collect /etc/default/grub for package installation failures found when running update-grub: DONE
[brian-murray] update apport to gather /etc/default/grub in Precise: DONE
[mpt] design graphical interface for GRUB customization <>: DONE

This blueprint contains Public information 
Everyone can see this information.