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}\""
28 if [ -n "${KERNEL_OUTPUTDIR}" -a "${KERNEL_OUTPUTDIR}" != "${KERNEL_DIR}" ]
30 ARGS="${ARGS} O=\"${KERNEL_OUTPUTDIR}\""
41 if [ -n "${UTILS_CROSS_COMPILE}" ]
43 UTILS_CC="${UTILS_CROSS_COMPILE}gcc"
44 UTILS_LD="${UTILS_CROSS_COMPILE}ld"
45 UTILS_AS="${UTILS_CROSS_COMPILE}as"
48 if [ "${UTILS_ARCH}" != '' ]
50 ARGS="ARCH=\"${UTILS_ARCH}\""
52 if [ "${UTILS_CC}" != '' ]
54 ARGS="CC=\"${UTILS_CC}\""
56 if [ "${UTILS_LD}" != '' ]
58 ARGS="${ARGS} LD=\"${UTILS_LD}\""
60 if [ "${UTILS_AS}" != '' ]
62 ARGS="${ARGS} AS=\"${UTILS_AS}\""
71 if [ "${UTILS_ARCH}" != '' ]
73 export ARCH="${UTILS_ARCH}"
75 if [ "${UTILS_CC}" != '' ]
77 export CC="${UTILS_CC}"
79 if [ "${UTILS_LD}" != '' ]
81 export LD="${UTILS_LD}"
83 if [ "${UTILS_AS}" != '' ]
85 export AS="${UTILS_AS}"
87 if [ "${UTILS_CROSS_COMPILE}" != '' ]
89 export CROSS_COMPILE="${UTILS_CROSS_COMPILE}"
95 if [ "${UTILS_ARCH}" != '' ]
99 if [ "${UTILS_CC}" != '' ]
103 if [ "${UTILS_LD}" != '' ]
107 if [ "${UTILS_AS}" != '' ]
111 if [ "${UTILS_CROSS_COMPILE}" != '' ]
120 if [ "${KERNEL_CC}" != '' ]
122 export CC="${KERNEL_CC}"
124 if [ "${KERNEL_LD}" != '' ]
126 export LD="${KERNEL_LD}"
128 if [ "${KERNEL_AS}" != '' ]
130 export AS="${KERNEL_AS}"
132 if [ "${KERNEL_CROSS_COMPILE}" != '' ]
134 export CROSS_COMPILE="${KERNEL_CROSS_COMPILE}"
140 if [ "${KERNEL_CC}" != '' ]
144 if [ "${KERNEL_LD}" != '' ]
148 if [ "${KERNEL_AS}" != '' ]
152 if [ "${KERNEL_CROSS_COMPILE}" != '' ]
159 if [ "${ARCH}" != '' ]
161 export ORIG_ARCH="${ARCH}"
165 export ORIG_CC="${CC}"
169 export ORIG_LD="${LD}"
173 export ORIG_AS="${AS}"
175 if [ "${CROSS_COMPILE}" != '' ]
177 export ORIG_CROSS_COMPILE="${CROSS_COMPILE}"
182 if [ "${ORIG_ARCH}" != '' ]
184 export ARCH="${ORIG_ARCH}"
187 if [ "${ORIG_CC}" != '' ]
189 export CC="${ORIG_CC}"
192 if [ "${ORIG_LD}" != '' ]
194 export LD="${ORIG_LD}"
197 if [ "${ORIG_AS}" != '' ]
199 export AS="${ORIG_AS}"
202 if [ "${ORIG_CROSS_COMPILE}" != '' ]
204 export CROSS_COMPILE="${ORIG_CROSS_COMPILE}"
205 unset ORIG_CROSS_COMPILE
213 if [ -d "${GK_SHARE}/patches/${util}/${version}" ]
215 print_info 1 "${util}: >> Applying patches..."
216 for i in ${GK_SHARE}/patches/${util}/${version}/*{diff,patch}
218 [ -f "${i}" ] || continue
222 patch -p${j} --backup-if-mismatch -f < "${i}" >/dev/null
229 if [ ${patch_success} -eq 1 ]
231 print_info 1 " - `basename ${i}`"
233 gen_die "could not apply patch ${i} for ${util}-${version}"
242 gen_die 'compile_generic(): improper usage!'
246 case "${argstype}" in
247 kernel|kernelruntask)
257 case "${argstype}" in
258 kernel|kernelruntask) ARGS="`compile_kernel_args`" ;;
259 utils) ARGS="`compile_utils_args`" ;;
264 # the eval usage is needed in the next set of code
265 # as ARGS can contain spaces and quotes, eg:
266 # ARGS='CC="ccache gcc"'
267 if [ "${argstype}" == 'kernelruntask' ]
269 # Silent operation, forced -j1
270 print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} -j1 ${ARGS} ${target} $*" 1 0 1
271 eval ${MAKE} -s ${MAKEOPTS} -j1 "${ARGS}" ${target} $*
273 elif [ "${LOGLEVEL}" -gt "1" ]
275 # Output to stdout and logfile
276 print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $*" 1 0 1
277 eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* 2>&1 | tee -a ${LOGFILE}
280 # Output to logfile only
281 print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${1} $*" 1 0 1
282 eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* >> ${LOGFILE} 2>&1
286 gen_die "Failed to compile the \"${target}\" target..."
291 case "${argstype}" in
292 kernel) unset_kernel_args ;;
293 utils) unset_utils_args ;;
298 print_info 1 " >> Compiling ${KV} modules..."
300 compile_generic modules kernel
301 export UNAME_MACHINE="${ARCH}"
302 [ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH
303 MAKEOPTS="${MAKEOPTS} -j1" compile_generic "modules_install" kernel
304 print_info 1 " >> Generating module dependency data..."
305 if [ "${INSTALL_MOD_PATH}" != '' ]
307 depmod -a -e -F "${KERNEL_OUTPUTDIR}"/System.map -b "${INSTALL_MOD_PATH}" ${KV}
309 depmod -a -e -F "${KERNEL_OUTPUTDIR}"/System.map ${KV}
315 [ "${KERNEL_MAKE}" = '' ] &&
316 gen_die "KERNEL_MAKE undefined - I don't know how to compile a kernel for this arch!"
318 local kernel_make_directive="${KERNEL_MAKE_DIRECTIVE}"
319 if [ "${KERNEL_MAKE_DIRECTIVE_OVERRIDE}" != "${DEFAULT_KERNEL_MAKE_DIRECTIVE_OVERRIDE}" ]; then
320 kernel_make_directive="${KERNEL_MAKE_DIRECTIVE_OVERRIDE}"
322 print_info 1 " >> Compiling ${KV} ${kernel_make_directive/_install/ [ install ]/}..."
323 compile_generic "${kernel_make_directive}" kernel
324 if [ "${KERNEL_MAKE_DIRECTIVE_2}" != '' ]
326 print_info 1 " >> Starting supplimental compile of ${KV}: ${KERNEL_MAKE_DIRECTIVE_2}..."
327 compile_generic "${KERNEL_MAKE_DIRECTIVE_2}" kernel
330 local firmware_in_kernel_line=`fgrep CONFIG_FIRMWARE_IN_KERNEL "${KERNEL_OUTPUTDIR}"/.config`
331 if [ -n "${firmware_in_kernel_line}" -a "${firmware_in_kernel_line}" != CONFIG_FIRMWARE_IN_KERNEL=y ]
333 print_info 1 " >> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y..."
334 MAKEOPTS="${MAKEOPTS} -j1" compile_generic "firmware_install" kernel
336 print_info 1 " >> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)..."
339 local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY_OVERRIDE:-${KERNEL_BINARY}})
340 local tmp_kernel_binary2=$(find_kernel_binary ${KERNEL_BINARY_2})
341 if [ -z "${tmp_kernel_binary}" ]
343 gen_die "Cannot locate kernel binary"
346 if isTrue "${CMD_INSTALL}"
348 copy_image_with_preserve "kernel" \
349 "${tmp_kernel_binary}" \
350 "kernel-${KNAME}-${ARCH}-${KV}"
352 copy_image_with_preserve "System.map" \
354 "System.map-${KNAME}-${ARCH}-${KV}"
356 if isTrue "${GENZIMAGE}"
358 copy_image_with_preserve "kernelz" \
359 "${tmp_kernel_binary2}" \
363 cp "${tmp_kernel_binary}" "${TMPDIR}/kernel-${KNAME}-${ARCH}-${KV}" ||
364 gen_die "Could not copy the kernel binary to ${TMPDIR}!"
365 cp "System.map" "${TMPDIR}/System.map-${KNAME}-${ARCH}-${KV}" ||
366 gen_die "Could not copy System.map to ${TMPDIR}!"
367 if isTrue "${GENZIMAGE}"
369 cp "${tmp_kernel_binary2}" "${TMPDIR}/kernelz-${KV}" ||
370 gen_die "Could not copy the kernelz binary to ${TMPDIR}!"
376 [ -f "${BUSYBOX_SRCTAR}" ] ||
377 gen_die "Could not find busybox source tarball: ${BUSYBOX_SRCTAR}!"
379 if [ -n "${BUSYBOX_CONFIG}" ]
381 [ -f "${BUSYBOX_CONFIG}" ] ||
382 gen_die "Could not find busybox config file: ${BUSYBOX_CONFIG}"
383 elif isTrue "${NETBOOT}" && [ -f "$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/netboot-busy-config")" ]
385 BUSYBOX_CONFIG="$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/netboot-busy-config")"
386 elif isTrue "${NETBOOT}" && [ -f "${GK_SHARE}/netboot/busy-config" ]
388 BUSYBOX_CONFIG="${GK_SHARE}/netboot/busy-config"
389 elif [ -f "$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/busy-config")" ]
391 BUSYBOX_CONFIG="$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/busy-config")"
392 elif [ -f "${GK_SHARE}/defaults/busy-config" ]
394 BUSYBOX_CONFIG="${GK_SHARE}/defaults/busy-config"
396 gen_die "Could not find a busybox config file"
399 # Delete cache if stored config's MD5 does not match one to be used
400 if [ -f "${BUSYBOX_BINCACHE}" ]
402 oldconfig_md5=$(tar -xjf "${BUSYBOX_BINCACHE}" -O .config.gk_orig 2>/dev/null | md5sum)
403 newconfig_md5=$(md5sum < "${BUSYBOX_CONFIG}")
404 if [ "${oldconfig_md5}" != "${newconfig_md5}" ]
406 print_info 1 "busybox: >> Removing stale cache..."
407 rm -rf "${BUSYBOX_BINCACHE}"
409 print_info 1 "busybox: >> Using cache"
413 if [ ! -f "${BUSYBOX_BINCACHE}" ]
416 rm -rf "${BUSYBOX_DIR}" > /dev/null
417 /bin/tar -jxpf ${BUSYBOX_SRCTAR} ||
418 gen_die 'Could not extract busybox source tarball!'
419 [ -d "${BUSYBOX_DIR}" ] ||
420 gen_die "Busybox directory ${BUSYBOX_DIR} is invalid!"
421 cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config"
422 cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config.gk_orig"
424 apply_patches busybox ${BUSYBOX_VER}
425 print_info 1 'busybox: >> Configuring...'
426 yes '' 2>/dev/null | compile_generic oldconfig utils
428 print_info 1 'busybox: >> Compiling...'
429 compile_generic all utils
430 print_info 1 'busybox: >> Copying to cache...'
431 [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] ||
432 gen_die 'Busybox executable does not exist!'
433 ${UTILS_CROSS_COMPILE}strip "${TEMP}/${BUSYBOX_DIR}/busybox" ||
434 gen_die 'Could not strip busybox binary!'
435 tar -cj -C "${TEMP}/${BUSYBOX_DIR}" -f "${BUSYBOX_BINCACHE}" busybox .config .config.gk_orig ||
436 gen_die 'Could not create the busybox bincache!'
439 rm -rf "${BUSYBOX_DIR}" > /dev/null
444 if [ -f "${LVM_BINCACHE}" ]
446 print_info 1 "lvm: >> Using cache"
448 [ -f "${LVM_SRCTAR}" ] ||
449 gen_die "Could not find LVM source tarball: ${LVM_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
451 rm -rf ${LVM_DIR} > /dev/null
452 /bin/tar -zxpf ${LVM_SRCTAR} ||
453 gen_die 'Could not extract LVM source tarball!'
454 [ -d "${LVM_DIR}" ] ||
455 gen_die "LVM directory ${LVM_DIR} is invalid!"
457 apply_patches lvm ${LVM_VER}
458 print_info 1 'lvm: >> Configuring...'
460 ./configure --enable-static_link --prefix=/ \
461 --with-lvm1=internal --with-clvmd=none --with-cluster=none \
462 --disable-readline --disable-selinux --with-mirrors=internal \
463 --with-snapshots=internal --with-pool=internal \
464 >> ${LOGFILE} 2>&1 || \
465 gen_die 'Configure of lvm failed!'
466 print_info 1 'lvm: >> Compiling...'
467 compile_generic '' utils
468 compile_generic "install DESTDIR=${TEMP}/lvm/" utils
471 print_info 1 ' >> Copying to bincache...'
472 ${UTILS_CROSS_COMPILE}strip "sbin/lvm.static" ||
473 gen_die 'Could not strip lvm.static!'
475 ${UTILS_CROSS_COMPILE}strip "sbin/dmsetup.static" ||
476 gen_die 'Could not strip dmsetup.static'
477 /bin/tar -cjf "${LVM_BINCACHE}" . ||
478 gen_die 'Could not create binary cache'
481 rm -rf "${TEMP}/lvm" > /dev/null
482 rm -rf "${LVM_DIR}" lvm
487 if [ -f "${MDADM_BINCACHE}" ]
489 print_info 1 ' MDADM: Using cache'
491 [ -f "${MDADM_SRCTAR}" ] ||
492 gen_die "Could not find MDADM source tarball: ${MDADM_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
494 rm -rf "${MDADM_DIR}" > /dev/null
495 /bin/tar -jxpf "${MDADM_SRCTAR}" ||
496 gen_die 'Could not extract MDADM source tarball!'
497 [ -d "${MDADM_DIR}" ] ||
498 gen_die "MDADM directory ${MDADM_DIR} is invalid!"
501 apply_patches mdadm ${MDADM_VER}
502 sed -i "/^CFLAGS = /s:^CFLAGS = \(.*\)$:CFLAGS = -Os:" Makefile
503 sed -i "/^CXFLAGS = /s:^CXFLAGS = \(.*\)$:CXFLAGS = -Os:" Makefile
504 sed -i "/^CWFLAGS = /s:^CWFLAGS = \(.*\)$:CWFLAGS = -Wall:" Makefile
505 sed -i "s/^# LDFLAGS = -static/LDFLAGS = -static/" Makefile
507 print_info 1 'mdadm: >> Compiling...'
508 compile_generic 'mdadm mdmon' utils
510 mkdir -p "${TEMP}/mdadm/sbin"
511 install -m 0755 -s mdadm "${TEMP}/mdadm/sbin/mdadm"
512 install -m 0755 -s mdmon "${TEMP}/mdadm/sbin/mdmon"
513 print_info 1 ' >> Copying to bincache...'
515 ${UTILS_CROSS_COMPILE}strip "sbin/mdadm" "sbin/mdmon" ||
516 gen_die 'Could not strip mdadm binaries!'
517 /bin/tar -cjf "${MDADM_BINCACHE}" sbin/mdadm sbin/mdmon ||
518 gen_die 'Could not create binary cache'
521 rm -rf "${MDADM_DIR}" mdadm
526 compile_device_mapper
527 if [ ! -f "${DMRAID_BINCACHE}" ]
529 [ -f "${DMRAID_SRCTAR}" ] ||
530 gen_die "Could not find DMRAID source tarball: ${DMRAID_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
532 rm -rf ${DMRAID_DIR} > /dev/null
533 /bin/tar -jxpf ${DMRAID_SRCTAR} ||
534 gen_die 'Could not extract DMRAID source tarball!'
535 [ -d "${DMRAID_DIR}" ] ||
536 gen_die "DMRAID directory ${DMRAID_DIR} is invalid!"
537 rm -rf "${TEMP}/lvm" > /dev/null
538 mkdir -p "${TEMP}/lvm"
539 /bin/tar -jxpf "${LVM_BINCACHE}" -C "${TEMP}/lvm" ||
540 gen_die "Could not extract LVM2 binary cache!";
543 apply_patches dmraid ${DMRAID_VER}
544 print_info 1 'dmraid: >> Configuring...'
546 LDFLAGS="-L${TEMP}/lvm/lib" \
547 CFLAGS="-I${TEMP}/lvm/include" \
548 CPPFLAGS="-I${TEMP}/lvm/include" \
550 ./configure --enable-static_link --prefix=${TEMP}/dmraid >> ${LOGFILE} 2>&1 ||
551 gen_die 'Configure of dmraid failed!'
553 # We dont necessarily have selinux installed yet... look into
554 # selinux global support in the future.
555 sed -i tools/Makefile -e "/DMRAID_LIBS +=/s|-lselinux||g"
556 ###echo "DMRAIDLIBS += -lselinux -lsepol" >> tools/Makefile
557 mkdir -p "${TEMP}/dmraid"
558 print_info 1 'dmraid: >> Compiling...'
559 # Force dmraid to be built with -j1 for bug #188273
560 MAKEOPTS="${MAKEOPTS} -j1" compile_generic '' utils
561 #compile_generic 'install' utils
562 mkdir ${TEMP}/dmraid/sbin
563 install -m 0755 -s tools/dmraid "${TEMP}/dmraid/sbin/dmraid"
564 print_info 1 ' >> Copying to bincache...'
566 /bin/tar -cjf "${DMRAID_BINCACHE}" sbin/dmraid ||
567 gen_die 'Could not create binary cache'
570 rm -rf "${TEMP}/lvm" > /dev/null
571 rm -rf "${DMRAID_DIR}" dmraid
575 compile_device_mapper() {
580 if [ ! -f "${FUSE_BINCACHE}" ]
582 [ ! -f "${FUSE_SRCTAR}" ] &&
583 gen_die "Could not find fuse source tarball: ${FUSE_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
586 tar -zxpf "${FUSE_SRCTAR}"
587 [ ! -d "${FUSE_DIR}" ] &&
588 gen_die "fuse directory ${FUSE_DIR} invalid"
590 apply_patches fuse ${FUSE_VER}
591 print_info 1 'fuse: >> Configuring...'
592 ./configure --disable-example >> ${LOGFILE} 2>&1 ||
593 gen_die 'Configuring fuse failed!'
594 print_info 1 'fuse: >> Compiling...'
595 MAKE=${UTILS_MAKE} compile_generic "" ""
597 # Since we're linking statically against libfuse, we don't need to cache the .so
598 # print_info 1 'libfuse: >> Copying to cache...'
599 # [ -f "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ] ||
600 # gen_die 'libfuse.so does not exist!'
601 # ${UTILS_CROSS_COMPILE}strip "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ||
602 # gen_die 'Could not strip libfuse.so!'
603 # cd "${TEMP}/${FUSE_DIR}/lib/.libs"
604 # tar -cjf "${FUSE_BINCACHE}" libfuse*so* ||
605 # gen_die 'Could not create fuse bincache!'
608 # rm -rf "${FUSE_DIR}" > /dev/null
612 compile_unionfs_fuse() {
613 if [ ! -f "${UNIONFS_FUSE_BINCACHE}" ]
616 # We'll call compile_fuse() from here, since it's not needed directly by anything else
619 [ ! -f "${UNIONFS_FUSE_SRCTAR}" ] &&
620 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!"
622 rm -rf "${UNIONFS_FUSE_DIR}"
623 tar -jxpf "${UNIONFS_FUSE_SRCTAR}"
624 [ ! -d "${UNIONFS_FUSE_DIR}" ] &&
625 gen_die "unionfs-fuse directory ${UNIONFS_FUSE_DIR} invalid"
626 cd "${UNIONFS_FUSE_DIR}"
627 apply_patches unionfs-fuse ${UNIONFS_FUSE_VER}
628 print_info 1 'unionfs-fuse: >> Compiling...'
629 sed -i "/^\(CFLAGS\|CPPFLAGS\)/s:^\\(.*\\)$:\\1 -static -I${TEMP}/${FUSE_DIR}/include -L${TEMP}/${FUSE_DIR}/lib/.libs:" Makefile src/Makefile
630 sed -i "/^LIB = /s:^LIB = \(.*\)$:LIB = -static -L${TEMP}/${FUSE_DIR}/lib/.libs \1 -ldl -lpthread -lrt:" Makefile src/Makefile
631 MAKE=${UTILS_MAKE} compile_generic "" ""
632 print_info 1 'unionfs-fuse: >> Copying to cache...'
633 [ -f "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ] ||
634 gen_die 'unionfs binary does not exist!'
635 ${UTILS_CROSS_COMPILE}strip "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
636 gen_die 'Could not strip unionfs binary!'
637 bzip2 "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
638 gen_die 'bzip2 compression of unionfs binary failed!'
639 mv "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs.bz2" "${UNIONFS_FUSE_BINCACHE}" ||
640 gen_die 'Could not copy the unionfs binary to the package directory, does the directory exist?'
643 rm -rf "${UNIONFS_FUSE_DIR}" > /dev/null
648 if [ ! -f "${ISCSI_BINCACHE}" ]
650 [ ! -f "${ISCSI_SRCTAR}" ] &&
651 gen_die "Could not find iSCSI source tarball: ${ISCSI_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
653 rm -rf "${ISCSI_DIR}"
654 tar -zxpf "${ISCSI_SRCTAR}"
655 [ ! -d "${ISCSI_DIR}" ] &&
656 gen_die "ISCSI directory ${ISCSI_DIR} invalid"
657 print_info 1 'iSCSI: >> Compiling...'
658 cd "${TEMP}/${ISCSI_DIR}"
659 apply_patches iscsi ${ISCSI_VER}
661 # Only build userspace
662 print_info 1 'iSCSI: >> Configuring userspace...'
663 cd utils/open-isns || gen_die 'Could not enter open-isns dir'
664 # we currently have a patch that changes configure.ac
665 # once given patch is dropped, drop autoconf too
666 autoconf || gen_die 'Could not tweak open-iscsi configuration'
667 ./configure --without-slp >> ${LOGFILE} 2>&1 || gen_die 'Could not configure userspace'
668 cd ../.. || gen_die 'wtf?'
669 MAKE=${UTILS_MAKE} compile_generic "user" ""
671 # if kernel modules exist, copy them to initramfs, otherwise it will be compiled into the kernel
672 mkdir -p "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
673 for modname in iscsi_tcp libiscsi scsi_transport_iscsi
675 if [ -e "${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko" ]
677 cp ${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
681 cd "${TEMP}/initramfs-iscsi-temp/"
682 print_info 1 'iscsistart: >> Copying to cache...'
683 [ -f "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ] ||
684 gen_die 'iscsistart executable does not exist!'
685 ${UTILS_CROSS_COMPILE}strip "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ||
686 gen_die 'Could not strip iscsistart binary!'
687 bzip2 "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ||
688 gen_die 'bzip2 compression of iscsistart failed!'
689 mv "${TEMP}/${ISCSI_DIR}/usr/iscsistart.bz2" "${ISCSI_BINCACHE}" ||
690 gen_die 'Could not copy the iscsistart binary to the package directory, does the directory exist?'
693 rm -rf "${ISCSI_DIR}" > /dev/null
698 if [ -f "${GPG_BINCACHE}" ]
700 print_info 1 "gnupg: >> Using cache"
702 [ ! -f "${GPG_SRCTAR}" ] &&
703 gen_die "Could not find gnupg source tarball: ${GPG_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
706 tar -jxf "${GPG_SRCTAR}"
707 [ ! -d "${GPG_DIR}" ] &&
708 gen_die "gnupg directory ${GPG_DIR} invalid"
710 apply_patches gnupg ${GPG_VER}
711 print_info 1 'gnupg: >> Configuring...'
712 # --enable-minimal works, but it doesn't reduce the command length much.
713 # Given its history and the precision this needs, explicit is cleaner.
714 LDFLAGS='-static' CFLAGS='-Os' ./configure --prefix=/ \
715 --enable-static-rnd=linux --disable-dev-random --disable-asm \
716 --disable-selinux-support --disable-gnupg-iconv --disable-card-support \
717 --disable-agent-support --disable-bzip2 --disable-exec \
718 --disable-photo-viewers --disable-keyserver-helpers --disable-ldap \
719 --disable-hkp --disable-finger --disable-generic --disable-mailto \
720 --disable-keyserver-path --disable-dns-srv --disable-dns-pka \
721 --disable-dns-cert --disable-nls --disable-threads --disable-regex \
722 --disable-optimization --with-included-zlib --without-capabilities \
723 --without-tar --without-ldap --without-libcurl --without-mailprog \
724 --without-libpth-prefix --without-libiconv-prefix --without-libintl-prefix\
725 --without-zlib --without-bzip2 --without-libusb --without-readline \
726 >> ${LOGFILE} 2>&1 || gen_die 'Configuring gnupg failed!'
727 print_info 1 'gnupg: >> Compiling...'
728 compile_generic "" "utils"
729 print_info 1 'gnupg: >> Copying to cache...'
730 [ -f "${TEMP}/${GPG_DIR}/g10/gpg" ] ||
731 gen_die 'gnupg executable does not exist!'
732 ${UTILS_CROSS_COMPILE}strip "${TEMP}/${GPG_DIR}/g10/gpg" ||
733 gen_die 'Could not strip gpg binary!'
734 bzip2 -z -c "${TEMP}/${GPG_DIR}/g10/gpg" > "${GPG_BINCACHE}" ||
735 gen_die 'Could not copy the gpg binary to the package directory, does the directory exist?'
738 rm -rf "${GPG_DIR}" > /dev/null