Index: PKGBUILD =================================================================== --- PKGBUILD (revision 50017) +++ PKGBUILD (working copy) @@ -45,7 +45,15 @@ # See http://projects.archlinux.org/git/?p=linux-2.6-ARCH.git;a=summary patch -Np1 -i ${srcdir}/${_patchname} || return 1 + # Set correct ARCH during make (prepare|config|bzImage|modules) steps + # This allows building a i686 kernel inside a i686 chroot on a x86_64 host if [ "$CARCH" = "x86_64" ]; then + BUILD_ARCH=x86_64 + else + BUILD_ARCH=i386 + fi + + if [ "$CARCH" = "x86_64" ]; then cat ../config.x86_64 >./.config else cat ../config >./.config @@ -54,7 +62,7 @@ sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config fi # get kernel version - make prepare + make ARCH=$BUILD_ARCH prepare _kernver="$(make kernelrelease)" # load configuration # Configure the kernel. Replace the line below with one of your choice. @@ -68,11 +76,11 @@ #msg "Stopping build" #return 1 #################### - yes "" | make config + yes "" | make ARCH=$BUILD_ARCH config # build! - make bzImage modules || return 1 + make ARCH=$BUILD_ARCH bzImage modules || return 1 mkdir -p ${pkgdir}/{lib/modules,boot} - make INSTALL_MOD_PATH=${pkgdir} modules_install || return 1 + make ARCH=$BUILD_ARCH INSTALL_MOD_PATH=${pkgdir} modules_install || return 1 cp System.map ${pkgdir}/boot/System.map26${_kernelname} cp arch/$KARCH/boot/bzImage ${pkgdir}/boot/vmlinuz26${_kernelname} install -D -m644 Makefile \