Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gentoo-kernel : call custom installkernel [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8717
Location: ~Brussels - Belgique

PostPosted: Thu Dec 21, 2023 10:39 am    Post subject: gentoo-kernel : call custom installkernel [SOLVED] Reply with quote

Hi!

I am testing gentoo-kernel and it does almost what I do manually, but I would like to install and name new kernel items using my custom install script.

I see in /usr/src/linux/scripts/install.sh that I can overwrite installkernel by using my scripts in ${HOME}/bin, but I tried to create a script in /var/lib/portage/home/bin and it is not called during emerge / install of gentoo-kernel: actual installkernel-gentoo is called. Also tried in /root/bin without success...

How can I define my custom installkernel script called automatically by make install ?

EDIT: SOLVED

from this post
Ionen wrote:
gentoo-kernel first merges the (stripped) sources alongside the kernel in /usr/src/, then in pkg_postinst() it'll call /sbin/installkernel (default provided by installkernel-gentoo) to copy the kernel to /boot, roughly the same `make install` would do.

This installkernel script itself runs any executable scripts in /etc/kernel/postinst.d/* with $1 being kernel version, and $2 path to the kernel.

These scripts can be used for whatever needed, grub setup, efi stub installs, cleaning or backing up old kernels/modules, etc... With a little work most things can be automated if not a too exotic setup, and with the new USE=dist-kernel even third party modules get rebuilt without user workarounds now :) (albeit need portage >=3.0.13 to solve a portage bug when multiple modules).


I simply add a postinstall hook to move versioned files to a my required folder, and remove what I don't need:
/etc/kernel/postinst.d/99-EFI.install:
#!/bin/env bash

ver=${1}

echo === CUSTOM SCRIPT
mkdir -pv /boot/EFI/gentoo
mv -v /boot/config-${ver} /boot/EFI/gentoo/config
mv -v /boot/vmlinuz-${ver} /boot/EFI/gentoo/bootx64.efi
rm -v /boot/*${ver}*


or for an ARM system (pinebook pro):
/etc/kernel/postinst.d/99-pinebook-pro.install:
#!/bin/env bash

ver=${1}

echo === CUSTOM SCRIPT
mv -v /boot/dtbs/${ver}/rockchip/rk3399-pinebook-pro.dtb /boot/
mv -v /boot/config-${ver} /boot/config-gentoo
mv -v /boot/vmlinuz-${ver} /boot/Image-gentoo
rm -vrf /boot/*${ver}* /boot/dtbs/


bonus: how to disable dracut
/etc/portage/package.use/gentoo-kernel:
sys-kernel/gentoo-kernel savedconfig -initramfs
sys-kernel/installkernel-gentoo -dracut
/etc/portage/profile/package.use.force/gentoo-kernel:
sys-kernel/gentoo-kernel -initramfs

_________________
Kind regards,
Xavier Miller


Last edited by xaviermiller on Sat Dec 30, 2023 6:42 pm; edited 9 times in total
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3695
Location: Rasi, Finland

PostPosted: Thu Dec 21, 2023 11:02 am    Post subject: Reply with quote

I tuned in since I could probably utilize such feature, if possible. But meanwhile:

One place where you can customize the kernel name is kernel config itself. But that's only the name.
I have /etc/kernel/config.d/naming.config where I rename my kernel.

More advanced, although workaround, way would be to use /etc/kernel/postinst.d and place a script there which would then move and/or rename your kernel to your needs. Every script there will be run and given these arguments: <kernel version> <path to the new kernel>
From there it's pretty easy to construct a script to do whatever you want. I have my custom initramfs script there.

EDIT: Then there's the possibility the create your own installkernel script and ebuild which would then provide virtual of installkernel. :P
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8717
Location: ~Brussels - Belgique

PostPosted: Thu Dec 21, 2023 7:06 pm    Post subject: Reply with quote

Thank you Zucca,

I will report on the progress in this thread, updating the OP when something is relevant.
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3695
Location: Rasi, Finland

PostPosted: Thu Dec 21, 2023 7:35 pm    Post subject: Reply with quote

Maybe the answer lies in gentoo/eclass/kernel-build.eclass at kernel-build_src_install()?
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8717
Location: ~Brussels - Belgique

PostPosted: Thu Dec 21, 2023 7:48 pm    Post subject: Reply with quote

Finally, I will try with a post-install hook : move the versioned files from /boot to my preferred place
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8717
Location: ~Brussels - Belgique

PostPosted: Fri Dec 22, 2023 7:57 am    Post subject: Reply with quote

Finally, I use the hooks and it works
- one pre-install to disable dracut (which is forced for nothing, I don't use it and don't want an intramfs) : delete the dracut hook and replace it with a dummy script
- one post-install which moves the needed files to other locations (EFI, u-boot partition, other names...) and deleted unwanted files (initrd, unneeded DTBs for my ARM boards)

I will automate the deploy of those scripts in /etc/portage/bashrc (pre-install phase of gentoo-kernel) and it will be then too annoying 8)
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3695
Location: Rasi, Finland

PostPosted: Fri Dec 22, 2023 9:38 am    Post subject: Reply with quote

xaviermiller wrote:
- one pre-install to disable dracut (which is forced for nothing, I don't use it and don't want an intramfs) : delete the dracut hook and replace it with a dummy script
I've set USE="-initramfs" for gentoo-kernel (because I use my own initramfs build script). Doesn't it work for you?
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8717
Location: ~Brussels - Belgique

PostPosted: Fri Dec 22, 2023 10:20 am    Post subject: Reply with quote

Zucca wrote:
xaviermiller wrote:
- one pre-install to disable dracut (which is forced for nothing, I don't use it and don't want an intramfs) : delete the dracut hook and replace it with a dummy script
I've set USE="-initramfs" for gentoo-kernel (because I use my own initramfs build script). Doesn't it work for you?


no, the USE flag is forced, and dracut is pulled by dependencies and called during installkernel
I will later re-check, I could have missed something...

At least it works and I don't need to manual reconfigure / build /kinstall the kernel on all my Gentoo installations :)
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22648

PostPosted: Fri Dec 22, 2023 4:02 pm    Post subject: Reply with quote

I do not see that flag as forced, and apparently Zucca does not either. What is the output of USE=-initramfs emerge --pretend --verbose sys-kernel/gentoo-kernel ; emerge --info for you?
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8717
Location: ~Brussels - Belgique

PostPosted: Fri Dec 22, 2023 6:32 pm    Post subject: Reply with quote

Hi Hu,
Code:
# USE=-initramfs emerge --pretend --verbose sys-kernel/gentoo-kernel

These are the packages that would be merged, in order:

Calculating dependencies                             ... done!
Dependency resolution took 2.58 s (backtrack: 0/20).

[ebuild   R    ] sys-kernel/gentoo-kernel-6.6.8:6.6.8::gentoo  USE="(initramfs) savedconfig strip -debug -hardened -modules-sign -secureboot -test" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Code:
# emerge --info
-bash: merge : commande introuvable
redpoint2 ~ # emerge --info
Portage 3.0.58 (python 3.11.7-final-0, default/linux/amd64/17.1/no-multilib, gcc-13, glibc-2.38-r7, 6.6.8 x86_64)
=================================================================
System uname: Linux-6.6.8-x86_64-Intel-R-_Core-TM-_i5-5200U_CPU_@_2.20GHz-with-glibc2.38
KiB Mem:    16275440 total,  11786464 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Fri, 22 Dec 2023 16:47:03 +0000
Head commit of repository gentoo: a84ae15745142ac636399c463bc1c6bae9ed6742

Head commit of repository audio-overlay: 81863e341e83cfb4b9c285a416deabde8eb815fe

Timestamp of repository guru: Thu, 21 Dec 2023 16:48:49 +0000
Head commit of repository guru: 854a683f5c69b83fa3152423e53f15ef7e880228

Head commit of repository inode64-overlay: ea5a263ff2fb7ccbeb9245823e50c46658e61636

Head commit of repository local: 6f4b19c0e9ae6b228879780e4add2545123f9a9b

sh bash 5.2_p21-r1
ld GNU ld (Gentoo 2.41 p4) 2.41.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p21-r1::gentoo
dev-java/java-config:      2.3.3-r1::gentoo
dev-lang/perl:             5.38.2-r1::gentoo
dev-lang/python:           3.11.7::gentoo, 3.12.1_p1::gentoo
dev-lang/rust:             1.74.1::gentoo
dev-util/cmake:            3.28.1::gentoo
dev-util/meson:            1.3.0-r2::gentoo
sys-apps/baselayout:       2.14-r1::gentoo
sys-apps/openrc:           0.52.1::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/autoconf:        2.13-r8::gentoo, 2.71-r7::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.41-r3::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.6::gentoo
sys-devel/gcc:             13.2.1_p20231216::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             17.0.6::gentoo
sys-devel/llvm:            17.0.6::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.6::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r7::gentoo
Repositories:

gentoo
    location: /var/portage/repos/gentoo
    sync-type: git
    sync-uri: git://anongit.gentoo.org/repo/sync/gentoo.git
    priority: -1000
    volatile: True

audio-overlay
    location: /var/portage/repos/audio-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-audio/audio-overlay.git
    masters: gentoo
    volatile: True

guru
    location: /var/portage/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: True

inode64-overlay
    location: /var/portage/repos/inode64-overlay
    sync-type: git
    sync-uri: https://github.com/inode64/inode64-overlay.git
    masters: gentoo
    volatile: True

local
    location: /usr/local/portage
    sync-type: git
    sync-uri: /data/nas/xavier/git_repos/local_overlay.git/
    masters: gentoo
    volatile: True

crossdev
    location: /data/nas/xavier/portage/redpoint2/var/db/repos/crossdev
    masters: gentoo
    priority: 10
    volatile: True

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE freedist as-is"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -fomit-frame-pointer -march=broadwell -mmmx -mpopcnt -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -mno-sse4a -mno-fma4 -mno-xop -mfma -mno-avx512f -mbmi -mbmi2 -maes -mpclmul -mno-avx512vl -mno-avx512bw -mno-avx512dq -mno-avx512cd -mno-avx512er -mno-avx512pf -mno-avx512vbmi -mno-avx512ifma -mno-avx5124vnniw -mno-avx5124fmaps -mno-avx512vpopcntdq -mno-avx512vbmi2 -mno-gfni -mno-vpclmulqdq -mno-avx512vnni -mno-avx512bitalg -mno-avx512bf16 -mno-avx512vp2intersect -mno-3dnow -madx -mabm -mno-cldemote -mno-clflushopt -mno-clwb -mno-clzero -mcx16 -mno-enqcmd -mf16c -mfsgsbase -mfxsr -mno-hle -msahf -mno-lwp -mlzcnt -mmovbe -mno-movdir64b -mno-movdiri -mno-mwaitx -mno-pconfig -mno-pku -mno-prefetchwt1 -mprfchw -mno-ptwrite -mno-rdpid -mrdrnd -mrdseed -mno-rtm -mno-serialize -mno-sgx -mno-sha -mno-shstk -mno-tbm -mno-tsxldtrk -mno-vaes -mno-waitpkg -mno-wbnoinvd -mxsave -mno-xsavec -mxsaveopt -mno-xsaves -mno-amx-tile -mno-amx-int8 -mno-amx-bf16 -mno-uintr -mno-hreset -mno-kl -mno-widekl -mno-avxvnni -mno-avx512fp16 -mno-avxifma -mno-avxvnniint8 -mno-avxneconvert -mno-cmpccxadd -mno-amx-fp16 -mno-prefetchi -mno-raoint -mno-amx-complex --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=broadwell"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer -march=broadwell -mmmx -mpopcnt -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -mno-sse4a -mno-fma4 -mno-xop -mfma -mno-avx512f -mbmi -mbmi2 -maes -mpclmul -mno-avx512vl -mno-avx512bw -mno-avx512dq -mno-avx512cd -mno-avx512er -mno-avx512pf -mno-avx512vbmi -mno-avx512ifma -mno-avx5124vnniw -mno-avx5124fmaps -mno-avx512vpopcntdq -mno-avx512vbmi2 -mno-gfni -mno-vpclmulqdq -mno-avx512vnni -mno-avx512bitalg -mno-avx512bf16 -mno-avx512vp2intersect -mno-3dnow -madx -mabm -mno-cldemote -mno-clflushopt -mno-clwb -mno-clzero -mcx16 -mno-enqcmd -mf16c -mfsgsbase -mfxsr -mno-hle -msahf -mno-lwp -mlzcnt -mmovbe -mno-movdir64b -mno-movdiri -mno-mwaitx -mno-pconfig -mno-pku -mno-prefetchwt1 -mprfchw -mno-ptwrite -mno-rdpid -mrdrnd -mrdseed -mno-rtm -mno-serialize -mno-sgx -mno-sha -mno-shstk -mno-tbm -mno-tsxldtrk -mno-vaes -mno-waitpkg -mno-wbnoinvd -mxsave -mno-xsavec -mxsaveopt -mno-xsaves -mno-amx-tile -mno-amx-int8 -mno-amx-bf16 -mno-uintr -mno-hreset -mno-kl -mno-widekl -mno-avxvnni -mno-avx512fp16 -mno-avxifma -mno-avxvnniint8 -mno-avxneconvert -mno-cmpccxadd -mno-amx-fp16 -mno-prefetchi -mno-raoint -mno-amx-complex --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=broadwell"
DISTDIR="/var/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --quiet-build=n --buildpkg"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live candy config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="fr_BE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--hash-style=gnu -Wl,--as-needed"
LEX="flex"
LINGUAS="fr fr_FR fr_BE nl nl_BE nl_NL"
MAKEOPTS="-j7 -l13"
PKGDIR="/var/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="3dnow 3dnowext X a52 aac acpi alsa amd64 apng branding bzip2 cairo cdda cli crossdev crypt css cups dbus display-manager dlna dri dssi dts dvd elogind exif fftw flac fluidsynth gif glamor gles2 gnome-keyring gpm gtk gtk3 gudev gui iconv imagemagick joystick jpeg keyring ladspa lash lcms libcanberra libinput libnotify libsamplerate libtirpc mad midi mmx mng mp3 mpeg mtp ncurses nls nptl ogg opengl openmp opus osc pam pango pcre pdf png policykit powermanagement printsupport python3 qt5 readline rubberband sddm sdl seccomp sna sndfile snmp spell split-usr sqlite sse sse2 ssl startup-notification svg symlink system-bootstrap system-llvm test-rust tiff timidity truetype udev udisks unicode upnp upower usb vaapi vdpau vorbis wmf x264 x265 xattr xcb xinerama xkb xml xosd xscreensaver xv xvid xvmc zlib" ABI_X86="64" ADA_TARGET="gnat_2021" ALSA_CARDS="hda-intel usb-audio virmidi" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" INPUT_DEVICES="keyboard mouse libinput joystick" KERNEL="linux" L10N="fr nl en" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_TARGETS="X86 AMDGPU" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" QEMU_SOFTMMU_TARGETS="arm i386" QEMU_USER_TARGETS="arm i386" RUBY_TARGETS="ruby31" SANE_BACKENDS="hp" VIDEO_CARDS="intel i915" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22648

PostPosted: Fri Dec 22, 2023 7:03 pm    Post subject: Reply with quote

I see it. This is profiles/base: Force sys-kernel/gentoo-kernel{,-bin}[initramfs], which is more recent than my last sync:
Code:
commit 8dfa9a7c505b2c97ffdedc08497e9948936f97d3
Author: Michał Górny <mgorny@gentoo.org>
Date:   Thu Dec 21 04:34:36 2023 +0100

    profiles/base: Force sys-kernel/gentoo-kernel{,-bin}[initramfs]
   
    Add sys-kernel/gentoo-kernel{,-bin} to the entry forcing USE=initramfs
    on dist-kernels.  It was originally supposed to apply to all
    dist-kernels (i.e. kernels using generic config), and it was my mistake
    not to add new kernel packages to it.
   
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

diff --git a/profiles/base/package.use.force b/profiles/base/package.use.force
index f5c1c68f40e7..a563a60377e0 100644
--- a/profiles/base/package.use.force
+++ b/profiles/base/package.use.force
@@ -169,6 +169,8 @@ sys-libs/libcxx libcxxabi
 # the mask, so that users don't brick their systems.  If somebody wants
 # to avoid initramfs, he needs to use a custom .config and unforce
 # the flag.
+sys-kernel/gentoo-kernel initramfs
+sys-kernel/gentoo-kernel-bin initramfs
 sys-kernel/vanilla-kernel initramfs
 
 # Matt Turner <mattst88@gentoo.org> (2019-09-01)
You can override the force, which per the comment is done to make it difficult for users to build without the native initramfs support.
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8717
Location: ~Brussels - Belgique

PostPosted: Fri Dec 22, 2023 8:03 pm    Post subject: Reply with quote

even with USE=-initramfs on gentoo-kernel, dracut is called because the hook in /etc/kernel.

I will try to see how to not set that hook (debianutils, USE="-dracut")

EDIT: USE="-dracut -initramfs" + -initramfs in package.use.force did the trick to disable and unmerge dracut :)
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3695
Location: Rasi, Finland

PostPosted: Fri Dec 22, 2023 8:53 pm    Post subject: Refresh my memory Reply with quote

So.
I'd need to put following lines
Code:
sys-kernel/gentoo-kernel -initramfs
sys-kernel/gentoo-kernel-bin -initramfs
sys-kernel/vanilla-kernel -initramfs
... into /etc/portage/profile/package.use.force/dist-kernel to
    a) avoid pulling dracut as an depency
    b) avoid compiling and generating any stuff needed by initramfs creation process by dracut

... and hopefully things continue working as-is?
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8717
Location: ~Brussels - Belgique

PostPosted: Fri Dec 22, 2023 9:06 pm    Post subject: Re: Refresh my memory Reply with quote

Zucca wrote:
So.
I'd need to put following lines
Code:
sys-kernel/gentoo-kernel -initramfs
sys-kernel/gentoo-kernel-bin -initramfs
sys-kernel/vanilla-kernel -initramfs
... into /etc/portage/profile/package.use.force/dist-kernel to
    a) avoid pulling dracut as an depency
    b) avoid compiling and generating any stuff needed by initramfs creation process by dracut

... and hopefully things continue working as-is?


+ USE="-dracut" (for sys-kernel/installkernel-gentoo)
I have edited my initial post
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3695
Location: Rasi, Finland

PostPosted: Fri Dec 22, 2023 9:09 pm    Post subject: Re: Refresh my memory Reply with quote

xaviermiller wrote:
+ USE="-dracut" (for sys-kernel/installkernel-gentoo)
I have edited my initial post
Thanks!
_________________
..: Zucca :..

My gentoo installs:
init=/sbin/openrc-init
-systemd -logind -elogind seatd

Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
TheUncleTed
n00b
n00b


Joined: 26 Dec 2023
Posts: 4

PostPosted: Sat Dec 30, 2023 12:04 pm    Post subject: Reply with quote

xaviermiller,

Thanks for summarizing you results!

Maybe for those finding this thread later you could add a quote from lonen in https://forums.gentoo.org/viewtopic-t-1128103-start-0.html
Quote:
This installkernel script itself runs any executable scripts in /etc/kernel/postinst.d/* with $1 being kernel version, and $2 path to the kernel.

This could be even included in the installkernel manpage, as there is no mention of scripts at all.

Personally, I wasted some time with the "executable" part...
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8717
Location: ~Brussels - Belgique

PostPosted: Sat Dec 30, 2023 6:43 pm    Post subject: Reply with quote

TheUncleTed wrote:
xaviermiller,

Thanks for summarizing you results!

Maybe for those finding this thread later you could add a quote from lonen in https://forums.gentoo.org/viewtopic-t-1128103-start-0.html
Quote:
This installkernel script itself runs any executable scripts in /etc/kernel/postinst.d/* with $1 being kernel version, and $2 path to the kernel.

This could be even included in the installkernel manpage, as there is no mention of scripts at all.

Personally, I wasted some time with the "executable" part...


Thank you for your feed-back, I have edited the initial post with this useful information !
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5104
Location: Bavaria

PostPosted: Sun Dec 31, 2023 11:50 am    Post subject: Reply with quote

xaviermiller,

with all the results we have here, I think it belongs to "Documentation". If you dont like it please tell me.

Moved from Kernel & Hardware to Documentation, Tips & Tricks.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8717
Location: ~Brussels - Belgique

PostPosted: Sun Dec 31, 2023 10:37 pm    Post subject: Reply with quote

This is fine for me :)
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Nowa
Developer
Developer


Joined: 25 Jun 2014
Posts: 429
Location: Nijmegen

PostPosted: Tue Jan 16, 2024 2:09 pm    Post subject: Reply with quote

For completeness and future reference, adding here the link to the new installkernel wiki page: https://wiki.gentoo.org/wiki/Installkernel

Also, overriding the USE=initramfs package.use.force is no longer necessary, nowadays instead of forcing the flag we print a big warning if it is disabled.
_________________
OS: Gentoo 6.10.12-gentoo-dist, ~amd64, 23.0/desktop/plasma/systemd
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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