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/-j?/j1} ${ARGS} ${target} $*" 1 0 1
256 eval ${MAKE} -s ${MAKEOPTS/-j?/-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!'
430 rm -rf "${TEMP}/device-mapper" > /dev/null
431 /bin/tar -jxpf "${DEVICE_MAPPER_BINCACHE}" -C "${TEMP}" ||
432 gen_die "Could not extract device-mapper binary cache!";
435 apply_patches lvm ${LVM_VER}
436 print_info 1 'lvm: >> Configuring...'
438 ./configure --enable-static_link --prefix=${TEMP}/lvm \
439 --with-lvm1=internal --with-clvmd=none --with-cluster=none \
440 --disable-readline --disable-selinux --with-mirrors=internal \
441 --with-snapshots=internal --with-pool=internal >> ${LOGFILE} 2>&1 || \
442 gen_die 'Configure of lvm failed!'
443 print_info 1 'lvm: >> Compiling...'
444 compile_generic '' utils
445 compile_generic 'install' utils
448 print_info 1 ' >> Copying to bincache...'
449 strip "sbin/lvm.static" ||
450 gen_die 'Could not strip lvm.static!'
451 /bin/tar -cjf "${LVM_BINCACHE}" sbin/lvm.static ||
452 gen_die 'Could not create binary cache'
455 rm -rf "${TEMP}/device-mapper" > /dev/null
456 rm -rf "${LVM_DIR}" lvm
461 compile_device_mapper
462 if [ ! -f "${DMRAID_BINCACHE}" ]
464 [ -f "${DMRAID_SRCTAR}" ] ||
465 gen_die "Could not find DMRAID source tarball: ${DMRAID_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
467 rm -rf ${DMRAID_DIR} > /dev/null
468 /bin/tar -jxpf ${DMRAID_SRCTAR} ||
469 gen_die 'Could not extract DMRAID source tarball!'
470 [ -d "${DMRAID_DIR}" ] ||
471 gen_die 'DMRAID directory ${DMRAID_DIR} is invalid!'
472 rm -rf "${TEMP}/device-mapper" > /dev/null
473 /bin/tar -jxpf "${DEVICE_MAPPER_BINCACHE}" -C "${TEMP}" ||
474 gen_die "Could not extract device-mapper binary cache!";
477 print_info 1 'dmraid: >> Configuring...'
479 LDFLAGS="-L${TEMP}/device-mapper/lib" \
480 CFLAGS="-I${TEMP}/device-mapper/include" \
481 CPPFLAGS="-I${TEMP}/device-mapper/include" \
482 ./configure --enable-static_link --prefix=${TEMP}/dmraid >> ${LOGFILE} 2>&1 ||
483 gen_die 'Configure of dmraid failed!'
485 # We dont necessarily have selinux installed yet... look into
486 # selinux global support in the future.
487 sed -i tools/Makefile -e "s|DMRAIDLIBS += -lselinux||g"
488 ###echo "DMRAIDLIBS += -lselinux -lsepol" >> tools/Makefile
489 mkdir -p "${TEMP}/dmraid"
490 print_info 1 'dmraid: >> Compiling...'
491 # Force dmraid to be built with -j1 for bug #188273
492 MAKEOPTS=-j1 compile_generic '' utils
493 #compile_generic 'install' utils
494 mkdir ${TEMP}/dmraid/sbin
495 install -m 0755 -s tools/dmraid "${TEMP}/dmraid/sbin/dmraid"
496 print_info 1 ' >> Copying to bincache...'
498 /bin/tar -cjf "${DMRAID_BINCACHE}" sbin/dmraid ||
499 gen_die 'Could not create binary cache'
502 rm -rf "${TEMP}/device-mapper" > /dev/null
503 rm -rf "${DMRAID_DIR}" dmraid
507 compile_device_mapper() {
508 if [ ! -f "${DEVICE_MAPPER_BINCACHE}" ]
510 [ ! -f "${DEVICE_MAPPER_SRCTAR}" ] &&
511 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!"
513 rm -rf "${DEVICE_MAPPER_DIR}"
514 /bin/tar -zxpf "${DEVICE_MAPPER_SRCTAR}"
515 [ ! -d "${DEVICE_MAPPER_DIR}" ] &&
516 gen_die "device-mapper directory ${DEVICE_MAPPER_DIR} invalid"
517 cd "${DEVICE_MAPPER_DIR}"
519 ./configure --prefix=${TEMP}/device-mapper --enable-static_link \
520 --disable-selinux >> ${LOGFILE} 2>&1 ||
521 gen_die 'Configuring device-mapper failed!'
522 print_info 1 'device-mapper: >> Compiling...'
523 compile_generic '' utils
524 compile_generic 'install' utils
525 print_info 1 ' >> Copying to cache...'
527 rm -rf "${TEMP}/device-mapper/man" ||
528 gen_die 'Could not remove manual pages!'
529 strip "${TEMP}/device-mapper/sbin/dmsetup" ||
530 gen_die 'Could not strip dmsetup binary!'
531 /bin/tar -jcpf "${DEVICE_MAPPER_BINCACHE}" device-mapper ||
532 gen_die 'Could not tar up the device-mapper binary!'
533 [ -f "${DEVICE_MAPPER_BINCACHE}" ] ||
534 gen_die 'device-mapper cache not created!'
536 rm -rf "${DEVICE_MAPPER_DIR}" > /dev/null
537 rm -rf "${TEMP}/device-mapper" > /dev/null
541 compile_e2fsprogs() {
542 if [ -f "${BLKID_BINCACHE}" ]
544 print_info 1 "blkid: >> Using cache"
546 [ ! -f "${E2FSPROGS_SRCTAR}" ] &&
547 gen_die "Could not find e2fsprogs source tarball: ${E2FSPROGS_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
549 rm -rf "${E2FSPROGS_DIR}"
550 tar -zxpf "${E2FSPROGS_SRCTAR}"
551 [ ! -d "${E2FSPROGS_DIR}" ] &&
552 gen_die "e2fsprogs directory ${E2FSPROGS_DIR} invalid"
553 cd "${E2FSPROGS_DIR}"
554 print_info 1 'e2fsprogs: >> Configuring...'
555 LDFLAGS=-static ./configure >> ${LOGFILE} 2>&1 ||
556 gen_die 'Configuring e2fsprogs failed!'
557 print_info 1 'e2fsprogs: >> Compiling...'
558 MAKE=${UTILS_MAKE} compile_generic "" ""
559 print_info 1 'blkid: >> Copying to cache...'
560 [ -f "${TEMP}/${E2FSPROGS_DIR}/misc/blkid" ] ||
561 gen_die 'Blkid executable does not exist!'
562 strip "${TEMP}/${E2FSPROGS_DIR}/misc/blkid" ||
563 gen_die 'Could not strip blkid binary!'
564 bzip2 "${TEMP}/${E2FSPROGS_DIR}/misc/blkid" ||
565 gen_die 'bzip2 compression of blkid failed!'
566 mv "${TEMP}/${E2FSPROGS_DIR}/misc/blkid.bz2" "${BLKID_BINCACHE}" ||
567 gen_die 'Could not copy the blkid binary to the package directory, does the directory exist?'
570 rm -rf "${E2FSPROGS_DIR}" > /dev/null
575 if [ ! -f "${FUSE_BINCACHE}" ]
577 [ ! -f "${FUSE_SRCTAR}" ] &&
578 gen_die "Could not find fuse source tarball: ${FUSE_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
581 tar -zxpf "${FUSE_SRCTAR}"
582 [ ! -d "${FUSE_DIR}" ] &&
583 gen_die "fuse directory ${FUSE_DIR} invalid"
585 print_info 1 'fuse: >> Configuring...'
586 ./configure --disable-kernel-module --disable-example >> ${LOGFILE} 2>&1 ||
587 gen_die 'Configuring fuse failed!'
588 print_info 1 'fuse: >> Compiling...'
589 MAKE=${UTILS_MAKE} compile_generic "" ""
591 # Since we're linking statically against libfuse, we don't need to cache the .so
592 # print_info 1 'libfuse: >> Copying to cache...'
593 # [ -f "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ] ||
594 # gen_die 'libfuse.so does not exist!'
595 # strip "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ||
596 # gen_die 'Could not strip libfuse.so!'
597 # cd "${TEMP}/${FUSE_DIR}/lib/.libs"
598 # tar -cjf "${FUSE_BINCACHE}" libfuse*so* ||
599 # gen_die 'Could not create fuse bincache!'
602 # rm -rf "${FUSE_DIR}" > /dev/null
606 compile_unionfs_fuse() {
607 if [ ! -f "${UNIONFS_FUSE_BINCACHE}" ]
610 # We'll call compile_fuse() from here, since it's not needed directly by anything else
613 [ ! -f "${UNIONFS_FUSE_SRCTAR}" ] &&
614 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!"
616 rm -rf "${UNIONFS_FUSE_DIR}"
617 tar -jxpf "${UNIONFS_FUSE_SRCTAR}"
618 [ ! -d "${UNIONFS_FUSE_DIR}" ] &&
619 gen_die "unionfs-fuse directory ${UNIONFS_FUSE_DIR} invalid"
620 cd "${UNIONFS_FUSE_DIR}"
621 print_info 1 'unionfs-fuse: >> Compiling...'
622 sed -i "/^\(CFLAGS\|CPPFLAGS\)/s:^\\(.*\\)$:\\1 -static -I${TEMP}/${FUSE_DIR}/include -L${TEMP}/${FUSE_DIR}/lib/.libs:" Makefile src/Makefile
623 sed -i "/^LIB = /s:^LIB = \(.*\)$:LIB = -static -L${TEMP}/${FUSE_DIR}/lib/.libs \1 -ldl -lrt:" Makefile src/Makefile
624 MAKE=${UTILS_MAKE} compile_generic "" ""
625 print_info 1 'unionfs-fuse: >> Copying to cache...'
626 [ -f "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ] ||
627 gen_die 'unionfs binary does not exist!'
628 strip "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
629 gen_die 'Could not strip unionfs binary!'
630 bzip2 "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
631 gen_die 'bzip2 compression of unionfs binary failed!'
632 mv "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs.bz2" "${UNIONFS_FUSE_BINCACHE}" ||
633 gen_die 'Could not copy the unionfs binary to the package directory, does the directory exist?'
636 rm -rf "${UNIONFS_FUSE_DIR}" > /dev/null
641 if [ ! -f "${ISCSI_BINCACHE}" ]
643 [ ! -f "${ISCSI_SRCTAR}" ] &&
644 gen_die "Could not find iSCSI source tarball: ${ISCSI_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
646 rm -rf "${ISCSI_DIR}"
647 tar -zxpf "${ISCSI_SRCTAR}"
648 [ ! -d "${ISCSI_DIR}" ] &&
649 gen_die "ISCSI directory ${ISCSI_DIR} invalid"
650 print_info 1 'iSCSI: >> Compiling...'
651 cd "${TEMP}/${ISCSI_DIR}"
653 # Only build userspace
654 MAKE=${UTILS_MAKE} compile_generic "user" ""
656 # if kernel modules exist, copy them to initramfs, otherwise it will be compiled into the kernel
657 mkdir -p "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
658 for modname in iscsi_tcp libiscsi scsi_transport_iscsi
660 if [ -e "${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko" ]
662 cp ${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
666 cd "${TEMP}/initramfs-iscsi-temp/"
667 print_info 1 'iscsistart: >> Copying to cache...'
668 [ -f "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ] ||
669 gen_die 'iscsistart executable does not exist!'
670 strip "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ||
671 gen_die 'Could not strip iscsistart binary!'
672 bzip2 "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ||
673 gen_die 'bzip2 compression of iscsistart failed!'
674 mv "${TEMP}/${ISCSI_DIR}/usr/iscsistart.bz2" "${ISCSI_BINCACHE}" ||
675 gen_die 'Could not copy the iscsistart binary to the package directory, does the directory exist?'
678 rm -rf "${ISCSI_DIR}" > /dev/null
683 if [ -f "${GPG_BINCACHE}" ]
685 print_info 1 "gnupg: >> Using cache"
687 [ ! -f "${GPG_SRCTAR}" ] &&
688 gen_die "Could not find gnupg source tarball: ${GPG_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
691 tar -jxf "${GPG_SRCTAR}"
692 [ ! -d "${GPG_DIR}" ] &&
693 gen_die "gnupg directory ${GPG_DIR} invalid"
695 print_info 1 'gnupg: >> Configuring...'
696 # --enable-minimal works, but it doesn't reduce the command length much.
697 # Given its history and the precision this needs, explicit is cleaner.
698 LDFLAGS='-static' CFLAGS='-Os' ./configure --prefix=/ \
699 --enable-static-rnd=linux --disable-dev-random --disable-asm \
700 --disable-selinux-support --disable-gnupg-iconv --disable-card-support \
701 --disable-agent-support --disable-bzip2 --disable-exec \
702 --disable-photo-viewers --disable-keyserver-helpers --disable-ldap \
703 --disable-hkp --disable-finger --disable-generic --disable-mailto \
704 --disable-keyserver-path --disable-dns-srv --disable-dns-pka \
705 --disable-dns-cert --disable-nls --disable-threads --disable-regex \
706 --disable-optimization --with-included-zlib --without-capabilities \
707 --without-tar --without-ldap --without-libcurl --without-mailprog \
708 --without-libpth-prefix --without-libiconv-prefix --without-libintl-prefix\
709 --without-zlib --without-bzip2 --without-libusb --without-readline \
710 >> ${LOGFILE} 2>&1 || gen_die 'Configuring gnupg failed!'
711 print_info 1 'gnupg: >> Compiling...'
712 compile_generic "" "utils"
713 print_info 1 'gnupg: >> Copying to cache...'
714 [ -f "${TEMP}/${GPG_DIR}/g10/gpg" ] ||
715 gen_die 'gnupg executable does not exist!'
716 strip "${TEMP}/${GPG_DIR}/g10/gpg" ||
717 gen_die 'Could not strip gpg binary!'
718 bzip2 -z -c "${TEMP}/${GPG_DIR}/g10/gpg" > "${GPG_BINCACHE}" ||
719 gen_die 'Could not copy the gpg binary to the package directory, does the directory exist?'
722 rm -rf "${GPG_DIR}" > /dev/null