Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 921622 - >=sys-kernel/installkernel-gentoo-8: dracut[F]: Can't write to vmlinux: Directory vmlinux does not exist or is not accessible
Summary: >=sys-kernel/installkernel-gentoo-8: dracut[F]: Can't write to vmlinux: Direc...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal (vote)
Assignee: Distribution Kernel Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-09 01:05 UTC by Peter Easton
Modified: 2024-01-09 08:58 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Easton 2024-01-09 01:05:32 UTC
Good afternoon!

I'd like to report a bug for `make install` on on the kernel.

Steps to reproduce
Attempting to run `make install` on the kernel in /usr/src/linux fails with the following scrollback:

```
morgans-revenge ~ # cd /usr/src/linux
morgans-revenge /usr/src/linux # make -j50
  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CHK     kernel/kheaders_data.tar.xz
morgans-revenge /usr/src/linux # make install 
sh -x ./arch/powerpc/boot/install.sh "5.15.145-gentoo-ppc64le" vmlinux \
System.map "/boot"
+ set -e
+ verify vmlinux
+ '[' '!' -f vmlinux ']'
+ verify System.map
+ '[' '!' -f System.map ']'
+ '[' -x /root/bin/installkernel ']'
+ '[' -x /sbin/installkernel ']'
+ exec /sbin/installkernel 5.15.145-gentoo-ppc64le vmlinux System.map /boot
run-parts: executing /etc/kernel/preinst.d/50-dracut.install 5.15.145-gentoo-ppc64le vmlinux
dracut[I]: Executing: /usr/bin/dracut --force --verbose --kernel-image vmlinux vmlinux/initrd 5.15.145-gentoo-ppc64le
dracut[F]: Can't write to vmlinux: Directory vmlinux does not exist or is not accessible.
 * Failed to generate initramfs
run-parts: /etc/kernel/preinst.d/50-dracut.install exited with return code 1
make: *** [arch/powerpc/Makefile:387: install] Error 1
morgans-revenge /usr/src/linux #
```

Dracut is version 060. I have been able to reproduce this with kernel version 5.15.135 to 5.15.145.

I discussed on the IRC channel, here is a chat log of the discussion.

```
<matoro> JollyRoger: is your kernel image actually vmlinux or is it something else.  i.e. do you actually have a vmlinux file in the root of your kernel directory
<matoro> with genkernel at least it explicitly invokes "make vmlinux".  maybe your kenrnel image is zImage or something like that?
<awilfox> it's being called with the wrong arguments
<awilfox> https://github.com/dracutdevs/dracut/blob/master/install.d/50-dracut.install
<matoro> yeah but that's being called from /etc/kernel/preinst.d/50-dracut.install
<matoro> which for us comes from sys-kernel/installkernel-gentoo
<ernsteiswuerfel> sam_: ah, you already fixed my gcc-14 bug! that was fast :o
<ernsteiswuerfel> but I got another one coming ;)
<@sam_> uh oh
<ernsteiswuerfel> no showstopper though ;) gcc-14 errors out with an an unknown opcode when building with -mcpu=7450. I am just waiting the build to finish with -mcpu=powerpc to check whether this helps
<JollyRoger> Hi matoro, let me give it a try... if I try "file vmlinux" it returns to me this output: 
<JollyRoger> morgans-revenge /usr/src/linux # file vmlinux
<JollyRoger> vmlinux: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (SYSV), statically linked, BuildID[sha1]=9f504ee96d83ed63d7fcfa8353cf627b7f05e969, with debug_info, not stripped
<matoro> hmm, so it's there.  what do you get for: $ qfile -v /etc/kernel/preinst.d/50-dracut.install
<JollyRoger> Lemme try...
<JollyRoger> Oh this is pretty neat! 
<JollyRoger> Thank you for showing me this, I will use this command a lot in the future, I just know it!
<JollyRoger> morgans-revenge /usr/src/linux # qfile -v /etc/kernel/preinst.d/50-dracut.install 
<JollyRoger> sys-kernel/installkernel-gentoo-10: /etc/kernel/preinst.d/50-dracut.install
<JollyRoger> This is what it gives me back in return.
<matoro> okay, I'm kind of following what's happening
<matoro> we have img=${2}
<matoro> which is set to "vmlinux"
<matoro> and then we have initrd=${img%/*}/initrd
<matoro> this evaluates to "vmlinux/initrd"
<matoro> but I don't think that's what we want, it should be just "initrd"
<matoro> for example, if img=arch/powerpc/boot/vmlinux
<matoro> then it evaluates to initrd=arch/powerpc/boot/initrd
<JollyRoger> Oh. Hummm... any ideas on what we should try? 
<matoro> I believe you need to open a bug against sys-kernel/installkernel-gentoo
<JollyRoger> I wonder what caused this to happen. 
<JollyRoger> Okay! 
<JollyRoger> I'll uh, I'll go and get it. 
<matoro> it's this PR's fault I think:  https://github.com/projg2/installkernel-gentoo/pull/10
<matoro> looking at the change where this logic was ported from the eclass:  https://github.com/gentoo/gentoo/pull/33727
<matoro> this is the original code:  local image=${output%/*}/${rel_image_path##*/}
<matoro> kind of hard to follow...do CC Andrew
<matoro> this came in v8, so bug should specify: >=sys-kernel/installkernel-gentoo-8
<JollyRoger> Okay! I'll uh... I'll go and try to get a report drafted and sent in. I'll just search first to see if there's anything else there...
<@sam_> i don't think there is, this is very new
<@sam_> just get it filed
<JollyRoger> Ooh. should I attach this chat log, or maybe a summary...?
<matoro> can't hurt, most important thing is that you attach that log that you pasted
<JollyRoger> Copied it all now!
```

