4 compile_kernel_args() {
8 if [ "${KERNEL_CROSS_COMPILE}" != '' ]
10 ARGS="${ARGS} CROSS_COMPILE=\"${KERNEL_CROSS_COMPILE}\""
12 if [ "${KERNEL_CC}" != '' ]
14 ARGS="CC=\"${KERNEL_CC}\""
16 if [ "${KERNEL_LD}" != '' ]
18 ARGS="${ARGS} LD=\"${KERNEL_LD}\""
20 if [ "${KERNEL_AS}" != '' ]
22 ARGS="${ARGS} AS=\"${KERNEL_AS}\""
24 if [ -n "${KERNEL_ARCH}" ]
26 ARGS="${ARGS} ARCH=\"${KERNEL_ARCH}\""
37 if [ -n "${UTILS_CROSS_COMPILE}" ]
39 UTILS_CC="${UTILS_CROSS_COMPILE}gcc"
40 UTILS_LD="${UTILS_CROSS_COMPILE}ld"
41 UTILS_AS="${UTILS_CROSS_COMPILE}as"
44 if [ "${UTILS_ARCH}" != '' ]
46 ARGS="ARCH=\"${UTILS_ARCH}\""
48 if [ "${UTILS_CC}" != '' ]
50 ARGS="CC=\"${UTILS_CC}\""
52 if [ "${UTILS_LD}" != '' ]
54 ARGS="${ARGS} LD=\"${UTILS_LD}\""
56 if [ "${UTILS_AS}" != '' ]
58 ARGS="${ARGS} AS=\"${UTILS_AS}\""
67 if [ "${UTILS_ARCH}" != '' ]
69 export ARCH="${UTILS_ARCH}"
71 if [ "${UTILS_CC}" != '' ]
73 export CC="${UTILS_CC}"
75 if [ "${UTILS_LD}" != '' ]
77 export LD="${UTILS_LD}"
79 if [ "${UTILS_AS}" != '' ]
81 export AS="${UTILS_AS}"
87 if [ "${UTILS_ARCH}" != '' ]
91 if [ "${UTILS_CC}" != '' ]
95 if [ "${UTILS_LD}" != '' ]
99 if [ "${UTILS_AS}" != '' ]
108 if [ "${KERNEL_CC}" != '' ]
110 export CC="${KERNEL_CC}"
112 if [ "${KERNEL_LD}" != '' ]
114 export LD="${KERNEL_LD}"
116 if [ "${KERNEL_AS}" != '' ]
118 export AS="${KERNEL_AS}"
120 if [ "${KERNEL_CROSS_COMPILE}" != '' ]
122 export CROSS_COMPILE="${KERNEL_CROSS_COMPILE}"
128 if [ "${KERNEL_CC}" != '' ]
132 if [ "${KERNEL_LD}" != '' ]
136 if [ "${KERNEL_AS}" != '' ]
140 if [ "${KERNEL_CROSS_COMPILE}" != '' ]
147 if [ "${ARCH}" != '' ]
149 export ORIG_ARCH="${ARCH}"
153 export ORIG_CC="${CC}"
157 export ORIG_LD="${LD}"
161 export ORIG_AS="${AS}"
163 if [ "${CROSS_COMPILE}" != '' ]
165 export ORIG_CROSS_COMPILE="${CROSS_COMPILE}"
170 if [ "${ORIG_ARCH}" != '' ]
172 export ARCH="${ORIG_ARCH}"
175 if [ "${ORIG_CC}" != '' ]
177 export CC="${ORIG_CC}"
180 if [ "${ORIG_LD}" != '' ]
182 export LD="${ORIG_LD}"
185 if [ "${ORIG_AS}" != '' ]
187 export AS="${ORIG_AS}"
190 if [ "${ORIG_CROSS_COMPILE}" != '' ]
192 export CROSS_COMPILE="${ORIG_CROSS_COMPILE}"
193 unset ORIG_CROSS_COMPILE
201 if [ -d "${GK_SHARE}/patches/${util}/${version}" ]
203 print_info 1 "${util}: >> Applying patches..."
204 for i in ${GK_SHARE}/patches/${util}/${version}/*{diff,patch}
206 [ -f "${i}" ] || continue
210 patch -p${j} --backup-if-mismatch -f < "${i}" >/dev/null
217 if [ ${patch_success} -eq 1 ]
219 print_info 1 " - `basename ${i}`"
221 gen_die "could not apply patch ${i} for ${util}-${version}"
230 gen_die 'compile_generic(): improper usage!'
234 if [ "${argstype}" = 'kernel' ] || [ "${argstype}" = 'runtask' ]
238 elif [ "${2}" = 'utils' ]
243 case "${argstype}" in
244 kernel) ARGS="`compile_kernel_args`" ;;
245 utils) ARGS="`compile_utils_args`" ;;
246 *) ARGS="" ;; # includes runtask
250 # the eval usage is needed in the next set of code
251 # as ARGS can contain spaces and quotes, eg:
252 # ARGS='CC="ccache gcc"'
253 if [ "${argstype}" == 'runtask' ]
255 print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} -j1 ${ARGS} ${target} $*" 1 0 1
256 eval ${MAKE} -s ${MAKEOPTS} -j1 "${ARGS}" ${target} $*
258 elif [ "${LOGLEVEL}" -gt "1" ]
260 # Output to stdout and logfile
261 print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $*" 1 0 1
262 eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* 2>&1 | tee -a ${LOGFILE}
265 # Output to logfile only
266 print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${1} $*" 1 0 1
267 eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* >> ${LOGFILE} 2>&1
271 gen_die "Failed to compile the \"${target}\" target..."
275 if [ "${argstype}" = 'kernel' ]
278 elif [ "${argstype}" = 'utils' ]
285 print_info 1 " >> Compiling ${KV} modules..."
287 compile_generic modules kernel
288 export UNAME_MACHINE="${ARCH}"
289 [ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH
290 compile_generic "modules_install" kernel
295 [ "${KERNEL_MAKE}" = '' ] &&
296 gen_die "KERNEL_MAKE undefined - I don't know how to compile a kernel for this arch!"
298 print_info 1 " >> Compiling ${KV} ${KERNEL_MAKE_DIRECTIVE/_install/ [ install ]/}..."
299 compile_generic "${KERNEL_MAKE_DIRECTIVE}" kernel
300 if [ "${KERNEL_MAKE_DIRECTIVE_2}" != '' ]
302 print_info 1 " >> Starting supplimental compile of ${KV}: ${KERNEL_MAKE_DIRECTIVE_2}..."
303 compile_generic "${KERNEL_MAKE_DIRECTIVE_2}" kernel
306 local firmware_in_kernel_line=`fgrep CONFIG_FIRMWARE_IN_KERNEL "${KERNEL_DIR}"/.config`
307 if [ -n "${firmware_in_kernel_line}" -a "${firmware_in_kernel_line}" != CONFIG_FIRMWARE_IN_KERNEL=y ]
309 print_info 1 " >> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y..."
310 compile_generic "firmware_install" kernel
312 print_info 1 " >> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)..."
315 local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY})
316 local tmp_kernel_binary2=$(find_kernel_binary ${KERNEL_BINARY_2})
317 if [ -z "${tmp_kernel_binary}" ]
319 gen_die "Cannot locate kernel binary"
322 if ! isTrue "${CMD_NOINSTALL}"
324 copy_image_with_preserve "kernel" \
325 "${tmp_kernel_binary}" \
326 "kernel-${KNAME}-${ARCH}-${KV}"
328 copy_image_with_preserve "System.map" \
330 "System.map-${KNAME}-${ARCH}-${KV}"
332 if isTrue "${GENZIMAGE}"
334 copy_image_with_preserve "kernelz" \
335 "${tmp_kernel_binary2}" \
339 cp "${tmp_kernel_binary}" "${TMPDIR}/kernel-${KNAME}-${ARCH}-${KV}" ||
340 gen_die "Could not copy the kernel binary to ${TMPDIR}!"
341 cp "System.map" "${TMPDIR}/System.map-${KNAME}-${ARCH}-${KV}" ||
342 gen_die "Could not copy System.map to ${TMPDIR}!"
343 if isTrue "${GENZIMAGE}"
345 cp "${tmp_kernel_binary2}" "${TMPDIR}/kernelz-${KV}" ||
346 gen_die "Could not copy the kernelz binary to ${TMPDIR}!"
352 [ -f "${BUSYBOX_SRCTAR}" ] ||
353 gen_die "Could not find busybox source tarball: ${BUSYBOX_SRCTAR}!"
355 if [ -n "${BUSYBOX_CONFIG}" ]
357 [ -f "${BUSYBOX_CONFIG}" ] ||
358 gen_die "Could not find busybox config file: ${BUSYBOX_CONFIG}"
359 elif isTrue "${NETBOOT}" && [ -f "$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/netboot-busy-config")" ]
361 BUSYBOX_CONFIG="$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/netboot-busy-config")"
362 elif isTrue "${NETBOOT}" && [ -f "${GK_SHARE}/netboot/busy-config" ]
364 BUSYBOX_CONFIG="${GK_SHARE}/netboot/busy-config"
365 elif [ -f "$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/busy-config")" ]
367 BUSYBOX_CONFIG="$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/busy-config")"
368 elif [ -f "${GK_SHARE}/defaults/busy-config" ]
370 BUSYBOX_CONFIG="${GK_SHARE}/defaults/busy-config"
372 gen_die "Could not find a busybox config file"
375 # Delete cache if stored config's MD5 does not match one to be used
376 if [ -f "${BUSYBOX_BINCACHE}" ]
378 oldconfig_md5=$(tar -xjf "${BUSYBOX_BINCACHE}" -O .config.gk_orig 2>/dev/null | md5sum)
379 newconfig_md5=$(md5sum < "${BUSYBOX_CONFIG}")
380 if [ "${oldconfig_md5}" != "${newconfig_md5}" ]
382 print_info 1 "busybox: >> Removing stale cache..."
383 rm -rf "${BUSYBOX_BINCACHE}"
385 print_info 1 "busybox: >> Using cache"
389 if [ ! -f "${BUSYBOX_BINCACHE}" ]
392 rm -rf "${BUSYBOX_DIR}" > /dev/null
393 /bin/tar -jxpf ${BUSYBOX_SRCTAR} ||
394 gen_die 'Could not extract busybox source tarball!'
395 [ -d "${BUSYBOX_DIR}" ] ||
396 gen_die 'Busybox directory ${BUSYBOX_DIR} is invalid!'
397 cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config"
398 cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config.gk_orig"
400 apply_patches busybox ${BUSYBOX_VER}
401 print_info 1 'busybox: >> Configuring...'
402 yes '' 2>/dev/null | compile_generic oldconfig utils
404 print_info 1 'busybox: >> Compiling...'
405 compile_generic all utils
406 print_info 1 'busybox: >> Copying to cache...'
407 [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] ||
408 gen_die 'Busybox executable does not exist!'
409 strip "${TEMP}/${BUSYBOX_DIR}/busybox" ||
410 gen_die 'Could not strip busybox binary!'
411 tar -cj -C "${TEMP}/${BUSYBOX_DIR}" -f "${BUSYBOX_BINCACHE}" busybox .config .config.gk_orig ||
412 gen_die 'Could not create the busybox bincache!'
415 rm -rf "${BUSYBOX_DIR}" > /dev/null
420 if [ ! -f "${LVM_BINCACHE}" ]
422 [ -f "${LVM_SRCTAR}" ] ||
423 gen_die "Could not find LVM source tarball: ${LVM_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
425 rm -rf ${LVM_DIR} > /dev/null
426 /bin/tar -zxpf ${LVM_SRCTAR} ||
427 gen_die 'Could not extract LVM source tarball!'
428 [ -d "${LVM_DIR}" ] ||
429 gen_die 'LVM directory ${LVM_DIR} is invalid!'
431 apply_patches lvm ${LVM_VER}
432 print_info 1 'lvm: >> Configuring...'
434 ./configure --enable-static_link --prefix=${TEMP}/lvm \
435 --with-lvm1=internal --with-clvmd=none --with-cluster=none \
436 --disable-readline --disable-selinux --with-mirrors=internal \
437 --with-snapshots=internal --with-pool=internal >> ${LOGFILE} 2>&1 || \
438 gen_die 'Configure of lvm failed!'
439 print_info 1 'lvm: >> Compiling...'
440 compile_generic '' utils
441 compile_generic 'install' utils
444 print_info 1 ' >> Copying to bincache...'
445 strip "sbin/lvm.static" ||
446 gen_die 'Could not strip lvm.static!'
447 /bin/tar -cjf "${LVM_BINCACHE}" sbin/lvm.static ||
448 gen_die 'Could not create binary cache'
451 rm -rf "${TEMP}/device-mapper" > /dev/null
452 rm -rf "${LVM_DIR}" lvm
457 if [ -f "${MDADM_BINCACHE}" ]
459 print_info 1 ' MDADM: Using cache'
461 [ -f "${MDADM_SRCTAR}" ] ||
462 gen_die "Could not find MDADM source tarball: ${MDADM_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
464 rm -rf "${MDADM_DIR}" > /dev/null
465 /bin/tar -jxpf "${MDADM_SRCTAR}" ||
466 gen_die 'Could not extract MDADM source tarball!'
467 [ -d "${MDADM_DIR}" ] ||
468 gen_die 'MDADM directory ${MDADM_DIR} is invalid!'
471 sed -i "/^CFLAGS = /s:^CFLAGS = \(.*\)$:CFLAGS = -Os:" Makefile
472 sed -i "/^CXFLAGS = /s:^CXFLAGS = \(.*\)$:CXFLAGS = -Os:" Makefile
473 sed -i "/^CWFLAGS = /s:^CWFLAGS = \(.*\)$:CWFLAGS = -Wall:" Makefile
474 sed -i "s/^# LDFLAGS = -static/LDFLAGS = -static/" Makefile
476 print_info 1 'mdadm: >> Compiling...'
477 compile_generic 'mdadm mdmon' utils
479 mkdir -p "${TEMP}/mdadm/sbin"
480 install -m 0755 -s mdadm "${TEMP}/mdadm/sbin/mdadm"
481 install -m 0755 -s mdmon "${TEMP}/mdadm/sbin/mdmon"
482 print_info 1 ' >> Copying to bincache...'
484 strip "sbin/mdadm" "sbin/mdmon" ||
485 gen_die 'Could not strip mdadm binaries!'
486 /bin/tar -cjf "${MDADM_BINCACHE}" sbin/mdadm sbin/mdmon ||
487 gen_die 'Could not create binary cache'
490 rm -rf "${MDADM_DIR}" mdadm
495 compile_device_mapper
496 if [ ! -f "${DMRAID_BINCACHE}" ]
498 [ -f "${DMRAID_SRCTAR}" ] ||
499 gen_die "Could not find DMRAID source tarball: ${DMRAID_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
501 rm -rf ${DMRAID_DIR} > /dev/null
502 /bin/tar -jxpf ${DMRAID_SRCTAR} ||
503 gen_die 'Could not extract DMRAID source tarball!'
504 [ -d "${DMRAID_DIR}" ] ||
505 gen_die 'DMRAID directory ${DMRAID_DIR} is invalid!'
506 rm -rf "${TEMP}/device-mapper" > /dev/null
507 /bin/tar -jxpf "${DEVICE_MAPPER_BINCACHE}" -C "${TEMP}" ||
508 gen_die "Could not extract device-mapper binary cache!";
511 print_info 1 'dmraid: >> Configuring...'
513 LDFLAGS="-L${TEMP}/device-mapper/lib" \
514 CFLAGS="-I${TEMP}/device-mapper/include" \
515 CPPFLAGS="-I${TEMP}/device-mapper/include" \
516 ./configure --enable-static_link --prefix=${TEMP}/dmraid >> ${LOGFILE} 2>&1 ||
517 gen_die 'Configure of dmraid failed!'
519 # We dont necessarily have selinux installed yet... look into
520 # selinux global support in the future.
521 sed -i tools/Makefile -e "s|DMRAIDLIBS += -lselinux||g"
522 ###echo "DMRAIDLIBS += -lselinux -lsepol" >> tools/Makefile
523 mkdir -p "${TEMP}/dmraid"
524 print_info 1 'dmraid: >> Compiling...'
525 # Force dmraid to be built with -j1 for bug #188273
526 MAKEOPTS=-j1 compile_generic '' utils
527 #compile_generic 'install' utils
528 mkdir ${TEMP}/dmraid/sbin
529 install -m 0755 -s tools/dmraid "${TEMP}/dmraid/sbin/dmraid"
530 print_info 1 ' >> Copying to bincache...'
532 /bin/tar -cjf "${DMRAID_BINCACHE}" sbin/dmraid ||
533 gen_die 'Could not create binary cache'
536 rm -rf "${TEMP}/device-mapper" > /dev/null
537 rm -rf "${DMRAID_DIR}" dmraid
541 compile_device_mapper() {
542 if [ ! -f "${DEVICE_MAPPER_BINCACHE}" ]
544 [ ! -f "${DEVICE_MAPPER_SRCTAR}" ] &&
545 gen_die "Could not find device-mapper source tarball: ${DEVICE_MAPPER_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
547 rm -rf "${DEVICE_MAPPER_DIR}"
548 /bin/tar -zxpf "${DEVICE_MAPPER_SRCTAR}"
549 [ ! -d "${DEVICE_MAPPER_DIR}" ] &&
550 gen_die "device-mapper directory ${DEVICE_MAPPER_DIR} invalid"
551 cd "${DEVICE_MAPPER_DIR}"
553 ./configure --prefix=${TEMP}/device-mapper --enable-static_link \
554 --disable-selinux >> ${LOGFILE} 2>&1 ||
555 gen_die 'Configuring device-mapper failed!'
556 print_info 1 'device-mapper: >> Compiling...'
557 compile_generic '' utils
558 compile_generic 'install' utils
559 print_info 1 ' >> Copying to cache...'
561 rm -rf "${TEMP}/device-mapper/man" ||
562 gen_die 'Could not remove manual pages!'
563 strip "${TEMP}/device-mapper/sbin/dmsetup" ||
564 gen_die 'Could not strip dmsetup binary!'
565 /bin/tar -jcpf "${DEVICE_MAPPER_BINCACHE}" device-mapper ||
566 gen_die 'Could not tar up the device-mapper binary!'
567 [ -f "${DEVICE_MAPPER_BINCACHE}" ] ||
568 gen_die 'device-mapper cache not created!'
570 rm -rf "${DEVICE_MAPPER_DIR}" > /dev/null
571 rm -rf "${TEMP}/device-mapper" > /dev/null
575 compile_e2fsprogs() {
576 if [ -f "${BLKID_BINCACHE}" ]
578 print_info 1 "blkid: >> Using cache"
580 [ ! -f "${E2FSPROGS_SRCTAR}" ] &&
581 gen_die "Could not find e2fsprogs source tarball: ${E2FSPROGS_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
583 rm -rf "${E2FSPROGS_DIR}"
584 tar -zxpf "${E2FSPROGS_SRCTAR}"
585 [ ! -d "${E2FSPROGS_DIR}" ] &&
586 gen_die "e2fsprogs directory ${E2FSPROGS_DIR} invalid"
587 cd "${E2FSPROGS_DIR}"
588 print_info 1 'e2fsprogs: >> Configuring...'
589 LDFLAGS=-static ./configure >> ${LOGFILE} 2>&1 ||
590 gen_die 'Configuring e2fsprogs failed!'
591 print_info 1 'e2fsprogs: >> Compiling...'
592 MAKE=${UTILS_MAKE} compile_generic "" ""
593 print_info 1 'blkid: >> Copying to cache...'
594 [ -f "${TEMP}/${E2FSPROGS_DIR}/misc/blkid" ] ||
595 gen_die 'Blkid executable does not exist!'
596 strip "${TEMP}/${E2FSPROGS_DIR}/misc/blkid" ||
597 gen_die 'Could not strip blkid binary!'
598 bzip2 "${TEMP}/${E2FSPROGS_DIR}/misc/blkid" ||
599 gen_die 'bzip2 compression of blkid failed!'
600 mv "${TEMP}/${E2FSPROGS_DIR}/misc/blkid.bz2" "${BLKID_BINCACHE}" ||
601 gen_die 'Could not copy the blkid binary to the package directory, does the directory exist?'
604 rm -rf "${E2FSPROGS_DIR}" > /dev/null
609 if [ ! -f "${FUSE_BINCACHE}" ]
611 [ ! -f "${FUSE_SRCTAR}" ] &&
612 gen_die "Could not find fuse source tarball: ${FUSE_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
615 tar -zxpf "${FUSE_SRCTAR}"
616 [ ! -d "${FUSE_DIR}" ] &&
617 gen_die "fuse directory ${FUSE_DIR} invalid"
619 print_info 1 'fuse: >> Configuring...'
620 ./configure --disable-kernel-module --disable-example >> ${LOGFILE} 2>&1 ||
621 gen_die 'Configuring fuse failed!'
622 print_info 1 'fuse: >> Compiling...'
623 MAKE=${UTILS_MAKE} compile_generic "" ""
625 # Since we're linking statically against libfuse, we don't need to cache the .so
626 # print_info 1 'libfuse: >> Copying to cache...'
627 # [ -f "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ] ||
628 # gen_die 'libfuse.so does not exist!'
629 # strip "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ||
630 # gen_die 'Could not strip libfuse.so!'
631 # cd "${TEMP}/${FUSE_DIR}/lib/.libs"
632 # tar -cjf "${FUSE_BINCACHE}" libfuse*so* ||
633 # gen_die 'Could not create fuse bincache!'
636 # rm -rf "${FUSE_DIR}" > /dev/null
640 compile_unionfs_fuse() {
641 if [ ! -f "${UNIONFS_FUSE_BINCACHE}" ]
644 # We'll call compile_fuse() from here, since it's not needed directly by anything else
647 [ ! -f "${UNIONFS_FUSE_SRCTAR}" ] &&
648 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!"
650 rm -rf "${UNIONFS_FUSE_DIR}"
651 tar -jxpf "${UNIONFS_FUSE_SRCTAR}"
652 [ ! -d "${UNIONFS_FUSE_DIR}" ] &&
653 gen_die "unionfs-fuse directory ${UNIONFS_FUSE_DIR} invalid"
654 cd "${UNIONFS_FUSE_DIR}"
655 print_info 1 'unionfs-fuse: >> Compiling...'
656 sed -i "/^\(CFLAGS\|CPPFLAGS\)/s:^\\(.*\\)$:\\1 -static -I${TEMP}/${FUSE_DIR}/include -L${TEMP}/${FUSE_DIR}/lib/.libs:" Makefile src/Makefile
657 sed -i "/^LIB = /s:^LIB = \(.*\)$:LIB = -static -L${TEMP}/${FUSE_DIR}/lib/.libs \1 -ldl -lrt:" Makefile src/Makefile
658 MAKE=${UTILS_MAKE} compile_generic "" ""
659 print_info 1 'unionfs-fuse: >> Copying to cache...'
660 [ -f "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ] ||
661 gen_die 'unionfs binary does not exist!'
662 strip "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
663 gen_die 'Could not strip unionfs binary!'
664 bzip2 "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
665 gen_die 'bzip2 compression of unionfs binary failed!'
666 mv "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs.bz2" "${UNIONFS_FUSE_BINCACHE}" ||
667 gen_die 'Could not copy the unionfs binary to the package directory, does the directory exist?'
670 rm -rf "${UNIONFS_FUSE_DIR}" > /dev/null
675 if [ ! -f "${ISCSI_BINCACHE}" ]
677 [ ! -f "${ISCSI_SRCTAR}" ] &&
678 gen_die "Could not find iSCSI source tarball: ${ISCSI_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
680 rm -rf "${ISCSI_DIR}"
681 tar -zxpf "${ISCSI_SRCTAR}"
682 [ ! -d "${ISCSI_DIR}" ] &&
683 gen_die "ISCSI directory ${ISCSI_DIR} invalid"
684 print_info 1 'iSCSI: >> Compiling...'
685 cd "${TEMP}/${ISCSI_DIR}"
687 # Only build userspace
688 MAKE=${UTILS_MAKE} compile_generic "user" ""
690 # if kernel modules exist, copy them to initramfs, otherwise it will be compiled into the kernel
691 mkdir -p "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
692 for modname in iscsi_tcp libiscsi scsi_transport_iscsi
694 if [ -e "${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko" ]
696 cp ${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
700 cd "${TEMP}/initramfs-iscsi-temp/"
701 print_info 1 'iscsistart: >> Copying to cache...'
702 [ -f "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ] ||
703 gen_die 'iscsistart executable does not exist!'
704 strip "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ||
705 gen_die 'Could not strip iscsistart binary!'
706 bzip2 "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ||
707 gen_die 'bzip2 compression of iscsistart failed!'
708 mv "${TEMP}/${ISCSI_DIR}/usr/iscsistart.bz2" "${ISCSI_BINCACHE}" ||
709 gen_die 'Could not copy the iscsistart binary to the package directory, does the directory exist?'
712 rm -rf "${ISCSI_DIR}" > /dev/null
717 if [ -f "${GPG_BINCACHE}" ]
719 print_info 1 "gnupg: >> Using cache"
721 [ ! -f "${GPG_SRCTAR}" ] &&
722 gen_die "Could not find gnupg source tarball: ${GPG_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
725 tar -jxf "${GPG_SRCTAR}"
726 [ ! -d "${GPG_DIR}" ] &&
727 gen_die "gnupg directory ${GPG_DIR} invalid"
729 print_info 1 'gnupg: >> Configuring...'
730 # --enable-minimal works, but it doesn't reduce the command length much.
731 # Given its history and the precision this needs, explicit is cleaner.
732 LDFLAGS='-static' CFLAGS='-Os' ./configure --prefix=/ \
733 --enable-static-rnd=linux --disable-dev-random --disable-asm \
734 --disable-selinux-support --disable-gnupg-iconv --disable-card-support \
735 --disable-agent-support --disable-bzip2 --disable-exec \
736 --disable-photo-viewers --disable-keyserver-helpers --disable-ldap \
737 --disable-hkp --disable-finger --disable-generic --disable-mailto \
738 --disable-keyserver-path --disable-dns-srv --disable-dns-pka \
739 --disable-dns-cert --disable-nls --disable-threads --disable-regex \
740 --disable-optimization --with-included-zlib --without-capabilities \
741 --without-tar --without-ldap --without-libcurl --without-mailprog \
742 --without-libpth-prefix --without-libiconv-prefix --without-libintl-prefix\
743 --without-zlib --without-bzip2 --without-libusb --without-readline \
744 >> ${LOGFILE} 2>&1 || gen_die 'Configuring gnupg failed!'
745 print_info 1 'gnupg: >> Compiling...'
746 compile_generic "" "utils"
747 print_info 1 'gnupg: >> Copying to cache...'
748 [ -f "${TEMP}/${GPG_DIR}/g10/gpg" ] ||
749 gen_die 'gnupg executable does not exist!'
750 strip "${TEMP}/${GPG_DIR}/g10/gpg" ||
751 gen_die 'Could not strip gpg binary!'
752 bzip2 -z -c "${TEMP}/${GPG_DIR}/g10/gpg" > "${GPG_BINCACHE}" ||
753 gen_die 'Could not copy the gpg binary to the package directory, does the directory exist?'
756 rm -rf "${GPG_DIR}" > /dev/null