| Summary: | default entry set by drakboot isn't enforced by grub2 | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | papoteur <yvesbrungard> |
| Component: | Installer | Assignee: | Thierry Vignaud <thierry.vignaud> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | Normal | CC: | thierry.vignaud, zen25000 |
| Version: | Cauldron | Keywords: | NEEDINFO, PATCH |
| Target Milestone: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| See Also: | https://bugs.mageia.org/show_bug.cgi?id=18560 | ||
| Whiteboard: | |||
| Source RPM: | grub2, drakxtools | CVE: | |
| Status comment: | |||
| Bug Depends on: | |||
| Bug Blocks: | 416 | ||
| Attachments: |
set default grub2 entry in /etc/default/grub
grub.cfg diff |
||
|
Description
papoteur
2015-05-30 11:19:40 CEST
Manuel Hiebel
2015-05-30 12:44:42 CEST
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
Samuel Verschelde
2015-05-30 23:47:28 CEST
Summary:
MCC doesn't set the default entry as selected for grub2 =>
drakboot doesn't apply user-selected default entry when using grub2 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) =>
zen25000 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 =>
zen25000 (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
Thierry Vignaud
2015-06-05 14:59:00 CEST
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.
Barry Jackson
2015-06-06 17:46:44 CEST
Assignee:
zen25000 =>
thierry.vignaud 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
Thierry Vignaud
2016-05-31 11:09:49 CEST
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 =>
RESOLVED |