View | Details | Raw Unified
Collapse All | Expand All

(-) genkernel-3.4.6.orig/gen_compile.sh (-63 / +5 lines)
 Lines 320-384   compile_kernel() { Link Here 
	fi
	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() {
compile_unionfs_utils() {
	if [ ! -f "${UNIONFS_BINCACHE}" ]
	if [ ! -f "${UNIONFS_BINCACHE}" ]
	then
	then
 Lines 388-402   compile_unionfs_utils() { Link Here 
		rm -rf ${UNIONFS_DIR} > /dev/null
		rm -rf ${UNIONFS_DIR} > /dev/null
		rm -rf unionfs > /dev/null
		rm -rf unionfs > /dev/null
		mkdir -p unionfs/sbin
		mkdir -p unionfs/sbin
		rm -rf ${UNIONFS_DIR} > /dev/null
		/bin/tar -zxpf ${UNIONFS_SRCTAR} ||
		/bin/tar -zxpf ${UNIONFS_SRCTAR} ||
			gen_die 'Could not extract unionfs source tarball!'
			gen_die 'Could not extract unionfs source tarball!'
		[ -d "${UNIONFS_DIR}" ] ||
		[ -d "${UNIONFS_DIR}" ] ||
			gen_die 'Unionfs directory ${UNIONFS_DIR} is invalid!'
			gen_die 'Unionfs directory ${UNIONFS_DIR} is invalid!'
		cd "${UNIONFS_DIR}"
		cd "${UNIONFS_DIR}"
		print_info 1 'unionfs tools: >> Compiling...'
		print_info 1 'unionfs tools: >> Compiling...'
		sed -i Makefile -e 's|${CC} -o|${CC} -static -o|g'
		./bootstrap &> /dev/null
		compile_generic utils utils
		./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...'
		print_info 1 'unionfs: >> Copying to cache...'
		strip uniondbg unionctl
		strip uniondbg unionctl
		cp uniondbg ${TEMP}/unionfs/sbin/ || 
		cp uniondbg ${TEMP}/unionfs/sbin/ || 
 Lines 408-414   compile_unionfs_utils() { Link Here 
			gen_die 'Could not create unionfs tools binary cache'
			gen_die 'Could not create unionfs tools binary cache'
		
		
		cd "${TEMP}"
		cd "${TEMP}"
		rm -rf "${UNIONFS_DIR}" > /dev/null
		rm -rf unionfs > /dev/null
		rm -rf unionfs > /dev/null
	fi
	fi
}
}
(-) genkernel-3.4.6.orig/generic/initrd.scripts (-2 / +4 lines)
 Lines 147-156   mount_sysfs() { Link Here 
# $2 = path to data directory
# $2 = path to data directory
#
#
union_insert_dir() {
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' ]
   if [ $? = '0' ]
   then
   then
   	good_msg "Addition of $2 to $1 successful"
   	good_msg "Addition of $2 to $1 after branch $BRANCH_0 successful"
   fi
   fi
}
}
(-) genkernel-3.4.6.orig/generic/linuxrc (+4 lines)
 Lines 561-566   then Link Here 
	if [ "${USE_UNIONFS_NORMAL}" -eq '1' ]
	if [ "${USE_UNIONFS_NORMAL}" -eq '1' ]
	then
	then
		union_insert_dir ${UNION} ${NEW_ROOT}/${FS_LOCATION}
		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.
		# 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
		sed -e 's|\(.*\s/\s*tmpfs\s*\)defaults\(.*\)|\1defaults,ro\2|' /${UNION}/etc/fstab > /${UNION}/etc/fstab.new
(-) genkernel-3.4.6.orig/gen_initramfs.sh (-16 lines)
 Lines 137-157   append_devfs(){ Link Here 
	rm -rf "${TEMP}/initramfs-devfs-temp" > /dev/null
	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(){
append_unionfs_tools(){
	if [ -d "${TEMP}/initramfs-unionfs-tools-temp" ]
	if [ -d "${TEMP}/initramfs-unionfs-tools-temp" ]
	then
	then
 Lines 484-490   create_initramfs() { Link Here 
	append_data 'busybox' "${BUSYBOX}"
	append_data 'busybox' "${BUSYBOX}"
	append_data 'devfs' "${DEVFS}"
	append_data 'devfs' "${DEVFS}"
#	append_data 'udev' "${UDEV}"
#	append_data 'udev' "${UDEV}"
	append_data 'unionfs_modules' "${UNIONFS}"
	append_data 'unionfs_tools' "${UNIONFS}"
	append_data 'unionfs_tools' "${UNIONFS}"
	append_data 'suspend' "${SUSPEND}"
	append_data 'suspend' "${SUSPEND}"
	append_data 'lvm2' "${LVM2}"
	append_data 'lvm2' "${LVM2}"
(-) genkernel-3.4.6.orig/gen_initrd.sh (-9 lines)
 Lines 126-140   create_base_initrd_sys() { Link Here 
#		fi
#		fi
#	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
	#unionfs utils
	if [ "${UNIONFS}" -eq '1' ]
	if [ "${UNIONFS}" -eq '1' ]
	then
	then
(-) genkernel-3.4.6.orig/genkernel.conf (-11 / +3 lines)
 Lines 122-139   DMRAID_DIR="dmraid/${DMRAID_VER}" Link Here 
DMRAID_SRCTAR="${GK_SHARE}/pkg/dmraid-${DMRAID_VER}.tar.bz2"
DMRAID_SRCTAR="${GK_SHARE}/pkg/dmraid-${DMRAID_VER}.tar.bz2"
DMRAID_BINCACHE="%%CACHE%%/dmraid-${DMRAID_VER}-%%ARCH%%.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_VER="VERSION_UNIONFS"
UNIONFS_DIR="unionfs-${UNIONFS_VER}"
UNIONFS_DIR="unionfs-utils"
UNIONFS_SRCTAR="${GK_SHARE}/pkg/unionfs-${UNIONFS_VER}.tar.gz"
UNIONFS_SRCTAR="${GK_SHARE}/pkg/unionfs-utils-${UNIONFS_VER}.tar.gz"
UNIONFS_BINCACHE="%%CACHE%%/unionfs-${UNIONFS_VER}-tools-%%ARCH%%.tar.bz2"
UNIONFS_BINCACHE="%%CACHE%%/unionfs-utils-${UNIONFS_VER}-%%ARCH%%.tar.bz2"
UNIONFS_MODULES_BINCACHE="%%CACHE%%/unionfs-${UNIONFS_VER}-modules-%%KV%%-%%ARCH%%.tar.bz2"
E2FSPROGS_VER="VERSION_E2FSPROGS"
E2FSPROGS_VER="VERSION_E2FSPROGS"
E2FSPROGS_DIR="e2fsprogs-${E2FSPROGS_VER}"
E2FSPROGS_DIR="e2fsprogs-${E2FSPROGS_VER}"
(-) genkernel-3.4.6.orig/x86/modules_load (-1 / +1 lines)
 Lines 25-28   MODULES_DMRAID="dm-mod dm-mirror raid0 r Link Here 
MODULES_SATA="sata_promise sata_sil sata_sil24 sata_svw sata_via \
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 \
sata_nv sata_sx4 sata_sis sata_uli sata_vsc sata_qstor ahci \
ata_piix sata_mv pdc_adma"
ata_piix sata_mv pdc_adma"
MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs"
MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs unionfs"
(-) genkernel-3.4.6.orig/x86_64/modules_load (-1 / +1 lines)
 Lines 25-28   MODULES_DMRAID="dm-mod dm-mirror raid0 r Link Here 
MODULES_SATA="sata_promise sata_sil sata_sil24 sata_svw sata_via \
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 \
sata_nv sata_sx4 sata_sis sata_uli sata_vsc sata_qstor ahci \
ata_piix sata_mv pdc_adma"
ata_piix sata_mv pdc_adma"
MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs"
MODULES_FS="ext2 ext3 reiserfs jfs nfs xfs unionfs"