diff -ruN genkernel-3.4.22.1-vanilla/gen_cmdline.sh genkernel-3.4.22.1/gen_cmdline.sh --- genkernel-3.4.22.1-vanilla/gen_cmdline.sh 2012-01-08 03:31:04.000000000 +0100 +++ genkernel-3.4.22.1/gen_cmdline.sh 2012-01-11 02:05:16.986999998 +0100 @@ -107,6 +107,8 @@ echo " --no-gpg Exclude GPG-armored LUKS key support" echo " --busybox Include busybox" echo " --no-busybox Exclude busybox" + echo " --v86d Include uvesafb helper (v86d)" + echo " --no-v86d Exclude uvesafb helper (v86d)" echo " --unionfs Include support for unionfs" echo " --no-unionfs Exclude support for unionfs" echo " --netboot Create a self-contained env in the initramfs" @@ -272,6 +274,10 @@ CMD_BUSYBOX=`parse_optbool "$*"` print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}" ;; + --v86d|--no-v86d) + CMD_V86D=`parse_optbool "$*"` + print_info 2 "CMD_V86D: ${CMD_V86D}" + ;; --unionfs|--no-unionfs) CMD_UNIONFS=`parse_optbool "$*"` print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}" diff -ruN genkernel-3.4.22.1-vanilla/gen_compile.sh genkernel-3.4.22.1/gen_compile.sh --- genkernel-3.4.22.1-vanilla/gen_compile.sh 2012-01-08 03:31:04.000000000 +0100 +++ genkernel-3.4.22.1/gen_compile.sh 2012-01-11 02:05:16.988000014 +0100 @@ -775,3 +775,128 @@ rm -rf "${GPG_DIR}" > /dev/null fi } + +compile_klibc() { + if [ -f "${KLIBC_BINCACHE}" ] + then + print_info 1 "klibc: >> Using cache" + else + local myARCH="${ARCH}" myABI="${ABI}" + + case ${ARCH} in + amd64) a=x86_64 ;; + mips) gen_die 'TODO: Use the $ABI' ;; + x86) a=i386 ;; + *) a=${ARCH} ;; + esac + KLIBCARCH=${a} + + case ${ARCH} in + x86|x86_64) a=x86 ;; + ppc*) a=powerpc ;; + alpha|arm|ia64|m68k|mips|sh|sparc*) a=${ARCH} ;; + *) gen_die "TODO: Update the code for your asm-ARCH symlink" ;; + esac + KLIBCASMARCH=${a} + + unset ABI ARCH KBUILD_OUTPUT + + print_info 1 'klibc: >> Unpacking klibc...' + [ ! -f "${KLIBC_SRCTAR}" ] && + gen_die "Could not find klibc source tarball: ${KLIBC_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!" + cd "${TEMP}" + rm -rf "${KLIBC_DIR}" + tar -xpf "${KLIBC_SRCTAR}" + [ ! -d "${KLIBC_DIR}" ] && + gen_die "klibc directory ${KLIBC_DIR} invalid" + cd "${KLIBC_DIR}" + ln -snf "${KERNEL_DIR}" linux + apply_patches klibc ${KLIBC_VER} + print_info 1 'klibc: >> Compiling klibc...' + compile_generic "all install" "utils" \ + EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \ + EXTRA_KLIBCLDFLAGS="-z,noexecstack" \ + HOSTCC="${UTILS_CC}" \ + CC="${UTILS_CC}" \ + LD="${UTILS_LD}" \ + AS="${UTILS_AS}" \ + INSTALLDIR="${TEMP}/klibc-install" \ + KLIBCARCH=${KLIBCARCH} \ + KLIBCASMARCH=${KLIBCASMARCH} \ + SHLIBDIR="${TEMP}/klibc-install/lib" \ + libdir="${TEMP}/klibc-install/lib" \ + bindir="${TEMP}/klibc-install/bin" \ + mandir="${TEMP}/klibc-install/man" + + linkname="${TEMP}/klibc-install/include/asm" + if [ -L "${linkname}" ] && [ ! -e "${linkname}" ]; then + ln -snf asm-${KLIBCASMARCH} "${linkname}" + fi + + print_info 1 ' >> Copying to bincache...' + cd ${TEMP} + rm -rf ${TEMP}/klibc-install/man + for BIN in ${TEMP}/klibc-install/bin/* ; do + if [ ${BIN} != "${TEMP}/klibc-install/bin/klcc" ] + then + rm -f ${BIN} + fi + done + /bin/tar -jcpf "${KLIBC_BINCACHE}" klibc-install || + gen_die 'Could not tar up the klibc binary!' + [ -f "${KLIBC_BINCACHE}" ] || + gen_die 'klibc cache not created!' + cd ${TEMP} + rm -rf "${KLIBC_DIR}" > /dev/null + rm -rf "${TEMP}/klibc-install" > /dev/null + fi +} + +compile_v86d() { + compile_klibc + if [ ! -f "${V86D_BINCACHE}" ] + then + if [ -z "$(grep V86D ${KERNEL_DIR}/include/linux/connector.h)" ]; then + gen_die "You need a kernel tree patched with uvesafb for v86d. Kernel not patched with uvesafb." + fi + print_info 1 'v86d: >> Unpacking v86d...' + [ -f "${V86D_SRCTAR}" ] || + gen_die "Could not find v86d source tarball: ${V86D_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!" + cd "${TEMP}" + rm -rf ${V86D_DIR} > /dev/null + /bin/tar -jxpf ${V86D_SRCTAR} || + gen_die 'Could not extract v86d source tarball!' + [ -d "${V86D_DIR}" ] || + gen_die 'v86d directory ${V86D_DIR} is invalid!' + + rm -rf "${TEMP}/klibc-install" > /dev/null + /bin/tar -jxpf "${KLIBC_BINCACHE}" -C "${TEMP}" || + gen_die "Could not extract klibc binary cache!"; + local myTEMP=`echo ${TEMP} | sed -e 's@/@\\/@g' -e 's@\.@\\.@g' -e 's@-@\\-@g'` + sed ${TEMP}/klibc-install/bin/klcc -i -e 's@\\/var\\/tmp\\/genkernel\\/.*\\/klibc\\-install@'${myTEMP}'\\/klibc\\-install@g' + + cd "${V86D_DIR}" + apply_patches v86d ${V86D_VER} + print_info 1 'v86d: >> Configuring...' + + ./configure \ + --with-klibc \ + --with-x86emu >> ${LOGFILE} 2>&1 || + gen_die 'Configure of v86d failed!' + + print_info 1 'v86d: >> Compiling...' + compile_generic "" "utils" KDIR="${KERNEL_DIR}" CC="${TEMP}/klibc-install/bin/klcc" || + gen_die 'Compiling v86d failed' + print_info 1 ' >> Copying to bincache...' + [ -f "${TEMP}/${V86D_DIR}/v86d" ] || + gen_die 'v86d executable does not exist!' + strip "${TEMP}/${V86D_DIR}/v86d" || + gen_die 'Could not strip v86d binary!' + bzip2 -z -c "${TEMP}/${V86D_DIR}/v86d" > "${V86D_BINCACHE}" || + gen_die 'Could not copy the v86d binary to the package directory, does the directory exist?' + + cd "${TEMP}" + rm -rf "${TEMP}/klibc-install" > /dev/null + rm -rf "${V86D_DIR}" + fi +} diff -ruN genkernel-3.4.22.1-vanilla/gen_determineargs.sh genkernel-3.4.22.1/gen_determineargs.sh --- genkernel-3.4.22.1-vanilla/gen_determineargs.sh 2012-01-08 03:31:04.000000000 +0100 +++ genkernel-3.4.22.1/gen_determineargs.sh 2012-01-11 02:05:16.988000014 +0100 @@ -120,6 +120,7 @@ set_config_with_override BOOL MDADM CMD_MDADM set_config_with_override STRING MDADM_CONFIG CMD_MDADM_CONFIG set_config_with_override BOOL MULTIPATH CMD_MULTIPATH + set_config_with_override BOOL V86D CMD_V86D "no" set_config_with_override BOOL FIRMWARE CMD_FIRMWARE set_config_with_override STRING FIRMWARE_DIR CMD_FIRMWARE_DIR "/lib/firmware" set_config_with_override STRING FIRMWARE_FILES CMD_FIRMWARE_FILES @@ -144,6 +145,8 @@ FUSE_BINCACHE=`cache_replace "${FUSE_BINCACHE}"` UNIONFS_FUSE_BINCACHE=`cache_replace "${UNIONFS_FUSE_BINCACHE}"` GPG_BINCACHE=`cache_replace "${GPG_BINCACHE}"` + KLIBC_BINCACHE=`cache_replace "${KLIBC_BINCACHE}"` + V86D_BINCACHE=`cache_replace "${V86D_BINCACHE}"` DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"` BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"` @@ -157,6 +160,8 @@ FUSE_BINCACHE=`arch_replace "${FUSE_BINCACHE}"` UNIONFS_FUSE_BINCACHE=`arch_replace "${UNIONFS_FUSE_BINCACHE}"` GPG_BINCACHE=`arch_replace "${GPG_BINCACHE}"` + KLIBC_BINCACHE=`arch_replace "${KLIBC_BINCACHE}"` + V86D_BINCACHE=`arch_replace "${V86D_BINCACHE}"` if [ -n "${CMD_BOOTLOADER}" ] then diff -ruN genkernel-3.4.22.1-vanilla/gen_initramfs.sh genkernel-3.4.22.1/gen_initramfs.sh --- genkernel-3.4.22.1-vanilla/gen_initramfs.sh 2012-01-08 03:31:04.000000000 +0100 +++ genkernel-3.4.22.1/gen_initramfs.sh 2012-01-11 02:05:16.988000014 +0100 @@ -38,6 +38,7 @@ mknod -m 600 tty0 c 4 0 mknod -m 600 tty1 c 4 1 mknod -m 600 ttyS0 c 4 64 + mknod -m 600 mem c 1 1 date -u '+%Y%m%d-%H%M%S' > ${TEMP}/initramfs-base-temp/etc/build_date @@ -343,6 +344,25 @@ rm -rf "${TEMP}/initramfs-mdadm-temp" > /dev/null } +append_v86d(){ + if [ -d "${TEMP}/initramfs-v86d-temp" ] + then + rm -r "${TEMP}/initramfs-v86d-temp/" + fi + print_info 1 'v86d: Adding support (compiling binaries)...' + compile_v86d + cd ${TEMP} + mkdir -p "${TEMP}/initramfs-v86d-temp/sbin/" + [ "${V86D}" = '1' ] && { /bin/bzip2 -dc "${V86D_BINCACHE}" > "${TEMP}/initramfs-v86d-temp/sbin/v86d" || + gen_die "Could not extract v86d binary cache!"; } + chmod a+x "${TEMP}/initramfs-v86d-temp/sbin/v86d" + cd "${TEMP}/initramfs-v86d-temp/" + find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ + || gen_die "compressing v86d cpio" + cd "${TEMP}" + rm -rf "${TEMP}/initramfs-v86d-temp" > /dev/null +} + append_splash(){ splash_geninitramfs=`which splash_geninitramfs 2>/dev/null` if [ -x "${splash_geninitramfs}" ] @@ -662,6 +682,8 @@ append_data 'splash' "${SPLASH}" + append_data 'v86d' "${V86D}" + if isTrue "${FIRMWARE}" && [ -n "${FIRMWARE_DIR}" ] then append_data 'firmware' diff -ruN genkernel-3.4.22.1-vanilla/genkernel.conf genkernel-3.4.22.1/genkernel.conf --- genkernel-3.4.22.1-vanilla/genkernel.conf 2012-01-08 03:31:04.000000000 +0100 +++ genkernel-3.4.22.1/genkernel.conf 2012-01-11 02:07:03.322000181 +0100 @@ -112,6 +112,9 @@ # This supersedes the "SPLASH_THEME" option of /etc/conf.d/splash (in early space). # SPLASH_THEME="gentoo" +# Enable uvesafb userspace helper (v86d). Default is "no" +# V86D="yes" + # =========Keymap Settings========= # @@ -250,6 +253,16 @@ GPG_SRCTAR="${DISTDIR}/gnupg-${GPG_VER}.tar.bz2" GPG_BINCACHE="%%CACHE%%/gnupg-${GPG_VER}-%%ARCH%%.bz2" +KLIBC_VER="VERSION_KLIBC" +KLIBC_DIR="klibc-${KLIBC_VER}" +KLIBC_SRCTAR="${DISTDIR}/klibc-${KLIBC_VER}.tar.bz2" +KLIBC_BINCACHE="%%CACHE%%/klibc-${KLIBC_VER}-%%ARCH%%.tar.bz2" + +V86D_VER="VERSION_V86D" +V86D_DIR="v86d-${V86D_VER}" +V86D_SRCTAR="${DISTDIR}/v86d-${V86D_VER}.tar.bz2" +V86D_BINCACHE="%%CACHE%%/v86d-${V86D_VER}-%%ARCH%%.bz2" + # =========MISC KERNEL CONFIGURATION============ # diff -ruN genkernel-3.4.22.1-vanilla/patches/klibc/1.5.25/klibc-1.4.11-interp-flags.patch genkernel-3.4.22.1/patches/klibc/1.5.25/klibc-1.4.11-interp-flags.patch --- genkernel-3.4.22.1-vanilla/patches/klibc/1.5.25/klibc-1.4.11-interp-flags.patch 1970-01-01 01:00:00.000000000 +0100 +++ genkernel-3.4.22.1/patches/klibc/1.5.25/klibc-1.4.11-interp-flags.patch 2012-01-11 02:05:16.989000022 +0100 @@ -0,0 +1,13 @@ +diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild +index c2bfd2f..8066bda 100644 +--- a/usr/klibc/Kbuild ++++ b/usr/klibc/Kbuild +@@ -152,7 +152,7 @@ # build interp.o + targets += interp.o + + quiet_cmd_interp = BUILD $@ +- cmd_interp = $(KLIBCCC) $(klibccflags) -D__ASSEMBLY__ \ ++ cmd_interp = $(KLIBCCC) $(klibccflags) $(EXTRA_KLIBCAFLAGS) -D__ASSEMBLY__ \ + -DLIBDIR=\"$(SHLIBDIR)\" \ + -DSOHASH=\"$(SOLIBHASH)\" \ + -c -o $@ $< diff -ruN genkernel-3.4.22.1-vanilla/patches/klibc/1.5.25/klibc-1.5.7-strip-fix-dash-s.patch genkernel-3.4.22.1/patches/klibc/1.5.25/klibc-1.5.7-strip-fix-dash-s.patch --- genkernel-3.4.22.1-vanilla/patches/klibc/1.5.25/klibc-1.5.7-strip-fix-dash-s.patch 1970-01-01 01:00:00.000000000 +0100 +++ genkernel-3.4.22.1/patches/klibc/1.5.25/klibc-1.5.7-strip-fix-dash-s.patch 2012-01-11 02:05:16.989000022 +0100 @@ -0,0 +1,12 @@ +diff -Naurp klibc-1.5.7-orig/klcc/klcc.in klibc-1.5.7/klcc/klcc.in +--- klibc-1.5.7-orig/klcc/klcc.in 2007-12-03 01:17:26.000000000 +0100 ++++ klibc-1.5.7/klcc/klcc.in 2007-12-03 01:18:39.000000000 +0100 +@@ -259,7 +259,7 @@ if ( $operation ne '' ) { + unlink(@rmobjs); + + if ( $strip && !$rv ) { +- $rv = mysystem($STRIP, @STRIPFLAGS, $output); ++ $rv = mysystem($STRIP, @STRIPFLAGS, $output || 'a.out'); + } + } +