|
|
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 |
} | } |