Description of problem: Installation with DVD-x86_64 pre-final-round 3 on UEFI laptop. Bootloader from summary at installation step. Ask for installation in sdax, (/ of the new installation). Ask to have already installed Mageia 4 as default entry. After reboot, the default entry is the first line, i.e. the new installation, not my Mageia 4. The Mageia 4 system has no more bootloader to configure. Restart Mageia 5 Go to MCC, configure the bootloader. It is in /dev/sda. The default option is Mageia 4 ! Write the configuration. At reboot, the default entry is always the first line. Reproducible: Steps to Reproduce:
Assignee: bugsquad => thierry.vignaud
Please attach your /root/drakx/report.bug.xz & the file resulting from running: journalctl|egrep 'drakboot|os-prober|grub'>/tmp/journal.txt
Keywords: (none) => NEEDINFO
For report.bug, it is already here: https://bugs.mageia.org/attachment.cgi?id=6668 I must reboot to access the journal entries.
Journal is short and haven't such entries. Papoteur
Summary: MCC doesn't set the default entry as selected for grub2 => drakboot doesn't apply user-selected default entry when using grub2Severity: normal => major
If journal is short then you didn't run "drakboot --boot"... As for drakx, we did run the following command: "grub2-set-default Mageia 4 (4) (sur /dev/sda5)" which means we respect your choice. So that would be a grub2 bug. What happens if you manually run the following command? grub2-set-default "Mageia 4 (4) (sur /dev/sda5)"
CC: (none) => zen25000Blocks: (none) => 416Source RPM: (none) => grub2
Before I run this command, I checkeddd the file /boot/grub2/grubenv. Its content is: # GRUB Environment Block saved_entry=Mageia 4 (4) (sur /dev/sda5) ########################################## The command grub2-set-default "Mageia 4 (4) (sur /dev/sda5)" gives no message when executed. Yet I will reboot to see if something is changed a boot.
s/a boot/at boot There is no changes, the default entry is always the first line.
Barry: grub.cfg contains "menuentry 'Mageia 4 (4) (sur /dev/sda5)' ..." (from os-prober). However, depsite grub2-set-default "Mageia 4 (4) (sur /dev/sda5)" having altered /boot/grub2/grubenv, this is not respected by grub2 on booting
Assignee: thierry.vignaud => zen25000Summary: drakboot doesn't apply user-selected default entry when using grub2 => default entry set by drakboot isn't enforced by grub2
(In reply to Thierry Vignaud from comment #7) > Barry: > grub.cfg contains "menuentry 'Mageia 4 (4) (sur /dev/sda5)' ..." (from > os-prober). > However, depsite grub2-set-default "Mageia 4 (4) (sur /dev/sda5)" having > altered /boot/grub2/grubenv, this is not respected by grub2 on booting Is grub2-mkconfig -o /boot/grub2/grub.cfg OR update-grub run afterwards? I have always used a GRUB_DEFAULT= entry in /etc/default/grub (followed by grub2-mkconfig) for that purpose. e.g.: GRUB_DEFAULT="Windows Vista (loader) (on /dev/sda2)" I have never used or tested grub2-set-default.
I can confirm that grub2-set-default does not seem to work, in fact I was not aware of it. However I think it is more consistent to use the GRUB_DEFAULT variable in /etc/default/grub for this which does work correctly. (Keeping all configuration in one place) I have just tested it in a clean Mga5 install and I also have a laptop that uses it with Mga5 with no problems.
@thierry I just noticed that you were not cc'd on this.
CC: (none) => thierry.vignaud
That's easy to do (see attached patch). However, grub2-set-default did worked at some stage, so there's some regression. Also wouldn't GRUB_DEFAULT be overwritten if we boot another entry? Wouldn't it be set back to GRUB_DEFAULT="saved"?
Created attachment 6706 [details] set default grub2 entry in /etc/default/grub Anyway, it would me much simpler this way
Keywords: (none) => PATCH
Created attachment 6707 [details] grub.cfg diff though it didn't work in my case: grub2-mkconfig introduced a bogus if block that messed up the default entry... grub2 then default to first entry ("Mageia") grub2 needs serious fixing...
(In reply to Thierry Vignaud from comment #11) > That's easy to do (see attached patch). > > However, grub2-set-default did worked at some stage, so there's some > regression. > Also wouldn't GRUB_DEFAULT be overwritten if we boot another entry? > Wouldn't it be set back to GRUB_DEFAULT="saved"? I have never seen that happen.
I have just been reading the docs and it seems that grub2-set-default should only work if GRUB_DEFAULT="saved". It will not be changed on each boot as long as we don't have GRUB_SAVEDEFAULT set. I will try to test this later.
Yes, that seems to work - so for the current use of grub2-set-default to work it needs to be combined with GRUB_DEFAULT="saved".
Hello,I confirm that grub2-set-default "Mageia 4 (4) (sur /dev/sda5)" GRUB_DEFAULT="saved" and update-grub works to change the default entry.
Assignee: zen25000 => thierry.vignaudSource RPM: grub2 => drakxtools
Barry, no it doesn't work everywhere. It doesn't work at all on my test VM. See comment #13
Source RPM: drakxtools => grub2, drakxtools
(In reply to Thierry Vignaud from comment #18) > Barry, no it doesn't work everywhere. > It doesn't work at all on my test VM. See comment #13 In comment 13 you were testing the use of just GRUB_DEFAULT not grub2-set-default. Did you also test in VM using the same as papoteur in #17?
@Thierry I just tested in a fully updated Mga5 VM (PC-BIOS) and it worked fine. Was your test in A UEFI system or PC-BIOS?
On the last kernel update in Cauldron I noticed this: --------snip----------- removing upgraded package kernel-server-latest-4.3.2-2.mga6.x86_64 1/3: removing kernel-server-latest-4.3.2-2.mga6.x86_64 ############################################# removing upgraded package kernel-desktop-latest-4.3.2-2.mga6.x86_64 2/3: removing kernel-desktop-latest-4.3.2-2.mga6.x86_64 ############################################# removing upgraded package cpupower-4.3.2-2.mga6.x86_64 3/3: removing cpupower-4.3.2-2.mga6.x86_64 ############################################# Creating: target|kernel|dracut args|basicmodules Usage: grub2-set-default [OPTION] MENU_ENTRY Set the default boot menu entry for GRUB. This requires setting GRUB_DEFAULT=saved in /etc/default/grub. -h, --help print this message and exit -v, --version print the version information and exit --boot-directory=DIR expect GRUB images under the directory DIR//grub2 instead of the /boot/grub2 directory MENU_ENTRY is a number, a menu item title or a menu item identifier. Report bugs to <bug-grub@gnu.org>. Creating: target|kernel|dracut args|basicmodules Usage: grub2-set-default [OPTION] MENU_ENTRY Set the default boot menu entry for GRUB. This requires setting GRUB_DEFAULT=saved in /etc/default/grub. -h, --help print this message and exit -v, --version print the version information and exit --boot-directory=DIR expect GRUB images under the directory DIR//grub2 instead of the /boot/grub2 directory MENU_ENTRY is a number, a menu item title or a menu item identifier. Report bugs to <bug-grub@gnu.org>. removing installed rpms (kernel-desktop-4.4.0-0.rc6.2.mga6-1-1.mga6.x86_64.rpm kernel-server-4.4.0-0.rc6.2.mga6-1-1.mga6.x86_64.rpm kernel-desktop-latest-4.4.0-0.rc6.2.mga6.x86_64.rpm kernel-server-latest-4.4.0-0.rc6.2.mga6.x86_64.rpm cpupower-4.4.0-0.rc6.2.mga6.x86_64.rpm) from /var/cache/urpmi/rpms -------snip------------ [baz@jackodesktop ~]$ cat /etc/default/grub GRUB_ENABLE_CRYPTODISK=y GRUB_GFXPAYLOAD_LINUX=auto GRUB_GFXMODE=1024x768x32 GRUB_TERMINAL_OUTPUT=gfxterm GRUB_CMDLINE_LINUX_DEFAULT=" splash quiet noiswmd resume=UUID=d0402b80-ef19-4956-9064-abe20fe77dc0" GRUB_DISABLE_OS_PROBER=false GRUB_THEME=/boot/grub2/themes/maggy/theme.txt GRUB_DISABLE_SUBMENU=n GRUB_DISABLE_RECOVERY=false GRUB_DISTRIBUTOR=Mageia GRUB_TIMEOUT=10 Maybe this should only be run if GRUB_DEFAULT=saved
See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=18560
commit ad128f02d165f26d7eec3781952f108efb588c67 Author: Thierry Vignaud <tvignaud@...> Date: Fri May 27 16:38:51 2016 +0200 grub2: set GRUB_DEFAULT + GRUB_SAVEDEFAULT else grub2-set-default won't work (mga#9627, mga#16059) but do not overwrite it if user has changed its value --- Commit Link: http://gitweb.mageia.org/software/drakx/commit/?id=ad128f02d165f26d7eec3781952f108efb588c67 Bug links: Mageia https://bugs.mageia.org/9627 https://bugs.mageia.org/16059
Fixed in git
Status: NEW => RESOLVEDResolution: (none) => FIXED