Revision 1108,
1022 bytes
checked in by daisuke, 14 years ago
(diff) |
import initscripts-8.90.6 from internal cvs repository
|
Rev | Line | |
---|
[1108] | 1 | #!/bin/bash |
---|
| 2 | # |
---|
| 3 | # Generate a header that defines the boot kernel. |
---|
| 4 | # |
---|
| 5 | |
---|
| 6 | KERNEL_TYPE=`uname -r | sed 's_^.*\(tape\)$_-\1_;t;s_.*__;'` |
---|
| 7 | KERNEL_RELEASE=`uname -r | sed 's|tape||g'` |
---|
| 8 | |
---|
| 9 | 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` |
---|
| 10 | |
---|
| 11 | OLD_KERNEL_ARCH_TYPE=`sed -n 's_^/\* Kernel type \(.*\) \*/_\1_p' /boot/kernel.h 2>/dev/null` |
---|
| 12 | if [ -n "$KERNEL_ARCH" -a "$KERNEL_ARCH$KERNEL_TYPE" != "$OLD_KERNEL_ARCH_TYPE" ]; then |
---|
| 13 | TAPE='0' |
---|
| 14 | VM='0' |
---|
| 15 | case "$KERNEL_TYPE" in |
---|
| 16 | -tape) TAPE='1';; |
---|
| 17 | *) VM='1';; |
---|
| 18 | esac |
---|
| 19 | cat > /boot/kernel.h << EOF |
---|
| 20 | /* This file is automatically generated at boot time. */ |
---|
| 21 | #ifndef __BOOT_KERNEL_H_ |
---|
| 22 | #define __BOOT_KERNEL_H_ |
---|
| 23 | |
---|
| 24 | /* Kernel type $KERNEL_ARCH$KERNEL_TYPE */ |
---|
| 25 | |
---|
| 26 | #ifndef __MODULE_KERNEL_$KERNEL_ARCH |
---|
| 27 | #define __MODULE_KERNEL_$KERNEL_ARCH 1 |
---|
| 28 | #endif |
---|
| 29 | |
---|
| 30 | #ifndef __BOOT_KERNEL_TAPE |
---|
| 31 | #define __BOOT_KERNEL_TAPE $TAPE |
---|
| 32 | #endif |
---|
| 33 | |
---|
| 34 | #ifndef __BOOT_KERNEL_VM |
---|
| 35 | #define __BOOT_KERNEL_VM $VM |
---|
| 36 | #endif |
---|
| 37 | |
---|
| 38 | #endif |
---|
| 39 | EOF |
---|
| 40 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.