Commit 5dd596a2 authored by Jondy Zhao's avatar Jondy Zhao

Change windows installer scripts

parent 51a4a9f5
...@@ -20,75 +20,92 @@ ...@@ -20,75 +20,92 @@
<chapter id="ch_introduction"><title>Introduction</title> <chapter id="ch_introduction"><title>Introduction</title>
<para>SlapOS can be described as a cloud operating system in which "everything is a process" unlike Unix in which "everything is a file". If one has to manage thousands of servers with thousands of processes, hundred different applications in multiple different releases or versions, SlapOS can help you a lot by making the whole management process well specified, automated and under control.</para> <para>SlapOS can be described as a cloud operating system in which "everything is a process" unlike Unix in which "everything is a file". If one has to manage thousands of servers with thousands of processes, hundred different applications in multiple different releases or versions, SlapOS can help you a lot by making the whole management process well specified, automated and under control.</para>
<para>The goal of this tutorial is to teach how to use SlapOS in the windows.</para> <para>The goal of this tutorial is to teach how to use SlapOS in the windows.</para>
<!--
<itemizedlist>
<listitem><para>First you need register an account in the slapos.org (refer to <xref linkend="ch_register_slapos_org"/>)</para></listitem>
<listitem><para>Then install SlapOS slave node in the windows (refer to <xref linkend="ch_install_slapos"/>)</para></listitem>
<listitem><para>Finally enjoy slapos cloud in the Windows</para></listitem>
</itemizedlist>
-->
</chapter> </chapter>
<!--
<chapter id="ch_register_slapos_org"><title>Registering in the slapos.org</title>
<para>Then, we need to register your computer to slapos.org community Cloud. By doing so, we will obtain X509 certificate and key which are later needed for the configuration process.
<itemizedlist>
<listitem><para>Login to www.slapos.org. Go to the "My Space" area and then to the "My Servers" section. Click on the button "New Server". This button will lead you to a page where you can specify the name of your server.</para></listitem>
<listitem><para>Enter a self contained name to identify your server. Consider a name "VIFIB 19 Asus i7 for JB" rather than "My Server". This will help you find your server later on. Click on the "Add" button.</para></listitem>
<listitem><para>X509 key and certificate are generated. Certificates are not stored by slapos.org server. They will be lost if you do not save them : Do not close this web page yet as we are going to store the key and certificate in files in next step. </para>
<para>You can create 2 new files named as computer.key and computer.crt by Notepad or any editor your prefer, and save the content of certificate and key into both of files respectively.</para></listitem>
</itemizedlist>
</para>
<para>Refer to <ulink url="http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/developer-Running.SlapOS.on.your.computer"></ulink> in the section VIFIB Registration.</para>
</chapter>
-->
<chapter id="ch_install_slapos"><title>Installing SlapOS node in the Windows</title> <chapter id="ch_install_slapos"><title>Installing SlapOS node in the Windows</title>
<para>At first, we need to sign up in VIFIB community Cloud by clicking here <ulink url="https://www.slapos.org/login_form"/></para> <para>At first, we need to sign up in VIFIB community Cloud by clicking here <ulink url="https://www.slapos.org/login_form"/></para>
<para>Then download the latest slapos windows installer from <ulink url="http://www.erp5.org/dists/installer"></ulink>, the filename of windows installer look like slapos-XXX-windows-x86-all-in-one.exe or slapos-XXX-windows.exe, XXX stands for version-release information. The all-in-one installer include all the files required by slapos node, so it can run in the computer which doesn't access internat; the later will download most of packages from internet and build, so it need more time than all-in-one installer. It's recommanded to use the former installer in case of slow or unstable internet even if the size of all-in-one installer is more than 100MB, compare of the latter which size is about 2MB.</para> <para>Then download the latest slapos windows installer from <ulink url="http://www.erp5.org/dists/installer"></ulink>, the filename of windows installer look like slapos-XXX-windows-x86-all-in-one.exe or slapos-XXX-windows.exe, XXX stands for version-release information. The all-in-one installer include all the files required by slapos node, so it can run in the computer which doesn't access internat; the later will download most of packages from internet and build, so it need more time than all-in-one installer. It's recommanded to use the former installer in case of slow or unstable internet even if the size of all-in-one installer is more than 100MB, compare of the latter which size is about 2MB.</para>
<para>Double click the installer, click Next, Next ...</para> <para>Double click the installer, click Next, Next ...
<note><para>If the current user isn't Administrator, you need run it as Administrator. Right click the installer, then click Run As Administrator.</para></note>
</para>
<para>At the final wizard page, click Install.</para> <para>At the final wizard page, click Install.</para>
<para>Waiting for everything done.</para> <para>Waiting for everything done.</para>
<para>If you'd like to install slapos node from sources, refer to the chapter <xref linkend="ch_generate_window_installer"/>.</para> <para>If you prefer to install slapos node from sources, refer to the chapter <xref linkend="ch_generate_window_installer"/>.</para>
</chapter> </chapter>
<chapter><title>Using Slapos in the Windows</title> <chapter><title>Using Slapos in the Windows</title>
<para>After SlapOS has been installed successfully, you will find program group "SlapOS" which include the following entries: <para>After SlapOS has been installed successfully, you will find program group "SlapOS" which include the following entries:
<itemizedlist> <itemizedlist>
<listitem><para>Configure SlapOS</para></listitem>
<listitem><para>SlapOS Node</para></listitem>
<listitem><para>SlapOS Desktop</para></listitem> <listitem><para>SlapOS Desktop</para></listitem>
<listitem><para>Node Runner</para></listitem> <listitem><para>Node Runner</para></listitem>
<listitem><para>SlapOS Node</para></listitem>
<listitem><para>Command Console</para></listitem> <listitem><para>Command Console</para></listitem>
<listitem><para>Configure SlapOS</para></listitem>
<listitem><para>User Guide</para></listitem> <listitem><para>User Guide</para></listitem>
</itemizedlist> </itemizedlist>
</para> </para>
<section><title>Configure SlapOS</title>
<para>It used to generate all the configure files required by slapos slave node, you can run it anytime when you need change the configure of your slapos slave node.</para>
<para>Go to slapos.org (or any other SlapOS Master), register if not already done, go to My Account and request an SSL certificate:
<itemizedlist>
<listitem><para>Copy the certificate in a file, save it in C:/slapos/cygwin/certificate</para></listitem>
<listitem><para>Copy the key in a file, save it in C:/slapos/cygwin/key</para></listitem>
</itemizedlist>
You can save them anywhere, but it's better to save them in the path C:/slapos/cygwin which is your slapos installed, because it's the default path in the slapos configure script. More information refer to <ulink url="http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/developer-Installing.SlapOS.Client"></ulink></para>
<para>Then register your computer to slapos.org community Cloud. By doing so, we will obtain X509 certificate and key which are later needed for the configuration process.
<itemizedlist>
<listitem><para>Login to www.slapos.org. Go to the "My Space" area and then to the "My Servers" section. Click on the button "New Server". This button will lead you to a page where you can specify the name of your server.</para></listitem>
<listitem><para>Enter a self contained name to identify your server. Consider a name "VIFIB 19 Asus i7 for JB" rather than "My Server". This will help you find your server later on. Click on the "Add" button.</para></listitem>
<listitem><para>X509 key and certificate are generated. Certificates are not stored by slapos.org server. They will be lost if you do not save them : Do not close this web page yet as we are going to store the key and certificate in files in next step. </para></listitem>
<listitem><para>Copy the certificate in a file, save it in C:/slapos/cygwin/computer.crt</para></listitem>
<listitem><para>Copy the key in a file, save it in C:/slapos/cygwin/computer.key</para></listitem>
</itemizedlist>
More information refer to <ulink url="http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/developer-Running.SlapOS.on.your.computer"></ulink> in the section VIFIB Registration.</para>
<para>Now it's time to run Configure SlapOS, click Start -> SlapOS -> Configure SlapOS, if the current user isn't Administrator, Right click Configure SlapOS, then Run As Administrator.</para>
<para>Or you can run configure script in the command line, first click Start -> SlapOS -> Command Console, if the current user isn't Administrator, Right click Command Console, then Run As Administrator, then in the command line:
<programlisting>
/etc/opt/slapos/scripts/slapos-configure.sh
</programlisting>
The configure script will guide you to configure slapos slave node, as the prompt:
<itemizedlist>
<listitem><para>Type computer certificate filename, if it's stored in the default path as above, type Enter directly</para></listitem>
<listitem><para>Type computer key filename, if it's stored in the default path as above, type Enter directly</para></listitem>
<listitem><para>Type client certificate filename, if it's stored in the default path as above, type Enter directly</para></listitem>
<listitem><para>Type client key filename, if it's stored in the default path as above, type Enter directly</para></listitem>
</itemizedlist>
Be sure the configure scrip report successfully, otherwise fix the problem and run it again. You can run Slapos Configure at anytime, and netx time you needn't input anything, configure scripts just checks all then configuration and update the configure files.
</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>
<para>Click Start -> SlapOS -> SlapOS Node, if the current user isn't Administrator, Right click SlapOS Node, then Run As Administrator.</para>
<para>Be sure the scrip reports successfully, otherwise fix the problem and run it again.</para>
</section>
<section><title>SlapOS Desktop</title> <section><title>SlapOS Desktop</title>
<para>This is used by slapos client, now it's connected to <ulink url="https://www.slapos.org"/>. Logon and enjoy the journey in the SlapOS Cloud world.</para> <para>This is used by slapos client, now it's connected to <ulink url="https://www.slapos.org"/>. Logon and enjoy the journey in the SlapOS Cloud world.</para>
</section> </section>
<section><title>Node Runner</title> <section><title>Node Runner</title>
<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>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>After installing slapos, Node Runner isn't available. You need run Configure SlapOS first. After that, Node Runner would be available.</para>
<para>Refer to <ulink url="http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/developer-Howto.Use.SlapOS.Web.Runner.html5"/></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>
<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> <section><title>Command Console</title>
<para>It will open a terminal, here you can run most of slapos command, <para>It will open a terminal, here you can run most of slapos command, for examples,
<programlisting> <programlisting>
cd /opt/slapos /opt/slapos/bin/slapos node foramt -cv --now
ls bin /opt/slapos/bin/slapos supply slaprunner COMP-1658
bang slapconsole slapgrid-sr slapos /opt/slapos/bin/slapos request "Jondy Web Runner In Windows 7" slaprunner --node computer_guid=COMP-1658
buildout slapformat slapgrid-supervisorctl slapos-watchdog /opt/slapos/bin/slapos node software
generate-signature-key slapgrid slapgrid-supervisord slapproxy /opt/slapos/bin/slapos node instance
py slapgrid-cp slapgrid-ur slapproxy-query /opt/slapos/bin/slapos node status
</programlisting> </programlisting>
</para> </para>
<para>Refer to <ulink url="http://git.erp5.org/gitweb/slapos.core.git/blob/HEAD:/documentation/source/slapos.usage.rst?js=1"/></para> <para>For more information, refer to <ulink url="http://git.erp5.org/gitweb/slapos.core.git/blob/HEAD:/documentation/source/slapos.usage.rst?js=1"/></para>
</section>
<section><title>Configure SlapOS</title>
<para>It used to generate all the configure files required by slapos slave node, it will be called when first run slapos. And you can run it anytime when you need change the configure of your slapos slave node.</para>
</section> </section>
<section><title>User Guide</title> <section><title>User Guide</title>
<para>It just showes this documnet in the web browser.</para> <para>It just showes this documnet in the web browser.</para>
</section> </section>
...@@ -190,15 +207,17 @@ Refer to: http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/develope ...@@ -190,15 +207,17 @@ Refer to: http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/develope
<para>Or you can install cygwin by command console, first you need download setup.exe from cygwin.com, save to D:\temp\setup.exe or somewhere else. <para>Or you can install cygwin by command console, first you need download setup.exe from cygwin.com, save to D:\temp\setup.exe or somewhere else.
<itemizedlist> <itemizedlist>
<listitem><para>In the Windows destktop, Click Start</para></listitem> <listitem><para>In the Windows destktop, Click Start</para></listitem>
<listitem><para>Click Run, type command: 'cmd', click OK to enter windows console</para></listitem> <listitem><para>Click Run, type command: 'cmd', click OK to enter windows console. Be sure you start 'cmd' as Administrator:</para></listitem>
<listitem><para>Type the following commands:<programlisting> <listitem><para>Type the following commands:<programlisting>
D: D:
MD slapos MD slapos
CD 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 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
REM If you require docbook-utils indeed, uncomment the next line (remove REM). Refer to <xref linkend="package-docbook-utils"/> to know what about docbook-utils.
REM SET PACKAGES=%PACKAGES% -P docbook-utils
MOVE d:\temp\setup.exe .\ 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 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. -P docbook-utils</para></listitem> </programlisting>Waiting for the installer finished.</para></listitem>
</itemizedlist> </itemizedlist>
A cygwin icon will be added in the windows desktop, click it to enter cygwin box, then run the following commands: A cygwin icon will be added in the windows desktop, click it to enter cygwin box, then run the following commands:
<!-- <!--
...@@ -245,7 +264,7 @@ Then restart cygwin command box. ...@@ -245,7 +264,7 @@ Then restart cygwin command box.
mkdir -p /cygdrive/d/slapos/opt mkdir -p /cygdrive/d/slapos/opt
cd / cd /
ln -s /cygdrive/d/slapos/opt ln -s /cygdrive/d/slapos/opt
mkdir -p /opt/slapos mkdir -p /opt/slapos/log
mkdir -p /opt/download-cache mkdir -p /opt/download-cache
cd /opt/slapos cd /opt/slapos
echo "[buildout] echo "[buildout]
...@@ -323,11 +342,12 @@ git clone -b cygwin http://git.erp5.org/repos/re6stnet.git ...@@ -323,11 +342,12 @@ git clone -b cygwin http://git.erp5.org/repos/re6stnet.git
cd re6stnet cd re6stnet
python setup.py sdist python setup.py sdist
</programlisting> </programlisting>
Get the icons and openvpn drivers Get the icons and openvpn drivers, if you use 32-bit windows, uncomment the comment line to download openvpn-driver-i386.tar.gz other than openvpn-driver-x86_64.tar.gz:
<programlisting> <programlisting>
cd /opt cd /opt
wget http://www.dashingsoft.com/products/slapos/images.tar.gz wget http://www.dashingsoft.com/products/slapos/images.tar.gz
wget http://www.dashingsoft.com/products/slapos/openvpn-driver.tar.gz wget http://www.dashingsoft.com/products/slapos/openvpn-driver-x86_64.tar.gz -O openvpn-driver.tar.gz
# wget http://www.dashingsoft.com/products/slapos/openvpn-driver-i386.tar.gz -O openvpn-driver.tar.gz
tar xzf images.tar.gz --no-same-owner tar xzf images.tar.gz --no-same-owner
tar xzf openvpn-driver.tar.gz --no-same-owner tar xzf openvpn-driver.tar.gz --no-same-owner
</programlisting> </programlisting>
...@@ -406,46 +426,6 @@ $ bin/slapformat -c - -now /etc/slapos/slapos.cfg ...@@ -406,46 +426,6 @@ $ bin/slapformat -c - -now /etc/slapos/slapos.cfg
</section> </section>
</chapter> </chapter>
<!--
A.
To install the IPv6 protocol for Windows XP with SP2 or later, do the following:
Log on to the computer with a user account that has privileges to change network configuration.
Click Start, click Control Panel, and then double-click Network Connections.
Right-click any local area connection, and then click Properties.
Click Install.
In the Select Network Component Type dialog box, click Protocol, and then click Add.
In the Select Network Protocol dialog box, click Microsoft TCP/IP version 6, and then click OK.
Click Close to save changes to your network connection.
Alternately, from the Windows XP desktop, click Start, point to Programs, point to Accessories, and then click Command Prompt. At the command prompt, type netsh interface ipv6 install.
For the IPv6 protocol for Windows XP with SP1, do the following:
Log on to the computer with a user account that has privileges to change network configuration.
Click Start, click Control Panel, and then double-click Network Connections.
Right-click any local area connection, and then click Properties.
Click Install.
In the Select Network Component Type dialog box, click Protocol, and then click Add.
In the Select Network Protocol dialog box, click Microsoft IPv6 Developer Edition, and then click OK.
Click Close to save changes to your network connection.
Alternately, from the Windows XP desktop, click Start, point to Programs, point to Accessories, and then click Command Prompt. At the command prompt, type netsh interface ipv6 install.
To install the IPv6 protocol for Windows XP with no service packs installed:
Log on to the computer running Windows XP with a user account that has privileges to change network configuration.
Open a command prompt. From the Windows XP desktop, click Start, point to Programs, point to Accessories, and then click Command Prompt.
At the command prompt, type ipv6 install.
Regardless of the version of Windows XP, to use RPC applications over IPv6, you must first restart the computer.
Q. How can I tell if the IPv6 protocol is installed for Windows XP with no service packs installed? It does not appear in the list of protocols in Network Connections. A. The installation of the IPv6 Protocol for Windows XP with no service packs installed does not use the standard procedure for protocol installation in the Network Connections folder. Therefore, it is not visible as an installed protocol. To determine whether IPv6 is installed, type ipv6 if at a command prompt. If IPv6 is installed, you will see a display of your IPv6 interfaces and their configuration. Otherwise, the Ipv6.exe tool will indicate that IPv6 is not installed.
-->
<appendix id="appendix_cygwin_packages"><title>Cygwin Required Packages List</title> <appendix id="appendix_cygwin_packages"><title>Cygwin Required Packages List</title>
<para>The following packages are requied by SlapOS Node <para>The following packages are requied by SlapOS Node
<itemizedlist> <itemizedlist>
...@@ -458,6 +438,7 @@ Q. How can I tell if the IPv6 protocol is installed for Windows XP with no servi ...@@ -458,6 +438,7 @@ Q. How can I tell if the IPv6 protocol is installed for Windows XP with no servi
<listitem><para>Utils/bzip2<superscript></superscript></para></listitem> <listitem><para>Utils/bzip2<superscript></superscript></para></listitem>
<listitem><para>Net/ca-certificates</para></listitem> <listitem><para>Net/ca-certificates</para></listitem>
<listitem><para>Admin/cron</para></listitem> <listitem><para>Admin/cron</para></listitem>
<listitem><para>Net/curl</para></listitem>
<listitem><para>Devel/cygport</para></listitem> <listitem><para>Devel/cygport</para></listitem>
<listitem><para>Admin/cygrunsrv</para></listitem> <listitem><para>Admin/cygrunsrv</para></listitem>
<listitem><para>Utils/file<superscript>*</superscript></para></listitem> <listitem><para>Utils/file<superscript>*</superscript></para></listitem>
...@@ -504,7 +485,10 @@ Q. How can I tell if the IPv6 protocol is installed for Windows XP with no servi ...@@ -504,7 +485,10 @@ Q. How can I tell if the IPv6 protocol is installed for Windows XP with no servi
<listitem><para>Editor/vim</para></listitem> <listitem><para>Editor/vim</para></listitem>
<listitem><para>Web/wget</para></listitem> <listitem><para>Web/wget</para></listitem>
</itemizedlist> </itemizedlist>
<note id="package-docbook-utils"><para>
There is another package: Text/docbook-utils, it only used to generate user-guide.html from source file. But this package will increase required disk size remarkable, because many dependent packages are installed by Cygwin, so it recommand not to check this package when building slapos source or the installer.</para></note>
</para> </para>
<!--
<para> <para>
The following packages are requied by re6stnet The following packages are requied by re6stnet
<itemizedlist> <itemizedlist>
...@@ -518,9 +502,6 @@ The following packages are requied by re6stnet ...@@ -518,9 +502,6 @@ The following packages are requied by re6stnet
<listitem><para>Web/apache2-devel</para></listitem> <listitem><para>Web/apache2-devel</para></listitem>
<listitem><para>apache2-php<superscript>#</superscript></para></listitem> <listitem><para>apache2-php<superscript>#</superscript></para></listitem>
<listitem><para>Devel/cmake</para></listitem> <listitem><para>Devel/cmake</para></listitem>
<listitem><para>Admin/cron</para></listitem>
<listitem><para>Admin/cygrunsrv</para></listitem>
<listitem><para>Net/curl</para></listitem>
<listitem><para>Libs/libbz2-devel</para></listitem> <listitem><para>Libs/libbz2-devel</para></listitem>
<listitem><para>Net/libcurl-devel</para></listitem> <listitem><para>Net/libcurl-devel</para></listitem>
<listitem><para>Text/libenchant-devel</para></listitem> <listitem><para>Text/libenchant-devel</para></listitem>
...@@ -541,6 +522,7 @@ The following packages are requied by re6stnet ...@@ -541,6 +522,7 @@ The following packages are requied by re6stnet
</itemizedlist> </itemizedlist>
'*' means it's default package of cygwin, '#' means it need to build by myself, '?' means maybe it's not required. '*' means it's default package of cygwin, '#' means it need to build by myself, '?' means maybe it's not required.
</para> </para>
-->
</appendix> </appendix>
</book> </book>
...@@ -6,47 +6,57 @@ ...@@ -6,47 +6,57 @@
# #
# It will do: # It will do:
# #
# 1. Set uid of Adminstrator to 0, and create root account # * Set uid of Adminstrator to 0, and create root account
# #
# 2. Create .minttyrc and cygtty.bat, which used to start comand console # * Create .minttyrc and cygtty.bat, which used to start comand console
# #
# 3. Configure cygserver # * Create autorebase.bat, it used to fix cygwin dll problem
# #
# 4. Configure syslog-ng # * Change readme.txt to dos format
# #
password_filename=/etc/passwd
if [[ ! "$(whoami)" == "Administrator" ]] ; then echo Checking passwd file ...
exit 1 if [[ ! -f $password_filename ]] ; then
echo No passwd file found.
mkpasswd > $password_filename
echo Generate passwd file OK.
else
echo Check passwd file OK.
fi fi
if [[ ! -f /etc/passwd ]] ; then echo Checking group file ...
mkpasswd > /etc/passwd if [[ ! -f /etc/group ]] ; then
echo No group file found.
mkgroup > /etc/group
echo Generate group file OK.
else else
cp /etc/passwd /etc/passwd.orig echo Check group file OK.
fi fi
# sed -i -e "s/Administrator:unused:500:/Administrator:unused:0:/g" /etc/passwd # grep -q "^root:" $password_filename
grep -q "^root:" /etc/passwd # if (( $? != 0 )) ; then
if (( $? != 0 )) ; then # myaccount=$(grep "^Administrator:" $password_filename | \
myaccount=$(grep "^Administrator:" /etc/passwd | \ # sed -e "s/Administrator:unused:500:/root:unused:0:/g")
sed -e "s/Administrator:unused:500:/root:unused:0:/g") # if [[ "${myaccount:0:4}" == root ]] ; then
if [[ "${myaccount:0:4}" == root ]] ; then # echo $myaccount >> $password_filename
echo $myaccount >> /etc/passwd # else
else # exit 1
exit 1 # fi
fi # fi
fi
if [[ ! -f ~/.minttyrc ]] ; then if [[ ! -f ~/.minttyrc ]] ; then
echo Creating ~/.minttyrc
cat <<EOF > ~/.minttyrc cat <<EOF > ~/.minttyrc
BoldAsFont=no BoldAsFont=no
Font=Courier New Font=Courier New
FontHeight=16 FontHeight=16
Scrollbar=none Scrollbar=none
EOF EOF
echo File ~/.minttyrc created
fi fi
if [[ ! -f /cygtty.bat ]] ; then if [[ ! -f /cygtty.bat ]] ; then
echo Creating /cygtty.bat
cyghome=$(cygpath -w /) cyghome=$(cygpath -w /)
cat <<EOF > /cygtty.bat cat <<EOF > /cygtty.bat
@echo off @echo off
...@@ -57,24 +67,37 @@ chdir ${cyghome}\\bin ...@@ -57,24 +67,37 @@ chdir ${cyghome}\\bin
start mintty.exe -i /Cygwin-Terminal.ico - start mintty.exe -i /Cygwin-Terminal.ico -
EOF EOF
chmod +x /cygtty.bat chmod +x /cygtty.bat
echo File /cygtty.bat created.
fi fi
# Configure cygserver
/usr/bin/cygserver-config --yes
# Configure syslog-ng
/usr/bin/syslog-ng-config --yes
# Copy rebaseall.bat to / # Copy rebaseall.bat to /
if [[ -f /etc/postinstall/autorebase.bat.done ]] ; then if [[ ! -f /autorebase.bat ]] ; then
cp /etc/postinstall/autorebase.bat.done /autorebase.bat echo Create /autorebase.bat
copy <<EOF > /autorebase.bat
@echo off
rem Postinstall scripts are always started from the Cygwin root dir
rem so we can just call dash from here
path .\bin;%path%
dash /bin/rebaseall -p
EOF
chmod +x /autorebase.bat
echo /autorebase.bat created.
fi fi
# Change format of readme.txt # Change format of readme.txt
readme_filepath=$(cygpath -m /)/.. readme_filepath=$(cygpath -m /)/..
if [[ -f $readme_filepath/Readme.txt ]] ; then if [[ -f $readme_filepath/Readme.txt ]] ; then
unix2dos $readme_filepath/Readme.txt unix2dos $readme_filepath/Readme.txt
echo Change readme.txt to dos format OK.
fi fi
# Remove cygwin services to be sure these services will be configured
# in this cygwin enviroments when there are many cygwin instances
# installed in this computer.
for x in $(cygrunsrv --list) ; do
echo Removing cygservice $x
cygrunsrv -R $x
done
exit 0 exit 0
#! /bin/bash #! /bin/bash
# #
# When uninstall slapos, it will be called by uninstaller. # When uninstall slapos, it will be called by uninstaller. Root right
# required to run this script.
# #
# /bin/bash/ --login -i pre-uninstall.sh # /bin/bash/ --login -i pre-uninstall.sh
# #
...@@ -8,24 +9,15 @@ ...@@ -8,24 +9,15 @@
# #
# 1. Remove virtual netcards installed by re6stnet # 1. Remove virtual netcards installed by re6stnet
# #
# 2. Remove service cygserver and syslog-ng # 2. Remove service cron, cygserver and syslog-ng
# #
if [[ ! "$(whoami)" == "Administrator" ]] ; then
exit 1
fi
#
# Remove slapos-init script when windows startup
#
run_key='\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
slapos_run_entry=SlapOS-Node
regtool -q unset "$run_key\\$slapos_run_entry"
# #
# Remove virtual netcard installed by re6stnet # Remove virtual netcard installed by re6stnet
# #
for ifname in $(netsh interface show interface | gawk '{ print $3 }') ; do for ifname in $(netsh interface show interface | gawk '{ print $3 }') ; do
if [[ ("$ifname" == re6stnet*) && ("$ifname" != "re6stnet-lo") ]] ; then if [[ ("$ifname" == re6stnet*) && ("$ifname" != "re6stnet-lo") ]] ; then
echo Removing network connection: $ifname
ip vpntap del dev $ifname mode true ip vpntap del dev $ifname mode true
fi fi
done done
...@@ -33,8 +25,10 @@ done ...@@ -33,8 +25,10 @@ done
# #
# Remove services installed by cygwin # Remove services installed by cygwin
# #
cygrunsrv.exe --remove syslog-ng for x in $(cygrunsrv --list) ; do
cygrunsrv.exe --remove cygserver echo Removing cygservice $x
cygrunsrv -R $x
done
exit 0 exit 0
...@@ -64,6 +64,7 @@ Source: "opt\git\slapos.package\windows\scripts\post-install.sh"; DestDir: "{app ...@@ -64,6 +64,7 @@ Source: "opt\git\slapos.package\windows\scripts\post-install.sh"; DestDir: "{app
Source: "opt\git\slapos.package\windows\scripts\build-slapos.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"; Source: "opt\git\slapos.package\windows\scripts\slapos-configure.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\slapos-node-runner.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts"; Source: "opt\git\slapos.package\windows\scripts\slapos-node-runner.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\slap-runner.html"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\pre-uninstall.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts"; Source: "opt\git\slapos.package\windows\scripts\pre-uninstall.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\docs\using-slapos-in-windows.html"; DestDir: "{app}"; DestName: "user-guide.html"; Source: "opt\git\slapos.package\windows\docs\using-slapos-in-windows.html"; DestDir: "{app}"; DestName: "user-guide.html";
...@@ -71,18 +72,18 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D ...@@ -71,18 +72,18 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D
[Icons] [Icons]
Name: "{commondesktop}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico"; Name: "{commondesktop}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.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 -h never -t ""Configure SlapOS Node"" /etc/slapos/scripts/slapos-client-config.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\Node Runner"; Filename: "http://{app}\cygwin\etc\slapos\scripts\slap-runner.html"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\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 -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}\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 -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}"; Name: "{group}\Uninstall SlapOS"; Filename: "{uninstallexe}";
Name: "{group}\User Guide"; Filename: "{app}\user-guide.html";
[Run] [Run]
Filename: "{app}\setup-cygwin.bat"; Parameters: """{app}"""; StatusMsg: "Installing Cygwin..."; Flags: runhidden; 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; 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;
Filename: "{app}\cygwin\autorebase.bat"; WorkingDir: "{app}\cygwin"; Flags: skipifdoesntexist runhidden; Filename: "{app}\cygwin\autorebase.bat"; WorkingDir: "{app}\cygwin"; Flags: skipifdoesntexist;
[UninstallRun] [UninstallRun]
Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/pre-uninstall.sh"; WorkingDir: "{app}\cygwin\bin"; Flags: skipifdoesntexist runhidden; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/pre-uninstall.sh"; WorkingDir: "{app}\cygwin\bin"; Flags: skipifdoesntexist runhidden;
......
#! /bin/bash #! /bin/bash
# #
# Configure slapos node, it could be run at anytime to check the # This script need root rights. Before run it, make sure you have root
# configure of slapos node. The main functions: # right.
# #
# * Install msloop network adapter, named to re6stnet-lo # It used to configure slapos node, it could be run at anytime to
# check the configure of slapos node. The main functions:
# #
# It'll used as main interface for slapos and re6stnet # * Install msloop network adapter, named to re6stnet-lo
# #
# * ipv6: Ipv6 configure # * ipv6: Ipv6 configure
# #
...@@ -15,14 +16,21 @@ ...@@ -15,14 +16,21 @@
# #
# * client: Create client configure file by parameters ca/key # * client: Create client configure file by parameters ca/key
# #
# * cron: start/stop cron configure. # * cron: create cron configure file
# #
# Usage: # Usage:
# #
# ./slapos-node-config [ * | ipv6 | re6stnet | node | client | cron ] # ./slapos-configure
# #
export PATH=/usr/local/bin:/usr/bin:$PATH export PATH=/usr/local/bin:/usr/bin:$PATH
grep -q "export CYGWIN=server" ~/.bash_profie || echo "export CYGWIN=server" >> ~/.bash_profile
grep -q "export CYGWIN=server" ~/.profie || echo "export CYGWIN=server" >> ~/.profile
#-------------------------------------------------
# Common functions
#-------------------------------------------------
# #
# Return connection name by line, and replace space with '%' # Return connection name by line, and replace space with '%'
# #
...@@ -76,10 +84,15 @@ function reset_connection() ...@@ -76,10 +84,15 @@ function reset_connection()
function connection2guid() function connection2guid()
{ {
ifname=${1-re6stnet-lo} ifname=${1-re6stnet-lo}
# This command doesn't work in the Windows 7/8, maybe Vista #
# This command doesn't work in the Windows 7, Window 8, maybe
# Vista. Because no guid information in these platforms.
#
# netsh interface ipv6 show interface $ifname | \ # netsh interface ipv6 show interface $ifname | \
# grep "^GUID\s*:" | \ # grep "^GUID\s*:" | \
# sed -e "s/^GUID\s*:\s*//" # sed -e "s/^GUID\s*:\s*//"
#
# So we use getmac to repleace it:
getmac /fo list /v | grep -A3 "^Connection Name: *$ifname\$" \ getmac /fo list /v | grep -A3 "^Connection Name: *$ifname\$" \
| grep "^Transport Name:" | sed -e "s/^.*Tcpip_//g" | grep "^Transport Name:" | sed -e "s/^.*Tcpip_//g"
} }
...@@ -98,7 +111,7 @@ function show_error_exit() ...@@ -98,7 +111,7 @@ function show_error_exit()
# #
# Query the parameter, usage: # Query the parameter, usage:
# #
# query_parameter Actual Excpeted Message # query_parameter ACTUAL EXCPETED MESSAGE
# #
function query_parameter() function query_parameter()
{ {
...@@ -119,23 +132,78 @@ function query_parameter() ...@@ -119,23 +132,78 @@ function query_parameter()
return 0 return 0
} }
#-------------------------------------------------
# Constants
#-------------------------------------------------
slapos_client_home=~/.slapos slapos_client_home=~/.slapos
client_configure_file=$slapos_client_home/slapos.cfg client_configure_file=$slapos_client_home/slapos.cfg
client_certificate_file=$slapos_client_home/certificate client_certificate_file=$slapos_client_home/certificate
client_key_file=$slapos_client_home/key client_key_file=$slapos_client_home/key
client_template_file=/etc/slapos/slapos-client.cfg.example client_template_file=/etc/slapos/slapos-client.cfg.example
url_client_template_file=http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/slapos-client.cfg.example
node_certificate_file=/etc/opt/slapos/ssl/computer.crt node_certificate_file=/etc/opt/slapos/ssl/computer.crt
node_key_file=/etc/opt/slapos/ssl/computer.key node_key_file=/etc/opt/slapos/ssl/computer.key
node_config_file=/etc/opt/slapos/slapos.cfg node_config_file=/etc/opt/slapos/slapos.cfg
node_template_file=/etc/slapos/slapos.cfg.example node_template_file=/etc/slapos/slapos.cfg.example
run_key='\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run' url_node_template_file=http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/slapos.cfg.example
slapos_run_entry=SlapOS-Node
slapos_ifname=re6stnet-lo slapos_ifname=re6stnet-lo
# Hope it will not confilct with original network in the local machine
ipv4_local_network=10.201.67.0/24
slapos_runner_file=/etc/slapos/scripts/slap-runner.html
slaprunner_cfg=http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-0:/software/slaprunner/software.cfg
slaprunner_title="Node Runner"
#-------------------------------------------------
# Create paths
#-------------------------------------------------
mkdir -p /etc/opt/slapos/ssl/partition_pki mkdir -p /etc/opt/slapos/ssl/partition_pki
mkdir -p $slapos_client_home mkdir -p $slapos_client_home
#-------------------------------------------------
# Configure cygwin server services
#-------------------------------------------------
echo Checking cygserver service ...
cygrunsrv --query cygserver > /dev/null
if (( $? )) ; then
echo Run cygserver-config ...
/usr/bin/cygserver-config --yes || \
show_error_exit "Failed to run cygserver-config"
echo OK.
else
echo The cygserver service has been installed.
fi
echo Checking syslog-ng service ...
cygrunsrv --query syslog-ng > /dev/null
if (( $? )) ; then
echo Run syslog-ng-config ...
/usr/bin/syslog-ng-config --yes || \
show_error_exit "Failed to run syslog-ng-config"
echo OK.
else
echo The syslog-ng service has been installed.
fi
echo Checking cron service ...
cygrunsrv --query cron > /dev/null
if (( $? )) ; then
echo Run cron-config ...
/usr/bin/cron-config --yes || \
show_error_exit "Failed to run cron-config"
echo OK.
else
echo The cron service has been installed.
fi
#-------------------------------------------------
# Configure slapos network
#-------------------------------------------------
# #
# Add msloop network adapter, ane name it as "re6stnet-lo" # Add msloop network adapter, ane name it as "re6stnet-lo"
# #
...@@ -150,131 +218,173 @@ if [[ ! " $original_connections " == *[\ ]$slapos_ifname[\ ]* ]] ; then ...@@ -150,131 +218,173 @@ if [[ ! " $original_connections " == *[\ ]$slapos_ifname[\ ]* ]] ; then
echo echo
netsh interface set interface name="$connection_name" newname="$slapos_ifname" netsh interface set interface name="$connection_name" newname="$slapos_ifname"
fi fi
reset_connection $slapos_ifname #ip -4 addr add $ipv4_local_network dev $slapos_ifname
# reset_connection $slapos_ifname
echo SlapOS network adapter OK. echo SlapOS network adapter OK.
echo Slapos ipv4_local_network is $ipv4_local_network
# #-------------------------------------------------
# Generate Node Configure file # Generate slapos node configure file
# #-------------------------------------------------
echo
echo Before continue to configure, make sure you have register your server to
echo slapos.org community Cloud, and have obtained X509 certificate and key
echo which are needed for the following configuration process.
echo
echo Refer to http://community.slapos.org/wiki/osoe-Lecture.SlapOS.Extended/developer-Installing.SlapOS.Slave.Node.Source
echo
echo Checking computer certificate file ...
if [[ ! -f $node_certificate_file ]] ; then if [[ ! -f $node_certificate_file ]] ; then
read -p "Where is computer certificate file: " certificate_file read -p "Where is computer certificate file (/computer.crt): " certificate_file
[[ X$certificate_file == X ]] && certificate_file=/computer.crt
[[ ! -f "$certificate_file" ]] && \ [[ ! -f "$certificate_file" ]] && \
show_error_exit "Certificate file $certificate_file doesn't exists." show_error_exit "Certificate file $certificate_file doesn't exists."
echo "Copy certificate from $certificate_file to $node_certificate_file" echo "Copy certificate from $certificate_file to $node_certificate_file"
certificate_file=$(cygpath -u $certificate_file) certificate_file=$(cygpath -u $certificate_file)
cp $certificate_file $node_certificate_file cp $certificate_file $node_certificate_file
else
echo Found computer certificate file: $node_certificate_file
fi fi
openssl x509 -noout -in $node_certificate_file || \
show_error_exit "Invalid computer certificate: $node_certificate_file."
echo Check computer certificate OK.
echo Checking computer guid ...
computer_id=$(grep CN=COMP $node_certificate_file | sed -e "s/^.*, CN=//g" | sed -e "s%/emailAddress.*\$%%g") computer_id=$(grep CN=COMP $node_certificate_file | sed -e "s/^.*, CN=//g" | sed -e "s%/emailAddress.*\$%%g")
[[ "$computer_id" == COMP-+([0-9]) ]] || \ [[ "$computer_id" == COMP-+([0-9]) ]] || \
show_error_exit "Invalid computer id specified." show_error_exit "Invalid computer id specified."
echo Computer GUID is: $computer_id echo Computer GUID is: $computer_id
echo Checking computer key file ...
if [[ ! -f $node_key_file ]] ; then if [[ ! -f $node_key_file ]] ; then
read -p "Where is computer key file: " key_file read -p "Where is computer key file (/computer.key): " key_file
[[ X$key_file == X ]] && key_file=/computer.key
[[ ! -f "$key_file" ]] && \ [[ ! -f "$key_file" ]] && \
show_error_exit "Key file $key_file doesn't exists." show_error_exit "Key file $key_file doesn't exists."
echo "Copy key from $key_file to $node_key_file" echo "Copy key from $key_file to $node_key_file"
key_file=$(cygpath -u $key_file) key_file=$(cygpath -u $key_file)
cp $key_file $node_key_file cp $key_file $node_key_file
else
echo Found computer key file: $node_key_file
fi fi
openssl rsa -noout -in $node_key_file -check || \
# Hope it will not confilct with original network in the local machine show_error_exit "Invalid computer key: $node_key_file."
ipv4_local_network=10.201.67.0/24 echo Check computer key OK.
# Add ipv4 address
ip -4 addr add $ipv4_local_network dev $slapos_ifname
# Create node configure file, replace interface_name with guid of # Create node configure file, replace interface_name with guid of
# re6stnet-lo # re6stnet-lo
echo Checking computer configure file ...
if [[ ! -f $node_config_file ]] ; then if [[ ! -f $node_config_file ]] ; then
[[ -f $node_template_file ]] || \ [[ -f $node_template_file ]] || \
(cd /etc/slapos; wget http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/slapos.cfg.example) || \ (cd /etc/slapos; wget $url_node_template_file -O $node_template_file) || \
show_error_exit "Download slapos.cfg.example failed." show_error_exit "Download slapos.cfg.example failed."
echo "Copy computer configure file from $node_template_file to $node_config_file"
cp $node_template_file $node_config_file cp $node_template_file $node_config_file
fi fi
interface_guid=$(connection2guid $slapos_ifname) interface_guid=$(connection2guid $slapos_ifname) || \
show_error_exit "Failed to get guid of interface: $slapos_ifname."
echo Computer configuration information:
echo interface name: $slapos_ifname
echo GUID: $interface_guid
echo ipv4_local_network: $ipv4_local_network
echo computer_id: $computer_id
# generate /etc/slapos/slapos.cfg # generate /etc/slapos/slapos.cfg
sed -i -e "s%^\\s*interface_name.*$%interface_name = $interface_guid%" \ sed -i -e "s%^\\s*interface_name.*$%interface_name = $interface_guid%" \
-e "s%^#\?\\s*ipv6_interface.*$%# ipv6_interface =%g" \ -e "s%^#\?\\s*ipv6_interface.*$%# ipv6_interface =%g" \
-e "s%^ipv4_local_network.*$%ipv4_local_network = $ipv4_local_network%" \ -e "s%^ipv4_local_network.*$%ipv4_local_network = $ipv4_local_network%" \
-e "s%^computer_id.*$%computer_id = $computer_id%" \ -e "s%^computer_id.*$%computer_id = $computer_id%" \
$node_config_file $node_config_file
echo Check computer configure file OK.
#-------------------------------------------------
# Generate slapos client configure file
#-------------------------------------------------
echo Checking client certificate file ...
if [[ ! -f $client_certificate_file ]] ; then if [[ ! -f $client_certificate_file ]] ; then
read -p "Where is user certificate file: " certificate_file read -p "Where is client certificate file (/certificate): " certificate_file
[[ X$certificate_file == X ]] && certificate_file=/certificate
[[ ! -f "$certificate_file" ]] && \ [[ ! -f "$certificate_file" ]] && \
show_error_exit "Certificate file $certificate_file doesn't exists." show_error_exit "Certificate file $certificate_file doesn't exists."
echo "Copy certificate from $certificate_file to $client_certificate_file" echo "Copy client certificate from $certificate_file to $client_certificate_file"
certificate_file=$(cygpath -u $certificate_file) certificate_file=$(cygpath -u $certificate_file)
cp $certificate_file $client_certificate_file cp $certificate_file $client_certificate_file
fi fi
openssl x509 -noout -in $client_certificate_file || \
show_error_exit "Invalid client certificate: $client_certificate_file."
echo Check client certificate Ok.
echo Checking client key file ...
if [[ ! -f $client_key_file ]] ; then if [[ ! -f $client_key_file ]] ; then
read -p "Where is user key file: " key_file read -p "Where is client key file (/key): " key_file
[[ X$key_file == X ]] && key_file=/key
[[ ! -f "$key_file" ]] && \ [[ ! -f "$key_file" ]] && \
show_error_exit "Key file $key_file doesn't exists." show_error_exit "Key file $key_file doesn't exists."
echo "Copy key from $key_file to $client_key_file" echo "Copy client key from $key_file to $client_key_file"
key_file=$(cygpath -u $key_file) key_file=$(cygpath -u $key_file)
cp $key_file $client_key_file cp $key_file $client_key_file
fi fi
openssl rsa -noout -in $client_key_file -check || \
show_error_exit "Invalid client key: $client_key_file."
echo Checking computer key OK.
echo Checking client configure file ...
if [[ ! -f $client_configure_file ]] ; then if [[ ! -f $client_configure_file ]] ; then
[[ -f $template_configure_file ]] || \ [[ -f $client_template_file ]] || \
(cd /etc/slapos; wget http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/slapos-client.cfg.example) || \ (cd /etc/slapos; wget $url_client_template_file -O $client_template_file) || \
show_error_exit "Download slapos-client.cfg.example failed." show_error_exit "Download slapos-client.cfg.example failed."
cp $template_configure_file $client_configure_file echo "Copy client configure file from $client_template_file to $client_config_file"
cp $client_template_file $client_configure_file
fi fi
echo Client configuration information:
echo client certificate file: $client_certificate_file
echo client key file: $client_key_file
echo
sed -i -e "s%^cert_file.*$%cert_file = $client_certificate_file%" \ sed -i -e "s%^cert_file.*$%cert_file = $client_certificate_file%" \
-e "s%^key_file.*$%key_file = $client_key_file%" \ -e "s%^key_file.*$%key_file = $client_key_file%" \
$client_configure_file $client_configure_file
echo Check client configure file OK.
# #-------------------------------------------------
# Re6stnet # Re6stnet
# #-------------------------------------------------
# Check ipv6, install it if it isn't installed. # Check ipv6, install it if it isn't installed.
netsh interface ipv6 show interface > /dev/null || netsh interface ipv6 install echo Checking ipv6 protocol ...
netsh interface ipv6 show interface > /dev/null || netsh interface ipv6 install || \
show_error_exit "Failed to install ipv6 protocol."
echo IPv6 protocol has been installed.
# miniupnpc is required by re6stnet # miniupnpc is required by re6stnet
echo Checking miniupnpc ...
if [[ ! -d /opt/miniupnpc ]] ; then if [[ ! -d /opt/miniupnpc ]] ; then
if [[ -f /miniupnpc.tar.gz ]] ; then [[ -f /miniupnpc.tar.gz ]] || show_error_exit "No package found: /miniupnpc.tar.gz"
echo "Installing miniupnpc ..." echo "Installing miniupnpc ..."
cd /opt cd /opt
tar xzf /miniupnpc.tar.gz --no-same-owner tar xzf /miniupnpc.tar.gz --no-same-owner
mv $(ls -d miniupnpc-*) miniupnpc mv $(ls -d miniupnpc-*) miniupnpc
cd miniupnpc cd miniupnpc
make make
python setup.py install || echo "Install miniupnpc failed." python setup.py install || show_error_exit "Failed to install miniupnpc."
else echo "Install miniupnpc OK."
echo "No miniupnpc source package found." else
fi echo Check miniupnpc OK.
fi fi
# pyOpenSSL is required by re6stnet # pyOpenSSL is required by re6stnet
echo Checking pyOpenSSL ...
if [[ ! -d /opt/pyOpenSSL ]] ; then if [[ ! -d /opt/pyOpenSSL ]] ; then
if [[ -f /pyOpenSSL.tar.gz ]] ; then [[ -f /pyOpenSSL.tar.gz ]] || show_error_exit "No package found: /pyOpenSSL.tar.gz"
echo "Installing pyOpenSSL ..." echo "Installing pyOpenSSL ..."
cd /opt cd /opt
tar xzf /pyOpenSSL.tar.gz --no-same-owner tar xzf /pyOpenSSL.tar.gz --no-same-owner
mv $(ls -d pyOpenSSL-*) pyOpenSSL mv $(ls -d pyOpenSSL-*) pyOpenSSL
cd pyOpenSSL cd pyOpenSSL
python setup.py install || echo "Install pyOpenSSL failed." python setup.py install || show_error_exit "Failed ot install pyOpenSSL."
fi echo "Install pyOpenSSL OK."
else
echo Check pyOpenSSL OK.
fi fi
# Install re6stnet # Install re6stnet
echo Checking re6stnet ...
if [[ ! -d /opt/re6stnet ]] ; then if [[ ! -d /opt/re6stnet ]] ; then
echo "Installing re6stnet ..." echo "Installing re6stnet ..."
cd /opt cd /opt
...@@ -286,35 +396,133 @@ if [[ ! -d /opt/re6stnet ]] ; then ...@@ -286,35 +396,133 @@ if [[ ! -d /opt/re6stnet ]] ; then
git clone -b cygwin http://git.erp5.org/repos/re6stnet.git git clone -b cygwin http://git.erp5.org/repos/re6stnet.git
fi fi
cd re6stnet cd re6stnet
python setup.py install || echo "Install re6stnet failed." python setup.py install || show_error_exit "Failed to install re6stnet."
echo "Install re6stnet OK."
else
echo Check re6stnet OK.
fi fi
echo Checking re6stent configuration ...
mkdir -p /etc/re6stnet mkdir -p /etc/re6stnet
cd /etc/re6stnet cd /etc/re6stnet
if [[ ! -f re6stnet.conf ]] ; then if [[ ! -f re6stnet.conf ]] ; then
re6st-conf --registry http://re6stnet.nexedi.com/ echo Register to http://re6stnet.nexedi.com ...
# Your subnet: 2001:67c:1254:e:19::/80 (CN=917529/32)
mysubnet=$(re6st-conf --registry http://re6stnet.nexedi.com/ --anonymous | grep "^Your subnet:") \
|| show_error_exit "Register to nexedi re6stnet failed"
echo Register OK.
echo
echo $mysubnet
echo
echo Write subnet information to re6stnet.conf
echo "# $mysubnet" >> re6stnet.conf
echo Write "table 0" to re6stnet.conf
echo "table 0" >> re6stnet.conf
fi fi
[[ ! -f re6stnet.conf ]] && show_error_exit "Register to nexedi re6stnet failed" [[ ! -f re6stnet.conf ]] && \
grep -q "^table " re6stnet.conf || echo "table 0" >> re6stnet.conf show_error_exit "Failed to register to nexedi re6stnet: no /etc/re6stnet/re6stnet.conf found."
grep -q "^table " re6stnet.conf || \
show_error_exit "Error: no parameter 'table 0' found in the /etc/re6stnet/re6stnet.conf"
grep -q "^# Your subnet: " re6stnet.conf || \
show_error_exit "Error: no subnet found in the /etc/re6stnet/re6stnet.conf"
echo Check re6stnet configuration OK.
#-------------------------------------------------
# Create instance of Web Runner
#-------------------------------------------------
grep -q "location.reload" $slapos_runner_file
if (( $? )) ; then
echo
echo Installing Web Runner ...
echo
# re6stnet_ipv6=$(cat /etc/re6stnet/re6stnet.conf | grep "Your subnet" | \
# Create instance of web runner sed -e "s/^.*subnet: //g" -e "s/ (CN.*\$//g")1
# echo "Re6stnet address in this computer: $re6stnet_ipv6"
slaprunner_cfg=http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-0:/software/slaprunner/software.cfg netsh interface ipv6 show addr $slapos_ifname | grep -q $re6stnet_ipv6 || \
while true ; do netsh interface ipv6 add addr $slapos_ifname re6stnet_ipv6
echo Run slapformat ...
/opt/slapos/bin/slapos node format -cv --now ||
show_error_exit "Failed to run slapos format."
echo
echo "Supply $slaprunner_cfg in the computer $computer_id"
/opt/slapos/bin/slapos supply $slaprunner_cfg $computer_id /opt/slapos/bin/slapos supply $slaprunner_cfg $computer_id
/opt/slapos/bin/slapos request "Node Runner" $slaprunner_cfg --node computer_guid=$computer_id && break echo "Request an instance 'Node Runner' ..."
done while true ; do
# /opt/slapos/bin/slapos node software
# Get url from connection infromation /opt/slapos/bin/slapos node instance
# /opt/slapos/bin/slapos request $slaprunner_title $slaprunner_cfg --node computer_guid=$computer_id && break
# Connection parameters of instance are: done
# {'backend_url': 'http://[2001:67c:1254:45::c5d5]:50000',
# 'cloud9-url': 'http://localhost:9999', # Connection parameters of instance are:
# 'password_recovery_code': 'e2d01c14', # {'backend_url': 'http://[2001:67c:1254:45::c5d5]:50000',
# 'ssh_command': 'ssh 2001:67c:1254:45::c5d5 -p 2222', # 'cloud9-url': 'http://localhost:9999',
# 'url': 'http://softinst39090.host.vifib.net/'} # 'password_recovery_code': 'e2d01c14',
slaprunner_url=$(/opt/slapos/bin/slapos request "Node Runner" $slaprunner_cfg --node computer_guid=$computer_id | grep backend_url | sed -e "s/^.*': '//g" -e "s/',.*$//g") # 'ssh_command': 'ssh 2001:67c:1254:45::c5d5 -p 2222',
# 'url': 'http://softinst39090.host.vifib.net/'}
slaprunner_url=$(/opt/slapos/bin/slapos request $slaprunner_title \
$slaprunner_cfg --node computer_guid=$computer_id \
| grep backend_url | sed -e "s/^.*': '//g" -e "s/',.*$//g")
echo Got node runner url: $slaprunner_url
echo <<EOF > $slapos_runner_file
<html>
<head><title>SlapOS Web Runner</title>
<script LANGUAGE="JavaScript">
<!--
function openwin() {
location.reload("$slaprunner_url")
}
//-->
</script>
</head>
<body onload="openwin()"/>
</html>
EOF
echo Generate file: $slapos_runner_file
# Apply patches to slapos.cookbook for inotifix
patch_file=/etc/slapos/patches/slapos-cookbook-inotifyx.patch
if [[ -f $patch_file ]] ; then
echo "Apply patch: $patch_file"
for x in $(find /opt/slapgrid/ -name slapos.cookbook-*.egg) ; do
echo Apply to $x
cd $x
patch -p1 < $patch_file
done
fi
echo
echo Install Web Runner OK.
echo
fi
#-------------------------------------------------
# Configure crontab
#-------------------------------------------------
cron_file=/var/cron/tabs/$(whoami)
if [[ ! -f $cron_file ]] ; then
cat <<EOF > $cron_file
SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin
MAILTO=""
# Run "Installation/Destruction of Software Releases" and "Deploy/Start/Stop Partitions" once per minute
* * * * * Administrator /opt/slapos/bin/slapos node software --verbose --logfile=/opt/slapos/log/slapos-node-software.log > /dev/null 2>&1
* * * * * Administrator /opt/slapos/bin/slapos node instance --verbose --logfile=/opt/slapos/log/slapos-node-instance.log > /dev/null 2>&1
# Run "Destroy Partitions to be destroyed" once per hour
0 * * * * Administrator /opt/slapos/bin/slapos node report --maximal_delay=3600 --verbose --logfile=/opt/slapos/log/slapos-node-report.log > /dev/null 2>&1
# Run "Check/add IPs and so on" once per hour
0 * * * * Administrator /opt/slapos/bin/slapos node format >> /opt/slapos/log/slapos-node-format.log 2>&1
# Make sure we have only good network routes if we use VPN
# * * * * * root if [ -f /etc/opt/slapos/openvpn-needed ]; then ifconfig tapVPN | grep "Scope:Global" > /dev/null ;if [ $? = 0 ]; then ROUTES=$(ip -6 r l | grep default | awk '{print $5}'); for GW in $ROUTES ; do if [ ! $GW = tapVPN ]; then /sbin/ip -6 route del default dev $GW > /dev/null 2>&1;fi ;done ;fi ;fi
EOF
fi
echo SlapOS Node configure successfully. echo SlapOS Node configure successfully.
read -n 1 -p "Press any key to exit..." read -n 1 -p "Press any key to exit..."
......
...@@ -19,3 +19,22 @@ if [[ -f $current_path/node-runner.vbs ]] ; then ...@@ -19,3 +19,22 @@ if [[ -f $current_path/node-runner.vbs ]] ; then
cyg_cscript $current_path/node-runner.vbs || (echo Failed to start slap-runner ; exit 1) cyg_cscript $current_path/node-runner.vbs || (echo Failed to start slap-runner ; exit 1)
echo Start slap-runner OK. echo Start slap-runner OK.
fi fi
cat <<EOF > slap-runner.html
d>
<script LANGUAGE="JavaScript">
<!--
function openwin() {
location.reload("url")
}
//-->
</script>
</head>
<body onload="openwin()">
</body>
</html>
EOF
#! /bin/bash #! /bin/bash
export PATH=/usr/local/bin:/usr/bin:$PATH export PATH=/usr/local/bin:/usr/bin:$PATH
ifname=re6stnet-lo #
# Check ipv6 connection by default ipv6 route
#
function check_ipv6_connection()
{
netsh interface ipv6 show route | grep -q " ::/0 "
}
ping6 slap.vifib.com > /dev/null #
# Check cygwin service
#
function check_cygwin_service()
{
service_name=$1
echo Checking $1 service ...
if [ ! -e /usr/bin/cygrunsrv.exe ]; then
show_error_exit "No cygserver found, please install the cygrunsrv package first."
fi
service_account="$(cygrunsrv -VQ $service_name | sed -n -e 's/^Account[ :]*//p')" || \
show_error_exit "No $1 service install, please run Configure SlapOS to install it."
service_state=$(cygrunsrv --query $service_name | sed -n -e 's/^Current State[ :]*//p')
if [[ ! x$service_state == "xRunning" ]] ; then
echo Warning: Cygwin service $1 currnt state is $service_state, Running is expeted
echo Try to use cygrunsrv --start $1 to start this service
fi
echo Check $1 service OVER.
}
#
# Show error message and waiting for user to press any key quit
#
function show_error_exit()
{
msg=${1-Failed to configure Slapos Node in this computer.}
echo $msg
read -n 1 -p "Press any key to exit..."
exit 1
}
#-------------------------------------------------
# Constants
#-------------------------------------------------
slapos_ifname=re6stnet-lo
#-------------------------------------------------
# IPv6 Connection
#-------------------------------------------------
echo "Checking native IPv6 ..."
check_ipv6_connection
# Run re6stnet if no native ipv6 # Run re6stnet if no native ipv6
if (( $? )) ; then if (( $? )) ; then
echo "No native IPv6."
echo Check re6stnet network ...
which re6stnet > /dev/null || show_error_exit "Error: no re6stnet installed, please run Configure SlapOS first."
# re6st-conf --is-needed --registry http://re6stnet.nexedi.com/
ps -ef | grep -q babeld.exe
if (( $? )) ; then
echo "Start re6stnet ..." echo "Start re6stnet ..."
(cd /etc/re6stnet; re6stnet @re6stnet.conf --ovpnlog -I $ifname -i $ifname &) # It need root rights to install tap-driver
echo "Start re6stent in the background OK." (cd /etc/re6stnet; re6stnet @re6stnet.conf --ovpnlog -I $slapos_ifname -i $slapos_ifname &)
echo "Start re6stent in the background OK. You can check log files in the /var/log/re6stnet"
echo "Waiting re6stent network work ..." echo "Waiting re6stent network work ..."
while true ; do while true ; do
ping6 slap.vifib.com && break check_ipv6_connection && break
done done
fi
echo "re6stnet network OK." echo "re6stnet network OK."
else
echo "Native IPv6 Found."
fi fi
# Format slapos node #-------------------------------------------------
# Check cygserver, syslog-ng
#-------------------------------------------------
check_cygwin_service cygserver
check_cygwin_service syslog-ng
#-------------------------------------------------
# Format slapos node, need root right
#-------------------------------------------------
[[ -f /etc/opt/slapos/slapos.cfg ]] || \
show_error_exit "Error: no node configure file found, please run Configure SlapOS first."
echo "Run Slapos format ..." echo "Run Slapos format ..."
/opt/slapos/bin/slapos node format -cv --now /opt/slapos/bin/slapos node format -cv --now || \
if (( $? )) ; then show_error_exit "Failed to run slapos format."
echo "Failed to run slapos format." echo "Format slapos node OK."
exit 1
else
echo "Format slapos node OK."
fi
#-------------------------------------------------
# Release software # Release software
#-------------------------------------------------
echo "Releasing software ..." echo "Releasing software ..."
/opt/slapos/bin/slapos node software /opt/slapos/bin/slapos node software --verbose
if (( $? )) ; then
echo "Failed to relase software in the slapos node."
exit 1
else
echo "Release software OK."
fi
#-------------------------------------------------
# Instance software # Instance software
#-------------------------------------------------
echo "Creating instance ..." echo "Creating instance ..."
/opt/slapos/bin/slapos node instance /opt/slapos/bin/slapos node instance --verbose
if (( $? )) ; then
echo "Failed to create instance in the slapos node."
exit 1
else
echo "Create instance OK."
fi
#-------------------------------------------------
# Send report # Send report
/opt/slapos/bin/slapos node report #-------------------------------------------------
echo "Sending report ..."
/opt/slapos/bin/slapos node report --verbose
exit 0 exit 0
...@@ -58,6 +58,7 @@ Source: "opt\git\slapos.package\windows\scripts\post-install.sh"; DestDir: "{app ...@@ -58,6 +58,7 @@ Source: "opt\git\slapos.package\windows\scripts\post-install.sh"; DestDir: "{app
Source: "opt\git\slapos.package\windows\scripts\build-slapos.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"; Source: "opt\git\slapos.package\windows\scripts\slapos-configure.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\slapos-node-runner.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts"; Source: "opt\git\slapos.package\windows\scripts\slapos-node-runner.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\slap-runner.html"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\scripts\pre-uninstall.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts"; Source: "opt\git\slapos.package\windows\scripts\pre-uninstall.sh"; DestDir: "{app}\cygwin\etc\slapos\scripts";
Source: "opt\git\slapos.package\windows\docs\using-slapos-in-windows.html"; DestDir: "{app}"; DestName: "user-guide.html"; Source: "opt\git\slapos.package\windows\docs\using-slapos-in-windows.html"; DestDir: "{app}"; DestName: "user-guide.html";
...@@ -65,19 +66,19 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D ...@@ -65,19 +66,19 @@ Source: "opt\git\slapos.package\windows\docs\README.cygwin"; DestDir: "{app}"; D
[Icons] [Icons]
Name: "{commondesktop}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.ico"; Name: "{commondesktop}\SlapOS Desktop"; Filename: "https://www.slapos.org/"; IconFilename: "{app}\cygwin\etc\slapos\images\slapos.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 -h never -t ""Configure SlapOS Node"" /etc/slapos/scripts/slapos-client-config.sh"; WorkingDir: "{app}\cygwin\bin"; IconFilename: "{app}\cygwin\etc\slapos\images\configure.ico";
Name: "{group}\Node Runner"; Filename: "http://{app}\cygwin\etc\slapos\scripts\slap-runner.html"; IconFilename: "{app}\cygwin\etc\slapos\images\manager.ico";
Name: "{group}\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 -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}\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 -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}"; Name: "{group}\Uninstall SlapOS"; Filename: "{uninstallexe}";
Name: "{group}\User Guide"; Filename: "{app}\user-guide.html";
[Run] [Run]
Filename: "{app}\setup-cygwin.bat"; Parameters: """{app}"" network"; StatusMsg: "Installing Cygwin..."; Flags: runhidden; Filename: "{app}\setup-cygwin.bat"; Parameters: """{app}"" network"; 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; 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;
Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/build-slapos.sh"; WorkingDir: "{app}\cygwin\bin"; Description: "Builout process"; StatusMsg: "Building SlapOS..."; Flags: skipifdoesntexist; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/build-slapos.sh"; WorkingDir: "{app}\cygwin\bin"; Description: "Builout process"; StatusMsg: "Building SlapOS..."; Flags: skipifdoesntexist;
Filename: "{app}\cygwin\autorebase.bat"; WorkingDir: "{app}\cygwin"; Flags: skipifdoesntexist runhidden; Filename: "{app}\cygwin\autorebase.bat"; WorkingDir: "{app}\cygwin"; Flags: skipifdoesntexist;
[UninstallRun] [UninstallRun]
Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/pre-uninstall.sh"; WorkingDir: "{app}\cygwin\bin"; Flags: skipifdoesntexist runhidden; Filename: "{app}\cygwin\bin\bash.exe"; Parameters: "--login -i /etc/slapos/scripts/pre-uninstall.sh"; WorkingDir: "{app}\cygwin\bin"; Flags: skipifdoesntexist runhidden;
......
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