Commit 58fb0e98 authored by Łukasz Nowak's avatar Łukasz Nowak

Support banging.

parent 5561d341
...@@ -48,10 +48,13 @@ pwgen -sync 512 1 | passwd --stdin root ...@@ -48,10 +48,13 @@ pwgen -sync 512 1 | passwd --stdin root
SLAP_INSTALL_LOG=/opt/slapos/slapos-install.log SLAP_INSTALL_LOG=/opt/slapos/slapos-install.log
if [ ! -f /opt/slapos/bin/slapformat ] ; then while :; do
while [ ! -f /opt/slapos/bin/slapformat ] ; do if [ -f /opt/slapos/bin/slapformat ] && [ -f /opt/slapos/bin/bang ]; then
echo -n "Installing SlapOS, log availble at ${SLAP_INSTALL_LOG}..." # slapos tools available, nothing to do
break
fi
# software not detected, force forever installation # software not detected, force forever installation
echo -n "Installing SlapOS, log availble at ${SLAP_INSTALL_LOG}..."
mkdir -p /opt/slapos mkdir -p /opt/slapos
(python -S -c \ (python -S -c \
'import urllib2;print urllib2.urlopen("http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py").read()' \ 'import urllib2;print urllib2.urlopen("http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py").read()' \
...@@ -60,8 +63,7 @@ if [ ! -f /opt/slapos/bin/slapformat ] ; then ...@@ -60,8 +63,7 @@ if [ ! -f /opt/slapos/bin/slapformat ] ; then
/etc/slapos/software.cfg buildout:directory=/opt/slapos >> \ /etc/slapos/software.cfg buildout:directory=/opt/slapos >> \
${SLAP_INSTALL_LOG} 2>&1 ) && (echo "done.") || (echo \ ${SLAP_INSTALL_LOG} 2>&1 ) && (echo "done.") || (echo \
"failed, retrying, the last error was:." ; tail -n 20 ${SLAP_INSTALL_LOG} ; rm -f /opt/slapos/bin/slapformat) "failed, retrying, the last error was:." ; tail -n 20 ${SLAP_INSTALL_LOG} ; rm -f /opt/slapos/bin/slapformat)
done done
fi
# Create PKI repository # Create PKI repository
repo=`egrep ^certificate_repository_path /etc/slapos/slapos.cfg | sed 's/^certificate_repository_path.*= *//'` repo=`egrep ^certificate_repository_path /etc/slapos/slapos.cfg | sed 's/^certificate_repository_path.*= *//'`
...@@ -97,6 +99,9 @@ sysctl -w \ ...@@ -97,6 +99,9 @@ sysctl -w \
echo -n "Running slapformat..." echo -n "Running slapformat..."
/opt/slapos/bin/slapformat --verbose --console /etc/slapos/slapos.cfg /opt/slapos/bin/slapformat --verbose --console /etc/slapos/slapos.cfg
echo "done." echo "done."
echo -n "Banging..."
/opt/slapos/bin/bang -m "Rebooted" /etc/slapos/slapos.cfg
echo "done."
# Set kvm up # Set kvm up
modprobe kvm_intel modprobe kvm_intel
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment