aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2000-08-07 22:55:07 +0000
committerJakub Jelinek <jakub@redhat.com>2000-08-07 22:55:07 +0000
commitb410f2f0a47914bf14bea7e5199806e5bf785dc2 (patch)
tree85bd025132d74ef1f26978b4c77c1a11328d35bc
parent904691cc2039ef45e564785ea0de80c81bfeb89c (diff)
downloadinitscripts-b410f2f0a47914bf14bea7e5199806e5bf785dc2.tar
initscripts-b410f2f0a47914bf14bea7e5199806e5bf785dc2.tar.gz
initscripts-b410f2f0a47914bf14bea7e5199806e5bf785dc2.tar.bz2
initscripts-b410f2f0a47914bf14bea7e5199806e5bf785dc2.tar.xz
initscripts-b410f2f0a47914bf14bea7e5199806e5bf785dc2.zip
Put kernel architecture into /boot/kernel.h
-rwxr-xr-xrc.d/rc.sysinit32
1 files changed, 22 insertions, 10 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index ea2322f9..c29e1d1f 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -581,21 +581,33 @@ fi
# Generate a header that defines the boot kernel.
-if uname -r | grep -q smp ; then
- SMP="1"
- UP="0"
-else
+KERNEL_TYPE=`uname -r | sed 's_^[^se]*\(\|smp\|enterprise\)$_-\1_;s_^-$__'`
+KERNEL_ARCH=`rpm -q --qf '%{ARCH}' kernel$KERNEL_TYPE`
+OLD_KERNEL_ARCH_TYPE=`sed -n 's_^/\* Kernel type \(.*\) \*/_\1_p' /boot/kernel.h`
+if [ "$KERNEL_ARCH$KERNEL_TYPE" != "$OLD_KERNEL_ARCH_TYPE" ]; then
+ ENTERPRISE="0"
SMP="0"
- UP="1"
-fi
-OLDSMP=`grep "#define __BOOT_KERNEL_SMP" /boot/kernel.h 2>/dev/null | awk '{ print $3 }'`
-OLDUP=`grep "#define __BOOT_KERNEL_UP" /boot/kernel.h 2>/dev/null | awk '{ print $3 }'`
-if [ "$SMP" != "$OLDSMP" -o "$UP" != "$OLDUP" ]; then
- cat > /boot/kernel.h << EOF
+ UP="0"
+ case "$KERNEL_TYPE" in
+ -smp) SMP="1";;
+ -enterprise) ENTERPRISE="1";;
+ *) UP="1";;
+ esac
+ cat > /boot/kernel.h << EOF
/* This file is automatically generated at boot time. */
#ifndef __BOOT_KERNEL_H_
#define __BOOT_KERNEL_H_
+/* Kernel type $KERNEL_ARCH$KERNEL_TYPE */
+
+#ifndef __MODULE_KERNEL_$KERNEL_ARCH
+#define __MODULE_KERNEL_$KERNEL_ARCH 1
+#endif
+
+#ifndef __BOOT_KERNEL_ENTERPRISE
+#define __BOOT_KERNEL_ENTERPRISE $ENTERPRISE
+#endif
+
#ifndef __BOOT_KERNEL_SMP
#define __BOOT_KERNEL_SMP $SMP
#endif