2010-03-22 16:11:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#--
|
|
|
|
#-- IBMhpc.postinstall
|
|
|
|
#-- Run this script from your <profile>.postinstall to perform the following
|
|
|
|
#-- general setup in your diskless image for your HPC cluster:
|
|
|
|
#-- - create entries in /etc/fstab for basic filesystems
|
|
|
|
#-- - enables the "cons" entry in /etc/inittab
|
|
|
|
#-- - create initial copies of /etc/passwd and other files in the image
|
|
|
|
#-- - turn on the "at" service
|
|
|
|
#-- - turn on xinetd
|
|
|
|
#-- -
|
|
|
|
#--
|
|
|
|
#-- it gets these arguments:
|
|
|
|
#--
|
|
|
|
#-- $1 = install root (chroot directory for profile)
|
|
|
|
#-- $2 = OS version
|
|
|
|
#-- $3 = architecture
|
|
|
|
#-- $4 = profile name
|
|
|
|
#-- $5 = work dir (where genimage is located)
|
|
|
|
#--
|
|
|
|
#--
|
|
|
|
installroot=$1
|
|
|
|
osver=$2
|
|
|
|
arch=$3
|
|
|
|
profile=$4
|
|
|
|
workdir=$5
|
|
|
|
|
|
|
|
#-- Generate /etc/fstab automatically during image generation:
|
|
|
|
#-- adjust filesystem sizes as needed for your cluster
|
|
|
|
cat <<END >$installroot/etc/fstab
|
|
|
|
proc /proc proc rw 0 0
|
|
|
|
sysfs /sys sysfs rw 0 0
|
|
|
|
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
|
|
|
|
#${profile}_${arch} / tmpfs rw 0 1
|
|
|
|
none /tmp tmpfs defaults,size=3g 0 2
|
|
|
|
none /var/tmp tmpfs defaults,size=1g 0 2
|
|
|
|
END
|
|
|
|
|
|
|
|
#-- Uncomment the "cons" entry in /etc/inittab
|
|
|
|
#cons:12345:respawn:/sbin/smart_agetty -L 38400 console
|
|
|
|
TMP_inittab=`sed 's/\(#\)\(cons:12345.*\)$/\2/' $installroot/etc/inittab`
|
|
|
|
echo "$TMP_inittab" > $installroot/etc/inittab
|
|
|
|
|
|
|
|
# Create initial copies of /etc/passwd and others in case they are needed
|
|
|
|
# by other postscripts
|
|
|
|
# If you would like xCAT to keep these up to date,
|
|
|
|
# use the xCAT syncfiles function which runs during
|
|
|
|
# packimage/liteimage and at other times
|
|
|
|
cp -p /etc/passwd $installroot/etc/passwd
|
|
|
|
cp -p /etc/group $installroot/etc/group
|
|
|
|
cp -p /etc/shadow $installroot/etc/shadow
|
|
|
|
cp -p /etc/hosts $installroot/etc/hosts
|
|
|
|
|
|
|
|
# Turn on 'at' service
|
|
|
|
chroot $installroot chkconfig atd on
|
|
|
|
|
|
|
|
# Turn on xinetd
|
|
|
|
chroot $installroot chkconfig xinetd on
|
|
|
|
|
2010-04-07 14:01:24 +00:00
|
|
|
# Automatically mount /dev/cpuset at node boot
|
|
|
|
if ! grep 'cpuset' $installroot/etc/init.d/boot.local ; then
|
|
|
|
cat <<END >>$installroot/etc/init.d/boot.local
|
|
|
|
if test -e /dev/cpuset || mkdir -p /dev/cpuset ; then
|
|
|
|
mount -t cpuset none /dev/cpuset
|
|
|
|
fi
|
|
|
|
END
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-22 16:11:46 +00:00
|
|
|
# Modify some ulimits
|
2010-04-05 04:41:51 +00:00
|
|
|
if [ ! -f $installroot/etc/sysconfig/ulimit ]; then
|
2010-04-05 17:54:34 +00:00
|
|
|
cp -p /etc/sysconfig/ulimit $installroot/etc/sysconfig
|
2010-03-22 16:11:46 +00:00
|
|
|
fi
|
2010-04-05 04:41:51 +00:00
|
|
|
if [ ! -f $installroot/etc/sysconfig/ulimit.XCAT_BAK ]; then
|
|
|
|
cp -p $installroot/etc/sysconfig/ulimit $installroot/etc/sysconfig/ulimit.XCAT_BAK
|
2010-03-22 16:11:46 +00:00
|
|
|
fi
|
2010-04-05 04:41:51 +00:00
|
|
|
# max locked memory
|
|
|
|
/usr/bin/sed -i 's/HARDLOCKLIMIT=.*/HARDLOCKLIMIT="unlimited"/g' $installroot/etc/sysconfig/ulimit
|
|
|
|
/usr/bin/sed -i 's/SOFTLOCKLIMIT=.*/SOFTLOCKLIMIT="unlimited"/g' $installroot/etc/sysconfig/ulimit
|
|
|
|
# max memory size
|
|
|
|
/usr/bin/sed -i 's/HARDRESIDENTLIMIT=.*/HARDRESIDENTLIMIT="unlimited"/g' $installroot/etc/sysconfig/ulimit
|
|
|
|
/usr/bin/sed -i 's/SOFTRESIDENTLIMIT=.*/SOFTRESIDENTLIMIT="unlimited"/g' $installroot/etc/sysconfig/ulimit
|
|
|
|
|
|
|
|
|
2010-03-22 16:11:46 +00:00
|
|
|
|