one new script named "setbootfromdisk" is added,
which is used to change the default booting-up device to hard disk when the redhat (also including fedora, centos, sl etc) diskful installation is completed git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7819 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
0017b64a0f
commit
1607f2c06c
@ -443,6 +443,12 @@ sub makescript {
|
||||
{
|
||||
push @scriptd, "setbootfromnet\n";
|
||||
}
|
||||
|
||||
# add setbootfromdisk if the nodesetstate is install and arch is ppc64
|
||||
if (($nodesetstate) && ($nodesetstate eq "install") && ($arch eq "ppc64") ) {
|
||||
push @scriptd, "setbootfromdisk\n";
|
||||
}
|
||||
|
||||
###Please do not remove or modify this line of code!!! xcatdsklspost depends on it
|
||||
push @scriptd, "# postscripts-end-here\n";
|
||||
|
||||
|
0
xCAT-server/sbin/xcatconfig
Normal file → Executable file
0
xCAT-server/sbin/xcatconfig
Normal file → Executable file
41
xCAT/postscripts/setbootfromdisk
Executable file
41
xCAT/postscripts/setbootfromdisk
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
# IBM(c) 2010 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
#(C)IBM Corp
|
||||
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
#setbootfromdisk
|
||||
# The script is used to set harddisk(sda) to be the default bootup devices
|
||||
# on Redhat-family OSes with POWER system
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
OS=`uname`
|
||||
if [[ $OS = "Linux" ]]; then
|
||||
if [[ $OSVER = fedora* ]] || [[ $OSVER = rhels5* ]] || [[ $OSVER = rhel6* ]] || [[ $OSVER=rhels6* ]] || [[ -f /etc/fedora-release ]] || [[ -f /etc/redhat-release ]]; then
|
||||
if [[ -f /usr/sbin/bootlist ]] ; then
|
||||
# determine which harddisk should be the default one
|
||||
# /dev/sda3 /boot ext4 rw,seclabel,relatime,barrier=1,data=ordered 0 0
|
||||
BOOTENTRY=`cat /proc/mounts |grep /boot`
|
||||
|
||||
if [[ -z $BOOTENTRY ]]; then
|
||||
BOOTENTRY=`mount |grep " / "`
|
||||
fi
|
||||
|
||||
BOOTDEVICE=`echo $BOOTENTRY | awk '{print $1}'`
|
||||
if [[ -z $BOOTDEVICE ]]; then
|
||||
logger -t xcat setbootfromdisk: cannot find the booting device
|
||||
else
|
||||
logger -t xcat setbootfromdisk: Setting $BOOTDEVICE to be the default bootup device
|
||||
echo "setbootfromdisk: setting up $BOOTDEVICE as the default bootup device"
|
||||
bootlist -m normal $BOOTDEVICE
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
logger -t xcat Could not find /usr/sbin/bootlist
|
||||
echo "setbootfromdisk: could not find /usr/sbin/bootlist"
|
||||
exit -1
|
||||
fi
|
||||
fi
|
||||
fi
|
Loading…
Reference in New Issue
Block a user