30_os-prober fails in make_timeout() when using GRUB_BUTTON_CMOS_ADDRESS

Bug #1271141 reported by TJ
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

I've been configuring the alternate OS boot functionality and discovered that "30_os-prober" causes a syntax error in the generated "grub.cfg.new" when GRUB_BUTTON_CMOS_ADDRESS is defined. The bad generated code is:

if cmostest 85:3; then
else
fi

It is obviously missing any statements inside the conditional blocks.

The cause is make_timeout() only generating output when "$found_other_os" is empty. In the case of using GRUB_BUTTON_CMOS_ADDRESS its entire purpose is to use the alternative OS boot button that some PCs have.

I'll do a merge request later but the quick-fix to "/etc/grub/30_os-prober" is:

make_timeout() {
  if [ "x${found_other_os}" = "x" -o "x${GRUB_BUTTON_CMOS_ADDRESS}" != "x" ]; then

Revision history for this message
Colin Watson (cjwatson) wrote :

Could you try 2.02~beta2-*, now in trusty? The timeout code looks rather different there, and shouldn't suffer from this.

Revision history for this message
TJ (tj) wrote :

Looks to be solved. The generated grub script:

if cmostest 85:3 ; then
   set default="0"
elif [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

Changed in grub2 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.