diff options
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/rc.sysinit | 32 |
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 |