aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-03-22 16:41:55 +0000
committerBill Nottingham <notting@redhat.com>2001-03-22 16:41:55 +0000
commitc25af57c950502a1e1546cf815619e5c8b757dd6 (patch)
tree0150ed16e13534f5b931fa4b29cbcbc17f2357da /rc.d
parenta298aba9462bc4e0ad8a8faa0919e5e4ae19b10c (diff)
downloadinitscripts-c25af57c950502a1e1546cf815619e5c8b757dd6.tar
initscripts-c25af57c950502a1e1546cf815619e5c8b757dd6.tar.gz
initscripts-c25af57c950502a1e1546cf815619e5c8b757dd6.tar.bz2
initscripts-c25af57c950502a1e1546cf815619e5c8b757dd6.tar.xz
initscripts-c25af57c950502a1e1546cf815619e5c8b757dd6.zip
fix /boot/kernel.h generation (#32081)
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/rc.sysinit16
1 files changed, 9 insertions, 7 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 6c3b0952..b0ed12ca 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -646,16 +646,18 @@ fi
# Generate a header that defines the boot kernel.
KERNEL_TYPE=`uname -r | sed 's_^[^se]*\(\|smp\|enterprise\)$_-\1_;s_^-$__'`
KERNEL_RELEASE=`uname -r | sed 's|smp\|enterprise||g'`
-KERNEL_ARCH=`rpm -q --qf '%{ARCH}' kernel$KERNEL_TYPE-$KERNEL_RELEASE 2>/dev/null`
+
+rpm -q kernel$KERNEL_TYPE-$KERNEL_RELEASE >/dev/null 2>&1 && KERNEL_ARCH=`rpm -q --qf '%{ARCH}' kernel$KERNEL_TYPE-$KERNEL_RELEASE 2>/dev/null` || KERNEL_ARCH=`uname -m`
+
OLD_KERNEL_ARCH_TYPE=`sed -n 's_^/\* Kernel type \(.*\) \*/_\1_p' /boot/kernel.h 2>/dev/null`
if [ -n "$KERNEL_ARCH" -a "$KERNEL_ARCH$KERNEL_TYPE" != "$OLD_KERNEL_ARCH_TYPE" ]; then
- ENTERPRISE="0"
- SMP="0"
- UP="0"
+ ENTERPRISE='0'
+ SMP='0'
+ UP='0'
case "$KERNEL_TYPE" in
- -smp) SMP="1";;
- -enterprise) ENTERPRISE="1";;
- *) UP="1";;
+ -smp) SMP='1';;
+ -enterprise) ENTERPRISE='1';;
+ *) UP='1';;
esac
cat > /boot/kernel.h << EOF
/* This file is automatically generated at boot time. */