Make it so no kernel is compiled if a kernel is installed in /boot and an

emerge will only install the same kernel.

This (and other) logic really needs to be moved out of Makefile and into a
shell script where it can be better maintained and not look so ugly.
This commit is contained in:
Albert Hopkins 2011-06-28 08:20:05 -04:00
parent 3077913344
commit 23e20007a9
1 changed files with 15 additions and 10 deletions

View File

@ -168,18 +168,23 @@ kernel: base_system $(KERNEL_CONFIG)
$(inroot) cp /usr/share/zoneinfo/$(TIMEZONE) /etc/localtime $(inroot) cp /usr/share/zoneinfo/$(TIMEZONE) /etc/localtime
echo $(TIMEZONE) > "$(CHROOT)"/etc/timezone echo $(TIMEZONE) > "$(CHROOT)"/etc/timezone
ifneq ($(EXTERNAL_KERNEL),YES) ifneq ($(EXTERNAL_KERNEL),YES)
$(inroot) $(EMERGE) $(USEPKG) sys-kernel/$(KERNEL) if [ -e "$(CHROOT)/boot/vmlinuz" ] && $(inroot) emerge -pq sys-kernel/$(KERNEL)|grep '^\[.*R.*\]' >/dev/null ; \
cp $(KERNEL_CONFIG) $(CHROOT)/usr/src/linux/.config then \
$(gcc_config) /bin/true ; \
$(inroot) make $(MAKEOPTS) -C /usr/src/linux oldconfig else \
$(inroot) make $(MAKEOPTS) -C /usr/src/linux $(inroot) $(EMERGE) $(USEPKG) sys-kernel/$(KERNEL) ; \
$(inroot) rm -rf /lib/modules/* cp $(KERNEL_CONFIG) $(CHROOT)/usr/src/linux/.config ; \
$(inroot) make $(MAKEOPTS) -C /usr/src/linux modules_install $(gcc_config) ; \
$(inroot) rm -f /boot/vmlinuz* $(inroot) make $(MAKEOPTS) -C /usr/src/linux oldconfig ; \
$(inroot) make $(MAKEOPTS) -C /usr/src/linux install $(inroot) make $(MAKEOPTS) -C /usr/src/linux ; \
$(inroot) rm -rf /lib/modules/* ; \
$(inroot) make $(MAKEOPTS) -C /usr/src/linux modules_install ; \
$(inroot) rm -f /boot/vmlinuz* ; \
$(inroot) make $(MAKEOPTS) -C /usr/src/linux install ; \
cd $(CHROOT)/boot ; \ cd $(CHROOT)/boot ; \
k=`/bin/ls -1 --sort=time vmlinuz-*|head -n 1` ; \ k=`/bin/ls -1 --sort=time vmlinuz-*|head -n 1` ; \
ln -nsf $$k vmlinuz ln -nsf $$k vmlinuz ; \
fi
endif endif
touch kernel touch kernel