1 |
commit: 3b3b5360aaa4a2dafc84037f492e73ff31814fd7 |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 26 14:56:43 2022 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 26 14:58:44 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b3b5360 |
7 |
|
8 |
sys-boot/grub: add postinst warning to run grub-install |
9 |
|
10 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
11 |
|
12 |
sys-boot/grub/grub-2.06-r3.ebuild | 22 ++++++++++++++++------ |
13 |
sys-boot/grub/grub-9999.ebuild | 22 ++++++++++++++++------ |
14 |
2 files changed, 32 insertions(+), 12 deletions(-) |
15 |
|
16 |
diff --git a/sys-boot/grub/grub-2.06-r3.ebuild b/sys-boot/grub/grub-2.06-r3.ebuild |
17 |
index 3331ce3f9b71..341b1edc2a5e 100644 |
18 |
--- a/sys-boot/grub/grub-2.06-r3.ebuild |
19 |
+++ b/sys-boot/grub/grub-2.06-r3.ebuild |
20 |
@@ -301,18 +301,28 @@ pkg_postinst() { |
21 |
elog "For information on how to configure GRUB2 please refer to the guide:" |
22 |
elog " https://wiki.gentoo.org/wiki/GRUB2_Quick_Start" |
23 |
|
24 |
- if has_version 'sys-boot/grub:0'; then |
25 |
- elog "A migration guide for GRUB Legacy users is available:" |
26 |
- elog " https://wiki.gentoo.org/wiki/GRUB2_Migration" |
27 |
- fi |
28 |
- |
29 |
- if [[ -z ${REPLACING_VERSIONS} ]]; then |
30 |
+ if [[ -n ${REPLACING_VERSIONS} ]]; then |
31 |
+ local v |
32 |
+ for v in ${REPLACING_VERSIONS}; do |
33 |
+ if ver_test -gt ${v}; then |
34 |
+ ewarn |
35 |
+ ewarn "Re-run grub-install to update installed boot code!" |
36 |
+ ewarn |
37 |
+ break |
38 |
+ fi |
39 |
+ done |
40 |
+ else |
41 |
elog |
42 |
optfeature "detecting other operating systems (grub-mkconfig)" sys-boot/os-prober |
43 |
optfeature "creating rescue media (grub-mkrescue)" dev-libs/libisoburn |
44 |
optfeature "enabling RAID device detection" sys-fs/mdadm |
45 |
fi |
46 |
|
47 |
+ if has_version 'sys-boot/grub:0'; then |
48 |
+ elog "A migration guide for GRUB Legacy users is available:" |
49 |
+ elog " https://wiki.gentoo.org/wiki/GRUB2_Migration" |
50 |
+ fi |
51 |
+ |
52 |
if has_version sys-boot/os-prober; then |
53 |
ewarn "Due to security concerns, os-prober is disabled by default." |
54 |
ewarn "Set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub to enable it." |
55 |
|
56 |
diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild |
57 |
index 5aff4addbbee..407e54b6f361 100644 |
58 |
--- a/sys-boot/grub/grub-9999.ebuild |
59 |
+++ b/sys-boot/grub/grub-9999.ebuild |
60 |
@@ -297,18 +297,28 @@ pkg_postinst() { |
61 |
elog "For information on how to configure GRUB2 please refer to the guide:" |
62 |
elog " https://wiki.gentoo.org/wiki/GRUB2_Quick_Start" |
63 |
|
64 |
- if has_version 'sys-boot/grub:0'; then |
65 |
- elog "A migration guide for GRUB Legacy users is available:" |
66 |
- elog " https://wiki.gentoo.org/wiki/GRUB2_Migration" |
67 |
- fi |
68 |
- |
69 |
- if [[ -z ${REPLACING_VERSIONS} ]]; then |
70 |
+ if [[ -n ${REPLACING_VERSIONS} ]]; then |
71 |
+ local v |
72 |
+ for v in ${REPLACING_VERSIONS}; do |
73 |
+ if ver_test -gt ${v}; then |
74 |
+ ewarn |
75 |
+ ewarn "Re-run grub-install to update installed boot code!" |
76 |
+ ewarn |
77 |
+ break |
78 |
+ fi |
79 |
+ done |
80 |
+ else |
81 |
elog |
82 |
optfeature "detecting other operating systems (grub-mkconfig)" sys-boot/os-prober |
83 |
optfeature "creating rescue media (grub-mkrescue)" dev-libs/libisoburn |
84 |
optfeature "enabling RAID device detection" sys-fs/mdadm |
85 |
fi |
86 |
|
87 |
+ if has_version 'sys-boot/grub:0'; then |
88 |
+ elog "A migration guide for GRUB Legacy users is available:" |
89 |
+ elog " https://wiki.gentoo.org/wiki/GRUB2_Migration" |
90 |
+ fi |
91 |
+ |
92 |
if has_version sys-boot/os-prober; then |
93 |
ewarn "Due to security concerns, os-prober is disabled by default." |
94 |
ewarn "Set GRUB_DISABLE_OS_PROBER=false in /etc/default/grub to enable it." |