KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /sbin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //sbin/installkernel
#! /bin/sh

#
# /sbin/installkernel  - written by tyson@rwii.com
#

usage() {
    echo "Usage: `basename $0` <kernel_version> <bootimage> <mapfile>" >&2
    exit 1
}

cfgLoader=

if [ -z "$INSTALL_PATH" -o "$INSTALL_PATH" == "/boot" ]; then
    INSTALL_PATH=/boot
    cfgLoader=1
fi

LINK_PATH=/boot
RELATIVE_PATH=`echo "$INSTALL_PATH/" | sed "s|^$LINK_PATH/||"`
KERNEL_VERSION=$1
BOOTIMAGE=$2
MAPFILE=$3
ARCH=$(uname -m)
if [ $ARCH = 'ppc64' -o $ARCH = 'ppc' ]; then
    KERNEL_NAME=vmlinux
else
    KERNEL_NAME=vmlinuz
fi

if [ -z "$KERNEL_VERSION" -o -z "$BOOTIMAGE" -o -z "$MAPFILE" ]; then
    usage
fi

if [ -f $INSTALL_PATH/$KERNEL_NAME-$KERNEL_VERSION ]; then 
      mv $INSTALL_PATH/$KERNEL_NAME-$KERNEL_VERSION \
              $INSTALL_PATH/$KERNEL_NAME-$KERNEL_VERSION.old;
fi

if [ ! -L $INSTALL_PATH/$KERNEL_NAME ]; then
    if [ -e $INSTALLPATH/$KERNEL_NAME ]; then 
	mv $INSTALL_PATH/$KERNEL_NAME $INSTALL_PATH/$KERNEL_NAME.old
    fi
fi

if [ -f $INSTALL_PATH/System.map-$KERNEL_VERSION ]; then 
      mv $INSTALL_PATH/System.map-$KERNEL_VERSION \
              $INSTALL_PATH/System.map-$KERNEL_VERSION.old; 
fi

if [ ! -L $INSTALL_PATH/System.map ]; then
    if [ -e $INSTALLPATH/System.map ]; then 
	mv $INSTALL_PATH/System.map $INSTALL_PATH/System.map.old
    fi
fi
ln -sf ${RELATIVE_PATH}$INSTALL_PATH/System.map-$KERNEL_VERSION $LINK_PATH/System.map

cat $BOOTIMAGE > $INSTALL_PATH/$KERNEL_NAME-$KERNEL_VERSION
cp $MAPFILE $INSTALL_PATH/System.map-$KERNEL_VERSION

ln -fs ${RELATIVE_PATH}$INSTALL_PATH/$KERNEL_NAME-$KERNEL_VERSION $LINK_PATH/$KERNEL_NAME
ln -fs ${RELATIVE_PATH}$INSTALL_PATH/System.map-$KERNEL_VERSION $LINK_PATH/System.map

if [ -n "$cfgLoader" -a -x /sbin/new-kernel-pkg ]; then
	/sbin/new-kernel-pkg --mkinitrd --depmod --install $KERNEL_VERSION
fi

Anon7 - 2021