Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 484144 - Update /boot/grub path in grub2 documents
Summary: Update /boot/grub path in grub2 documents
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Other documents (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-07 23:18 UTC by Mike Gilbert
Modified: 2013-09-21 21:29 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Docs patch (grub2-boot-grub.patch,3.15 KB, patch)
2013-09-07 23:18 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Gilbert gentoo-dev 2013-09-07 23:18:22 UTC
Created attachment 358218 [details, diff]
Docs patch

I'm making one last configuration change before this package goes stable and I have to stop messing with it.

grub2-install from >=sys-boot/grub-2.00_p5107-r1 will install files in /boot/grub rather than /boot/grub2. This is upstream's default location, and there isn't really a good reason to change it.

See attached patch for the handbook and grub2 migration guide.
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2013-09-19 18:31:25 UTC
Sorry for the late action; I notice the ebuild displays the change if the user already had a previous grub2 installed.

If a user misses it, am I right in my assumption that the user, when running "grub2-mkconfig -o /boot/grub2/grub.cfg", will not notice anything (errors of any kind) until he ran grub2-install (as it replaces the "old" GRUB2 with the new GRUB2)?

Will grub2-install complain about /boot/grub2 still being available while not being used anymore?
Comment 2 Mike Gilbert gentoo-dev 2013-09-19 19:23:29 UTC
(In reply to Sven Vermeulen from comment #1)
> If a user misses it, am I right in my assumption that the user, when running
> "grub2-mkconfig -o /boot/grub2/grub.cfg", will not notice anything (errors
> of any kind) until he ran grub2-install (as it replaces the "old" GRUB2 with
> the new GRUB2)?
> 

Correct. Running grub2-install will update the MBR (or EFI binary) with the new path, which means grub will then start looking for /boot/grub/grub.cfg instead of /boot/grub2/grub.cfg.

If the user never runs grub2-install, the old version of grub will continue to load /boot/grub2/grub.cfg.

> Will grub2-install complain about /boot/grub2 still being available while
> not being used anymore?

grub2-install does not issue any kind of warning message in this scenario.

I thought about adding some migration code to pkg_postinst that would move /boot/grub2 to /boot/grub and create a symlink from /boot/grub2 -> /boot/grub. However, that is a bit tricky:

- If /boot is a FAT filesystem, we can't use a symlink. This is common in EFI setups.
- We would need to check for conflicting files in /boot/grub.
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2013-09-20 06:48:21 UTC
Ok, I've committed the changes. I hope we don't get (m)any reports about users that ran grub2-install and then still used grub2-mkconfig -o /boot/grub2/grub.cfg and then finding out GRUB2 doesn't load the new kernels.

But then again, I'm not sure how many users would run grub2-install after they already switched to grub2...
Comment 4 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2013-09-21 20:29:45 UTC
Hi, I'm User Zero, ... maybe.

I updated to grub-2.00_p5107-r1 today  ( because the previous version of ~ I had unmasked vanished ).

Ran grub2-install to update my mbr, nothing seemed out of place.

Ran my automated script that calls grub2-mkconfig, nothing seemed out of place.

Rebooted ... OH Dear.

This bug is the best that matches my problem, or should I file a separate one?

Fortunately I worked out how to load the grub2 config manually and get my system booting again.

Only after booting and checking the mtimes in /boot/grub/ did I observe changes had transpired there.
Comment 5 Mike Gilbert gentoo-dev 2013-09-21 21:06:33 UTC
(In reply to Kent Fredric from comment #4)
> This bug is the best that matches my problem, or should I file a separate
> one?
> 

This is not the place to discuss it. File a new bug if you must.
Comment 6 Mike Gilbert gentoo-dev 2013-09-21 21:29:30 UTC
+  21 Sep 2013; Mike Gilbert <floppym@gentoo.org> grub-2.00_p5107-r1.ebuild,
+  grub-9999.ebuild:
+  Make a symlink from /boot/grub/grub.cfg to /boot/grub2/grub.cfg in case people
+  don't read the warning.