# Cannot install an initramfs

## h10082

[Moderator note: this post, and only this post, was originally attached to the solved topic [solved] Cannot install an initramfs.  Contrary to the content of this post, that thread does not seem to be a similar issue, so I split this post to its own thread. -Hu]

I want to upgrade my kernel from 5.10.27 to 5.10.49-gentoo-r1.

I'm having a similar issue when running genkernel:

```

genkernel --lvm --install --kernel-config=./.config initramfs

```

```

Copying file m4/wchar_t.m4

Copying file m4/wint_t.m4

Copying file m4/xsize.m4

Copying file po/Makevars.template

sh: line 1: tools/git-version-gen: Permission denied

configure.ac:14: error: AC_INIT should be called with package and version arguments

/usr/share/aclocal-1.16/init.m4:29: AM_INIT_AUTOMAKE is expanded from...

configure.ac:14: the top level

autom4te-2.69: /usr/bin/m4 failed with exit status: 1

aclocal-1.16: error: /usr/bin/autom4te-2.69 failed with exit status: 1

autoreconf-2.69: aclocal failed with exit status: 1

* ERROR: Command 'autoreconf --force --install ' failed!

* ERROR: create_initramfs(): append_data(): append_util-linux(): populate_binpkg(): gkbuild(): Failed to create binpkg of util-linux-2.37!

* Please consult '/var/log/genkernel.log' for more information and any

* errors that were reported above.

*

```

tools/git-version-gen dosen't exist on my system. How can I install it?

----------

## h10082

I've tried reinstalling sys-apps/util-linux as git-version-gen seems to beling to this package (https://github.com/karelzak/util-linux/blob/master/tools/git-version-gen)

 However tools/git-version-gen wasn't copied.   :Sad: 

----------

## Hu

genkernel is trying, and failing, to build its own private copy of util-linux.  The system util-linux package does not install that file.  It is probably only used in part of the build process.

----------

## h10082

The mentioned error was happening with genkernel 4.2.3. I downgraded genkernel to versions 4.0.10 and 3.5.3.3 but still saw errors about premissions. This time complaining about diffrent files that actual exist.

To install the new sources I ran:

```

emerge --ask --update --deep --with-bdeps=y --newuse @world

```

I proceeded to run:

```

emerge --depclean

```

This removes the superseded kernel sources from portage but dosen't actually remove the kernel sources folder 

```

tux ~ # ls -la /usr/src/

total 20

drwxr-xr-x  5 root root 4096 Jul 22 15:04 .

drwxr-xr-x 13 root root 4096 Jun 21 02:43 ..

-rw-r--r--  1 root root    0 Jun 21 02:37 .keep

lrwxrwxrwx  1 root root   20 Jul 22 13:55 linux -> linux-5.10.52-gentoo

drwxr-xr-x 21 root root 4096 Jul 17 08:10 linux-5.10.27-gentoo

drwxr-xr-x 21 root root 4096 Jul 22 13:54 linux-5.10.49-gentoo-r1

drwxr-xr-x 25 root root 4096 Jul 22 15:41 linux-5.10.52-gentoo

```

Is it fine to follow this approch? This is my first attempt to upgrade my kernel since installing Gentoo recently.Last edited by h10082 on Thu Jul 22, 2021 8:09 pm; edited 1 time in total

----------

## Hu

That is an acceptable way of managing kernel sources.  I don't use genkernel, so I can't help with errors specific to it.  Perhaps someone more familiar with it will see your thread and comment.

----------

## h10082

 *Hu wrote:*   

> That is an acceptable way of managing kernel sources.  I don't use genkernel, so I can't help with errors specific to it.  Perhaps someone more familiar with it will see your thread and comment.

 

Ok thanks for the confirmation. 

I may concede and try dracut as I haven't found any mention about issue on the web or related bugs on the genkernel project. 

Also with the downgrades, I would of thought it would work. I seem to have broken something and don't know how.

----------

## Goverp

<edit> Sorry, I misunderstood the original post - it's genkernel you've downgraded.  I wrote a long answer about downgrading kernels.  Totally irrelevant, so I've removed that post and replaced it with this comment.</edit>

----------

## h10082

I've opted for dracut which is working fine   :Very Happy: 

----------

## Bogdan107

My conf:

```
$ cat /etc/genkernel.conf | grep -e TMPDIR -e CACHE_DIR

TMPDIR="/tmp/genkernel"

CACHE_DIR="/var/cache/genkernel"

$ mount | grep " /tmp "

/dev/zram0 on /tmp type btrfs (rw,nosuid,nodev,noexec,relatime,ssd,space_cache,subvolid=5,subvol=/)
```

In my case, this error message generated, if "noexec" option activated on the filesystem:

 *Quote:*   

> sh: line 1: tools/git-version-gen: Permission denied

 

P.S. Command "genkernel initramfs" make binary packages under CACHE_DIR (/var/cache/genkernel/<version>) directory. This genkernel script started in TMPDIR directory. Without "exec" rights, this script can not produce binaries.

Message  *Quote:*   

> Failed to create binpkg of util-linux-2.37!

  produced, because first compiled package is sys-apps/util-linux.

----------

