Magellan Linux

Annotation of /tags/grubby-8_3/installkernel

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (hide annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 7 months ago) by niro
Original Path: trunk/mkinitrd-magellan/installkernel
File size: 1694 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

1 niro 532 #! /bin/sh
2    
3     #
4     # /sbin/installkernel - written by tyson@rwii.com
5     #
6    
7     usage() {
8     echo "Usage: `basename $0` <kernel_version> <bootimage> <mapfile>" >&2
9     exit 1
10     }
11    
12     cfgLoader=
13    
14     if [ -z "$INSTALL_PATH" -o "$INSTALL_PATH" == "/boot" ]; then
15     INSTALL_PATH=/boot
16     cfgLoader=1
17     fi
18    
19     KERNEL_VERSION=$1
20     BOOTIMAGE=$2
21     MAPFILE=$3
22     ARCH=$(uname -m)
23     if [ $ARCH = 'ppc64' -o $ARCH = 'ppc' ]; then
24     KERNEL_NAME=vmlinux
25     else
26     KERNEL_NAME=vmlinuz
27     fi
28    
29     if [ -z "$KERNEL_VERSION" -o -z "$BOOTIMAGE" -o -z "$MAPFILE" ]; then
30     usage
31     fi
32    
33     if [ -f $INSTALL_PATH/$KERNEL_NAME-$KERNEL_VERSION ]; then
34     mv $INSTALL_PATH/$KERNEL_NAME-$KERNEL_VERSION \
35     $INSTALL_PATH/$KERNEL_NAME-$KERNEL_VERSION.old;
36     fi
37    
38     if [ ! -L $INSTALL_PATH/$KERNEL_NAME ]; then
39     if [ -e $INSTALLPATH/$KERNEL_NAME ]; then
40     mv $INSTALL_PATH/$KERNEL_NAME $INSTALL_PATH/$KERNEL_NAME.old
41     fi
42     fi
43    
44     ln -sf $KERNEL_NAME-$KERNEL_VERSION $INSTALL_PATH/$KERNEL_NAME
45    
46     if [ -f $INSTALL_PATH/System.map-$KERNEL_VERSION ]; then
47     mv $INSTALL_PATH/System.map-$KERNEL_VERSION \
48     $INSTALL_PATH/System.map-$KERNEL_VERSION.old;
49     fi
50    
51     if [ ! -L $INSTALL_PATH/System.map ]; then
52     if [ -e $INSTALLPATH/System.map ]; then
53     mv $INSTALL_PATH/System.map $INSTALL_PATH/System.map.old
54     fi
55     fi
56     ln -sf System.map-$KERNEL_VERSION $INSTALL_PATH/System.map
57    
58     cat $BOOTIMAGE > $INSTALL_PATH/$KERNEL_NAME-$KERNEL_VERSION
59     cp $MAPFILE $INSTALL_PATH/System.map-$KERNEL_VERSION
60    
61     ln -fs $KERNEL_NAME-$KERNEL_VERSION $INSTALL_PATH/$KERNEL_NAME
62     ln -fs System.map-$KERNEL_VERSION $INSTALL_PATH/System.map
63    
64     if [ -n "$cfgLoader" -a -x /sbin/new-kernel-pkg ]; then
65     /sbin/new-kernel-pkg --mkinitrd --depmod --install $KERNEL_VERSION
66     fi

Properties

Name Value
svn:executable *