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
cleanup-cruft
Andrew Gaffney 17 years ago
parent d176b8c104
commit 18407fa3ed

@ -2,6 +2,11 @@
# Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2 # Copyright 2006-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $ # $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, 13 Mar 2008; Andrew Gaffney <agaffney@gentoo.org> gen_cmdline.sh,
gen_compile.sh, gen_determineargs.sh, gen_initramfs.sh, gen_initrd.sh, gen_compile.sh, gen_determineargs.sh, gen_initramfs.sh, gen_initrd.sh,
gen_package.sh, genkernel: gen_package.sh, genkernel:

@ -42,3 +42,39 @@ get_official_arch() {
ARCH_CONFIG="${GK_SHARE}/${ARCH}/config.sh" 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}" [ -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
}

@ -20,6 +20,10 @@ compile_kernel_args() {
then then
ARGS="${ARGS} AS=\"${KERNEL_AS}\"" ARGS="${ARGS} AS=\"${KERNEL_AS}\""
fi fi
if [ -n "${KERNEL_ARCH}" ]
then
ARGS="${ARGS} ARCH=\"${KERNEL_ARCH}\""
fi
fi fi
echo -n "${ARGS}" echo -n "${ARGS}"
} }

@ -99,6 +99,7 @@ echo
# Set ${ARCH} # Set ${ARCH}
get_official_arch get_official_arch
set_kernel_arch
# Read arch-specific config # Read arch-specific config
source ${ARCH_CONFIG} || gen_die "Could not read ${ARCH_CONFIG}" source ${ARCH_CONFIG} || gen_die "Could not read ${ARCH_CONFIG}"

Loading…
Cancel
Save