From 9a9a9ea8bb23baff44b51d635e33692958418ca7 Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Thu, 17 Nov 2005 19:36:55 +0000 Subject: [PATCH] Udev 075 support, klibc 1.1.1, and fixes for ppc on 2.6.14+ kernels git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@321 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- gen_compile.sh | 118 +++++++++++++++++++++++++++++-------------- gen_determineargs.sh | 2 + genkernel.conf | 7 ++- 3 files changed, 88 insertions(+), 39 deletions(-) diff --git a/gen_compile.sh b/gen_compile.sh index e710edc..4cab050 100644 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -696,10 +696,55 @@ compile_dietlibc() { rm -rf "${TEMP}/diet" > /dev/null fi } - +compile_klibc() { + cd "${TEMP}" + rm -rf "${KLIBC_DIR}" klibc-build + [ ! -f "${KLIBC_SRCTAR}" ] && + gen_die "Could not find klibc tarball: ${KLIBC_SRCTAR}" + /bin/tar -xpf "${KLIBC_SRCTAR}" || + gen_die 'Could not extract klibc tarball' + [ ! -d "${KLIBC_DIR}" ] && + gen_die "klibc tarball ${KLIBC_SRCTAR} is invalid" + cd "${KLIBC_DIR}" + print_info 1 'klibc: >> Compiling...' + ln -snf "${KERNEL_DIR}" linux || gen_die "Could not link to ${KERNEL_DIR}" + sed -i MCONFIG -e "s|prefix =.*|prefix = ${TEMP}/klibc-build|g" + # PPC fixup for 2.6.14 + if [ "${VER}" -eq '2' -a "${PAT}" -eq '6' -a "${SUB}" -ge '14' ] + then + if [ "${ARCH}" = 'ppc' -o "${ARCH}" = 'ppc64' ] + then + # Headers are moving around .. need to make them available + echo 'INCLUDE += -I$(KRNLSRC)/arch/$(ARCH)/include' >> MCONFIG + fi + fi + if [ "${ARCH}" = 'um' ] + then + compile_generic "ARCH=um" runtask + elif [ "${ARCH}" = 'sparc64' ] + then + compile_generic "ARCH=sparc64 CROSS=sparc64-unknown-linux-gnu-" runtask + else + compile_generic "" runtask + fi + compile_generic "install" runtask + +} compile_udev() { if [ ! -f "${UDEV_BINCACHE}" ] then + # PPC fixup for 2.6.14 + # Headers are moving around .. need to make them available + if [ "${VER}" -eq '2' -a "${PAT}" -eq '6' -a "${SUB}" -ge '14' ] + then + if [ "${ARCH}" = 'ppc' -o "${ARCH}" = 'ppc64' ] + then + cd ${KERNEL_DIR} + echo 'Applying hack to workaround 2.6.14+ PPC header breakages...' + compile_generic 'include/asm' kernel + fi + fi + compile_klibc cd "${TEMP}" rm -rf "${UDEV_DIR}" udev [ ! -f "${UDEV_SRCTAR}" ] && @@ -710,57 +755,43 @@ compile_udev() { gen_die "Udev tarball ${UDEV_SRCTAR} is invalid" cd "${UDEV_DIR}" + local extras="extras/scsi_id extras/volume_id extras/ata_id extras/run_directory extras/usb_id extras/floppy extras/cdrom_id extras/firmware" + # No selinux support yet .. someday maybe + #use selinux && myconf="${myconf} USE_SELINUX=true" print_info 1 'udev: >> Compiling...' + # PPC fixup for 2.6.14 + if [ "${VER}" -eq '2' -a "${PAT}" -eq '6' -a "${SUB}" -ge '14' ] + then + if [ "${ARCH}" = 'ppc' -o "${ARCH}" = 'ppc64' ] + then + # Headers are moving around .. need to make them available + echo "CFLAGS += -I${KERNEL_DIR}/arch/${ARCH}/include" >> Makefile + fi + fi - ln -snf "${KERNEL_DIR}" klibc/linux || gen_die "Could not link to ${KERNEL_DIR}" if [ "${ARCH}" = 'um' ] then - compile_generic "ARCH=um KERNEL_DIR=$KERNEL_DIR USE_KLIBC=true USE_LOG=false DEBUG=false udevdir=/dev all etc/udev/udev.conf" runtask + compile_generic "EXTRAS=\"${extras}\" ARCH=um USE_KLIBC=true KLCC=${TEMP}/klibc-build/bin/klcc USE_LOG=false DEBUG=false udevdir=/dev all" runtask elif [ "${ARCH}" = 'sparc64' ] then - compile_generic "ARCH=sparc64 CROSS=sparc64-unknown-linux-gnu- KERNEL_DIR=$KERNEL_DIR USE_KLIBC=true USE_LOG=false DEBUG=false udevdir=/dev all etc/udev/udev.conf" runtask + compile_generic "EXTRAS=\"${extras}\" ARCH=sparc64 CROSS=sparc64-unknown-linux-gnu- USE_KLIBC=true KLCC=${TEMP}/klibc-build/bin/klcc USE_LOG=false DEBUG=false udevdir=/dev all" runtask else - compile_generic "KERNEL_DIR=$KERNEL_DIR USE_KLIBC=true USE_LOG=false DEBUG=false udevdir=/dev all etc/udev/udev.conf" runtask + compile_generic "EXTRAS=\"${extras}\" USE_KLIBC=true KLCC=${TEMP}/klibc-build/bin/klcc USE_LOG=false DEBUG=false udevdir=/dev all" runtask fi - strip udev || gen_die 'Failed to strip the udev binary!' - if [ -e udevstart ] - then - strip udevstart || gen_die 'Failed to strip the udevstart binary!' - fi - - if [ -e udevsend ] - then - strip udevsend || gen_die 'Failed to strip the udevsend binary!' - fi - print_info 1 ' >> Installing...' - install -d "${TEMP}/udev/etc/udev" "${TEMP}/udev/sbin" "${TEMP}/udev/etc/udev/scripts" "${TEMP}/udev/etc/udev/rules.d" "${TEMP}/udev/etc/udev/permissions.d" || + install -d "${TEMP}/udev/etc/udev" "${TEMP}/udev/sbin" "${TEMP}/udev/etc/udev/scripts" "${TEMP}/udev/etc/udev/rules.d" "${TEMP}/udev/etc/udev/permissions.d" "${TEMP}/udev/etc/udev/extras" "${TEMP}/udev/etc" "${TEMP}/udev/sbin" "${TEMP}/udev/usr/" "${TEMP}/udev/usr/bin" "${TEMP}/udev/usr/sbin"|| gen_die 'Could not create directory hierarchy' - install -m 0755 udev "${TEMP}/udev/sbin" || - gen_die 'Could not install udev binary!' - - if [ -e udevstart ] - then - install -m 0755 udevstart "${TEMP}/udev/sbin" || - gen_die 'Could not install udevstart binary!' - fi - if [ -e udevsend ] - then - install -m 0755 udevsend "${TEMP}/udev/sbin" || - gen_die 'Could not install udevsend binary!' - fi + install -c etc/udev/gentoo/udev.rules "${TEMP}/udev/etc/udev/rules.d/50-udev.rules" || + gen_die 'Could not copy gentoo udev.rules to 50-udev.rules' - install -m 0644 etc/udev/udev.conf "${TEMP}/udev/etc/udev" || - gen_die 'Could not install udev configuration!' - install -m 0644 etc/udev/gentoo/udev.rules "${TEMP}/udev/etc/udev/rules.d/50-udev.rules" || - gen_die 'Could not install udev rules!' -# install -m 0644 etc/udev/udev.permissions "${TEMP}/udev/etc/udev/permissions.d/50-udev.permissions" || -# gen_die 'Could not install udev permissions!' - install -m 0755 extras/ide-devfs.sh "${TEMP}/udev/etc/udev/scripts" || - gen_die 'Could not install udev scripts!' + compile_generic "EXTRAS=\"${extras}\" DESTDIR=${TEMP}/udev install-config" runtask + compile_generic "EXTRAS=\"${extras}\" DESTDIR=${TEMP}/udev install-bin" runtask + install -c extras/ide-devfs.sh "${TEMP}/udev/etc/udev/scripts" + install -c extras/scsi-devfs.sh "${TEMP}/udev/etc/udev/scripts" + install -c extras/raid-devfs.sh "${TEMP}/udev/etc/udev/scripts" cd "${TEMP}/udev" print_info 1 ' >> Copying to bincache...' @@ -769,6 +800,17 @@ compile_udev() { cd "${TEMP}" rm -rf "${UDEV_DIR}" udev + + # PPC fixup for 2.6.14 + if [ "${VER}" -eq '2' -a "${PAT}" -eq '6' -a "${SUB}" -ge '14' ] + then + if [ "${ARCH}" = 'ppc' -o "${ARCH}" = 'ppc64' ] + then + cd ${KERNEL_DIR} + compile_generic 'archclean' kernel + cd "${TEMP}" + fi + fi fi } diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 63b5c0c..10c4a02 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -177,6 +177,7 @@ determine_real_args() { DEVFSD_BINCACHE=`cache_replace "${DEVFSD_BINCACHE}"` DEVFSD_CONF_BINCACHE=`cache_replace "${DEVFSD_CONF_BINCACHE}"` UDEV_BINCACHE=`cache_replace "${UDEV_BINCACHE}"` + KLIBC_BINCACHE=`cache_replace "${KLIBC_BINCACHE}"` DEVICE_MAPPER_BINCACHE=`cache_replace "${DEVICE_MAPPER_BINCACHE}"` LVM2_BINCACHE=`cache_replace "${LVM2_BINCACHE}"` DMRAID_BINCACHE=`cache_replace "${DMRAID_BINCACHE}"` @@ -194,6 +195,7 @@ determine_real_args() { DEVFSD_BINCACHE=`arch_replace "${DEVFSD_BINCACHE}"` DEVFSD_CONF_BINCACHE=`arch_replace "${DEVFSD_CONF_BINCACHE}"` UDEV_BINCACHE=`arch_replace "${UDEV_BINCACHE}"` + KLIBC_BINCACHE=`arch_replace "${KLIBC_BINCACHE}"` DEVICE_MAPPER_BINCACHE=`arch_replace "${DEVICE_MAPPER_BINCACHE}"` LVM2_BINCACHE=`arch_replace "${LVM2_BINCACHE}"` DMRAID_BINCACHE=`arch_replace "${DMRAID_BINCACHE}"` diff --git a/genkernel.conf b/genkernel.conf index 64f1d6f..42d5c15 100755 --- a/genkernel.conf +++ b/genkernel.conf @@ -97,11 +97,16 @@ DEVFSD_DIR="devfsd" DEVFSD_BINCACHE="%%CACHE%%/devfsd-${DEVFSD_VER}-%%ARCH%%.bz2" DEVFSD_CONF_BINCACHE="%%CACHE%%/devfsd-conf-${DIETLIBC_VER}-%%ARCH%%.bz2" -UDEV_VER="068" +UDEV_VER="075" UDEV_DIR="udev-${UDEV_VER}" UDEV_SRCTAR="${GK_SHARE}/pkg/udev-${UDEV_VER}.tar.bz2" UDEV_BINCACHE="%%CACHE%%/udev-${UDEV_VER}-%%ARCH%%.tar.bz2" +KLIBC_VER="1.1.1" +KLIBC_DIR="klibc-${KLIBC_VER}" +KLIBC_SRCTAR="${GK_SHARE}/pkg/klibc-${KLIBC_VER}.tar.gz" +KLIBC_BINCACHE="%%CACHE%%/klibc-${KLIBC_VER}-%%ARCH%%.tar.bz2" + DEVICE_MAPPER_VER="1.00.17" DEVICE_MAPPER_DIR="device-mapper.${DEVICE_MAPPER_VER}" DEVICE_MAPPER_SRCTAR="${GK_SHARE}/pkg/device-mapper.${DEVICE_MAPPER_VER}.tgz" -- 2.26.2