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}"
83 if [ "${UTILS_CROSS_COMPILE}" != '' ]
85 export CROSS_COMPILE="${UTILS_CROSS_COMPILE}"
91 if [ "${UTILS_ARCH}" != '' ]
95 if [ "${UTILS_CC}" != '' ]
99 if [ "${UTILS_LD}" != '' ]
103 if [ "${UTILS_AS}" != '' ]
107 if [ "${UTILS_CROSS_COMPILE}" != '' ]
116 if [ "${KERNEL_CC}" != '' ]
118 export CC="${KERNEL_CC}"
120 if [ "${KERNEL_LD}" != '' ]
122 export LD="${KERNEL_LD}"
124 if [ "${KERNEL_AS}" != '' ]
126 export AS="${KERNEL_AS}"
128 if [ "${KERNEL_CROSS_COMPILE}" != '' ]
130 export CROSS_COMPILE="${KERNEL_CROSS_COMPILE}"
136 if [ "${KERNEL_CC}" != '' ]
140 if [ "${KERNEL_LD}" != '' ]
144 if [ "${KERNEL_AS}" != '' ]
148 if [ "${KERNEL_CROSS_COMPILE}" != '' ]
155 if [ "${ARCH}" != '' ]
157 export ORIG_ARCH="${ARCH}"
161 export ORIG_CC="${CC}"
165 export ORIG_LD="${LD}"
169 export ORIG_AS="${AS}"
171 if [ "${CROSS_COMPILE}" != '' ]
173 export ORIG_CROSS_COMPILE="${CROSS_COMPILE}"
178 if [ "${ORIG_ARCH}" != '' ]
180 export ARCH="${ORIG_ARCH}"
183 if [ "${ORIG_CC}" != '' ]
185 export CC="${ORIG_CC}"
188 if [ "${ORIG_LD}" != '' ]
190 export LD="${ORIG_LD}"
193 if [ "${ORIG_AS}" != '' ]
195 export AS="${ORIG_AS}"
198 if [ "${ORIG_CROSS_COMPILE}" != '' ]
200 export CROSS_COMPILE="${ORIG_CROSS_COMPILE}"
201 unset ORIG_CROSS_COMPILE
209 if [ -d "${GK_SHARE}/patches/${util}/${version}" ]
211 print_info 1 "${util}: >> Applying patches..."
212 for i in ${GK_SHARE}/patches/${util}/${version}/*{diff,patch}
214 [ -f "${i}" ] || continue
218 patch -p${j} --backup-if-mismatch -f < "${i}" >/dev/null
225 if [ ${patch_success} -eq 1 ]
227 print_info 1 " - `basename ${i}`"
229 gen_die "could not apply patch ${i} for ${util}-${version}"
238 gen_die 'compile_generic(): improper usage!'
242 case "${argstype}" in
243 kernel|kernelruntask)
253 case "${argstype}" in
254 kernel|kernelruntask) ARGS="`compile_kernel_args`" ;;
255 utils) ARGS="`compile_utils_args`" ;;
260 # the eval usage is needed in the next set of code
261 # as ARGS can contain spaces and quotes, eg:
262 # ARGS='CC="ccache gcc"'
263 if [ "${argstype}" == 'kernelruntask' ]
265 # Silent operation, forced -j1
266 print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} -j1 ${ARGS} ${target} $*" 1 0 1
267 eval ${MAKE} -s ${MAKEOPTS} -j1 "${ARGS}" ${target} $*
269 elif [ "${LOGLEVEL}" -gt "1" ]
271 # Output to stdout and logfile
272 print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $*" 1 0 1
273 eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* 2>&1 | tee -a ${LOGFILE}
276 # Output to logfile only
277 print_info 2 "COMMAND: ${MAKE} ${MAKEOPTS} ${ARGS} ${1} $*" 1 0 1
278 eval ${MAKE} ${MAKEOPTS} ${ARGS} ${target} $* >> ${LOGFILE} 2>&1
282 gen_die "Failed to compile the \"${target}\" target..."
287 case "${argstype}" in
288 kernel) unset_kernel_args ;;
289 utils) unset_utils_args ;;
294 print_info 1 " >> Compiling ${KV} modules..."
296 compile_generic modules kernel
297 export UNAME_MACHINE="${ARCH}"
298 [ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH
299 MAKEOPTS="${MAKEOPTS} -j1" compile_generic "modules_install" kernel
300 print_info 1 " >> Generating module dependency data..."
301 depmod -a -e -b "${INSTALL_MOD_PATH}"/lib/modules/$KV ${KV}
306 [ "${KERNEL_MAKE}" = '' ] &&
307 gen_die "KERNEL_MAKE undefined - I don't know how to compile a kernel for this arch!"
309 local kernel_make_directive="${KERNEL_MAKE_DIRECTIVE}"
310 if [ "${KERNEL_MAKE_DIRECTIVE_OVERRIDE}" != "${DEFAULT_KERNEL_MAKE_DIRECTIVE_OVERRIDE}" ]; then
311 kernel_make_directive="${KERNEL_MAKE_DIRECTIVE_OVERRIDE}"
313 print_info 1 " >> Compiling ${KV} ${kernel_make_directive/_install/ [ install ]/}..."
314 compile_generic "${kernel_make_directive}" kernel
315 if [ "${KERNEL_MAKE_DIRECTIVE_2}" != '' ]
317 print_info 1 " >> Starting supplimental compile of ${KV}: ${KERNEL_MAKE_DIRECTIVE_2}..."
318 compile_generic "${KERNEL_MAKE_DIRECTIVE_2}" kernel
321 local firmware_in_kernel_line=`fgrep CONFIG_FIRMWARE_IN_KERNEL "${KERNEL_DIR}"/.config`
322 if [ -n "${firmware_in_kernel_line}" -a "${firmware_in_kernel_line}" != CONFIG_FIRMWARE_IN_KERNEL=y ]
324 print_info 1 " >> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y..."
325 MAKEOPTS="${MAKEOPTS} -j1" compile_generic "firmware_install" kernel
327 print_info 1 " >> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)..."
330 local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY_OVERRIDE:-${KERNEL_BINARY}})
331 local tmp_kernel_binary2=$(find_kernel_binary ${KERNEL_BINARY_2})
332 if [ -z "${tmp_kernel_binary}" ]
334 gen_die "Cannot locate kernel binary"
337 if isTrue "${CMD_INSTALL}"
339 copy_image_with_preserve "kernel" \
340 "${tmp_kernel_binary}" \
341 "kernel-${KNAME}-${ARCH}-${KV}"
343 copy_image_with_preserve "System.map" \
345 "System.map-${KNAME}-${ARCH}-${KV}"
347 if isTrue "${GENZIMAGE}"
349 copy_image_with_preserve "kernelz" \
350 "${tmp_kernel_binary2}" \
354 cp "${tmp_kernel_binary}" "${TMPDIR}/kernel-${KNAME}-${ARCH}-${KV}" ||
355 gen_die "Could not copy the kernel binary to ${TMPDIR}!"
356 cp "System.map" "${TMPDIR}/System.map-${KNAME}-${ARCH}-${KV}" ||
357 gen_die "Could not copy System.map to ${TMPDIR}!"
358 if isTrue "${GENZIMAGE}"
360 cp "${tmp_kernel_binary2}" "${TMPDIR}/kernelz-${KV}" ||
361 gen_die "Could not copy the kernelz binary to ${TMPDIR}!"
367 [ -f "${BUSYBOX_SRCTAR}" ] ||
368 gen_die "Could not find busybox source tarball: ${BUSYBOX_SRCTAR}!"
370 if [ -n "${BUSYBOX_CONFIG}" ]
372 [ -f "${BUSYBOX_CONFIG}" ] ||
373 gen_die "Could not find busybox config file: ${BUSYBOX_CONFIG}"
374 elif isTrue "${NETBOOT}" && [ -f "$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/netboot-busy-config")" ]
376 BUSYBOX_CONFIG="$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/netboot-busy-config")"
377 elif isTrue "${NETBOOT}" && [ -f "${GK_SHARE}/netboot/busy-config" ]
379 BUSYBOX_CONFIG="${GK_SHARE}/netboot/busy-config"
380 elif [ -f "$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/busy-config")" ]
382 BUSYBOX_CONFIG="$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/busy-config")"
383 elif [ -f "${GK_SHARE}/defaults/busy-config" ]
385 BUSYBOX_CONFIG="${GK_SHARE}/defaults/busy-config"
387 gen_die "Could not find a busybox config file"
390 # Delete cache if stored config's MD5 does not match one to be used
391 if [ -f "${BUSYBOX_BINCACHE}" ]
393 oldconfig_md5=$(tar -xjf "${BUSYBOX_BINCACHE}" -O .config.gk_orig 2>/dev/null | md5sum)
394 newconfig_md5=$(md5sum < "${BUSYBOX_CONFIG}")
395 if [ "${oldconfig_md5}" != "${newconfig_md5}" ]
397 print_info 1 "busybox: >> Removing stale cache..."
398 rm -rf "${BUSYBOX_BINCACHE}"
400 print_info 1 "busybox: >> Using cache"
404 if [ ! -f "${BUSYBOX_BINCACHE}" ]
407 rm -rf "${BUSYBOX_DIR}" > /dev/null
408 /bin/tar -jxpf ${BUSYBOX_SRCTAR} ||
409 gen_die 'Could not extract busybox source tarball!'
410 [ -d "${BUSYBOX_DIR}" ] ||
411 gen_die "Busybox directory ${BUSYBOX_DIR} is invalid!"
412 cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config"
413 cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config.gk_orig"
415 apply_patches busybox ${BUSYBOX_VER}
416 print_info 1 'busybox: >> Configuring...'
417 yes '' 2>/dev/null | compile_generic oldconfig utils
419 print_info 1 'busybox: >> Compiling...'
420 compile_generic all utils
421 print_info 1 'busybox: >> Copying to cache...'
422 [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] ||
423 gen_die 'Busybox executable does not exist!'
424 ${UTILS_CROSS_COMPILE}strip "${TEMP}/${BUSYBOX_DIR}/busybox" ||
425 gen_die 'Could not strip busybox binary!'
426 tar -cj -C "${TEMP}/${BUSYBOX_DIR}" -f "${BUSYBOX_BINCACHE}" busybox .config .config.gk_orig ||
427 gen_die 'Could not create the busybox bincache!'
430 rm -rf "${BUSYBOX_DIR}" > /dev/null
435 if [ -f "${LVM_BINCACHE}" ]
437 print_info 1 "lvm: >> Using cache"
439 [ -f "${LVM_SRCTAR}" ] ||
440 gen_die "Could not find LVM source tarball: ${LVM_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
442 rm -rf ${LVM_DIR} > /dev/null
443 /bin/tar -zxpf ${LVM_SRCTAR} ||
444 gen_die 'Could not extract LVM source tarball!'
445 [ -d "${LVM_DIR}" ] ||
446 gen_die "LVM directory ${LVM_DIR} is invalid!"
448 apply_patches lvm ${LVM_VER}
449 print_info 1 'lvm: >> Configuring...'
451 ./configure --enable-static_link --prefix=/ \
452 --with-lvm1=internal --with-clvmd=none --with-cluster=none \
453 --disable-readline --disable-selinux --with-mirrors=internal \
454 --with-snapshots=internal --with-pool=internal \
455 >> ${LOGFILE} 2>&1 || \
456 gen_die 'Configure of lvm failed!'
457 print_info 1 'lvm: >> Compiling...'
458 compile_generic '' utils
459 compile_generic "install DESTDIR=${TEMP}/lvm/" utils
462 print_info 1 ' >> Copying to bincache...'
463 ${UTILS_CROSS_COMPILE}strip "sbin/lvm.static" ||
464 gen_die 'Could not strip lvm.static!'
466 ${UTILS_CROSS_COMPILE}strip "sbin/dmsetup.static" ||
467 gen_die 'Could not strip dmsetup.static'
468 /bin/tar -cjf "${LVM_BINCACHE}" . ||
469 gen_die 'Could not create binary cache'
472 rm -rf "${TEMP}/lvm" > /dev/null
473 rm -rf "${LVM_DIR}" lvm
478 if [ -f "${MDADM_BINCACHE}" ]
480 print_info 1 ' MDADM: Using cache'
482 [ -f "${MDADM_SRCTAR}" ] ||
483 gen_die "Could not find MDADM source tarball: ${MDADM_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
485 rm -rf "${MDADM_DIR}" > /dev/null
486 /bin/tar -jxpf "${MDADM_SRCTAR}" ||
487 gen_die 'Could not extract MDADM source tarball!'
488 [ -d "${MDADM_DIR}" ] ||
489 gen_die "MDADM directory ${MDADM_DIR} is invalid!"
492 apply_patches mdadm ${MDADM_VER}
493 sed -i "/^CFLAGS = /s:^CFLAGS = \(.*\)$:CFLAGS = -Os:" Makefile
494 sed -i "/^CXFLAGS = /s:^CXFLAGS = \(.*\)$:CXFLAGS = -Os:" Makefile
495 sed -i "/^CWFLAGS = /s:^CWFLAGS = \(.*\)$:CWFLAGS = -Wall:" Makefile
496 sed -i "s/^# LDFLAGS = -static/LDFLAGS = -static/" Makefile
498 print_info 1 'mdadm: >> Compiling...'
499 compile_generic 'mdadm mdmon' utils
501 mkdir -p "${TEMP}/mdadm/sbin"
502 install -m 0755 -s mdadm "${TEMP}/mdadm/sbin/mdadm"
503 install -m 0755 -s mdmon "${TEMP}/mdadm/sbin/mdmon"
504 print_info 1 ' >> Copying to bincache...'
506 ${UTILS_CROSS_COMPILE}strip "sbin/mdadm" "sbin/mdmon" ||
507 gen_die 'Could not strip mdadm binaries!'
508 /bin/tar -cjf "${MDADM_BINCACHE}" sbin/mdadm sbin/mdmon ||
509 gen_die 'Could not create binary cache'
512 rm -rf "${MDADM_DIR}" mdadm
517 compile_device_mapper
518 if [ ! -f "${DMRAID_BINCACHE}" ]
520 [ -f "${DMRAID_SRCTAR}" ] ||
521 gen_die "Could not find DMRAID source tarball: ${DMRAID_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
523 rm -rf ${DMRAID_DIR} > /dev/null
524 /bin/tar -jxpf ${DMRAID_SRCTAR} ||
525 gen_die 'Could not extract DMRAID source tarball!'
526 [ -d "${DMRAID_DIR}" ] ||
527 gen_die "DMRAID directory ${DMRAID_DIR} is invalid!"
528 rm -rf "${TEMP}/lvm" > /dev/null
529 mkdir -p "${TEMP}/lvm"
530 /bin/tar -jxpf "${LVM_BINCACHE}" -C "${TEMP}/lvm" ||
531 gen_die "Could not extract LVM2 binary cache!";
534 apply_patches dmraid ${DMRAID_VER}
535 print_info 1 'dmraid: >> Configuring...'
537 LDFLAGS="-L${TEMP}/lvm/lib" \
538 CFLAGS="-I${TEMP}/lvm/include" \
539 CPPFLAGS="-I${TEMP}/lvm/include" \
541 ./configure --enable-static_link --prefix=${TEMP}/dmraid >> ${LOGFILE} 2>&1 ||
542 gen_die 'Configure of dmraid failed!'
544 # We dont necessarily have selinux installed yet... look into
545 # selinux global support in the future.
546 sed -i tools/Makefile -e "/DMRAID_LIBS +=/s|-lselinux||g"
547 ###echo "DMRAIDLIBS += -lselinux -lsepol" >> tools/Makefile
548 mkdir -p "${TEMP}/dmraid"
549 print_info 1 'dmraid: >> Compiling...'
550 # Force dmraid to be built with -j1 for bug #188273
551 MAKEOPTS="${MAKEOPTS} -j1" compile_generic '' utils
552 #compile_generic 'install' utils
553 mkdir ${TEMP}/dmraid/sbin
554 install -m 0755 -s tools/dmraid "${TEMP}/dmraid/sbin/dmraid"
555 print_info 1 ' >> Copying to bincache...'
557 /bin/tar -cjf "${DMRAID_BINCACHE}" sbin/dmraid ||
558 gen_die 'Could not create binary cache'
561 rm -rf "${TEMP}/lvm" > /dev/null
562 rm -rf "${DMRAID_DIR}" dmraid
566 compile_device_mapper() {
571 if [ ! -f "${FUSE_BINCACHE}" ]
573 [ ! -f "${FUSE_SRCTAR}" ] &&
574 gen_die "Could not find fuse source tarball: ${FUSE_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
577 tar -zxpf "${FUSE_SRCTAR}"
578 [ ! -d "${FUSE_DIR}" ] &&
579 gen_die "fuse directory ${FUSE_DIR} invalid"
581 apply_patches fuse ${FUSE_VER}
582 print_info 1 'fuse: >> Configuring...'
583 ./configure --disable-example >> ${LOGFILE} 2>&1 ||
584 gen_die 'Configuring fuse failed!'
585 print_info 1 'fuse: >> Compiling...'
586 MAKE=${UTILS_MAKE} compile_generic "" ""
588 # Since we're linking statically against libfuse, we don't need to cache the .so
589 # print_info 1 'libfuse: >> Copying to cache...'
590 # [ -f "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ] ||
591 # gen_die 'libfuse.so does not exist!'
592 # ${UTILS_CROSS_COMPILE}strip "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ||
593 # gen_die 'Could not strip libfuse.so!'
594 # cd "${TEMP}/${FUSE_DIR}/lib/.libs"
595 # tar -cjf "${FUSE_BINCACHE}" libfuse*so* ||
596 # gen_die 'Could not create fuse bincache!'
599 # rm -rf "${FUSE_DIR}" > /dev/null
603 compile_unionfs_fuse() {
604 if [ ! -f "${UNIONFS_FUSE_BINCACHE}" ]
607 # We'll call compile_fuse() from here, since it's not needed directly by anything else
610 [ ! -f "${UNIONFS_FUSE_SRCTAR}" ] &&
611 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!"
613 rm -rf "${UNIONFS_FUSE_DIR}"
614 tar -jxpf "${UNIONFS_FUSE_SRCTAR}"
615 [ ! -d "${UNIONFS_FUSE_DIR}" ] &&
616 gen_die "unionfs-fuse directory ${UNIONFS_FUSE_DIR} invalid"
617 cd "${UNIONFS_FUSE_DIR}"
618 apply_patches unionfs-fuse ${UNIONFS_FUSE_VER}
619 print_info 1 'unionfs-fuse: >> Compiling...'
620 sed -i "/^\(CFLAGS\|CPPFLAGS\)/s:^\\(.*\\)$:\\1 -static -I${TEMP}/${FUSE_DIR}/include -L${TEMP}/${FUSE_DIR}/lib/.libs:" Makefile src/Makefile
621 sed -i "/^LIB = /s:^LIB = \(.*\)$:LIB = -static -L${TEMP}/${FUSE_DIR}/lib/.libs \1 -ldl -lpthread -lrt:" Makefile src/Makefile
622 MAKE=${UTILS_MAKE} compile_generic "" ""
623 print_info 1 'unionfs-fuse: >> Copying to cache...'
624 [ -f "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ] ||
625 gen_die 'unionfs binary does not exist!'
626 ${UTILS_CROSS_COMPILE}strip "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
627 gen_die 'Could not strip unionfs binary!'
628 bzip2 "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
629 gen_die 'bzip2 compression of unionfs binary failed!'
630 mv "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs.bz2" "${UNIONFS_FUSE_BINCACHE}" ||
631 gen_die 'Could not copy the unionfs binary to the package directory, does the directory exist?'
634 rm -rf "${UNIONFS_FUSE_DIR}" > /dev/null
639 if [ ! -f "${ISCSI_BINCACHE}" ]
641 [ ! -f "${ISCSI_SRCTAR}" ] &&
642 gen_die "Could not find iSCSI source tarball: ${ISCSI_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
644 rm -rf "${ISCSI_DIR}"
645 tar -zxpf "${ISCSI_SRCTAR}"
646 [ ! -d "${ISCSI_DIR}" ] &&
647 gen_die "ISCSI directory ${ISCSI_DIR} invalid"
648 print_info 1 'iSCSI: >> Compiling...'
649 cd "${TEMP}/${ISCSI_DIR}"
650 apply_patches iscsi ${ISCSI_VER}
652 # Only build userspace
653 print_info 1 'iSCSI: >> Configuring userspace...'
654 cd utils/open-isns || gen_die 'Could not enter open-isns dir'
655 # we currently have a patch that changes configure.ac
656 # once given patch is dropped, drop autoconf too
657 autoconf || gen_die 'Could not tweak open-iscsi configuration'
658 ./configure --without-slp >> ${LOGFILE} 2>&1 || gen_die 'Could not configure userspace'
659 cd ../.. || gen_die 'wtf?'
660 MAKE=${UTILS_MAKE} compile_generic "user" ""
662 # if kernel modules exist, copy them to initramfs, otherwise it will be compiled into the kernel
663 mkdir -p "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
664 for modname in iscsi_tcp libiscsi scsi_transport_iscsi
666 if [ -e "${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko" ]
668 cp ${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
672 cd "${TEMP}/initramfs-iscsi-temp/"
673 print_info 1 'iscsistart: >> Copying to cache...'
674 [ -f "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ] ||
675 gen_die 'iscsistart executable does not exist!'
676 ${UTILS_CROSS_COMPILE}strip "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ||
677 gen_die 'Could not strip iscsistart binary!'
678 bzip2 "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ||
679 gen_die 'bzip2 compression of iscsistart failed!'
680 mv "${TEMP}/${ISCSI_DIR}/usr/iscsistart.bz2" "${ISCSI_BINCACHE}" ||
681 gen_die 'Could not copy the iscsistart binary to the package directory, does the directory exist?'
684 rm -rf "${ISCSI_DIR}" > /dev/null
689 if [ -f "${GPG_BINCACHE}" ]
691 print_info 1 "gnupg: >> Using cache"
693 [ ! -f "${GPG_SRCTAR}" ] &&
694 gen_die "Could not find gnupg source tarball: ${GPG_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
697 tar -jxf "${GPG_SRCTAR}"
698 [ ! -d "${GPG_DIR}" ] &&
699 gen_die "gnupg directory ${GPG_DIR} invalid"
701 apply_patches gnupg ${GPG_VER}
702 print_info 1 'gnupg: >> Configuring...'
703 # --enable-minimal works, but it doesn't reduce the command length much.
704 # Given its history and the precision this needs, explicit is cleaner.
705 LDFLAGS='-static' CFLAGS='-Os' ./configure --prefix=/ \
706 --enable-static-rnd=linux --disable-dev-random --disable-asm \
707 --disable-selinux-support --disable-gnupg-iconv --disable-card-support \
708 --disable-agent-support --disable-bzip2 --disable-exec \
709 --disable-photo-viewers --disable-keyserver-helpers --disable-ldap \
710 --disable-hkp --disable-finger --disable-generic --disable-mailto \
711 --disable-keyserver-path --disable-dns-srv --disable-dns-pka \
712 --disable-dns-cert --disable-nls --disable-threads --disable-regex \
713 --disable-optimization --with-included-zlib --without-capabilities \
714 --without-tar --without-ldap --without-libcurl --without-mailprog \
715 --without-libpth-prefix --without-libiconv-prefix --without-libintl-prefix\
716 --without-zlib --without-bzip2 --without-libusb --without-readline \
717 >> ${LOGFILE} 2>&1 || gen_die 'Configuring gnupg failed!'
718 print_info 1 'gnupg: >> Compiling...'
719 compile_generic "" "utils"
720 print_info 1 'gnupg: >> Copying to cache...'
721 [ -f "${TEMP}/${GPG_DIR}/g10/gpg" ] ||
722 gen_die 'gnupg executable does not exist!'
723 ${UTILS_CROSS_COMPILE}strip "${TEMP}/${GPG_DIR}/g10/gpg" ||
724 gen_die 'Could not strip gpg binary!'
725 bzip2 -z -c "${TEMP}/${GPG_DIR}/g10/gpg" > "${GPG_BINCACHE}" ||
726 gen_die 'Could not copy the gpg binary to the package directory, does the directory exist?'
729 rm -rf "${GPG_DIR}" > /dev/null