Add set_kernel_arch(), which maps the genkernel arch to the arch that the kernel...
authorAndrew Gaffney <agaffney@gentoo.org>
Thu, 13 Mar 2008 03:28:56 +0000 (03:28 +0000)
committerAndrew Gaffney <agaffney@gentoo.org>
Thu, 13 Mar 2008 03:28:56 +0000 (03:28 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@632 67a159dc-881f-0410-a524-ba9dfbe2cb84

ChangeLog
gen_arch.sh
gen_compile.sh
genkernel

index 3b2a60423c0efb0b99d01c622390b2aa0ee731a6..f174ea33d05ec82e294bc03dc198eb1040de1e82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,11 @@
 # 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:
index fcb45febb0390f7cbbf3727f1ed4bef27796ceb1..b96409e66ffc6309acb2575659db814ecfc038fa 100755 (executable)
@@ -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
+}
index 57a093e76b9f8fbaa4899940d282ea572e155060..91b0a7f1548d00d454d978900098e39feb1c5a8a 100644 (file)
@@ -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}"
 }
index 4187f9e432248d17b7c864e05e00cf2e29b4bcc7..47a378c68ba8f71ee8a429a5e81fca5428583af3 100755 (executable)
--- 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}"