From: Andrew Gaffney Date: Thu, 13 Mar 2008 03:28:56 +0000 (+0000) Subject: Add set_kernel_arch(), which maps the genkernel arch to the arch that the kernel... X-Git-Tag: v3.4.10.902~120 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=18407fa3ede7ad37f692ea44559f8629364be485;p=genkernel.git Add set_kernel_arch(), which maps the genkernel arch to the arch that the kernel expects based on the version of the kernel git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@632 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- diff --git a/ChangeLog b/ChangeLog index 3b2a604..f174ea3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 13 Mar 2008; Andrew Gaffney 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 gen_cmdline.sh, gen_compile.sh, gen_determineargs.sh, gen_initramfs.sh, gen_initrd.sh, gen_package.sh, genkernel: diff --git a/gen_arch.sh b/gen_arch.sh index fcb45fe..b96409e 100755 --- a/gen_arch.sh +++ b/gen_arch.sh @@ -42,3 +42,39 @@ get_official_arch() { 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 +} diff --git a/gen_compile.sh b/gen_compile.sh index 57a093e..91b0a7f 100644 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -20,6 +20,10 @@ compile_kernel_args() { then ARGS="${ARGS} AS=\"${KERNEL_AS}\"" fi + if [ -n "${KERNEL_ARCH}" ] + then + ARGS="${ARGS} ARCH=\"${KERNEL_ARCH}\"" + fi fi echo -n "${ARGS}" } diff --git a/genkernel b/genkernel index 4187f9e..47a378c 100755 --- a/genkernel +++ b/genkernel @@ -99,6 +99,7 @@ echo # Set ${ARCH} get_official_arch +set_kernel_arch # Read arch-specific config source ${ARCH_CONFIG} || gen_die "Could not read ${ARCH_CONFIG}"