source: client/boot-tools/boottoolsgenerator.sh @ 3798b0f

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change on this file since 3798b0f was 841ce50, checked in by adv <adv@…>, 14 years ago

version 1.0.2 boot-tools #404 #420 id.version instalador

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

  • Property mode set to 100755
File size: 3.7 KB
Line 
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 #mkdir -p /tmp/opengnsys_installer/opengnsys;
14 #mkdir -p /tmp/opengnsys_installer/opengnsys2;
15 #cp -prv /home/administrador/workspace/OpenGnsys/branches/version2/* /tmp/opengnsys_installer/opengnsys2/;
16 #cp -prv /home/administrador/workspace/OpenGnsys/branches/version1.0/client/ /tmp/opengnsys_installer/opengnsys/;
17
18#find /tmp/opengnsys_installer/ -name .svn -type d -exec rm -fr {} \; 2>/dev/null;
19
20
21#Variables
22TYPECLIENT=host
23WORKDIR=/tmp/opengnsys_installer
24INSTALL_TARGET=/opt/opengnsys
25PROGRAMDIR=$(readlink -e $(dirname "$0"))
26
27# Solo ejecutable por usuario root
28if [ "$(whoami)" != 'root' ]
29then
30        echo "ERROR: this program must run under root privileges!!"
31        exit 1
32fi
33
34
35#funciones especificas del cliente.
36source $PROGRAMDIR/boottoolsfunctions.lib
37
38
39echoAndLog "OpenGnSys CLIENT installation begins at $(date)"
40
41##########################################################################
42## FASE 1 -  Instalación de software adicional.
43cat /etc/apt/sources.list | grep "http://free.nchc.org.tw/drbl-core" || echo "deb http://free.nchc.org.tw/drbl-core drbl stable " >> /etc/apt/sources.list
44apt-get update
45apt-get -y --force-yes install debootstrap subversion schroot squashfs-tools syslinux genisoimage gpxe qemu
46
47##### FASE 2   - Asignación de variables
48#obtenemos las variables necesarias y la información del host.
49btogGetVar && btogGetOsInfo
50
51############# FASE 3: Creación del Sistema raiz RootFS (Segundo Sistema archivos (img))
52##3.1 creación y formateo del disco virtual. generamos el dispositivo loop.
53file $BTROOTFSIMG | grep "partition 1: ID=0x83"
54if [ $? == 1 ]
55then
56        btogSetFsVirtual || exit 2
57fi
58#3.2 generamos el Sistema de archivos con debootstrap
59schroot -p -c IMGogclient -- touch /tmp/ogclientOK
60if [ -f /tmp/ogclientOK ]
61then
62        rm /tmp/ogclientOK
63else
64        btogSetFsBase || exit 3
65fi
66
67# FASE 4: Configuración el acceso al Segundo Sistema de archivos (img), para schroot
68cat /etc/schroot/schroot.conf | grep $BTROOTFSIMG || btogSetFsAccess
69
70# FASE 5: Incorporando con ficheros OG el sistema raiz rootfs
71cp -prv ${BTSVNBOOTTOOLS}/includes/usr/bin/* /tmp/
72chmod 777 /tmp/boot-tools/*.sh
73schroot -p -c IMGogclient -- /tmp/boot-tools/boottoolsFsOpengnsys.sh
74
75# FASE6: Instalacion de software
76# 6.1 instalacion de software con apt-get
77schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareInstall.sh
78echo "saltando"
79 if [ $? -ne 0 ]; then
80        errorAndLog "Instalando sofware adicional OG : ERROR"
81        exit
82else
83        echoAndLog "Instalando sofware adicional OG: OK"
84fi
85# 6.2 compilación de software.
86cd /
87schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareCompile.sh
88cd -
89
90#Fase 7. Personalizando
91### 7.1 incorporamos la clave publica del servidor
92cd /
93ssh-keygen -q -f /root/.ssh/id_rsa -N ""
94cp /root/.ssh/id_rsa.pub /tmp
95schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshServer.sh
96cd -
97### 7.2 y la del propio cliente.
98schroot -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshClient.sh
99
100## 7.3 configuramos los locales.
101schroot -c IMGogclient -- /usr/bin/boot-tools/boottoolsFsLocales.sh
102
103
104#Fase 7. Generando la ISO.
105#7.1 el initrd
106btogFsInitrd
107
108
109#7.2 Convertivos el sistema raiz img en formato sqfs
110btogFsSqfs
111#7.3 Generamos la iso
112btogIsoGenerator
113
114
115# Mostrar sumario de la instalación e instrucciones de post-instalación.
116installationSummary
117
118echoAndLog "OpenGnSys installation finished at $(date)"
Note: See TracBrowser for help on using the repository browser.