diff -Nurp genkernel-3.4.6.orig/gen_compile.sh genkernel-3.4.6/gen_compile.sh --- genkernel-3.4.6.orig/gen_compile.sh 2006-12-27 20:07:30.000000000 +0100 +++ genkernel-3.4.6/gen_compile.sh 2007-02-13 16:00:43.000000000 +0100 @@ -320,65 +320,6 @@ compile_kernel() { fi } -compile_unionfs_modules() { - if [ ! -f "${UNIONFS_MODULES_BINCACHE}" ] - then - [ -f "${UNIONFS_SRCTAR}" ] || - gen_die "Could not find unionfs source tarball: ${UNIONFS_SRCTAR}!" - cd "${TEMP}" - rm -rf ${UNIONFS_DIR} > /dev/null - rm -rf unionfs > /dev/null - mkdir -p unionfs - /bin/tar -zxpf ${UNIONFS_SRCTAR} || - gen_die 'Could not extract unionfs source tarball!' - [ -d "${UNIONFS_DIR}" ] || - gen_die 'Unionfs directory ${UNIONFS_DIR} is invalid!' - cd "${UNIONFS_DIR}" - print_info 1 'unionfs modules: >> Compiling...' - echo "LINUXSRC=${KERNEL_DIR}" >> fistdev.mk - echo 'TOPINC=-I$(LINUXSRC)/include' >> fistdev.mk - echo "MODDIR= /lib/modules/${KV}" >> fistdev.mk - echo "KERNELVERSION=${KV}" >> fistdev.mk - # Fix for hardened/selinux systems to have extened attributes - # per r2d2's request. Also add -DUNIONFS_UNSUPPORTED for 2.6.16 - echo "EXTRACFLAGS=-DUNIONFS_XATTR -DFIST_SETXATTR_CONSTVOID -DUNIONFS_UNSUPPORTED" \ - >> fistdev.mk - # Here we do something really nasty and disable debugging, along with - # change our default CFLAGS - echo "UNIONFS_DEBUG_CFLAG=-DUNIONFS_NDEBUG" >> fistdev.mk - echo "UNIONFS_OPT_CFLAG= -O2 -pipe" >> fistdev.mk - - if [ "${PAT}" -ge '6' ] - then - cd "${TEMP}" - cd "${UNIONFS_DIR}" - # Compile unionfs module within the unionfs - # environment not within the kernelsrc dir - make unionfs.ko || gen_die 'failed to compile unionfs' - else - gen_die 'unionfs is only supported on 2.6 targets' - fi - print_info 1 'unionfs: >> Copying to cache...' - - mkdir -p ${TEMP}/unionfs/lib/modules/${KV}/kernel/fs/unionfs - - if [ -f unionfs.ko ] - then - cp -f unionfs.ko ${TEMP}/unionfs/lib/modules/${KV}/kernel/fs/unionfs - else - cp -f unionfs.o ${TEMP}/unionfs/lib/modules/${KV}/kernel/fs/unionfs - fi - - cd ${TEMP}/unionfs - /bin/tar -cjf "${UNIONFS_MODULES_BINCACHE}" . || - gen_die 'Could not create unionfs modules binary cache' - - cd "${TEMP}" - rm -rf "${UNIONFS_DIR}" > /dev/null - rm -rf unionfs > /dev/null - fi -} - compile_unionfs_utils() { if [ ! -f "${UNIONFS_BINCACHE}" ] then @@ -388,15 +329,17 @@ compile_unionfs_utils() { rm -rf ${UNIONFS_DIR} > /dev/null rm -rf unionfs > /dev/null mkdir -p unionfs/sbin + rm -rf ${UNIONFS_DIR} > /dev/null /bin/tar -zxpf ${UNIONFS_SRCTAR} || gen_die 'Could not extract unionfs source tarball!' [ -d "${UNIONFS_DIR}" ] || gen_die 'Unionfs directory ${UNIONFS_DIR} is invalid!' cd "${UNIONFS_DIR}" print_info 1 'unionfs tools: >> Compiling...' - sed -i Makefile -e 's|${CC} -o|${CC} -static -o|g' - compile_generic utils utils - + ./bootstrap &> /dev/null + ./configure >> ${DEBUGFILE} 2>&1 || gen_die 'Configuring unionfs-utils failed!' + sed -i Makefile -e 's|LDFLAGS = |LDFLAGS = -all-static|g' + compile_generic '' utils print_info 1 'unionfs: >> Copying to cache...' strip uniondbg unionctl cp uniondbg ${TEMP}/unionfs/sbin/ || @@ -408,7 +351,6 @@ compile_unionfs_utils() { gen_die 'Could not create unionfs tools binary cache' cd "${TEMP}" - rm -rf "${UNIONFS_DIR}" > /dev/null rm -rf unionfs > /dev/null fi } diff -Nurp genkernel-3.4.6.orig/generic/initrd.scripts genkernel-3.4.6/generic/initrd.scripts --- genkernel-3.4.6.orig/generic/initrd.scripts 2007-02-13 16:03:22.000000000 +0100 +++ genkernel-3.4.6/generic/initrd.scripts 2007-02-13 16:02:11.000000000 +0100 @@ -147,10 +147,12 @@ mount_sysfs() { # $2 = path to data directory # union_insert_dir() { - /sbin/unionctl $1 --add --after 0 --mode ro $2 + # detect branch 0 because newer unionfs doesn't support "0,1,2" + BRANCH_0="/"$(/sbin/unionctl $1 --list | cut -d/ -f2- | cut -d'(' -f1) + /sbin/unionctl $1 --add --after $BRANCH_0 --mode ro $2 if [ $? = '0' ] then - good_msg "Addition of $2 to $1 successful" + good_msg "Addition of $2 to $1 after branch $BRANCH_0 successful" fi } diff -Nurp genkernel-3.4.6.orig/generic/linuxrc genkernel-3.4.6/generic/linuxrc --- genkernel-3.4.6.orig/generic/linuxrc 2007-02-13 16:03:22.000000000 +0100 +++ genkernel-3.4.6/generic/linuxrc 2007-02-13 16:00:43.000000000 +0100 @@ -561,6 +561,10 @@ then if [ "${USE_UNIONFS_NORMAL}" -eq '1' ] then union_insert_dir ${UNION} ${NEW_ROOT}/${FS_LOCATION} + + mkdir ${UNION}/mnt/livecd + mount --bind ${NEW_ROOT}/${FS_LOCATION} ${UNION}/mnt/livecd + # Make sure fstab notes livecd is mounted ro. Makes system skip remount which fails on unionfs dirs. sed -e 's|\(.*\s/\s*tmpfs\s*\)defaults\(.*\)|\1defaults,ro\2|' /${UNION}/etc/fstab > /${UNION}/etc/fstab.new diff -Nurp genkernel-3.4.6.orig/gen_initramfs.sh genkernel-3.4.6/gen_initramfs.sh --- genkernel-3.4.6.orig/gen_initramfs.sh 2006-12-27 20:07:30.000000000 +0100 +++ genkernel-3.4.6/gen_initramfs.sh 2007-02-13 16:00:57.000000000 +0100 @@ -137,21 +137,6 @@ append_devfs(){ rm -rf "${TEMP}/initramfs-devfs-temp" > /dev/null } -append_unionfs_modules(){ - if [ -d "${TEMP}/initramfs-unionfs-modules-temp" ] - then - rm -r "${TEMP}/initramfs-unionfs-modules-temp/" - fi - print_info 1 'UNIONFS MODULES: Adding support (compiling)...' - compile_unionfs_modules - mkdir -p "${TEMP}/initramfs-unionfs-modules-temp/" - /bin/tar -jxpf "${UNIONFS_MODULES_BINCACHE}" -C "${TEMP}/initramfs-unionfs-modules-temp" || - gen_die "Could not extract unionfs modules binary cache!"; - cd "${TEMP}/initramfs-unionfs-modules-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" - rm -r "${TEMP}/initramfs-unionfs-modules-temp/" -} - append_unionfs_tools(){ if [ -d "${TEMP}/initramfs-unionfs-tools-temp" ] then @@ -484,7 +469,6 @@ create_initramfs() { append_data 'busybox' "${BUSYBOX}" append_data 'devfs' "${DEVFS}" # append_data 'udev' "${UDEV}" - append_data 'unionfs_modules' "${UNIONFS}" append_data 'unionfs_tools' "${UNIONFS}" append_data 'suspend' "${SUSPEND}" append_data 'lvm2' "${LVM2}" diff -Nurp genkernel-3.4.6.orig/gen_initrd.sh genkernel-3.4.6/gen_initrd.sh --- genkernel-3.4.6.orig/gen_initrd.sh 2006-12-27 20:07:29.000000000 +0100 +++ genkernel-3.4.6/gen_initrd.sh 2007-02-13 16:00:57.000000000 +0100 @@ -126,15 +126,6 @@ create_base_initrd_sys() { # fi # fi - #unionfs modules - if [ "${UNIONFS}" -eq '1' ] - then - print_info 1 'UNIONFS MODULES: Adding support (compiling)...' - compile_unionfs_modules - /bin/tar -jxpf "${UNIONFS_MODULES_BINCACHE}" -C "${TEMP}/initrd-temp" || - gen_die "Could not extract unionfs modules binary cache!"; - fi - #unionfs utils if [ "${UNIONFS}" -eq '1' ] then diff -Nurp genkernel-3.4.6.orig/genkernel.conf genkernel-3.4.6/genkernel.conf --- genkernel-3.4.6.orig/genkernel.conf 2006-12-27 20:07:28.000000000 +0100 +++ genkernel-3.4.6/genkernel.conf 2007-02-13 16:00:57.000000000 +0100 @@ -122,18 +122,10 @@ DMRAID_DIR="dmraid/${DMRAID_VER}" DMRAID_SRCTAR="${GK_SHARE}/pkg/dmraid-${DMRAID_VER}.tar.bz2" DMRAID_BINCACHE="%%CACHE%%/dmraid-${DMRAID_VER}-%%ARCH%%.tar.bz2" -# Kernel Version Compatibility -# (from http://www.am-utils.org/project-unionfs.html) - -# 2.6.9 - 2.6.15 1.1.5 -# 2.6.16 1.2 -# 2.6.17 1.3 - UNIONFS_VER="VERSION_UNIONFS" -UNIONFS_DIR="unionfs-${UNIONFS_VER}" -UNIONFS_SRCTAR="${GK_SHARE}/pkg/unionfs-${UNIONFS_VER}.tar.gz" -UNIONFS_BINCACHE="%%CACHE%%/unionfs-${UNIONFS_VER}-tools-%%ARCH%%.tar.bz2" -UNIONFS_MODULES_BINCACHE="%%CACHE%%/unionfs-${UNIONFS_VER}-modules-%%KV%%-%%ARCH%%.tar.bz2" +UNIONFS_DIR="unionfs-utils" +UNIONFS_SRCTAR="${GK_SHARE}/pkg/unionfs-utils-${UNIONFS_VER}.tar.gz" +UNIONFS_BINCACHE="%%CACHE%%/unionfs-utils-${UNIONFS_VER}-%%ARCH%%.tar.bz2" E2FSPROGS_VER="VERSION_E2FSPROGS" E2FSPROGS_DIR="e2fsprogs-${E2FSPROGS_VER}" diff -Nurp genkernel-3.4.6.orig/x86/modules_load genkernel-3.4.6/x86/modules_load --- genkernel-3.4.6.orig/x86/modules_load 2006-12-27 20:07:29.000000000 +0100 +++ genkernel-3.4.6/x86/modules_load 2007-02-13 16:02:37.000000000 +0100 @@ -25,4 +25,4 @@ MODULES_DMRAID="dm-mod dm-mirror raid0 r MODULES_SATA="sata_promise sata_sil sata_sil24 sata_svw sata_via \ sata_nv sata_sx4 sata_sis sata_uli sata_vsc sata_qstor ahci \ ata_piix sata_mv pdc_adma" -MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs" +MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs unionfs" diff -Nurp genkernel-3.4.6.orig/x86_64/modules_load genkernel-3.4.6/x86_64/modules_load --- genkernel-3.4.6.orig/x86_64/modules_load 2006-12-27 20:07:28.000000000 +0100 +++ genkernel-3.4.6/x86_64/modules_load 2007-02-13 16:02:48.000000000 +0100 @@ -25,4 +25,4 @@ MODULES_DMRAID="dm-mod dm-mirror raid0 r MODULES_SATA="sata_promise sata_sil sata_sil24 sata_svw sata_via \ sata_nv sata_sx4 sata_sis sata_uli sata_vsc sata_qstor ahci \ ata_piix sata_mv pdc_adma" -MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs" +MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs unionfs"