From: Chris Gianelloni Date: Mon, 28 Jul 2008 23:31:30 +0000 (-0700) Subject: Removed a large chunk of 2.4 kernel support. This will still require some fairly... X-Git-Tag: v3.4.10.902~65 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=676dd5a061428ed95090d1b8059aea2a2c8d8802;p=genkernel.git 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. --- diff --git a/ChangeLog b/ChangeLog index 5772414..927384c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,13 @@ # Copyright 1999-2008 Gentoo Foundation; 2008 Chris Gianelloni # Distributed under the GPL v2 + 28 Jul 2008; Chris Gianelloni 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 genkernel, genkernel.8: Added a couple more places where I needed to switch INITRD with RAMDISK. diff --git a/TODO b/TODO index a8becc1..c901351 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,6 @@ - Make configs stackable - Move modules_load to /etc/genkernel - Move main config to /etc/genkernel -- Remove 2.4 kernel support - Refactor code to be more simple and extendable - Fix all TODO sections in the code - Add all options to genkernel.conf diff --git a/gen_bootloader.sh b/gen_bootloader.sh index a08135c..17ec15e 100644 --- a/gen_bootloader.sh +++ b/gen_bootloader.sh @@ -74,8 +74,7 @@ EOF else # grub.conf already exists; so... # ... Clone the first boot definition and change the version. - local TYPE - [ "${KERN_24}" -eq '1' ] && TYPE='rd' || TYPE='ramfs' + local TYPE='ramfs' cp -f ${GRUB_CONF} ${GRUB_CONF}.bak awk 'BEGIN { RS="\n"; } diff --git a/gen_compile.sh b/gen_compile.sh index 80b9a2e..14488c9 100644 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -287,31 +287,13 @@ clean_dietlibc_bincache() { 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 } diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 6b23a8d..278fc49 100644 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -87,18 +87,15 @@ config_kernel() { [ "$?" ] || 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' diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 28f0a34..dbe8fd6 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -6,24 +6,15 @@ get_KV() { /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 @@ -32,34 +23,27 @@ get_KV() { 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 } diff --git a/genkernel b/genkernel index a94dec6..77170ed 100755 --- a/genkernel +++ b/genkernel @@ -221,9 +221,6 @@ then # Configure kernel config_kernel - # Make deps - compile_dep - # Make prepare [2.6] if [ "${ARCH_HAVENOPREPARE}" = '' ] then