Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 923179 - sys-kernel/installkernel-18-r1 cannot execute `emerge @module-rebuild` in a script in /etc/kernel/*inst.d
Summary: sys-kernel/installkernel-18-r1 cannot execute `emerge @module-rebuild` in a s...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Distribution Kernel Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-29 05:54 UTC by amano.kenji
Modified: 2024-01-30 01:02 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 amano.kenji 2024-01-29 05:54:58 UTC
Executable scripts in both /etc/kernel/preinst.d and /etc/kernel/postinst.d cannot execute `emerge @module-rebuild`.

Here are the errors I got.

* !!! /etc/portage/make.profile is not a symlink and will probably prevent most merges.
* /bin/sh not available

It seems that emerge was executed in chroot or a sandboxed environment, but I could not locate chroot or sandbox.

Reproducible: Always
Comment 1 Nowa Ammerlaan gentoo-dev 2024-01-29 08:46:41 UTC
The problem is pollution of the environment. 

The first error for example is caused by ARCH being set to the value the kernel expects instead of the value portage uses.

If you want to do this you can take the plugin script directly from: https://github.com/projg2/installkernel-gentoo/tree/master/hooks

But be aware that we dropped this feature because while this script works for me, it is known to cause some weird problems with lock files because we might end up calling emerge in an emerge if distribution kernels are used.
Comment 2 amano.kenji 2024-01-30 01:02:11 UTC
I guess I will just call emerge separately from `make install`.