Commit 8fb14cc1 authored by Jondy Zhao's avatar Jondy Zhao

Fix slapos node configure problem in the Windows 7

parent 1510a838
......@@ -57,6 +57,7 @@
<itemizedlist>
<listitem><para>SlapOS Desktop</para></listitem>
<listitem><para>Node Runner</para></listitem>
<listitem><para>SlapOS Node</para></listitem>
<listitem><para>Command Console</para></listitem>
<listitem><para>Configure SlapOS</para></listitem>
<listitem><para>User Guide</para></listitem>
......@@ -69,6 +70,9 @@
<para>Node Runner is a web based development tool which uses slapgrid to install and instantiate the software, and it could be used to manage your slapos slave node in your computer.</para>
<para>Refer to <ulink url="http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/developer-Howto.Use.SlapOS.Web.Runner.html5"/></para>
</section>
<section><title>SlapOS Node</title>
<para>It's used to format slapos node, release software and create instance, you an run it at any time.</para>
</section>
<section><title>Command Console</title>
<para>It will open a terminal, here you can run most of slapos command,
<programlisting>
......@@ -191,10 +195,10 @@ Refer to: http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/develope
D:
MD slapos
CD slapos
SET PACKAGES=-P autobuild -P autoconf -P automake -P autossh -P binutils -P bison -P bzip2 -P ca-certificates -P cron -P curl -P cygport -P cygrunsrv -P file -P flex -P gcc4 -P gdbm -P libgdbm-devel -P gettext -P gettext-devel -P libglib2.0-devel -P libglib2.0_0 -P libexpat1 -P libexpat1-devel -P libmpfr-devel -P libmpfr4 -P libtool -P libxml2 -P libxml2-devel -P libxslt -P libxslt-devel -P make -P m4 -P libncurses-devel -P libncursesw-devel -P patch -P patchutils -P pkg-config -P python -P python-setuptools -P openssh -P openssl-devel -P libopenssl098 -P libopenssl100 -P popt -P readline -P libsqlite3-devel -P libsqlite3_0 -P swig -P syslog-ng -P zlib-devel -P vim -P wget -P docbook-utils
SET PACKAGES=-P autobuild -P autoconf -P automake -P autossh -P binutils -P bison -P bzip2 -P ca-certificates -P cron -P curl -P cygport -P cygrunsrv -P file -P flex -P gcc4 -P gdbm -P libgdbm-devel -P gettext -P gettext-devel -P libglib2.0-devel -P libglib2.0_0 -P libexpat1 -P libexpat1-devel -P libmpfr-devel -P libmpfr4 -P libtool -P libxml2 -P libxml2-devel -P libxslt -P libxslt-devel -P make -P m4 -P libncurses-devel -P libncursesw-devel -P patch -P patchutils -P pkg-config -P python -P python-setuptools -P openssh -P openssl-devel -P libopenssl098 -P libopenssl100 -P popt -P readline -P libsqlite3-devel -P libsqlite3_0 -P swig -P syslog-ng -P zlib-devel -P vim -P wget
MOVE d:\temp\setup.exe .\
setup.exe %PACKAGES% --no-verify -D -L -l D:\slapos\cygwin-packages -R D:\slapos\cygwin -s http://www.netgull.com/cygwin
</programlisting>Waiting for the installer finished.</para></listitem>
</programlisting>Waiting for the installer finished. -P docbook-utils</para></listitem>
</itemizedlist>
A cygwin icon will be added in the windows desktop, click it to enter cygwin box, then run the following commands:
<!--
......@@ -212,7 +216,9 @@ start mintty.exe -i /Cygwin-Terminal.ico -
<programlisting>
echo "export CYGWIN=server" >> ~/.bash_profile
sed -i -e "s/4\.3\.4/4.5.3/g" /usr/bin/libtool
cp /etc/password /etc/password.orig
[[ -f /etc/passwd ]] || mkpasswd > /etc/passwd
[[ -f /etc/group ]] || mkgroup > /etc/group
cp /etc/passwd /etc/passwd.orig
myaccount=$(grep "^Administrator:" /etc/passwd | \
sed -e "s/Administrator:unused:500:/root:unused:0:/g")
echo $myaccount >> /etc/passwd
......@@ -243,7 +249,7 @@ mkdir -p /opt/slapos
mkdir -p /opt/download-cache
cd /opt/slapos
echo "[buildout]
extends = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/cygwin-0:/component/slapos/buildout.cfg
extends = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-0:/component/slapos/buildout.cfg
download-cache = /opt/download-cache
prefix = ${buildout:directory}
" > buildout.cfg
......@@ -255,9 +261,9 @@ Now we need patch slapos.core for supporting cygwin, after these code are merged
<programlisting>
cd /opt
wget http://www.dashingsoft.com/products/slapos/slapos-patches.tar.gz
tar xzf slapos-patches.tar.gz
cd eggs/slapos.core-0.35-py2.7.egg/slapos
patch -p1 &lt; /opt/patches/slapos-core.patch
tar xzf slapos-patches.tar.gz --no-same-owner
cd /opt/slapos/eggs/slapos.core-0.35-py2.7.egg
patch -p1 &lt; /opt/patches/slapos-core-format.patch
</programlisting>
It seems netifaces.dll need to rebase,
<programlisting>
......@@ -282,7 +288,6 @@ git clone -b cygwin http://git.erp5.org/repos/slapos.package.git
Then build babeld and openvpn for cygwin, we need use the sources in the slapos.package.git, they are patched for cygwin:
<programlisting>
cd /opt/git/slapos.package/windows/babeld
# If your os is windows xp, type the following command, otherwise type make only.
make WINVER=XP
cp babeld.exe /usr/local/bin
......@@ -308,7 +313,7 @@ Download pyOpenSSL-0.13.tar.gz, miniupnpc-1.8.tar.gz,
<programlisting>
mkdir -p /opt/downloads
cd /opt/downloads
wget --no-verify-certificate https://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.tar.gz#md5=767bca18a71178ca353dff9e10941929
wget --no-check-certificate https://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.13.tar.gz#md5=767bca18a71178ca353dff9e10941929
wget http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.8.tar.gz -O miniupnpc-1.8.tar.gz
</programlisting>
Get re6stnet for cygwin
......@@ -323,8 +328,8 @@ Get the icons and openvpn drivers
cd /opt
wget http://www.dashingsoft.com/products/slapos/images.tar.gz
wget http://www.dashingsoft.com/products/slapos/openvpn-driver.tar.gz
tar xzf images.tar.gz
tar xzf openvpn-driver.tar.gz
tar xzf images.tar.gz --no-same-owner
tar xzf openvpn-driver.tar.gz --no-same-owner
</programlisting>
</para>
</section>
......
......@@ -59,6 +59,7 @@ Source: "opt\openvpn\bin\devcon.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver";
Source: "opt\git\slapos.package\windows\scripts\init-slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\post-install.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\build-slapos.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\slapos-configure.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
......@@ -71,15 +72,13 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D
[Icons]
Name: "{commondesktop}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\Node Runner"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-w hide -l /var/log/slapos-node-runner.log /etc/slapos/scripts/slapos-node-runner.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
; Name: "{group}\SlapOS Console"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -h always -t ""SlapOS Console"" /opt/slapos/bin/slapconsole /etc/opt/slapos/slapos.cfg"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Node Runner"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-w hide -h never -l /var/log/slapos-node-runner.log /etc/slapos/scripts/slapos-node-runner.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\SlapOS Node"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/slapos-node.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\cygtty.bat"; WorkingDir: "{app}\cygwin\opt\slapos"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Configure SlapOS"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -t ""Configure SlapOS Client"" /etc/slapos/scripts/slapos-client-config.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
; Name: "{group}\Configure Node"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -t ""Configure SlapOS Node"" /etc/slapos/scripts/slapos-node-config.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\Configure SlapOS"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -h never -t ""Configure SlapOS Client"" /etc/slapos/scripts/slapos-client-config.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\User Guide"; Filename: "{app}\user-guide.html";
Name: "{group}\Uninstall SlapOS"; Filename: "{uninstallexe}";
[Run]
Filename: "{app}\setup-cygwin.bat"; Parameters: """{app}"""; StatusMsg: "Installing Cygwin..."; Flags: runhidden;
Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/post-install.sh"; WorkingDir: "{app}\cygwin\bin"; Description: "Configure Cygwin"; StatusMsg: "Configure Cygwin..."; Flags: skipifdoesntexist runhidden;
......
This diff is collapsed.
#! /bin/bash
#
export PATH=/usr/local/bin:/usr/bin:/bin:$PATH
current_path=$(cygpath -a $(dirname $0))
if [[ ! -f $current_path/node-runner.vbs ]] ; then
echo Installing slap-runner ...
$current_path/slapos-configure runner || (echo Failed to create instance of slap-runner ; exit 1)
echo Install slap-runner OK.
fi
# cat <<EOF > $current_path/node-runner.vbs
# Set oShell = CreateObject("WScript.Shell")
# oShell.OpenBrowser("http://[2001:67c:1254:45::c5d5]:50000")
# EOF
if [[ -f $current_path/node-runner.vbs ]] ; then
echo Starting slap-runner ...
cyg_cscript $current_path/node-runner.vbs || (echo Failed to start slap-runner ; exit 1)
echo Start slap-runner OK.
fi
#! /bin/bash
export PATH=/usr/local/bin:/usr/bin:$PATH
ifname=re6stnet-lo
ping6 slap.vifib.com > /dev/null
# Run re6stnet if no native ipv6
if (( $? )) ; then
echo "Start re6stnet ..."
(cd /etc/re6stnet; re6stnet @re6stnet.conf --ovpnlog -I $ifname -i $ifname &)
echo "Start re6stent in the background OK."
echo "Waiting re6stent network work ..."
while true ; do
ping6 slap.vifib.com && break
done
echo "re6stnet network OK."
fi
# Format slapos node
echo "Run Slapos format ..."
/opt/slapos/bin/slapos node format -cv --now
if (( $? )) ; then
echo "Failed to run slapos format."
exit 1
else
echo "Format slapos node OK."
fi
# Release software
echo "Releasing software ..."
/opt/slapos/bin/slapos node software
if (( $? )) ; then
echo "Failed to relase software in the slapos node."
exit 1
else
echo "Release software OK."
fi
# Instance software
echo "Creating instance ..."
/opt/slapos/bin/slapos node instance
if (( $? )) ; then
echo "Failed to create instance in the slapos node."
exit 1
else
echo "Create instance OK."
fi
# Send report
/opt/slapos/bin/slapos node report
exit 0
......@@ -53,6 +53,7 @@ Source: "opt\openvpn\bin\devcon.exe"; DestDir: "{app}\cygwin\usr\local\bin";
Source: "opt\openvpn\driver\*"; DestDir: "{app}\cygwin\etc\slapos\driver";
Source: "opt\git\slapos.package\windows\scripts\init-slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\slapos-node.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\post-install.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\build-slapos.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\slapos-configure.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
......@@ -65,11 +66,10 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D
[Icons]
Name: "{commondesktop}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico";
Name: "{group}\Node Runner"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-w hide -l /var/log/slapos-node-runner.log /etc/slapos/scripts/slapos-node-runner.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
; Name: "{group}\SlapOS Console"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -h always -t ""SlapOS Console"" /opt/slapos/bin/slapconsole /etc/opt/slapos/slapos.cfg"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Node Runner"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-w hide -h never -l /var/log/slapos-node-runner.log /etc/slapos/scripts/slapos-node-runner.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\SlapOS Node"; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/slapos-node.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\Command Console"; Filename: "{app}\cygwin\cygtty.bat"; WorkingDir: "{app}\cygwin\opt\slapos"; IconFilename: "{app}\cygwin\etc\slapos\images\terminal.ico";
Name: "{group}\Configure SlapOS"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -t ""Configure SlapOS Client"" /etc/slapos/scripts/slapos-client-config.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
; Name: "{group}\Configure Node"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -t ""Configure SlapOS Node"" /etc/slapos/scripts/slapos-node-config.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\node.ico";
Name: "{group}\Configure SlapOS"; Filename: "{app}\cygwin\bin\mintty.exe"; Parameters: "-c ~/.minttyrc -h never -t ""Configure SlapOS Client"" /etc/slapos/scripts/slapos-client-config.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\User Guide"; Filename: "{app}\user-guide.html";
Name: "{group}\Uninstall SlapOS"; Filename: "{uninstallexe}";
......
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