aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2021-09-09 02:16:42 +0200
committerThomas Deutschmann <whissi@gentoo.org>2021-09-09 02:59:03 +0200
commit153a877d333d3b85920267535aef950056c92192 (patch)
tree49f00909f104fac428d1b69f4215bae7c55ab7b9 /gkbuilds
parentinitrd.scripts: don't skip top level devices with partitions (diff)
downloadgenkernel-153a877d333d3b85920267535aef950056c92192.tar.gz
genkernel-153a877d333d3b85920267535aef950056c92192.tar.bz2
genkernel-153a877d333d3b85920267535aef950056c92192.zip
Refactor (compressed) kernel module handling
To support a specific module compression algorithm, two things are needed: Used depmod utility on host system building the kernel must support chosen module compression algorithm to generate proper modules.dep file or genkernel would be unable to read module dependencies when copying modules to initramfs. At runtime, used modprobe utility must be able to handle chosen module compression algorithm or modules would be unloadable. To address the first requirement, genkernel will now check if used kmod utility on host system supports chosen module compression algorithm. To address the runtime requirement, this commit will switch from BusyBox's modutils implementation to kmod because BusyBox does not support ZSTD compression (yet). Bug: https://bugs.gentoo.org/809344 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gkbuilds')
-rw-r--r--gkbuilds/kmod.gkbuild26
1 files changed, 25 insertions, 1 deletions
diff --git a/gkbuilds/kmod.gkbuild b/gkbuilds/kmod.gkbuild
index 8572b77..ac6b3e2 100644
--- a/gkbuilds/kmod.gkbuild
+++ b/gkbuilds/kmod.gkbuild
@@ -20,8 +20,9 @@ src_prepare() {
src_configure() {
local myconf=(
--enable-static
+ --disable-manpages
--disable-python
- --disable-tools
+ --enable-tools
--with-xz
--with-zlib
--with-zstd
@@ -48,4 +49,27 @@ src_install() {
rm -rf \
"${D}"/usr/share/
+
+ "${STRIP}" --strip-all "${D}"/usr/bin/kmod \
+ || die "Failed to strip '${D}/usr/bin/kmod'!"
+
+ mkdir "${D}"/bin || die "Failed to create '${D}/bin'!"
+
+ mkdir "${D}"/sbin || die "Failed to create '${D}/sbin'!"
+
+ # We need to install these links where busybox would create them
+ local symlink_targets=()
+ symlink_targets+=( /sbin/depmod )
+ symlink_targets+=( /sbin/insmod )
+ symlink_targets+=( /sbin/lsmod )
+ symlink_targets+=( /sbin/modinfo )
+ symlink_targets+=( /sbin/modprobe )
+ symlink_targets+=( /sbin/rmmod )
+
+ local symlink_target=
+ for symlink_target in "${symlink_targets[@]}"
+ do
+ ln -s ../usr/bin/kmod "${D}${symlink_target}" \
+ || die "Failed to create symlink '${D}${symlink_target}' to '${D}/usr/bin/kmod'!"
+ done
}