#! /bin/sh # # /sbin/installkernel.iSeries - written by streeter@redhat.com # # installkernel a|b|c|prep [] INSTALL_PATH=/boot SIDE=`echo $1|tr a-z A-Z` BOOTIMAGE=$2 if [ -z "$BOOTIMAGE" ]; then BOOTIMAGE=/boot/vmlinux-`uname -r` if [ -f ${BOOTIMAGE}.initrd ]; then BOOTIMAGE=${BOOTIMAGE}.initrd fi fi if [ ! -f $BOOTIMAGE ]; then echo "Cannot install from $BOOTIMAGE" else if [ -n "$SIDE" ]; then if [ PREP = $SIDE ]; then tmpdisk=/dev/`sed -n -e '3s/^[^[:alpha:]]*\([/[:alnum:]]\+\).*$/\1/p' < /proc/partitions` tmppart=`fdisk -l $tmpdisk |sed -n -e 's/^\([^[:blank:]]\+\).*PPC PReP Boot/\1/p'` if [ -n "$tmppart" ]; then dd if=$BOOTIMAGE of=$tmppart bs=4k exit else echo "Cannot find a Prep Boot partition on the first disk" fi else if [ A = $SIDE -o B = $SIDE -o C = $SIDE ]; then dd if=$BOOTIMAGE of=/proc/iSeries/mf/$SIDE/vmlinux bs=8k echo $SIDE >/proc/iSeries/mf/side exit fi fi fi fi echo "Usage:" echo " installkernel a|b|c|prep []" exit -1