Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 591598 - sys-kernel/genkernel-next does not handle grub[-multislot] (error running grub2-mkconfig)
Summary: sys-kernel/genkernel-next does not handle grub[-multislot] (error running gru...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ettore Di Giacinto (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-18 10:51 UTC by Oliver Koch
Modified: 2016-12-22 17:53 UTC (History)
4 users (show)

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


Attachments
proposed patch (gen_bootloader.patch,982 bytes, patch)
2016-08-18 10:53 UTC, Oliver Koch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Koch 2016-08-18 10:51:55 UTC
This is the same problem as in bug 510108, only regarding genkernel-next instead of genkernel:

genkernel-next assumes grub[multislot] when regenerating grub2 config file.
Attached patch teaches it to look for grub2-mkconfig or grub-mkconfig.

Since -multislot has become the default change is necessary.

Reproducible: Always

Steps to Reproduce:
1. install grub2 [-multislot]
2. run genkernel-next with BOOTLOADER="grub2" in /etc/genkernel.conf
Actual Results:  
[..]
* Running grub2-mkconfig to create /boot/grub/grub.cfg...
/usr/share/genkernel/gen_bootloader.sh: line 53: grub2-mkconfig: command not found
[..]

Expected Results:  
[..]
* Running grub-mkconfig to create /boot/grub/grub.cfg...
Generating grub configuration file ...
Found linux image: [..]

proposing patch:

@@ -43,14 +43,24 @@
         fi
     done
 
+    for candidate in \
+            "/usr/sbin/grub2-mkconfig" \
+            "/usr/sbin/grub-mkconfig" \
+            ; do
+        if [[ -e "${candidate}" ]]; then
+            GRUB_MKCONF=${candidate}
+            break
+        fi
+    done
+
     if [[ -z "${GRUB_CONF}" ]]; then
         print_error 1 "Error! Grub2 configuration file does not exist, please ensure grub2 is correctly setup first."
         return 0
     fi
 
     print_info 1 "You can customize Grub2 parameters in /etc/default/grub."
-    print_info 1 "Running grub2-mkconfig to create ${GRUB_CONF}..."
-    grub2-mkconfig -o "${GRUB_CONF}"
+    print_info 1 "Running ${GRUB_MKCONF} to create ${GRUB_CONF}..."
+    ${GRUB_MKCONF} -o "${GRUB_CONF}"
     [ "${BUILD_RAMDISK}" -ne 0 ] && sed -i 's/ro single/ro debug/' "${GRUB_CONF}"
 }
Comment 1 Oliver Koch 2016-08-18 10:53:22 UTC
Created attachment 443682 [details, diff]
proposed patch
Comment 2 André 2016-12-15 07:06:45 UTC
I'm also affected by the issue and applying the patch fixes it.
Even though Sabayon is probably not yet runnning [-multislot], shouldn't this proposed upstream as well?
https://github.com/Sabayon/genkernel-next
Comment 3 Ettore Di Giacinto (RETIRED) gentoo-dev 2016-12-15 14:41:54 UTC
Thanks you all for filing the issue,

Is the problem still present with sys-kernel/genkernel-next-65 ?
Comment 4 André 2016-12-16 07:33:18 UTC
Yes indeed it's fixed upstream ```grub2-mkconfig || grub-mkconfig``` and it's working.
I don't know how I didn't catch that...
The commit:
https://github.com/Sabayon/genkernel-next/commit/fb7249e35c83a96412c291e3b5aa1e76ef328e9e
In the release 65:
https://github.com/Sabayon/genkernel-next/blob/v65/gen_bootloader.sh#L53
Thanks!
Comment 5 Oliver Koch 2016-12-16 07:55:19 UTC
The fix is working for me too.

Thanks!
Comment 6 Pacho Ramos gentoo-dev 2016-12-17 12:46:27 UTC
Since -multislot is now the default setting for grub, maybe -65 version should be stabilized as soon as possible :/

Thanks!