This also applies to sys-kernel/hardened-sources-2.6.37 'make install' runs the kbuild install script /usr/src/linux/arch/<arch>/boot/install.sh install.sh runs $INSTALLKERNEL, if it exists, which is by default /sbin/installkernel We have the Debian /sbin/installkernel script The Debian /sbin/installkernel script apparently now tries to run the contents of /etc/kernel/postinst.d (using 'run-parts'), regardless of whether the directory exists or not. The Debian /sbin/installkernel script is good and very useful, and should be kept. However, it should be modified slightly to only run this directory if it exists (as outlined below in "Expected Results". These errors involve no loss of functionality; the script still completes normally. They can be viewed as warnings. Reproducible: Always Steps to Reproduce: 1. make 2. make modules_install 3. make install Actual Results: Here is the tail of the output of 'make install' sh /usr/src/linux-2.6.37-hardened/arch/x86/boot/install.sh 2.6.37-hardened arch/x86/boot/bzImage \ System.map "/boot" run-parts: failed to open directory /etc/kernel/postinst.d: No such file or directory make[1]: *** [install] Error 1 make: *** [install] Error 2 This is because the default value of the kbuild variable INSTALLKERNEL is installkernel, so when 'make install' runs install.sh, install.sh checks for and finds the script /sbin/installkernel. That script, after doing its business (copying the kernel, system.map, and config file into the /boot directory and rotating links to the files, obviating the user's need to edit their bootloader configuration), tries to run user-defined post-install scripts: run-parts --verbose --exit-on-error --arg="$ver" --arg="$dir/$img_dest-$ver" \ /etc/kernel/postinst.d Expected Results: Make install did not previously attempt to use run the contents of /etc/kernel/postinst.d (which does not exist). Proposed solution: The Debian script (/sbin/installkernel) is useful. In addition to simply rotating the kernel files like the kbuild script would do by default, it copies the image, map and config files into to boot directory by name, and maintains symlinks to each, making it unnecessary for the user to modify their bootloader configuration files when updating the kernel. So we should continue to make /sbin/installkernel available to users, as we have been. The answer is probably to make a slight modification to the Debian installkernel script. The "run-parts" line should only be executed if the user has in fact created the /etc/kernel/postinst.d directory (or, rather, the Gentoo equivalent). In other words, this: run-parts --verbose --exit-on-error --arg="$ver" --arg="$dir/$img_dest-$ver" \ /etc/kernel/postinst.d Should be changed to something like: postinst=/etc/portage/kernel/postinst.d if [ -d $postinst ]; then run-parts --verbose --exit-on-error --arg="$ver" --arg="$dir/$img_dest-$ver" \ $postinst fi Or something simpler that is consistent with the general handling of post-installation scripts by portage. The main point is that it should optional, and the code should only attempt to execute the post-installation script if it indeed exists. An alternative would be to simply have the ebuild create the /etc/kernel/postinst.d directory if it does not exist. Another alternative would be simply comment out the postinst lines in the Debian /sbin/installkernel script (they are only useful to someone wishing to run something automatically after each kernel installation, like handling external modules with 'module-rebuild rebuild' or such). # emerge --info Portage 2.1.9.34 (default/linux/x86/10.0, gcc-4.5.2, glibc-2.12.2-r0, 2.6.37-gentoo i686) ================================================================= System uname: Linux-2.6.37-gentoo-i686-Intel-R-_Pentium-R-_4_CPU_1300MHz-with-gentoo-2.0.1 Timestamp of tree: Thu, 20 Jan 2011 07:15:02 +0000 ccache version 3.1.4 [enabled] app-shells/bash: 4.1_p9 dev-java/java-config: 2.1.11-r3 dev-lang/python: 2.7.1, 3.1.3 dev-util/ccache: 3.1.4 dev-util/cmake: 2.8.3-r1 sys-apps/baselayout: 2.0.1-r1 sys-apps/openrc: 0.7.0 sys-apps/sandbox: 2.4 sys-devel/autoconf: 2.68 sys-devel/automake: 1.11.1 sys-devel/binutils: 2.21 sys-devel/gcc: 4.5.2 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.4-r1 sys-devel/make: 3.82 virtual/os-headers: 2.6.36.1 (sys-kernel/linux-headers) ACCEPT_KEYWORDS="x86 ~x86" ACCEPT_LICENSE="*" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=pentium4 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O3 -march=pentium4 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="assume-digests binpkg-logs ccache distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" FFLAGS="" GENTOO_MIRRORS="ftp://ftp.gtlib.gatech.edu/pub/gentoo http://gentoo.osuosl.org/ http://open-systems.ufl.edu/mirrors/gentoo " LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" LDFLAGS="-Wl,--hash-style=gnu,-O1 -Wl,--as-needed" LINGUAS="en_US en" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="X alsa berkdb bzip2 cairo caps cli cracklib crypt cups cxx dbus dri exif ffmpeg gdbm gif gpm gtk iconv java jpeg lcms mmx modules mp3 mudflap ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pcre perl png python readline session sse sse2 ssl svg sysfs theora threads tiff truetype unicode vorbis win32codecs x86 xcb xorg xulrunner zlib" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LINGUAS="en_US en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
*** This bug has been marked as a duplicate of bug 352326 ***