Relocate the nbroot to /opt/xcat/share/netboot
-Override init with our own in order to preserve control of PID 1 (for switch_root) -Change nbroot shell to actually call shell and loop, rather than exit since that would be init trying to exit now -Increase destiny retrieval interval a bit to be less harsh, don't background as this must continue to be PID 1 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@363 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
091ab39b39
commit
a0a692eacb
@ -27,7 +27,7 @@ while :; do
|
||||
fi
|
||||
if [ $DESTINY == "shell" ]; then
|
||||
echo "Server notified us to stay in shell state, stopping destiny requests"
|
||||
exit
|
||||
while :; do /bin/sh; done #exit
|
||||
fi
|
||||
if [ $DESTINY == "discover" ]; then
|
||||
echo "MAC discovery begins"
|
||||
|
@ -4,4 +4,4 @@ rm /restart
|
||||
killall -12 udhcpc;killall -10 udhcpc
|
||||
sleep 5
|
||||
/etc/init.d/S11stunnel #redo stunnel config
|
||||
/etc/init.d/S99xcat
|
||||
exec /etc/init.d/S99xcat.sh
|
||||
|
@ -1,9 +1,10 @@
|
||||
#!/bin/sh
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
(
|
||||
|
||||
while ! /bin/getdestiny
|
||||
do
|
||||
echo "Retrying destiny retrieval"
|
||||
sleep 3
|
||||
ifconfig
|
||||
done
|
||||
/bin/dodestiny
|
||||
) &
|
||||
. /bin/dodestiny
|
36
xCAT-nbroot/overlay/init
Executable file
36
xCAT-nbroot/overlay/init
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
PATH=/sbin:/bin:/usr/bin:/usr/sbin
|
||||
export PATH
|
||||
/bin/mount -t proc none /proc
|
||||
/bin/mount -t sysfs none /sys
|
||||
/bin/mount -t tmpfs -o size=64k,mode=0755 none /dev
|
||||
/bin/mkdir /dev/pts
|
||||
/bin/mount -t devpts devpts /dev/pts
|
||||
/bin/echo /sbin/mdev > /proc/sys/kernel/hotplug
|
||||
/sbin/mdev -s
|
||||
/bin/mount -o remount,rw /
|
||||
/bin/mount -a
|
||||
/bin/hostname -F /etc/hostname
|
||||
/sbin/ifconfig lo 127.0.0.1 up
|
||||
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
|
||||
# now run any rc scripts
|
||||
for i in /etc/init.d/S??* ;do
|
||||
|
||||
# Ignore dangling symlinks (if any).
|
||||
[ ! -f "$i" ] && continue
|
||||
|
||||
case "$i" in
|
||||
*.sh)
|
||||
# Source shell script for speed.
|
||||
(
|
||||
trap - INT QUIT TSTP
|
||||
set start
|
||||
. $i
|
||||
)
|
||||
;;
|
||||
*)
|
||||
# No sh extension, so fork subprocess.
|
||||
$i start
|
||||
;;
|
||||
esac
|
||||
done
|
@ -13,6 +13,7 @@ BuildArch: noarch
|
||||
%define name xCAT-nbroot-core-%{tarch}
|
||||
Release: snap%(date +"%Y%m%d%H%M")
|
||||
AutoReq: false
|
||||
Prefix: /opt/xcat
|
||||
AutoProv: false
|
||||
|
||||
|
||||
@ -43,8 +44,8 @@ All files included are as they were downloadable on 4/7/2007
|
||||
|
||||
%Install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/share/xcat/netboot/%{tarch}/nbroot
|
||||
cd $RPM_BUILD_ROOT/usr/share/xcat/netboot/%{tarch}/nbroot
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/%{tarch}/nbroot
|
||||
cd $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/%{tarch}/nbroot
|
||||
tar zxvf %{SOURCE1}
|
||||
chmod 755 etc/init.d/S40network bin/getdestiny bin/getdestiny.awk bin/getipmi bin/getipmi.awk
|
||||
cd -
|
||||
|
@ -4,7 +4,7 @@ if [ $# -ne 1 ]; then
|
||||
echo "Usage: mknb <arch>"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -d /usr/share/xcat/netboot/$1 ]; then
|
||||
if [ ! -d /opt/xcat/share/xcat/netboot/$1 ]; then
|
||||
echo "Unsupported architecture: $1"
|
||||
exit 1
|
||||
fi
|
||||
@ -14,7 +14,7 @@ if [ ! -r ~/.ssh/id_rsa.pub ]; then
|
||||
#exit 1
|
||||
fi
|
||||
mkdir -p /tmp/mknb.$$
|
||||
cp -a /usr/share/xcat/netboot/$1/nbroot/* /tmp/mknb.$$/
|
||||
cp -a /opt/xcat/share/xcat/netboot/$1/nbroot/* /tmp/mknb.$$/
|
||||
mkdir -p /tmp/mknb.$$/root/.ssh
|
||||
cp ~/.ssh/id_rsa.pub /tmp/mknb.$$/root/.ssh/authorized_keys
|
||||
if [ -f /install/postscripts/hostkeys/ssh_host_key ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user