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 depmod -a -e -b "${INSTALL_MOD_PATH}"/lib/modules/$KV ${KV}
310 [ "${KERNEL_MAKE}" = '' ] &&
311 gen_die "KERNEL_MAKE undefined - I don't know how to compile a kernel for this arch!"
313 local kernel_make_directive="${KERNEL_MAKE_DIRECTIVE}"
314 if [ "${KERNEL_MAKE_DIRECTIVE_OVERRIDE}" != "${DEFAULT_KERNEL_MAKE_DIRECTIVE_OVERRIDE}" ]; then
315 kernel_make_directive="${KERNEL_MAKE_DIRECTIVE_OVERRIDE}"
317 print_info 1 " >> Compiling ${KV} ${kernel_make_directive/_install/ [ install ]/}..."
318 compile_generic "${kernel_make_directive}" kernel
319 if [ "${KERNEL_MAKE_DIRECTIVE_2}" != '' ]
321 print_info 1 " >> Starting supplimental compile of ${KV}: ${KERNEL_MAKE_DIRECTIVE_2}..."
322 compile_generic "${KERNEL_MAKE_DIRECTIVE_2}" kernel
325 local firmware_in_kernel_line=`fgrep CONFIG_FIRMWARE_IN_KERNEL "${KERNEL_OUTPUTDIR}"/.config`
326 if [ -n "${firmware_in_kernel_line}" -a "${firmware_in_kernel_line}" != CONFIG_FIRMWARE_IN_KERNEL=y ]
328 print_info 1 " >> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y..."
329 MAKEOPTS="${MAKEOPTS} -j1" compile_generic "firmware_install" kernel
331 print_info 1 " >> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)..."
334 local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY_OVERRIDE:-${KERNEL_BINARY}})
335 local tmp_kernel_binary2=$(find_kernel_binary ${KERNEL_BINARY_2})
336 if [ -z "${tmp_kernel_binary}" ]
338 gen_die "Cannot locate kernel binary"
341 if isTrue "${CMD_INSTALL}"
343 copy_image_with_preserve "kernel" \
344 "${tmp_kernel_binary}" \
345 "kernel-${KNAME}-${ARCH}-${KV}"
347 copy_image_with_preserve "System.map" \
349 "System.map-${KNAME}-${ARCH}-${KV}"
351 if isTrue "${GENZIMAGE}"
353 copy_image_with_preserve "kernelz" \
354 "${tmp_kernel_binary2}" \
358 cp "${tmp_kernel_binary}" "${TMPDIR}/kernel-${KNAME}-${ARCH}-${KV}" ||
359 gen_die "Could not copy the kernel binary to ${TMPDIR}!"
360 cp "System.map" "${TMPDIR}/System.map-${KNAME}-${ARCH}-${KV}" ||
361 gen_die "Could not copy System.map to ${TMPDIR}!"
362 if isTrue "${GENZIMAGE}"
364 cp "${tmp_kernel_binary2}" "${TMPDIR}/kernelz-${KV}" ||
365 gen_die "Could not copy the kernelz binary to ${TMPDIR}!"
371 [ -f "${BUSYBOX_SRCTAR}" ] ||
372 gen_die "Could not find busybox source tarball: ${BUSYBOX_SRCTAR}!"
374 if [ -n "${BUSYBOX_CONFIG}" ]
376 [ -f "${BUSYBOX_CONFIG}" ] ||
377 gen_die "Could not find busybox config file: ${BUSYBOX_CONFIG}"
378 elif isTrue "${NETBOOT}" && [ -f "$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/netboot-busy-config")" ]
380 BUSYBOX_CONFIG="$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/netboot-busy-config")"
381 elif isTrue "${NETBOOT}" && [ -f "${GK_SHARE}/netboot/busy-config" ]
383 BUSYBOX_CONFIG="${GK_SHARE}/netboot/busy-config"
384 elif [ -f "$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/busy-config")" ]
386 BUSYBOX_CONFIG="$(arch_replace "${GK_SHARE}/arch/%%ARCH%%/busy-config")"
387 elif [ -f "${GK_SHARE}/defaults/busy-config" ]
389 BUSYBOX_CONFIG="${GK_SHARE}/defaults/busy-config"
391 gen_die "Could not find a busybox config file"
394 # Delete cache if stored config's MD5 does not match one to be used
395 if [ -f "${BUSYBOX_BINCACHE}" ]
397 oldconfig_md5=$(tar -xjf "${BUSYBOX_BINCACHE}" -O .config.gk_orig 2>/dev/null | md5sum)
398 newconfig_md5=$(md5sum < "${BUSYBOX_CONFIG}")
399 if [ "${oldconfig_md5}" != "${newconfig_md5}" ]
401 print_info 1 "busybox: >> Removing stale cache..."
402 rm -rf "${BUSYBOX_BINCACHE}"
404 print_info 1 "busybox: >> Using cache"
408 if [ ! -f "${BUSYBOX_BINCACHE}" ]
411 rm -rf "${BUSYBOX_DIR}" > /dev/null
412 /bin/tar -jxpf ${BUSYBOX_SRCTAR} ||
413 gen_die 'Could not extract busybox source tarball!'
414 [ -d "${BUSYBOX_DIR}" ] ||
415 gen_die "Busybox directory ${BUSYBOX_DIR} is invalid!"
416 cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config"
417 cp "${BUSYBOX_CONFIG}" "${BUSYBOX_DIR}/.config.gk_orig"
419 apply_patches busybox ${BUSYBOX_VER}
420 print_info 1 'busybox: >> Configuring...'
421 yes '' 2>/dev/null | compile_generic oldconfig utils
423 print_info 1 'busybox: >> Compiling...'
424 compile_generic all utils
425 print_info 1 'busybox: >> Copying to cache...'
426 [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] ||
427 gen_die 'Busybox executable does not exist!'
428 ${UTILS_CROSS_COMPILE}strip "${TEMP}/${BUSYBOX_DIR}/busybox" ||
429 gen_die 'Could not strip busybox binary!'
430 tar -cj -C "${TEMP}/${BUSYBOX_DIR}" -f "${BUSYBOX_BINCACHE}" busybox .config .config.gk_orig ||
431 gen_die 'Could not create the busybox bincache!'
434 rm -rf "${BUSYBOX_DIR}" > /dev/null
439 if [ -f "${LVM_BINCACHE}" ]
441 print_info 1 "lvm: >> Using cache"
443 [ -f "${LVM_SRCTAR}" ] ||
444 gen_die "Could not find LVM source tarball: ${LVM_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
446 rm -rf ${LVM_DIR} > /dev/null
447 /bin/tar -zxpf ${LVM_SRCTAR} ||
448 gen_die 'Could not extract LVM source tarball!'
449 [ -d "${LVM_DIR}" ] ||
450 gen_die "LVM directory ${LVM_DIR} is invalid!"
452 apply_patches lvm ${LVM_VER}
453 print_info 1 'lvm: >> Configuring...'
455 ./configure --enable-static_link --prefix=/ \
456 --with-lvm1=internal --with-clvmd=none --with-cluster=none \
457 --disable-readline --disable-selinux --with-mirrors=internal \
458 --with-snapshots=internal --with-pool=internal \
459 >> ${LOGFILE} 2>&1 || \
460 gen_die 'Configure of lvm failed!'
461 print_info 1 'lvm: >> Compiling...'
462 compile_generic '' utils
463 compile_generic "install DESTDIR=${TEMP}/lvm/" utils
466 print_info 1 ' >> Copying to bincache...'
467 ${UTILS_CROSS_COMPILE}strip "sbin/lvm.static" ||
468 gen_die 'Could not strip lvm.static!'
470 ${UTILS_CROSS_COMPILE}strip "sbin/dmsetup.static" ||
471 gen_die 'Could not strip dmsetup.static'
472 /bin/tar -cjf "${LVM_BINCACHE}" . ||
473 gen_die 'Could not create binary cache'
476 rm -rf "${TEMP}/lvm" > /dev/null
477 rm -rf "${LVM_DIR}" lvm
482 if [ -f "${MDADM_BINCACHE}" ]
484 print_info 1 ' MDADM: Using cache'
486 [ -f "${MDADM_SRCTAR}" ] ||
487 gen_die "Could not find MDADM source tarball: ${MDADM_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
489 rm -rf "${MDADM_DIR}" > /dev/null
490 /bin/tar -jxpf "${MDADM_SRCTAR}" ||
491 gen_die 'Could not extract MDADM source tarball!'
492 [ -d "${MDADM_DIR}" ] ||
493 gen_die "MDADM directory ${MDADM_DIR} is invalid!"
496 apply_patches mdadm ${MDADM_VER}
497 sed -i "/^CFLAGS = /s:^CFLAGS = \(.*\)$:CFLAGS = -Os:" Makefile
498 sed -i "/^CXFLAGS = /s:^CXFLAGS = \(.*\)$:CXFLAGS = -Os:" Makefile
499 sed -i "/^CWFLAGS = /s:^CWFLAGS = \(.*\)$:CWFLAGS = -Wall:" Makefile
500 sed -i "s/^# LDFLAGS = -static/LDFLAGS = -static/" Makefile
502 print_info 1 'mdadm: >> Compiling...'
503 compile_generic 'mdadm mdmon' utils
505 mkdir -p "${TEMP}/mdadm/sbin"
506 install -m 0755 -s mdadm "${TEMP}/mdadm/sbin/mdadm"
507 install -m 0755 -s mdmon "${TEMP}/mdadm/sbin/mdmon"
508 print_info 1 ' >> Copying to bincache...'
510 ${UTILS_CROSS_COMPILE}strip "sbin/mdadm" "sbin/mdmon" ||
511 gen_die 'Could not strip mdadm binaries!'
512 /bin/tar -cjf "${MDADM_BINCACHE}" sbin/mdadm sbin/mdmon ||
513 gen_die 'Could not create binary cache'
516 rm -rf "${MDADM_DIR}" mdadm
521 compile_device_mapper
522 if [ ! -f "${DMRAID_BINCACHE}" ]
524 [ -f "${DMRAID_SRCTAR}" ] ||
525 gen_die "Could not find DMRAID source tarball: ${DMRAID_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
527 rm -rf ${DMRAID_DIR} > /dev/null
528 /bin/tar -jxpf ${DMRAID_SRCTAR} ||
529 gen_die 'Could not extract DMRAID source tarball!'
530 [ -d "${DMRAID_DIR}" ] ||
531 gen_die "DMRAID directory ${DMRAID_DIR} is invalid!"
532 rm -rf "${TEMP}/lvm" > /dev/null
533 mkdir -p "${TEMP}/lvm"
534 /bin/tar -jxpf "${LVM_BINCACHE}" -C "${TEMP}/lvm" ||
535 gen_die "Could not extract LVM2 binary cache!";
538 apply_patches dmraid ${DMRAID_VER}
539 print_info 1 'dmraid: >> Configuring...'
541 LDFLAGS="-L${TEMP}/lvm/lib" \
542 CFLAGS="-I${TEMP}/lvm/include" \
543 CPPFLAGS="-I${TEMP}/lvm/include" \
545 ./configure --enable-static_link --prefix=${TEMP}/dmraid >> ${LOGFILE} 2>&1 ||
546 gen_die 'Configure of dmraid failed!'
548 # We dont necessarily have selinux installed yet... look into
549 # selinux global support in the future.
550 sed -i tools/Makefile -e "/DMRAID_LIBS +=/s|-lselinux||g"
551 ###echo "DMRAIDLIBS += -lselinux -lsepol" >> tools/Makefile
552 mkdir -p "${TEMP}/dmraid"
553 print_info 1 'dmraid: >> Compiling...'
554 # Force dmraid to be built with -j1 for bug #188273
555 MAKEOPTS="${MAKEOPTS} -j1" compile_generic '' utils
556 #compile_generic 'install' utils
557 mkdir ${TEMP}/dmraid/sbin
558 install -m 0755 -s tools/dmraid "${TEMP}/dmraid/sbin/dmraid"
559 print_info 1 ' >> Copying to bincache...'
561 /bin/tar -cjf "${DMRAID_BINCACHE}" sbin/dmraid ||
562 gen_die 'Could not create binary cache'
565 rm -rf "${TEMP}/lvm" > /dev/null
566 rm -rf "${DMRAID_DIR}" dmraid
570 compile_device_mapper() {
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 apply_patches fuse ${FUSE_VER}
586 print_info 1 'fuse: >> Configuring...'
587 ./configure --disable-example >> ${LOGFILE} 2>&1 ||
588 gen_die 'Configuring fuse failed!'
589 print_info 1 'fuse: >> Compiling...'
590 MAKE=${UTILS_MAKE} compile_generic "" ""
592 # Since we're linking statically against libfuse, we don't need to cache the .so
593 # print_info 1 'libfuse: >> Copying to cache...'
594 # [ -f "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ] ||
595 # gen_die 'libfuse.so does not exist!'
596 # ${UTILS_CROSS_COMPILE}strip "${TEMP}/${FUSE_DIR}/lib/.libs/libfuse.so" ||
597 # gen_die 'Could not strip libfuse.so!'
598 # cd "${TEMP}/${FUSE_DIR}/lib/.libs"
599 # tar -cjf "${FUSE_BINCACHE}" libfuse*so* ||
600 # gen_die 'Could not create fuse bincache!'
603 # rm -rf "${FUSE_DIR}" > /dev/null
607 compile_unionfs_fuse() {
608 if [ ! -f "${UNIONFS_FUSE_BINCACHE}" ]
611 # We'll call compile_fuse() from here, since it's not needed directly by anything else
614 [ ! -f "${UNIONFS_FUSE_SRCTAR}" ] &&
615 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!"
617 rm -rf "${UNIONFS_FUSE_DIR}"
618 tar -jxpf "${UNIONFS_FUSE_SRCTAR}"
619 [ ! -d "${UNIONFS_FUSE_DIR}" ] &&
620 gen_die "unionfs-fuse directory ${UNIONFS_FUSE_DIR} invalid"
621 cd "${UNIONFS_FUSE_DIR}"
622 apply_patches unionfs-fuse ${UNIONFS_FUSE_VER}
623 print_info 1 'unionfs-fuse: >> Compiling...'
624 sed -i "/^\(CFLAGS\|CPPFLAGS\)/s:^\\(.*\\)$:\\1 -static -I${TEMP}/${FUSE_DIR}/include -L${TEMP}/${FUSE_DIR}/lib/.libs:" Makefile src/Makefile
625 sed -i "/^LIB = /s:^LIB = \(.*\)$:LIB = -static -L${TEMP}/${FUSE_DIR}/lib/.libs \1 -ldl -lpthread -lrt:" Makefile src/Makefile
626 MAKE=${UTILS_MAKE} compile_generic "" ""
627 print_info 1 'unionfs-fuse: >> Copying to cache...'
628 [ -f "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ] ||
629 gen_die 'unionfs binary does not exist!'
630 ${UTILS_CROSS_COMPILE}strip "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
631 gen_die 'Could not strip unionfs binary!'
632 bzip2 "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs" ||
633 gen_die 'bzip2 compression of unionfs binary failed!'
634 mv "${TEMP}/${UNIONFS_FUSE_DIR}/src/unionfs.bz2" "${UNIONFS_FUSE_BINCACHE}" ||
635 gen_die 'Could not copy the unionfs binary to the package directory, does the directory exist?'
638 rm -rf "${UNIONFS_FUSE_DIR}" > /dev/null
643 if [ ! -f "${ISCSI_BINCACHE}" ]
645 [ ! -f "${ISCSI_SRCTAR}" ] &&
646 gen_die "Could not find iSCSI source tarball: ${ISCSI_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
648 rm -rf "${ISCSI_DIR}"
649 tar -zxpf "${ISCSI_SRCTAR}"
650 [ ! -d "${ISCSI_DIR}" ] &&
651 gen_die "ISCSI directory ${ISCSI_DIR} invalid"
652 print_info 1 'iSCSI: >> Compiling...'
653 cd "${TEMP}/${ISCSI_DIR}"
654 apply_patches iscsi ${ISCSI_VER}
656 # Only build userspace
657 print_info 1 'iSCSI: >> Configuring userspace...'
658 cd utils/open-isns || gen_die 'Could not enter open-isns dir'
659 # we currently have a patch that changes configure.ac
660 # once given patch is dropped, drop autoconf too
661 autoconf || gen_die 'Could not tweak open-iscsi configuration'
662 ./configure --without-slp >> ${LOGFILE} 2>&1 || gen_die 'Could not configure userspace'
663 cd ../.. || gen_die 'wtf?'
664 MAKE=${UTILS_MAKE} compile_generic "user" ""
666 # if kernel modules exist, copy them to initramfs, otherwise it will be compiled into the kernel
667 mkdir -p "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
668 for modname in iscsi_tcp libiscsi scsi_transport_iscsi
670 if [ -e "${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko" ]
672 cp ${CMD_KERNEL_DIR}/drivers/scsi/${modname}.ko "${TEMP}/initramfs-iscsi-temp/lib/modules/${RELEASE}/kernel/drivers/scsi/"
676 cd "${TEMP}/initramfs-iscsi-temp/"
677 print_info 1 'iscsistart: >> Copying to cache...'
678 [ -f "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ] ||
679 gen_die 'iscsistart executable does not exist!'
680 ${UTILS_CROSS_COMPILE}strip "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ||
681 gen_die 'Could not strip iscsistart binary!'
682 bzip2 "${TEMP}/${ISCSI_DIR}/usr/iscsistart" ||
683 gen_die 'bzip2 compression of iscsistart failed!'
684 mv "${TEMP}/${ISCSI_DIR}/usr/iscsistart.bz2" "${ISCSI_BINCACHE}" ||
685 gen_die 'Could not copy the iscsistart binary to the package directory, does the directory exist?'
688 rm -rf "${ISCSI_DIR}" > /dev/null
693 if [ -f "${GPG_BINCACHE}" ]
695 print_info 1 "gnupg: >> Using cache"
697 [ ! -f "${GPG_SRCTAR}" ] &&
698 gen_die "Could not find gnupg source tarball: ${GPG_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
701 tar -jxf "${GPG_SRCTAR}"
702 [ ! -d "${GPG_DIR}" ] &&
703 gen_die "gnupg directory ${GPG_DIR} invalid"
705 apply_patches gnupg ${GPG_VER}
706 print_info 1 'gnupg: >> Configuring...'
707 # --enable-minimal works, but it doesn't reduce the command length much.
708 # Given its history and the precision this needs, explicit is cleaner.
709 LDFLAGS='-static' CFLAGS='-Os' ./configure --prefix=/ \
710 --enable-static-rnd=linux --disable-dev-random --disable-asm \
711 --disable-selinux-support --disable-gnupg-iconv --disable-card-support \
712 --disable-agent-support --disable-bzip2 --disable-exec \
713 --disable-photo-viewers --disable-keyserver-helpers --disable-ldap \
714 --disable-hkp --disable-finger --disable-generic --disable-mailto \
715 --disable-keyserver-path --disable-dns-srv --disable-dns-pka \
716 --disable-dns-cert --disable-nls --disable-threads --disable-regex \
717 --disable-optimization --with-included-zlib --without-capabilities \
718 --without-tar --without-ldap --without-libcurl --without-mailprog \
719 --without-libpth-prefix --without-libiconv-prefix --without-libintl-prefix\
720 --without-zlib --without-bzip2 --without-libusb --without-readline \
721 >> ${LOGFILE} 2>&1 || gen_die 'Configuring gnupg failed!'
722 print_info 1 'gnupg: >> Compiling...'
723 compile_generic "" "utils"
724 print_info 1 'gnupg: >> Copying to cache...'
725 [ -f "${TEMP}/${GPG_DIR}/g10/gpg" ] ||
726 gen_die 'gnupg executable does not exist!'
727 ${UTILS_CROSS_COMPILE}strip "${TEMP}/${GPG_DIR}/g10/gpg" ||
728 gen_die 'Could not strip gpg binary!'
729 bzip2 -z -c "${TEMP}/${GPG_DIR}/g10/gpg" > "${GPG_BINCACHE}" ||
730 gen_die 'Could not copy the gpg binary to the package directory, does the directory exist?'
733 rm -rf "${GPG_DIR}" > /dev/null