source: client/boot-tools/boottoolsgenerator.sh @ 312a0f4

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 312a0f4 was 27ee376, 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@2256 a21b9725-9963-47de-94b9-378ad31fedc9

  • Property mode set to 100755
File size: 3.3 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
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.
36cat /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
37apt-get update
38apt-get -y --force-yes install debootstrap subversion schroot squashfs-tools syslinux genisoimage apt-get install gpxe
39
40##### FASE 2   - Asignación de variables
41#obtenemos las variables necesarias y la información del host.
42btogGetVar && btogGetOsInfo
43
44############# FASE 3: Creación del Sistema raiz RootFS (Segundo Sistema archivos (img))
45##3.1 creación y formateo del disco virtual. generamos el dispositivo loop.
46file $BTROOTFSIMG | grep "partition 1: ID=0x83"
47if [ $? == 1 ]
48then
49        btogSetFsVirtual || exit 2
50fi
51#3.2 generamos el Sistema de archivos con debootstrap
52schroot -p -c IMGogclient -- touch /tmp/ogclientOK
53if [ -f /tmp/ogclientOK ]
54then
55        rm /tmp/ogclientOK
56else
57        btogSetFsBase || exit 3
58fi
59
60# FASE 4: Configuración el acceso al Segundo Sistema de archivos (img), para schroot
61cat /etc/schroot/schroot.conf | grep $BTROOTFSIMG || btogSetFsAccess
62
63# FASE 5: Incorporando con ficheros OG el sistema raiz rootfs
64cp -prv ${BTSVNBOOTTOOLS}/includes/usr/bin/* /tmp/
65chmod 777 /tmp/*.sh
66schroot -p -c IMGogclient -- /tmp/boottoolsFsOpengnsys.sh
67
68# FASE6: Instalacion de software
69# 6.1 instalacion de software con apt-get
70schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareInstall.sh
71echo "saltando"
72 if [ $? -ne 0 ]; then
73        errorAndLog "Instalando sofware adicional OG : ERROR"
74        exit
75else
76        echoAndLog "Instalando sofware adicional OG: OK"
77fi
78# 6.2 compilación de software.
79cd /
80schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareCompile.sh
81cd -
82
83#Fase 7. Personalizando
84### 7.1 incorporamos la clave publica del servidor
85cd /
86ssh-keygen -q -f /root/.ssh/id_rsa -N ""
87cp /root/.ssh/id_rsa.pub /tmp
88schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshServer.sh
89cd -
90### 7.2 y la del propio cliente.
91schroot -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshClient.sh
92
93## 7.3 configuramos los locales.
94schroot -c IMGogclient -- /usr/bin/boot-tools/boottoolsFsLocales.sh
95
96exit 99
97
98#Fase 7. Generando la ISO.
99#7.1 el initrd
100btogFsInitrd
101#7.2 Convertivos el sistema raiz img en formato sqfs
102btogFsSqfs
103#7.3 Generamos la iso
104btogIsoGenerator
105
106# Mostrar sumario de la instalación e instrucciones de post-instalación.
107installationSummary
108
109echoAndLog "OpenGnSys installation finished at $(date)"
Note: See TracBrowser for help on using the repository browser.