Known workarounds: Nothing at this moment. Please let me know if there's anything I can do.

Thank you!

Peter.

Reproducible: Always

Steps to Reproduce:
1. Set directory to /usr/src/linux with `cd /usr/src/linux`
2. Run `make oldconfig && make -j50` or make to compile kernel 
3. Run `make install` to install newly compiled kernel
Actual Results:  
Dracut fails by being unable to write to vmlinux directory. 

Expected Results:  
Kernel image to be installed to /boot

After discussing with matoro on the IRC channel, matoro suggested that this may be the issue: https://github.com/gentoo/gentoo/pull/33727
Comment 1 Larry the Git Cow gentoo-dev 2024-01-09 06:42:02 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce818c6629c7efe632e615793fa7050b7c7907c6

commit ce818c6629c7efe632e615793fa7050b7c7907c6
Author:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
AuthorDate: 2024-01-09 06:40:21 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
CommitDate: 2024-01-09 06:41:54 +0000

    sys-kernel/installkernel-gentoo: add 11
    
    fixes dracut/ukify gen on arches where the kernel image is in the
    kernel source root
    
    Closes: https://bugs.gentoo.org/921622
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>

 sys-kernel/installkernel-gentoo/Manifest           |  1 +
 .../installkernel-gentoo-11.ebuild                 | 56 ++++++++++++++++++++++
 2 files changed, 57 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76d617ec28c821b9ec4c319492c203e30e91c232

commit 76d617ec28c821b9ec4c319492c203e30e91c232
Author:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
AuthorDate: 2024-01-09 06:41:29 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan@gentoo.org>
CommitDate: 2024-01-09 06:41:55 +0000

    sys-kernel/installkernel-gentoo: drop 10
    
    Bug: https://bugs.gentoo.org/921622
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>

 sys-kernel/installkernel-gentoo/Manifest           |  1 -
 .../installkernel-gentoo-10.ebuild                 | 56 ----------------------
 2 files changed, 57 deletions(-)
Comment 2 Andrew Nowa Ammerlaan gentoo-dev 2024-01-09 06:44:10 UTC
Though I don't have a powerpc machine to test it on, I'm pretty sure version 11 fixes the issue. Please reopen if this is not the case.