# Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 13 Mar 2008; Andrew Gaffney <agaffney@gentoo.org> gen_arch.sh,
+ gen_compile.sh, genkernel:
+ Add set_kernel_arch(), which maps the genkernel arch to the arch that the
+ kernel expects based on the version of the kernel
+
13 Mar 2008; Andrew Gaffney <agaffney@gentoo.org> gen_cmdline.sh,
gen_compile.sh, gen_determineargs.sh, gen_initramfs.sh, gen_initrd.sh,
gen_package.sh, genkernel:
ARCH_CONFIG="${GK_SHARE}/${ARCH}/config.sh"
[ -f "${ARCH_CONFIG}" ] || gen_die "${ARCH} not yet supported by genkernel. Please add the arch-specific config file, ${ARCH_CONFIG}"
}
+
+set_kernel_arch() {
+ KERNEL_ARCH=${ARCH}
+ case ${ARCH} in
+# XXX: This doesn't seem to actually be necessary, as it still works just fine without it
+# ppc|ppc64)
+# if [ "${VER}" -eq "2" -a "${PAT}" -ge "6" ]
+# then
+# if [ "${PAT}" -eq "6" -a "${SUB}" -ge "17" ] || [ "${PAT}" -gt "6" ]
+# then
+# KERNEL_ARCH=powerpc
+# fi
+# fi
+# ;;
+ x86)
+ if [ "${VER}" -eq "2" -a "${PAT}" -ge "6" ] || [ "${VER}" -gt "2" ]
+ then
+ if [ "${PAT}" -eq "6" -a "${SUB}" -ge "24" ] || [ "${PAT}" -gt "6" ]
+ then
+ KERNEL_ARCH=x86
+ else
+ KERNEL_ARCH=i386
+ fi
+ fi
+ ;;
+ x86_64)
+ if [ "${VER}" -eq "2" -a "${PAT}" -ge "6" ] || [ "${VER}" -gt "2" ]
+ then
+ if [ "${PAT}" -eq "6" -a "${SUB}" -ge "24" ] || [ "${PAT}" -gt "6" ]
+ then
+ KERNEL_ARCH=x86
+ fi
+ fi
+ ;;
+ esac
+}
then
ARGS="${ARGS} AS=\"${KERNEL_AS}\""
fi
+ if [ -n "${KERNEL_ARCH}" ]
+ then
+ ARGS="${ARGS} ARCH=\"${KERNEL_ARCH}\""
+ fi
fi
echo -n "${ARGS}"
}
# Set ${ARCH}
get_official_arch
+set_kernel_arch
# Read arch-specific config
source ${ARCH_CONFIG} || gen_die "Could not read ${ARCH_CONFIG}"