Lines 611-613
Link Here
|
611 |
rm -rf "${UNIONFS_FUSE_DIR}" > /dev/null |
611 |
rm -rf "${UNIONFS_FUSE_DIR}" > /dev/null |
612 |
fi |
612 |
fi |
613 |
} |
613 |
} |
|
|
614 |
|
615 |
compile_v86d() { |
616 |
if [ ! -f "${V86D_BINCACHE}" ] |
617 |
then |
618 |
local myARCH="${ARCH}" myABI="${ABI}" |
619 |
|
620 |
if [ -z "$(grep V86D ${KERNEL_DIR}/include/linux/connector.h)" ]; then |
621 |
gen_die "You a kernel tree patched with uvesafb for v86d. Kernel not patched with uvesafb." |
622 |
fi |
623 |
|
624 |
case ${ARCH} in |
625 |
amd64) a=x86_64 ;; |
626 |
mips) gen_die 'TODO: Use the $ABI' ;; |
627 |
x86) a=i386 ;; |
628 |
*) a=${ARCH} ;; |
629 |
esac |
630 |
KLIBCARCH=${a} |
631 |
|
632 |
case ${ARCH} in |
633 |
# Merged arches |
634 |
x86|x86_64) a=x86 ;; |
635 |
ppc*) a=powerpc ;; |
636 |
# Non-merged |
637 |
alpha|arm|ia64|m68k|mips|sh|sparc*) a=${ARCH} ;; |
638 |
*) gen_die "TODO: Update the code for your asm-ARCH symlink" ;; |
639 |
esac |
640 |
KLIBCASMARCH=${a} |
641 |
|
642 |
unset ABI ARCH KBUILD_OUTPUT |
643 |
|
644 |
# klibc |
645 |
print_info 1 'v86d: >> Unpacking klibc...' |
646 |
[ ! -f "${KLIBC_SRCTAR}" ] && |
647 |
gen_die "Could not find klibc source tarball: ${KLIBC_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!" |
648 |
cd "${TEMP}" |
649 |
rm -rf "${KLIBC_DIR}" |
650 |
tar -xpf "${KLIBC_SRCTAR}" |
651 |
[ ! -d "${KLIBC_DIR}" ] && |
652 |
gen_die "klibc directory ${KLIBC_DIR} invalid" |
653 |
cd "${KLIBC_DIR}" |
654 |
# point klibc to kernel sourse |
655 |
ln -snf "${KERNEL_DIR}" linux |
656 |
apply_patches klibc ${KLIBC_VER} |
657 |
# compile klibc |
658 |
print_info 1 'v86d: >> Compiling klibc...' |
659 |
${UTILS_MAKE} \ |
660 |
EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \ |
661 |
EXTRA_KLIBCLDFLAGS="-z,noexecstack" \ |
662 |
HOSTCC="${UTILS_CC}" CC="${UTILS_CC}" \ |
663 |
LD="${UTILS_LD}" AS="${UTILS_AS}" \ |
664 |
INSTALLDIR="${TEMP}/klibc-install" \ |
665 |
KLIBCARCH=${KLIBCARCH} \ |
666 |
KLIBCASMARCH=${KLIBCASMARCH} \ |
667 |
SHLIBDIR="${TEMP}/klibc-install/lib" \ |
668 |
libdir="${TEMP}/klibc-install/lib" \ |
669 |
bindir="${TEMP}/klibc-install/bin" \ |
670 |
mandir="${TEMP}/klibc-install/usr/share/man" install >> ${LOGFILE} 2>&1 || gen_die "Failed to compile klibc" |
671 |
linkname="${TEMP}/klibc-install/include/asm" |
672 |
if [ -L "${linkname}" ] && [ ! -e "${linkname}" ]; then |
673 |
ln -snf asm-${KLIBCASMARCH} "${linkname}" |
674 |
fi |
675 |
|
676 |
# v86d |
677 |
print_info 1 'v86d: >> Unpacking v86d...' |
678 |
[ ! -f "${V86D_SRCTAR}" ] && |
679 |
gen_die "Could not find v86d source tarball: ${V86D_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!" |
680 |
cd "${TEMP}" |
681 |
rm -rf "${V86D_DIR}" |
682 |
tar -xpf "${V86D_SRCTAR}" |
683 |
[ ! -d "${V86D_DIR}" ] && |
684 |
gen_die "v86d directory ${V86D_DIR} invalid" |
685 |
cd "${V86D_DIR}" |
686 |
apply_patches v86d ${V86D_VER} |
687 |
print_info 1 'v86d: >> Configuring...' |
688 |
./configure --with-klibc --with-x86emu >> ${LOGFILE} 2>&1 || |
689 |
gen_die 'Configuring v86d failed!' |
690 |
print_info 1 'v86d: >> Compiling...' |
691 |
${UTILS_MAKE} KDIR="${KERNEL_DIR}" CC="${TEMP}/klibc-install/bin/klcc" >> ${LOGFILE} 2>&1 || |
692 |
gen_die 'Compiling v86d failed!' |
693 |
print_info 1 'v86d: >> Copying to cache...' |
694 |
[ -f "v86d" ] || |
695 |
gen_die 'v86d executable does not exist!' |
696 |
strip "v86d" || |
697 |
gen_die 'Could not strip v86d binary!' |
698 |
bzip2 "v86d" || |
699 |
gen_die 'bzip2 compression of v86d failed!' |
700 |
mv "v86d.bz2" "${V86D_BINCACHE}" || |
701 |
gen_die 'Could not copy the v86d binary to the package directory, does the directory exist?' |
702 |
cd .. |
703 |
rm -rf "${V86D_DIR}" |
704 |
|
705 |
ARCH="${myARCH}" ABI="${myABI}" |
706 |
fi |
707 |
} |