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 tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY})
307 local tmp_kernel_binary2=$(find_kernel_binary ${KERNEL_BINARY_2})
308 if [ -z "${tmp_kernel_binary}" ]
310 gen_die "Cannot locate kernel binary"
313 if ! isTrue "${CMD_NOINSTALL}"
315 copy_image_with_preserve "kernel" \
316 "${tmp_kernel_binary}" \
317 "kernel-${KNAME}-${ARCH}-${KV}"
319 copy_image_with_preserve "System.map" \
321 "System.map-${KNAME}-${ARCH}-${KV}"
323 if isTrue "${GENZIMAGE}"
325 copy_image_with_preserve "kernelz" \
326 "${tmp_kernel_binary2}" \
330 cp "${tmp_kernel_binary}" "${TMPDIR}/kernel-${KNAME}-${ARCH}-${KV}" ||
331 gen_die "Could not copy the kernel binary to ${TMPDIR}!"
332 cp "System.map" "${TMPDIR}/System.map-${KNAME}-${ARCH}-${KV}" ||
333 gen_die "Could not copy System.map to ${TMPDIR}!"
334 if isTrue "${GENZIMAGE}"
336 cp "${tmp_kernel_binary2}" "${TMPDIR}/kernelz-${KV}" ||
337 gen_die "Could not copy the kernelz binary to ${TMPDIR}!"
343 [ -f "${BUSYBOX_SRCTAR}" ] ||
344 gen_die "Could not find busybox source tarball: ${BUSYBOX_SRCTAR}!"
346 if [ -n "${BUSYBOX_CONFIG}" ]
348 [ -f "${BUSYBOX_CONFIG}" ] ||
349 gen_die "Could not find busybox config file: ${BUSYBOX_CONFIG}"
350 elif isTrue "${NETBOOT}" && [ -f "$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/netboot-busy-config")" ]
352 BUSYBOX_CONFIG="$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/netboot-busy-config")"
353 elif isTrue "${NETBOOT}" && [ -f "${GK_SHARE}/netboot/busy-config" ]
355 BUSYBOX_CONFIG="${GK_SHARE}/netboot/busy-config"
356 elif [ -f "$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/busy-config")" ]
358 BUSYBOX_CONFIG="$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/busy-config")"
359 elif [ -f "${GK_SHARE}/defaults/busy-config" ]
361 BUSYBOX_CONFIG="${GK_SHARE}/defaults/busy-config"
363 gen_die "Could not find a busybox config file"
366 # Delete cache if stored config's MD5 does not match one to be used
367 if [ -f "${BUSYBOX_BINCACHE}" ]
369 oldconfig_md5=$(tar -xjf "${BUSYBOX_BINCACHE}" -O .config.gk_orig 2>/dev/null | md5sum)
370 newconfig_md5=$(md5sum < "${BUSYBOX_CONFIG}")
371 if [ "${oldconfig_md5}" != "${newconfig_md5}" ]
373 print_info 1 "busybox: >> Removing stale cache..."
374 rm -rf "${BUSYBOX_BINCACHE}"
376 print_info 1 "busybox: >> Using cache"
380 if [ ! -f "${BUSYBOX_BINCACHE}" ]
383 rm -rf "${BUSYBOX_DIR}" > /dev/null
384 /bin/tar -jxpf ${BUSYBOX_SRCTAR} ||
385 gen_die 'Could not extract busybox source tarball!'
386 [ -d "${BUSYBOX_DIR}" ] ||
387 gen_die 'Busybox directory ${BUSYBOX_DIR} is invalid!'
388 cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config"
389 cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config.gk_orig"
391 apply_patches busybox ${BUSYBOX_VER}
392 print_info 1 'busybox: >> Configuring...'
393 yes '' 2>/dev/null | compile_generic oldconfig utils
395 print_info 1 'busybox: >> Compiling...'
396 compile_generic all utils
397 print_info 1 'busybox: >> Copying to cache...'
398 [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] ||
399 gen_die 'Busybox executable does not exist!'
400 strip "${TEMP}/${BUSYBOX_DIR}/busybox" ||
401 gen_die 'Could not strip busybox binary!'
402 tar -cj -C "${TEMP}/${BUSYBOX_DIR}" -f "${BUSYBOX_BINCACHE}" busybox .config .config.gk_orig ||
403 gen_die 'Could not create the busybox bincache!'
406 rm -rf "${BUSYBOX_DIR}" > /dev/null
411 compile_device_mapper
412 if [ ! -f "${LVM_BINCACHE}" ]
414 [ -f "${LVM_SRCTAR}" ] ||
415 gen_die "Could not find LVM source tarball: ${LVM_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
417 rm -rf ${LVM_DIR} > /dev/null
418 /bin/tar -zxpf ${LVM_SRCTAR} ||
419 gen_die 'Could not extract LVM source tarball!'
420 [ -d "${LVM_DIR}" ] ||
421 gen_die 'LVM directory ${LVM_DIR} is invalid!'
422 rm -rf "${TEMP}/device-mapper" > /dev/null
423 /bin/tar -jxpf "${DEVICE_MAPPER_BINCACHE}" -C "${TEMP}" ||
424 gen_die "Could not extract device-mapper binary cache!";
427 apply_patches lvm ${LVM_VER}
428 print_info 1 'lvm: >> Configuring...'
429 LDFLAGS="-L${TEMP}/device-mapper/lib" \
431 CPPFLAGS="-I${TEMP}/device-mapper/include" \
432 ./configure --enable-static_link --prefix=${TEMP}/lvm \
433 --with-lvm1=none --with-clvmd=none --with-cluster=none \
434 --disable-readline --disable-selinux --with-mirrors=none \
435 --with-snapshots=none --with-pool=internal >> ${LOGFILE} 2>&1 || \
436 gen_die 'Configure of lvm failed!'
437 print_info 1 'lvm: >> Compiling...'
438 compile_generic '' utils
439 compile_generic 'install' utils
442 print_info 1 ' >> Copying to bincache...'
443 strip "sbin/lvm.static" ||
444 gen_die 'Could not strip lvm.static!'
445 /bin/tar -cjf "${LVM_BINCACHE}" sbin/lvm.static ||
446 gen_die 'Could not create binary cache'
449 rm -rf "${TEMP}/device-mapper" > /dev/null
450 rm -rf "${LVM_DIR}" lvm
455 compile_device_mapper
456 if [ ! -f "${DMRAID_BINCACHE}" ]
458 [ -f "${DMRAID_SRCTAR}" ] ||
459 gen_die "Could not find DMRAID source tarball: ${DMRAID_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
461 rm -rf ${DMRAID_DIR} > /dev/null
462 /bin/tar -jxpf ${DMRAID_SRCTAR} ||
463 gen_die 'Could not extract DMRAID source tarball!'
464 [ -d "${DMRAID_DIR}" ] ||
465 gen_die 'DMRAID directory ${DMRAID_DIR} is invalid!'
466 rm -rf "${TEMP}/device-mapper" > /dev/null
467 /bin/tar -jxpf "${DEVICE_MAPPER_BINCACHE}" -C "${TEMP}" ||
468 gen_die "Could not extract device-mapper binary cache!";
471 print_info 1 'dmraid: >> Configuring...'
473 LDFLAGS="-L${TEMP}/device-mapper/lib" \
474 CFLAGS="-I${TEMP}/device-mapper/include" \
475 CPPFLAGS="-I${TEMP}/device-mapper/include" \
476 ./configure --enable-static_link --prefix=${TEMP}/dmraid >> ${LOGFILE} 2>&1 ||
477 gen_die 'Configure of dmraid failed!'
479 # We dont necessarily have selinux installed yet... look into
480 # selinux global support in the future.
481 sed -i tools/Makefile -e "s|DMRAIDLIBS += -lselinux||g"
482 ###echo "DMRAIDLIBS += -lselinux -lsepol" >> tools/Makefile
483 mkdir -p "${TEMP}/dmraid"
484 print_info 1 'dmraid: >> Compiling...'
485 # Force dmraid to be built with -j1 for bug #188273
486 MAKEOPTS=-j1 compile_generic '' utils
487 #compile_generic 'install' utils
488 mkdir ${TEMP}/dmraid/sbin
489 install -m 0755 -s tools/dmraid "${TEMP}/dmraid/sbin/dmraid"
490 print_info 1 ' >> Copying to bincache...'
492 /bin/tar -cjf "${DMRAID_BINCACHE}" sbin/dmraid ||
493 gen_die 'Could not create binary cache'
496 rm -rf "${TEMP}/device-mapper" > /dev/null
497 rm -rf "${DMRAID_DIR}" dmraid
501 compile_device_mapper() {
502 if [ ! -f "${DEVICE_MAPPER_BINCACHE}" ]
504 [ ! -f "${DEVICE_MAPPER_SRCTAR}" ] &&
505 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!"
507 rm -rf "${DEVICE_MAPPER_DIR}"
508 /bin/tar -zxpf "${DEVICE_MAPPER_SRCTAR}"
509 [ ! -d "${DEVICE_MAPPER_DIR}" ] &&
510 gen_die "device-mapper directory ${DEVICE_MAPPER_DIR} invalid"
511 cd "${DEVICE_MAPPER_DIR}"
513 ./configure --prefix=${TEMP}/device-mapper --enable-static_link \
514 --disable-selinux >> ${LOGFILE} 2>&1 ||
515 gen_die 'Configuring device-mapper failed!'
516 print_info 1 'device-mapper: >> Compiling...'
517 compile_generic '' utils
518 compile_generic 'install' utils
519 print_info 1 ' >> Copying to cache...'
521 rm -rf "${TEMP}/device-mapper/man" ||
522 gen_die 'Could not remove manual pages!'
523 strip "${TEMP}/device-mapper/sbin/dmsetup" ||
524 gen_die 'Could not strip dmsetup binary!'
525 /bin/tar -jcpf "${DEVICE_MAPPER_BINCACHE}" device-mapper ||
526 gen_die 'Could not tar up the device-mapper binary!'
527 [ -f "${DEVICE_MAPPER_BINCACHE}" ] ||
528 gen_die 'device-mapper cache not created!'
530 rm -rf "${DEVICE_MAPPER_DIR}" > /dev/null
531 rm -rf "${TEMP}/device-mapper" > /dev/null
535 compile_e2fsprogs() {
536 if [ -f "${BLKID_BINCACHE}" ]
538 print_info 1 "blkid: >> Using cache"
540 [ ! -f "${E2FSPROGS_SRCTAR}" ] &&
541 gen_die "Could not find e2fsprogs source tarball: ${E2FSPROGS_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
543 rm -rf "${E2FSPROGS_DIR}"
544 tar -zxpf "${E2FSPROGS_SRCTAR}"
545 [ ! -d "${E2FSPROGS_DIR}" ] &&
546 gen_die "e2fsprogs directory ${E2FSPROGS_DIR} invalid"
547 cd "${E2FSPROGS_DIR}"
548 print_info 1 'e2fsprogs: >> Configuring...'
549 LDFLAGS=-static ./configure >> ${LOGFILE} 2>&1 ||
550 gen_die 'Configuring e2fsprogs failed!'
551 print_info 1 'e2fsprogs: >> Compiling...'
552 MAKE=${UTILS_MAKE} compile_generic "" ""
553 print_info 1 'blkid: >> Copying to cache...'
554 [ -f "${TEMP}/${E2FSPROGS_DIR}/misc/blkid" ] ||
555 gen_die 'Blkid executable does not exist!'
556 strip "${TEMP}/${E2FSPROGS_DIR}/misc/blkid" ||
557 gen_die 'Could not strip blkid binary!'
558 bzip2 "${TEMP}/${E2FSPROGS_DIR}/misc/blkid" ||
559 gen_die 'bzip2 compression of blkid failed!'
560 mv "${TEMP}/${E2FSPROGS_DIR}/misc/blkid.bz2" "${BLKID_BINCACHE}" ||
561 gen_die 'Could not copy the blkid binary to the package directory, does the directory exist?'
564 rm -rf "${E2FSPROGS_DIR}" > /dev/null
569 if [ ! -f "${FUSE_BINCACHE}" ]
571 [ ! -f "${FUSE_SRCTAR}" ] &&
572 gen_die "Could not find fuse source tarball: ${FUSE_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
575 tar -zxpf "${FUSE_SRCTAR}"
576 [ ! -d "${FUSE_DIR}" ] &&
577 gen_die "fuse directory ${FUSE_DIR} invalid"
579 print_info 1 'fuse: >> Configuring...'
580 ./configure --disable-kernel-module --disable-example >> ${LOGFILE} 2>&1 ||
581 gen_die 'Configuring fuse failed!'
582 print_info 1 'fuse: >> Compiling...'
583 MAKE=${UTILS_MAKE} compile_generic "" ""
585 # Since we're linking statically against libfuse, we don't need to cache the .so
586 # print_info 1 'libfuse: >> Copying to cache...'
587 # [ -f "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ] ||
588 # gen_die 'libfuse.so does not exist!'
589 # strip "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ||
590 # gen_die 'Could not strip libfuse.so!'
591 # cd "${TEMP}/${FUSE_DIR}/lib/.libs"
592 # tar -cjf "${FUSE_BINCACHE}" libfuse*so* ||
593 # gen_die 'Could not create fuse bincache!'
596 # rm -rf "${FUSE_DIR}" > /dev/null
600 compile_unionfs_fuse() {
601 if [ ! -f "${UNIONFS_FUSE_BINCACHE}" ]
604 # We'll call compile_fuse() from here, since it's not needed directly by anything else
607 [ ! -f "${UNIONFS_FUSE_SRCTAR}" ] &&
608 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!"
610 rm -rf "${UNIONFS_FUSE_DIR}"
611 tar -jxpf "${UNIONFS_FUSE_SRCTAR}"
612 [ ! -d "${UNIONFS_FUSE_DIR}" ] &&
613 gen_die "unionfs-fuse directory ${UNIONFS_FUSE_DIR} invalid"
614 cd "${UNIONFS_FUSE_DIR}"
615 print_info 1 'unionfs-fuse: >> Compiling...'
616 sed -i "/^\(CFLAGS\|CPPFLAGS\)/s:^\\(.*\\)$:\\1 -static -I${TEMP}/${FUSE_DIR}/include -L${TEMP}/${FUSE_DIR}/lib/.libs:" Makefile src/Makefile
617 sed -i "/^LIB = /s:^LIB = \(.*\)$:LIB = -static -L${TEMP}/${FUSE_DIR}/lib/.libs \1 -ldl -lrt:" Makefile src/Makefile
618 MAKE=${UTILS_MAKE} compile_generic "" ""
619 print_info 1 'unionfs-fuse: >> Copying to cache...'
620 [ -f "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ] ||
621 gen_die 'unionfs binary does not exist!'
622 strip "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
623 gen_die 'Could not strip unionfs binary!'
624 bzip2 "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
625 gen_die 'bzip2 compression of unionfs binary failed!'
626 mv "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs.bz2" "${UNIONFS_FUSE_BINCACHE}" ||
627 gen_die 'Could not copy the unionfs binary to the package directory, does the directory exist?'
630 rm -rf "${UNIONFS_FUSE_DIR}" > /dev/null
635 if [ ! -f "${ISCSI_BINCACHE}" ]
637 [ ! -f "${ISCSI_SRCTAR}" ] &&
638 gen_die "Could not find iSCSI source tarball: ${ISCSI_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
640 rm -rf "${ISCSI_DIR}"
641 tar -zxpf "${ISCSI_SRCTAR}"
642 [ ! -d "${ISCSI_DIR}" ] &&
643 gen_die "ISCSI directory ${ISCSI_DIR} invalid"
644 print_info 1 'iSCSI: >> Compiling...'
645 cd "${TEMP}/${ISCSI_DIR}"
647 # Only build userspace
648 MAKE=${UTILS_MAKE} compile_generic "user" ""
650 # if kernel modules exist, copy them to initramfs, otherwise it will be compiled into the kernel
651 mkdir -p "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
652 for modname in iscsi_tcp libiscsi scsi_transport_iscsi
654 if [ -e "${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko" ]
656 cp ${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
660 cd "${TEMP}/initramfs-iscsi-temp/"
661 print_info 1 'iscsistart: >> Copying to cache...'
662 [ -f "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ] ||
663 gen_die 'iscsistart executable does not exist!'
664 strip "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ||
665 gen_die 'Could not strip iscsistart binary!'
666 bzip2 "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ||
667 gen_die 'bzip2 compression of iscsistart failed!'
668 mv "${TEMP}/${ISCSI_DIR}/usr/iscsistart.bz2" "${ISCSI_BINCACHE}" ||
669 gen_die 'Could not copy the iscsistart binary to the package directory, does the directory exist?'
672 rm -rf "${ISCSI_DIR}" > /dev/null
677 if [ -f "${GPG_BINCACHE}" ]
679 print_info 1 "gnupg: >> Using cache"
681 [ ! -f "${GPG_SRCTAR}" ] &&
682 gen_die "Could not find gnupg source tarball: ${GPG_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
685 tar -jxf "${GPG_SRCTAR}"
686 [ ! -d "${GPG_DIR}" ] &&
687 gen_die "gnupg directory ${GPG_DIR} invalid"
689 print_info 1 'gnupg: >> Configuring...'
690 # --enable-minimal works, but it doesn't reduce the command length much.
691 # Given its history and the precision this needs, explicit is cleaner.
692 LDFLAGS='-static' CFLAGS='-Os' ./configure --prefix=/ \
693 --enable-static-rnd=linux --disable-dev-random --disable-asm \
694 --disable-selinux-support --disable-gnupg-iconv --disable-card-support \
695 --disable-agent-support --disable-bzip2 --disable-exec \
696 --disable-photo-viewers --disable-keyserver-helpers --disable-ldap \
697 --disable-hkp --disable-finger --disable-generic --disable-mailto \
698 --disable-keyserver-path --disable-dns-srv --disable-dns-pka \
699 --disable-dns-cert --disable-nls --disable-threads --disable-regex \
700 --disable-optimization --with-included-zlib --without-capabilities \
701 --without-tar --without-ldap --without-libcurl --without-mailprog \
702 --without-libpth-prefix --without-libiconv-prefix --without-libintl-prefix\
703 --without-zlib --without-bzip2 --without-libusb --without-readline \
704 >> ${LOGFILE} 2>&1 || gen_die 'Configuring gnupg failed!'
705 print_info 1 'gnupg: >> Compiling...'
706 compile_generic "" "utils"
707 print_info 1 'gnupg: >> Copying to cache...'
708 [ -f "${TEMP}/${GPG_DIR}/g10/gpg" ] ||
709 gen_die 'gnupg executable does not exist!'
710 strip "${TEMP}/${GPG_DIR}/g10/gpg" ||
711 gen_die 'Could not strip gpg binary!'
712 bzip2 -z -c "${TEMP}/${GPG_DIR}/g10/gpg" > "${GPG_BINCACHE}" ||
713 gen_die 'Could not copy the gpg binary to the package directory, does the directory exist?'
716 rm -rf "${GPG_DIR}" > /dev/null