Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
genkernel & grub2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 316
Location: Napa, CA

PostPosted: Wed Nov 16, 2016 3:07 pm    Post subject: genkernel & grub2 Reply with quote

When I compile (just testing the installation in a grub2 host) with genkernal, I'll use:
Code:
genkernel --oldconfig  --install --bootloader=grub --symlink --disklabel --lvm --mdadm --makeopts=-j9 --no-symlink --no-clean

My goal is overcome the error message in the genkernel output of:
Quote:
* Adding kernel to /boot/grub/grub.conf...
awk: fatal: cannot open file `/var/tmp/genkernel/17356.7183.16045.1962/grub.map' for reading (No such file or directory)
* Error! /boot/grub/grub.conf does not exist and the correct settings can not be automatically detected.
* Please manually create your /boot/grub/grub.conf file.
*
* Kernel compiled successfully!


/etc/genkernel.conf has specified "grub2":
Code:
zeta boot # cat /etc/genkernel.conf |grep BOOTLOADER
#BOOTLOADER="grub"
BOOTLOADER="grub2"
zeta boot #

and I do have a grub2 configuration file at /etc/default/grub and I do have /boot/grub/grub.cfg previously generated by hand.

Is the attempt to find a grub.conf a bug in genkernal when you are using grub2?

Also, what would be the fatest way to simply test the install functionality of genkernel without going through a compile of the modules? I tried "--no-clean" hoping that it would just skip through files previously created, but running genkernel seems to still take several minutes and it is compiling modules and I could not determine a way to skip building modules.
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 15056
Location: here

PostPosted: Wed Nov 16, 2016 3:12 pm    Post subject: Reply with quote

Read this
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 316
Location: Napa, CA

PostPosted: Wed Nov 16, 2016 4:36 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Read this


Thank you.
In my case, I have /etc/genkernel.conf at line 112:
Code:
# Add new kernel to grub?
#BOOTLOADER="grub"
#
# 11/16/2016 jlpoole: specify 2!
#
BOOTLOADER="grub2


The patch referenced fedeliallalinea's link was a fix within the function set_bootloader_grub2(). I modified my /usr/share/genkernel/gen_bootloader.sh script according to the patch , but it did not change what happened.

I then dug further and started debugging /usr/bin/genkernel and /usr/share/genkernel/gen_bootloader and discovered that the assumption in the code and in /etc/genkernel.conf that $BOOTDIR has been populated with "/boot" is incorrect. In fact, when set_bootloader_grub2 is called, $BOOTDIR is empty and thus the failures ensue. This bug can be overcome by explicitly setting in /etc/genkernel.conf:
Code:
# Set genkernel's temporary work directory.  Default is /var/tmp/genkernel
#TMPDIR="/var/tmp/genkernel"

# Set the boot directory, default is /boot
#BOOTDIR="/boot"
#
# 11/16/2016 jlpoole: NOT SO! default is "", so
# we have to explicitly set it here.
#
BOOTDIR="/boot"
Back to top
View user's profile Send private message
jlpoole
Guru
Guru


Joined: 01 Nov 2005
Posts: 316
Location: Napa, CA

PostPosted: Wed Nov 16, 2016 4:55 pm    Post subject: Reply with quote

I'm not out of the woods yet. Supposing I had found the problem, I then reran genkernel with my debugging statements and found that $BOOTLOADER is being changed from grub2 to grub. Keep in mind these genkernel scripts were modified by me containing print_info() to trace values and I incorporated the changes in the patch referenced in prior comments.
Code:
zeta boot # genkernel --oldconfig  --install --bootloader=grub --symlink --disklabel --lvm --mdadm --makeopts=-j9 --no-symlink --no-clean all
* [jlpoole gen_bootloader 3] BOOTLOADER = grub2
* Gentoo Linux Genkernel; Version 3.4.52.4
* Running with options: --oldconfig --install --bootloader=grub --symlink --disklabel --lvm --mdadm --makeopts=-j9 --no-symlink --no-clean all

* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..

* Linux Kernel 4.4.26-gentoo for x86_64...
* .. with config file /etc/kernels/kernel-config-x86_64-4.4.26-gentoo
* kernel: --mrproper is disabled; not running 'make mrproper'.
*         >> Running oldconfig...
* kernel: --clean is disabled; not running 'make clean'.
*         >> Compiling 4.4.26-gentoo bzImage...
*         >> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y...
*         >> Compiling 4.4.26-gentoo modules...
*         >> Generating module dependency data...
* Copying config for successful build to /etc/kernels/kernel-config-x86_64-4.4.26-gentoo
* busybox: >> Using cache
* initramfs: >> Initializing...
*         >> Appending base_layout cpio data...
*         >> Appending auxilary cpio data...
*         >> Copying keymaps
*         >> Appending busybox cpio data...
*         >> Appending lvm cpio data...
*           LVM: Adding support (compiling binaries)...
* lvm: >> Using cache
*         >> Appending mdadm cpio data...
*               MDADM: Skipping inclusion of mdadm.conf
*               MDADM: Adding support (compiling binaries)...
*               MDADM: Using cache
*         >> Appending modules cpio data...
*         >> Appending blkid cpio data...
*         >> Appending modprobed cpio data...
*         >> Appending linker cpio data...
*         >> Finalizing cpio...
*         >> Compressing cpio data (.xz)...
* [jlpoole debug]in set_bootloader(),  Bootloader = grub
* [jlpoole gen_bootloader 9] calling wrong grub
* Adding kernel to /boot/grub/grub.conf...
awk: fatal: cannot open file `/var/tmp/genkernel/12094.4236.25626.7500/grub.map' for reading (No such file or directory)
* Error! /boot/grub/grub.conf does not exist and the correct settings can not be automatically detected.
* Please manually create your /boot/grub/grub.conf file.
*
* Kernel compiled successfully!
*
* Required Kernel Parameters:
*     root=/dev/$ROOT
*
*     Where $ROOT is the device node for your root partition as the
*     one specified in /etc/fstab
*
* If you require Genkernel's hardware detection features; you MUST
* tell your bootloader to use the provided INITRAMFS file.

* WARNING... WARNING... WARNING...
* Additional kernel cmdline arguments that *may* be required to boot properly...
* add "dolvm" for lvm support
* add "domdadm" for RAID support
* With support for several ext* filesystems available, it may be needed to
* add "rootfstype=ext3" or "rootfstype=ext4" to the list of boot parameters.

* Do NOT report kernel bugs as genkernel bugs unless your bug
* is about the default genkernel configuration...
*
* Make sure you have the latest ~arch genkernel before reporting bugs.
zeta boot #

So, the Bug Hunt continues and my previous declaration that explicitly setting BOOTDIR fixes the problem should be read with the understanding that the over all problem, namely using grub2 configuration, is not fixed.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum