Lines 324-426
Link Here
|
324 |
fi |
324 |
fi |
325 |
} |
325 |
} |
326 |
|
326 |
|
327 |
compile_unionfs_modules() { |
327 |
compile_aufs_modules() { |
328 |
if [ ! -f "${UNIONFS_MODULES_BINCACHE}" ] |
328 |
if [ ! -f "${AUFS_MODULES_BINCACHE}" ] |
329 |
then |
329 |
then |
330 |
[ -f "${UNIONFS_SRCTAR}" ] || |
330 |
[ -f "${AUFS_SRCTAR}" ] || |
331 |
gen_die "Could not find unionfs source tarball: ${UNIONFS_SRCTAR}!" |
331 |
gen_die "Could not find aufs source tarball: ${AUFS_SRCTAR}!" |
332 |
cd "${TEMP}" |
332 |
cd "${TEMP}" |
333 |
rm -rf ${UNIONFS_DIR} > /dev/null |
333 |
rm -rf ${AUFS_DIR} > /dev/null |
334 |
rm -rf unionfs* > /dev/null |
334 |
rm -rf aufs* > /dev/null |
335 |
mkdir unionfs |
335 |
mkdir aufs |
336 |
/bin/tar xzpf ${UNIONFS_SRCTAR} || |
336 |
/bin/tar xjpf ${AUFS_SRCTAR} || |
337 |
gen_die 'Could not extract unionfs source tarball!' |
337 |
gen_die 'Could not extract aufs source tarball!' |
338 |
[ -d "${UNIONFS_DIR}" ] || |
338 |
[ -d "${AUFS_DIR}" ] || |
339 |
gen_die 'Unionfs directory ${UNIONFS_DIR} is invalid!' |
339 |
gen_die 'Unionfs directory ${AUFS_DIR} is invalid!' |
340 |
cd "${UNIONFS_DIR}" |
340 |
cd "${AUFS_DIR}" |
341 |
print_info 1 'unionfs modules: >> Compiling...' |
341 |
print_info 1 'aufs modules: >> Compiling...' |
342 |
echo "LINUXSRC=${KERNEL_DIR}" >> fistdev.mk |
342 |
make KDIR="${KERNEL_DIR}" -f local.mk aufs.ko |
343 |
echo 'TOPINC=-I$(LINUXSRC)/include' >> fistdev.mk |
343 |
print_info 1 'aufs: >> Copying to cache...' |
344 |
echo "MODDIR= /lib/modules/${KV}" >> fistdev.mk |
|
|
345 |
echo "KVERS=${KV}" >> fistdev.mk |
346 |
echo "KERNELVERSION=${KV}" >> fistdev.mk |
347 |
# Fix for hardened/selinux systems to have extened attributes |
348 |
# per r2d2's request. Also add -DUNIONFS_UNSUPPORTED for 2.6.16 |
349 |
echo "EXTRACFLAGS=-DUNIONFS_XATTR -DFIST_SETXATTR_CONSTVOID -DUNIONFS_UNSUPPORTED" \ |
350 |
>> fistdev.mk |
351 |
# Here we do something really nasty and disable debugging, along with |
352 |
# change our default CFLAGS |
353 |
echo "UNIONFS_DEBUG_CFLAG=-DUNIONFS_NDEBUG" >> fistdev.mk |
354 |
echo "UNIONFS_OPT_CFLAG= -O2 -pipe" >> fistdev.mk |
355 |
|
356 |
if [ "${PAT}" -ge '6' ] |
357 |
then |
358 |
# ARCH is used by unionfs - and conflicts with genkernel |
359 |
ARCH_PUSH=${ARCH} |
360 |
unset ARCH |
361 |
# Compile unionfs module within the unionfs |
362 |
# environment not within the kernelsrc dir |
363 |
make unionfs.ko || gen_die 'failed to compile unionfs' |
364 |
ARCH=${ARCH_PUSH} |
365 |
else |
366 |
gen_die 'unionfs is only supported on 2.6 targets' |
367 |
fi |
368 |
print_info 1 'unionfs: >> Copying to cache...' |
369 |
|
344 |
|
370 |
mkdir -p ${TEMP}/unionfs/lib/modules/${KV}/kernel/fs/unionfs |
345 |
mkdir -p ${TEMP}/aufs/lib/modules/${KV}/kernel/fs/aufs |
|
|
346 |
cp -f fs/aufs/aufs.ko ${TEMP}/aufs/lib/modules/${KV}/kernel/fs/aufs |
371 |
|
347 |
|
372 |
if [ -f unionfs.ko ] |
|
|
373 |
then |
374 |
cp -f unionfs.ko ${TEMP}/unionfs/lib/modules/${KV}/kernel/fs/unionfs |
375 |
else |
376 |
cp -f unionfs.o ${TEMP}/unionfs/lib/modules/${KV}/kernel/fs/unionfs |
377 |
fi |
378 |
|
348 |
|
379 |
cd ${TEMP}/unionfs |
349 |
cd ${TEMP}/aufs |
380 |
/bin/tar -cjf "${UNIONFS_MODULES_BINCACHE}" . || |
350 |
/bin/tar -cjf "${AUFS_MODULES_BINCACHE}" . || |
381 |
gen_die 'Could not create unionfs modules binary cache' |
351 |
gen_die 'Could not create aufs modules binary cache' |
382 |
|
352 |
|
383 |
cd "${TEMP}" |
353 |
cd "${TEMP}" |
384 |
rm -rf "${UNIONFS_DIR}" > /dev/null |
354 |
rm -rf "${AUFS_DIR}" > /dev/null |
385 |
rm -rf unionfs > /dev/null |
355 |
rm -rf aufs > /dev/null |
386 |
fi |
356 |
fi |
387 |
} |
357 |
} |
388 |
|
358 |
|
389 |
compile_unionfs_utils() { |
359 |
compile_aufs_utils() { |
390 |
if [ ! -f "${UNIONFS_BINCACHE}" ] |
360 |
if [ ! -f "${AUFS_BINCACHE}" ] |
391 |
then |
361 |
then |
392 |
[ -f "${UNIONFS_SRCTAR}" ] || |
362 |
[ -f "${AUFS_SRCTAR}" ] || |
393 |
gen_die "Could not find unionfs source tarball: ${UNIONFS_SRCTAR}!" |
363 |
gen_die "Could not find aufs source tarball: ${AUFS_SRCTAR}!" |
394 |
cd "${TEMP}" |
364 |
cd "${TEMP}" |
395 |
rm -rf ${UNIONFS_DIR} > /dev/null |
365 |
rm -rf ${AUFS_DIR} > /dev/null |
396 |
rm -rf unionfs* > /dev/null |
366 |
rm -rf aufs* > /dev/null |
397 |
mkdir -p unionfs/sbin |
367 |
mkdir -p aufs/sbin |
398 |
/bin/tar -zxpf ${UNIONFS_SRCTAR} || |
368 |
/bin/tar -jxpf ${AUFS_SRCTAR} || |
399 |
gen_die 'Could not extract unionfs source tarball!' |
369 |
gen_die 'Could not extract aufs source tarball!' |
400 |
[ -d "${UNIONFS_DIR}" ] || |
370 |
[ -d "${AUFS_DIR}" ] || |
401 |
gen_die 'Unionfs directory ${UNIONFS_DIR} is invalid!' |
371 |
gen_die 'Unionfs directory ${AUFS_DIR} is invalid!' |
402 |
cd "${UNIONFS_DIR}" |
372 |
cd "${AUFS_DIR}" |
403 |
print_info 1 'unionfs tools: >> Compiling...' |
373 |
# Patching MAkefile for static compiling |
404 |
sed -i utils/Makefile -e 's|${CC} -o|${CC} -static -o|g' |
374 |
sed -i util/Makefile -e 's|-O2 -Wall|-O2 -Wall -static|g' |
405 |
sed -i Makefile -e 's|${CC} -o|${CC} -static -o|g' |
375 |
|
406 |
compile_generic utils utils |
376 |
print_info 1 'aufs tools: >> Compiling...' |
407 |
|
377 |
make -j1 -f local.mk mount.aufs auplink aulchown umount.aufs |
408 |
if [ ! -e "uniondbg" ]; then |
378 |
cd util |
409 |
cd utils |
379 |
|
410 |
fi |
380 |
print_info 1 'aufs: >> Copying to cache...' |
411 |
print_info 1 'unionfs: >> Copying to cache...' |
381 |
cp mount.aufs auplink aulchown umount.aufs ${TEMP}/aufs/sbin/ || |
412 |
strip uniondbg unionctl |
382 |
gen_die 'Could not copy the aufs binary to the tmp directory' |
413 |
cp uniondbg ${TEMP}/unionfs/sbin/ || |
383 |
cd ${TEMP}/aufs |
414 |
gen_die 'Could not copy the uniondbg binary to the tmp directory' |
384 |
/bin/tar -cjf "${AUFS_BINCACHE}" . || |
415 |
cp unionctl ${TEMP}/unionfs/sbin/ || |
385 |
gen_die 'Could not create aufs tools binary cache' |
416 |
gen_die 'Could not copy the unionctl binary to the tmp directory' |
|
|
417 |
cd ${TEMP}/unionfs |
418 |
/bin/tar -cjf "${UNIONFS_BINCACHE}" . || |
419 |
gen_die 'Could not create unionfs tools binary cache' |
420 |
|
386 |
|
421 |
cd "${TEMP}" |
387 |
cd "${TEMP}" |
422 |
rm -rf "${UNIONFS_DIR}" > /dev/null |
388 |
rm -rf "${AUFS_DIR}" > /dev/null |
423 |
rm -rf unionfs > /dev/null |
389 |
rm -rf aufs > /dev/null |
424 |
fi |
390 |
fi |
425 |
} |
391 |
} |
426 |
|
392 |
|