Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 744076

Summary: sys-kernel/gentoo-kernel-5.8.10[savedconfig] fails to compile: No rule to make target 'modules_prepare'
Product: Gentoo Linux Reporter: Jaak Ristioja <jaak>
Component: Current packagesAssignee: Distribution Kernel Project <dist-kernel>
Status: CONFIRMED ---    
Severity: normal CC: cruzki123, mgorny, PF4Public
Priority: Normal Keywords: NeedPatch
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Jaak Ristioja 2020-09-22 09:22:14 UTC
#
# configuration written to .config
#
make[1]: Leaving directory '/var/tmp/portage/sys-kernel/gentoo-kernel-5.8.10/work/modprep'
make -j5 O=/var/tmp/portage/sys-kernel/gentoo-kernel-5.8.10/work/modprep V=1 HOSTCC=x86_64-pc-linux-gnu-gcc HOSTCXX=x86_64-pc-linux-gnu-g++ 'HOSTCFLAGS=-mtune=native -O2 -pipe' 'HOSTLDFLAGS=-Wl,-O1 -Wl,--as-needed' CROSS_COMPILE=x86_64-pc-linux-gnu- AS=x86_64-pc-linux-gnu-as CC=x86_64-pc-linux-gnu-gcc LD=x86_64-pc-linux-gnu-ld.bfd AR=x86_64-pc-linux-gnu-ar NM=x86_64-pc-linux-gnu-nm STRIP=: OBJCOPY=x86_64-pc-linux-gnu-objcopy OBJDUMP=x86_64-pc-linux-gnu-objdump ARCH=x86 modules_prepare 
make -C /var/tmp/portage/sys-kernel/gentoo-kernel-5.8.10/work/modprep -f /var/tmp/portage/sys-kernel/gentoo-kernel-5.8.10/work/linux-5.8/Makefile modules_prepare
make[1]: Entering directory '/var/tmp/portage/sys-kernel/gentoo-kernel-5.8.10/work/modprep'
make[1]: *** No rule to make target 'modules_prepare'.  Stop.
make[1]: Leaving directory '/var/tmp/portage/sys-kernel/gentoo-kernel-5.8.10/work/modprep'
make: *** [Makefile:185: __sub-make] Error 2

Maybe gentoo-kernel incorrectly assumes that all configurations have enabled support for loadable modules (CONFIG_MODULES)?
Comment 1 Georgy Yakovlev archtester gentoo-dev 2020-09-22 10:55:33 UTC
kernel-build.eclass ineed assumes that modules enabled.
Comment 2 Ionen Wolkens gentoo-dev 2020-09-22 12:47:02 UTC
Had the same issue on my embedded system with no modules, ended up enabling it anyway but it wasn't ideal.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-10-02 06:47:23 UTC
A patch (to kernel-build.eclass) would be helpful.
Comment 4 Morteza 2021-10-15 07:15:32 UTC
Is there any patch for this or at least a workaround I don't really need modules
Comment 5 PF4Public 2021-11-15 17:06:29 UTC
I use grep in my ebuilds to find out if modules are used:

grep "CONFIG_MODULES=y" .config >/dev/null
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
	export DO_I_HAVE_MODULES=false
else
	export DO_I_HAVE_MODULES=true
fi

and:

if ${DO_I_HAVE_MODULES}; then
	emake modules ${xmakeopts}
fi

and finally:

if ${DO_I_HAVE_MODULES}; then
	emake modules_install ${xmakeopts} INSTALL_MOD_PATH="${D}";
fi

Is it a good solution for kernel-build.eclass?