compile_utils_args()
{
local ARGS
-
ARGS=''
+
+ if [ -n "${UTILS_CROSS_COMPILE}" ]
+ then
+ UTILS_CC="${UTILS_CROSS_COMPILE}gcc"
+ UTILS_LD="${UTILS_CROSS_COMPILE}ld"
+ UTILS_AS="${UTILS_CROSS_COMPILE}as"
+ fi
+
if [ "${UTILS_ARCH}" != '' ]
then
ARGS="ARCH=\"${UTILS_ARCH}\""
if [ -d "${GK_SHARE}/patches/${util}/${version}" ]
then
print_info 1 "${util}: >> Applying patches..."
- for i in ${GK_SHARE}/patches/${util}/${version}/*
+ for i in ${GK_SHARE}/patches/${util}/${version}/*{diff,patch}
do
patch_success=0
for j in `seq 0 5`
done
if [ ${patch_success} != 1 ]
then
-# return 1
gen_die "could not apply patch ${i} for ${util}-${version}"
fi
done
compile_busybox() {
[ -f "${BUSYBOX_SRCTAR}" ] ||
gen_die "Could not find busybox source tarball: ${BUSYBOX_SRCTAR}!"
- [ -f "${BUSYBOX_CONFIG}" ] ||
- gen_die "Cound not find busybox config file: ${BUSYBOX_CONFIG}!"
+
+ if [ -n "${BUSYBOX_CONFIG}" ]
+ then
+ [ -f "${BUSYBOX_CONFIG}" ] ||
+ gen_die "Could not find busybox config file: ${BUSYBOX_CONFIG}"
+ elif isTrue "${NETBOOT}" && [ -f "$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/netboot-busy-config")" ]
+ then
+ BUSYBOX_CONFIG="$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/netboot-busy-config")"
+ elif isTrue "${NETBOOT}" && [ -f "${GK_SHARE}/netboot/busy-config" ]
+ then
+ BUSYBOX_CONFIG="${GK_SHARE}/netboot/busy-config"
+ elif [ -f "$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/busy-config")" ]
+ then
+ BUSYBOX_CONFIG="$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/busy-config")"
+ elif [ -f "${GK_SHARE}/defaults/busy-config" ]
+ then
+ BUSYBOX_CONFIG="${GK_SHARE}/defaults/busy-config"
+ else
+ gen_die "Could not find a busybox config file"
+ fi
# Delete cache if stored config's MD5 does not match one to be used
if [ -f "${BUSYBOX_BINCACHE}" ]
rm -rf "${E2FSPROGS_DIR}" > /dev/null
fi
}
+
+compile_fuse() {
+ if [ ! -f "${FUSE_BINCACHE}" ]
+ then
+ [ ! -f "${FUSE_SRCTAR}" ] &&
+ gen_die "Could not find fuse source tarball: ${FUSE_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
+ cd "${TEMP}"
+ rm -rf "${FUSE_DIR}"
+ tar -zxpf "${FUSE_SRCTAR}"
+ [ ! -d "${FUSE_DIR}" ] &&
+ gen_die "fuse directory ${FUSE_DIR} invalid"
+ cd "${FUSE_DIR}"
+ print_info 1 'fuse: >> Configuring...'
+ ./configure --disable-kernel-module --disable-example >> ${LOGFILE} 2>&1 ||
+ gen_die 'Configuring fuse failed!'
+ print_info 1 'fuse: >> Compiling...'
+ MAKE=${UTILS_MAKE} compile_generic "" ""
+
+ # Since we're linking statically against libfuse, we don't need to cache the .so
+# print_info 1 'libfuse: >> Copying to cache...'
+# [ -f "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ] ||
+# gen_die 'libfuse.so does not exist!'
+# strip "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ||
+# gen_die 'Could not strip libfuse.so!'
+# cd "${TEMP}/${FUSE_DIR}/lib/.libs"
+# tar -cjf "${FUSE_BINCACHE}" libfuse*so* ||
+# gen_die 'Could not create fuse bincache!'
+
+ cd "${TEMP}"
+# rm -rf "${FUSE_DIR}" > /dev/null
+ fi
+}
+
+compile_unionfs_fuse() {
+ if [ ! -f "${UNIONFS_FUSE_BINCACHE}" ]
+ then
+
+ # We'll call compile_fuse() from here, since it's not needed directly by anything else
+ compile_fuse
+
+ [ ! -f "${UNIONFS_FUSE_SRCTAR}" ] &&
+ gen_die "Could not find unionfs-fuse source tarball: ${UNIONFS_FUSE_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
+ cd "${TEMP}"
+ rm -rf "${UNIONFS_FUSE_DIR}"
+ tar -jxpf "${UNIONFS_FUSE_SRCTAR}"
+ [ ! -d "${UNIONFS_FUSE_DIR}" ] &&
+ gen_die "unionfs-fuse directory ${UNIONFS_FUSE_DIR} invalid"
+ cd "${UNIONFS_FUSE_DIR}"
+ print_info 1 'unionfs-fuse: >> Compiling...'
+ sed -i "/^\(CFLAGS\|CPPFLAGS\)/s:^\\(.*\\)$:\\1 -static -I${TEMP}/${FUSE_DIR}/include -L${TEMP}/${FUSE_DIR}/lib/.libs:" Makefile src/Makefile
+ sed -i "/^LIB = /s:^LIB = \(.*\)$:LIB = -static -L${TEMP}/${FUSE_DIR}/lib/.libs \1 -ldl -lrt:" Makefile src/Makefile
+ MAKE=${UTILS_MAKE} compile_generic "" ""
+ print_info 1 'unionfs-fuse: >> Copying to cache...'
+ [ -f "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ] ||
+ gen_die 'unionfs binary does not exist!'
+ strip "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
+ gen_die 'Could not strip unionfs binary!'
+ bzip2 "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
+ gen_die 'bzip2 compression of unionfs binary failed!'
+ mv "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs.bz2" "${UNIONFS_FUSE_BINCACHE}" ||
+ gen_die 'Could not copy the unionfs binary to the package directory, does the directory exist?'
+
+ cd "${TEMP}"
+ rm -rf "${UNIONFS_FUSE_DIR}" > /dev/null
+ fi
+}