# Copyright 1999-2008 Gentoo Foundation; 2008 Chris Gianelloni
# Distributed under the GPL v2
+ 28 Jul 2008; Chris Gianelloni <wolf31o2@wolf31o2.org> TODO,
+ gen_bootloader.sh, gen_compile.sh, gen_configkernel.sh,
+ gen_determineargs.sh, genkernel:
+ Removed a large chunk of 2.4 kernel support. This will still require some
+ fairly extensive cleaning to completely remove, but I'd say that without a
+ shadow of a doubt, genkernel will not function on 2.4 kernels.
+
28 Jul 2008; Chris Gianelloni <wolf31o2@wolf31o2.org> genkernel,
genkernel.8:
Added a couple more places where I needed to switch INITRD with RAMDISK.
cd - > /dev/null
}
-compile_dep() {
- # Only run ``make dep'' for 2.4 kernels
- if [ "${VER}" -eq '2' -a "${KERN_24}" -eq '1' ]
- then
- print_info 1 "kernel: >> Making dependencies..."
- cd ${KERNEL_DIR}
- compile_generic dep kernel
- fi
-}
-
compile_modules() {
print_info 1 " >> Compiling ${KV} modules..."
cd ${KERNEL_DIR}
compile_generic modules kernel
export UNAME_MACHINE="${ARCH}"
- # On 2.4 kernels, if MAKEOPTS > -j1 it can cause failures
- if [ "${VER}" -eq '2' -a "${KERN_24}" -eq '1' ]
- then
- MAKEOPTS_SAVE="${MAKEOPTS}"
- MAKEOPTS="${MAKEOPTS_SAVE/-j?/-j1}"
- fi
[ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH
compile_generic "modules_install" kernel
- [ "${VER}" -eq '2' -a "${KERN_24}" -eq '1' ] && MAKEOPTS="${MAKEOPTS_SAVE}"
- export MAKEOPTS
unset UNAME_MACHINE
}
[ "$?" ] || gen_die 'Error: xconfig failed!'
fi
- # Force this on if we are a 2.4 kernel or less
- # This is required for initrd support
- # Initramfs doesn't require this
- # TODO: force on with --genzimage
- if [ "${KERN_24}" -eq '1' ]
+ # Force this on if we are using --genzimage
+ if isTrue ${CMD_GENZIMAGE}
then
# Make sure Ext2 support is on...
sed -e 's/#\? \?CONFIG_EXT2_FS[ =].*/CONFIG_EXT2_FS=y/g' \
-i ${KERNEL_DIR}/.config
fi
- # Make sure lvm modules are on if --lvm/--lvm
+ # Make sure lvm modules are on if --lvm
if isTrue ${CMD_LVM}
then
sed -i ${KERNEL_DIR}/.config -e 's/#\? \?CONFIG_BLK_DEV_DM is.*/CONFIG_BLK_DEV_DM=m/g'
/bin/tar -xj -C ${TEMP} -f ${KERNCACHE} kerncache.config
if [ -e ${TEMP}/kerncache.config ]
then
- KERN_24=0
VER=`grep ^VERSION\ \= ${TEMP}/kerncache.config | awk '{ print $3 };'`
PAT=`grep ^PATCHLEVEL\ \= ${TEMP}/kerncache.config | awk '{ print $3 };'`
SUB=`grep ^SUBLEVEL\ \= ${TEMP}/kerncache.config | awk '{ print $3 };'`
EXV=`grep ^EXTRAVERSION\ \= ${TEMP}/kerncache.config | sed -e "s/EXTRAVERSION =//" -e "s/ //g"`
- if [ "${PAT}" -gt '4' -a "${VER}" -ge '2' ]
- then
- LOV=`grep ^CONFIG_LOCALVERSION\= ${TEMP}/kerncache.config | sed -e "s/CONFIG_LOCALVERSION=\"\(.*\)\"/\1/"`
- KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
- else
- KERN_24=1
- KV=${VER}.${PAT}.${SUB}${EXV}
- fi
-
+ LOV=`grep ^CONFIG_LOCALVERSION\= ${TEMP}/kerncache.config | sed -e "s/CONFIG_LOCALVERSION=\"\(.*\)\"/\1/"`
+ KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
else
gen_die "Could not find kerncache.config in the kernel cache! Exiting."
fi
-
else
# Configure the kernel
# If BUILD_KERNEL=0 then assume --no-clean, menuconfig is cleared
PAT=`grep ^PATCHLEVEL\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };'`
SUB=`grep ^SUBLEVEL\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };'`
EXV=`grep ^EXTRAVERSION\ \= ${KERNEL_DIR}/Makefile | sed -e "s/EXTRAVERSION =//" -e "s/ //g" -e 's/\$([a-z]*)//gi'`
- if [ "${PAT}" -gt '4' -a "${VER}" -ge '2' -a -e ${KERNEL_DIR}/.config ]
+ cd ${KERNEL_DIR}
+ #compile_generic prepare kernel > /dev/null 2>&1
+ cd - > /dev/null 2>&1
+ [ -f "${KERNEL_DIR}/include/linux/version.h" ] && \
+ VERSION_SOURCE="${KERNEL_DIR}/include/linux/version.h"
+ [ -f "${KERNEL_DIR}/include/linux/utsrelease.h" ] && \
+ VERSION_SOURCE="${KERNEL_DIR}/include/linux/utsrelease.h"
+ # Handle new-style releases where version.h doesn't have UTS_RELEASE
+ if [ -f ${KERNEL_DIR}/include/config/kernel.release ]
+ then
+ UTS_RELEASE=`cat ${KERNEL_DIR}/include/config/kernel.release`
+ LOV=`echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//"`
+ KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
+ elif [ -n "${VERSION_SOURCE}" ]
then
- KERN_24=0
- cd ${KERNEL_DIR}
- #compile_generic prepare kernel > /dev/null 2>&1
- cd - > /dev/null 2>&1
- [ -f "${KERNEL_DIR}/include/linux/version.h" ] && \
- VERSION_SOURCE="${KERNEL_DIR}/include/linux/version.h"
- [ -f "${KERNEL_DIR}/include/linux/utsrelease.h" ] && \
- VERSION_SOURCE="${KERNEL_DIR}/include/linux/utsrelease.h"
- # Handle new-style releases where version.h doesn't have UTS_RELEASE
- if [ -f ${KERNEL_DIR}/include/config/kernel.release ]
- then
- UTS_RELEASE=`cat ${KERNEL_DIR}/include/config/kernel.release`
- LOV=`echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//"`
- KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
- elif [ -n "${VERSION_SOURCE}" ]
- then
- UTS_RELEASE=`grep UTS_RELEASE ${VERSION_SOURCE} | sed -e 's/#define UTS_RELEASE "\(.*\)"/\1/'`
- LOV=`echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//"`
- KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
- else
- LCV=`grep ^CONFIG_LOCALVERSION= ${KERNEL_DIR}/.config | sed -r -e "s/.*=\"(.*)\"/\1/"`
- KV=${VER}.${PAT}.${SUB}${EXV}${LCV}
- fi
+ UTS_RELEASE=`grep UTS_RELEASE ${VERSION_SOURCE} | sed -e 's/#define UTS_RELEASE "\(.*\)"/\1/'`
+ LOV=`echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//"`
+ KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
else
- KERN_24=1
- KV=${VER}.${PAT}.${SUB}${EXV}
+ LCV=`grep ^CONFIG_LOCALVERSION= ${KERNEL_DIR}/.config | sed -r -e "s/.*=\"(.*)\"/\1/"`
+ KV=${VER}.${PAT}.${SUB}${EXV}${LCV}
fi
fi
}