From: Brad House Date: Tue, 9 Dec 2003 00:47:51 +0000 (+0000) Subject: 2.4 kernel updates X-Git-Tag: v3.4.10.902~749 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5c705decd9ac9188ee1033b281ed2e379de15f3f;p=genkernel.git 2.4 kernel updates git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@3 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- diff --git a/README b/README index a9b2c63..1735896 100644 --- a/README +++ b/README @@ -2,9 +2,14 @@ VERY EXPERIMENTAL seems to work so far on amd64 and x86 I've only tested with 2.6 kernels, it's possible that the module-init-tools we use doesn't work with 2.4 in -which case we need to compile modutils as well and +which case we need to compile modutils as well and provide a static binary for that.... +DEPENDANCIES: +- bootsplash +- gcc/binutils +- bash + INSTALLATION: put genkernel.conf in /etc diff --git a/gen_compile.sh b/gen_compile.sh index b83020c..25dd2ba 100644 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -20,6 +20,18 @@ compile_generic() { [ "${RET}" -ne "0" ] && gen_die "compile of failed" } +compile_dep() { + # Only make dep for 2.4 kernels + if [ "${PAT}" -gt "4" ] + then + print_info 1 "kernel: skipping make dep for non 2.4 kernels" + else + print_info 1 "kernel: Making dependancies for linux ${KV}" + cd ${KERNEL_DIR} + compile_generic "dep" + fi +} + compile_modules() { print_info 1 "kernel: Starting compile of linux ${KV} modules" cd ${KERNEL_DIR} @@ -61,6 +73,7 @@ compile_busybox() { fi print_info 1 "Busybox: copying to bincache" [ ! -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] && gen_die "busybox executable does not exist after compile, error" + strip "${TEMP}/${BUSYBOX_DIR}/busybox" || gen_die "could not strip busybox" bzip2 "${TEMP}/${BUSYBOX_DIR}/busybox" || gen_die "bzip2 compression of busybox failed" [ ! -f "${TEMP}/${BUSYBOX_DIR}/busybox.bz2" ] && gen_die "could not find compressed busybox binary" mv "${TEMP}/${BUSYBOX_DIR}/busybox.bz2" "${BUSYBOX_BINCACHE}" || gen_die "could not copy busybox binary to arch package directory, does the directory exist?" @@ -69,6 +82,30 @@ compile_busybox() { fi } +compile_modutils() { + if [ ! -f "${MODUTILS_BINCACHE}" ] + then + [ ! -f "${MODUTILS_SRCTAR}" ] && gen_die "Could not find modutils source tarball: ${MODUTILS_BINCACHE}" + cd ${TEMP} + rm -rf "${MODUTILS_DIR}" + tar -jxpf "${MODUTILS_SRCTAR}" + [ ! -d "${MODUTILS_DIR}" ] && gen_die "Modutils directory ${MODUTILS_DIR} invalid" + cd "${MODUTILS_DIR}" + print_info 1 "modutils: configure" + CC="${CC}" LD="${LD}" AS="${AS}" ./configure --disable-combined --enable-insmod-static >> ${DEBUGFILE} 2>&1 || gen_die "Configure of modutils failed" + print_info 1 "modutils: make all" + compile_generic "all" + print_info 1 "modutils: copying to bincache" + [ ! -f "${TEMP}/${MODUTILS_DIR}/insmod/insmod.static" ] && gen_die "insmod.static does not exist after compilation of modutils" + strip "${TEMP}/${MODUTILS_DIR}/insmod/insmod.static" || gen_die "could not strip insmod.static" + bzip2 "${TEMP}/${MODUTILS_DIR}/insmod/insmod.static" || gen_die "compression of insmod.static failed" + [ ! -f "${TEMP}/${MODUTILS_DIR}/insmod/insmod.static.bz2" ] && gen_die "could not find compressed insmod.static.bz2 binary" + mv "${TEMP}/${MODULE_INIT_TOOLS_DIR}/insmod.static.bz2" "${MODUTILS_BINCACHE}" + else + print_info 1 "modutils: Found bincache at ${MODUTILS_BINCACHE}" + fi +} + compile_module_init_tools() { if [ ! -f "${MODULE_INIT_TOOLS_BINCACHE}" ] then @@ -79,12 +116,13 @@ compile_module_init_tools() { [ ! -d "${MODULE_INIT_TOOLS_DIR}" ] && gen_die "Module-init-tools directory ${MODULE_INIT_TOOLS_DIR} invalid" cd "${MODULE_INIT_TOOLS_DIR}" print_info 1 "module-init-tools: configure" - ./configure >> ${DEBUGFILE} 2>&1 || gen_die "Configure of module-init-tools failed" + CC="${CC}" LD="${LD}" AS="${AS}" ./configure >> ${DEBUGFILE} 2>&1 || gen_die "Configure of module-init-tools failed" print_info 1 "module-init-tools: make all" compile_generic "all" print_info 1 "module-init-tools: copying to bincache" [ ! -f "${TEMP}/${MODULE_INIT_TOOLS_DIR}/insmod.static" ] && gen_die "insmod.static does not exist after compilation of module-init-tools" - bzip2 "${TEMP}/${MODULE_INIT_TOOLS_DIR}/insmod.static" || gen_die "compression of busybox failed" + strip "${TEMP}/${MODULE_INIT_TOOLS_DIR}/insmod.static" || gen_die "could not strip insmod.static" + bzip2 "${TEMP}/${MODULE_INIT_TOOLS_DIR}/insmod.static" || gen_die "compression of insmod.static failed" [ ! -f "${TEMP}/${MODULE_INIT_TOOLS_DIR}/insmod.static.bz2" ] && gen_die "could not find compressed insmod.static.bz2 binary" mv "${TEMP}/${MODULE_INIT_TOOLS_DIR}/insmod.static.bz2" "${MODULE_INIT_TOOLS_BINCACHE}" else diff --git a/gen_initrd.sh b/gen_initrd.sh index c3accaa..12ec34f 100644 --- a/gen_initrd.sh +++ b/gen_initrd.sh @@ -38,9 +38,15 @@ create_base_initrd_sys() { cp "${BUSYBOX_BINCACHE}" "${TEMP}/initrd-temp/bin/busybox.bz2" || gen_die "could not copy busybox from bincache" bunzip2 "${TEMP}/initrd-temp/bin/busybox.bz2" || gen_die "could not uncompress busybox" - cp "${MODULE_INIT_TOOLS_BINCACHE}" "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die "could not copy insmod.static from bincache" + if [ "${PAT}" -gt "4" ] + then + cp "${MODULE_INIT_TOOLS_BINCACHE}" "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die "could not copy insmod.static from bincache" + else + cp "${MODUTILS_BINCACHE}" "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die "could not copy insmod.static from bincache" + fi + bunzip2 "${TEMP}/initrd-temp/bin/insmod.static.bz2" || gen_die "could not uncompress insmod.static" - + for i in '[' ash basename cat chroot clear cp dirname echo env false find \ grep gunzip gzip insmod ln ls loadkmap losetup lsmod mkdir mknod modprobe more mount mv \ pivot_root ps awk pwd rm rmdir rmmod sh sleep tar test touch true umount uname \ diff --git a/genkernel.conf b/genkernel.conf index 0f6684d..3c700aa 100755 --- a/genkernel.conf +++ b/genkernel.conf @@ -65,7 +65,12 @@ BUSYBOX_DIR="busybox-${BUSYBOX_VER}" MODULE_INIT_TOOLS_VER="0.9.15-pre4" MODULE_INIT_TOOLS_SRCTAR="${GK_SHARE}/pkg/module-init-tools-${MODULE_INIT_TOOLS_VER}.tar.bz2" MODULE_INIT_TOOLS_DIR="module-init-tools-${MODULE_INIT_TOOLS_VER}" -MODULE_INIT_TOOLS_BINCACHE="${GK_SHARE}/pkg/%%ARCH%%/insmod-%%ARCH%%-static.bz2" +MODULE_INIT_TOOLS_BINCACHE="${GK_SHARE}/pkg/%%ARCH%%/insmod-%%ARCH%%-static-2.6.bz2" + +MODUTILS_VER="2.4.26" +MODUTILS_SRCTAR="${GK_SHARE}/pkg/modutils-${MODUTILS_VER}.tar.bz2" +MODUTILS_DIR="modutils-${MODUTILS_VER}" +MODUTILS_BINCACHE="${GK_SHARE}/pkg/%%ARCH%%/insmod-%%ARCH%%-static-2.4.bz2" DIETLIBC_VER="0.24" DIETLIBC_SRCTAR="${GK_SHARE}/pkg/dietlibc-${DIETLIBC_VER}.tar.bz2" diff --git a/genkernel.sh b/genkernel.sh index 06cb8a9..bde9083 100755 --- a/genkernel.sh +++ b/genkernel.sh @@ -40,6 +40,9 @@ print_info 1 "ARCH: ${ARCH}" # Configure kernel config_kernel +# Make deps +compile_dep + # Compile modules compile_modules @@ -55,8 +58,13 @@ fi # Compile Busybox compile_busybox -# Compile module-init-tools -compile_module_init_tools +if [ "${PAT}" -gt "4" ] +then + # Compile module-init-tools + compile_module_init_tools +else + compile_modutils +fi # Create initrd create_initrd