source: ogLive-Builder-Git/boottoolsgenerator.sh @ e972c32

browserbuild-browserdeps-vadimfilebeat-installerimprove-versionlgromero-testsmainno-apt-moduleoglive-ipv6pull-from-cloning-enginepybuilderqndtest
Last change on this file since e972c32 was 2cffa56, checked in by adv <adv@…>, 14 years ago

version 1.0.2 boot-tools #404 #420

git-svn-id: https://opengnsys.es/svn/branches/version1.0@2250 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100755
File size: 4.1 KB
RevLine 
[2cffa56]1#!/bin/bash
2#@file    boottoolsgenerator.sh
3#@brief   Script generación del sistema opertativo cliente OpenGnSys
4#@warning
5#@version 0.9 - Prototipo de sistema operativo multiarranque de opengnsys.
6#@author  Antonio J. Doblas Viso. Universidad de Malaga.
7#@date    2010/05/24
8#@version 1.0 - Compatibilidad OpengGnsys X.
9#@author  Antonio J. Doblas Viso. Universidad de Malaga.
10#@date    2011/08/03
11#*/
12
13
14#Variables
15TYPECLIENT=host
16WORKDIR=/tmp/opengnsys_installer
17INSTALL_TARGET=/opt/opengnsys
18PROGRAMDIR=$(readlink -e $(dirname "$0"))
19
20# Solo ejecutable por usuario root
21if [ "$(whoami)" != 'root' ]
22then
23        echo "ERROR: this program must run under root privileges!!"
24        exit 1
25fi
26
27
28#funciones especificas del cliente.
29source $PROGRAMDIR/boottoolsfunctions.lib
30
31
32echoAndLog "OpenGnSys CLIENT installation begins at $(date)"
33
34##########################################################################
35## FASE 1 -  Instalación de software adicional.
36DEPENDENCIES=( debootstrap subversion schroot squashfs-tools)
37apt-get update
38# Instalación de dependencias (paquetes de sistema operativo).
39declare -a notinstalled
40checkDependencies DEPENDENCIES notinstalled
41if [ $? -ne 0 ]; then
42        installDependencies notinstalled
43        if [ $? -ne 0 ]; then
44                echoAndLog "Error while installing some dependeces, please verify your server installation before continue"
45                exit 1
46        fi
47fi
48########### FIN FASE 1
49
50##### FASE 2   - Asignación de variables
51#obtenemos las variables necesarias.
52btogGetVar
53#obtenemos la información del host.
54btogGetOsInfo
55##### FIN fase 2
56
57############# FASE 3: Creación del Sistema Root (Segundo Sistema archivos (img))
58##3.1 creación y formateo del disco virtual. generamos el dispositivo loop.
59file $BTROOTFSIMG | grep "partition 1: ID=0x83"
60if [ $? == 1 ]
61then
62        btogSetFsVirtual || exit 2
63fi
64#3.2 generamos el Sistema de archivos con debootstrap
65schroot -p -c IMGogclient -- touch /tmp/ogclientOK
66if [ -f /tmp/ogclientOK ]
67then
68        rm /tmp/ogclientOK
69else
70        btogSetFsBase || exit 3
71fi
72
73
74############### FASE 4: Configuración el acceso al Segundo Sistema de archivos (img), para schroot
75cat /etc/schroot/schroot.conf | grep $BTROOTFSIMG || btogSetFsAccess
76
77
78
79
80############### FASE 5: Configuración del Segundo Sistema de archivos (img) con la estructura especial de OpenGnsys
81cp ${BTSVNBOOTTOOLS}/includes/root/* /tmp/
82chmod 777 /tmp/*.sh
83schroot -p -c IMGogclient -- /tmp/importSVNboot-tools.sh
84
85
86
87
88
89
90############# FASE6: Ejecutamos los scripts de personalización del 2º sistema de archivos (img) desde la jaula schroot
91### 6.1 instalacion de software con apt-get
92schroot -p -c IMGogclient -- /root/InstallSoftware.sh
93echo "saltando"
94 if [ $? -ne 0 ]; then
95        errorAndLog "Instalando sofware adicional OG : ERROR"
96        exit
97else
98        echoAndLog "Instalando sofware adicional OG: OK"
99fi
100#### 6.2 compilación de software.
101cd /
102schroot -p -c IMGogclient -- /root/CompileSoftware.sh
103cd -
104
105### 6.3 configuracion hostname passroot securety
106cd /
107schroot -c IMGogclient -- /root/ConfFS.sh
108cd -
109#schroot -c IMGogclient -- echo -ne "og1\nog1\n" | passwd root
110# schroot -c IMGogclient -- passwd root | echo "root"
111
112
113### 6.4 incorporamos la clave publica del servidor
114cd /
115ssh-keygen -q -f /root/.ssh/id_rsa -N ""
116cp /root/.ssh/id_rsa.pub /tmp
117schroot -p -c IMGogclient -- /root/importSshKeys.sh
118cd -
119############ y la del propio cliente.
120schroot -c IMGogclient -- /root/generateSshKeysClient.sh
121
122## configuramos los locales.
123schroot -c IMGogclient -- /root/ReconfigureLocales.sh
124
125exit 99
126################## FIN fase 6.   Fin de comfiguración del segundo sistema de archivos (img)
127
128
129
130
131
132
133
134
135
136
137
138
139################## FASE 7.  Generamos el 1er sistema de archivos. INITRD
140btogFsInitrd
141
142
143################## FASE 8. convertimos el 2ºFS(img) en 2ºFS(sqfs)
144# generamos el 2sistema de archivos en squashfs
145ogClient2ndSqfs
146################## FIN FASE 8. convertimos el 2ºFS(img) en 2ºFS(sqfs)
147
148
149##################### FASE 9. algunos detallas del pxe
150#dejamos ficheros de ejemplo para el pxe y el nfs
151#ogClientConfpxe
152##################### FIN FASE 9. algunos detallas del pxe
153
154
155# Mostrar sumario de la instalación e instrucciones de post-instalación.
156installationSummary
157
158echoAndLog "OpenGnSys installation finished at $(date)"
Note: See TracBrowser for help on using the repository browser.