source: client/boot-tools/boottoolsgenerator.sh @ cca8f29

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 cca8f29 was 0d178ab, checked in by ramon <ramongomez@…>, 12 years ago

Versión 1.0.5: Corregir algunas erratas y unificar los mensajes en el proceso de generación del cliente ogLive.

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

  • Property mode set to 100755
File size: 4.9 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#find /tmp/opengnsys_installer/ -name .svn -type d -exec rm -fr {} \; 2>/dev/null;
18
19
20#Variables
21TYPECLIENT=host
22WORKDIR=/tmp/opengnsys_installer
23INSTALL_TARGET=/opt/opengnsys
24PROGRAMDIR=$(readlink -e $(dirname "$0"))
25
26# Solo ejecutable por usuario root
27if [ "$(whoami)" != 'root' ]
28then
29        echo "ERROR: this program must run under root privileges!!"
30        exit 1
31fi
32
33for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done
34for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done
35for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done
36
37
38#funciones especificas del cliente.
39source $PROGRAMDIR/boottoolsfunctions.lib
40
41####################################################################3
42echo "FASE 1 - Asignación de variables"
43#obtenemos las variables necesarias y la información del host.
44btogGetVar
45echoAndLog "OpenGnSys CLIENT installation begins at $(date)"
46btogGetOsInfo
47##########################################################################
48echo "FASE 2 - Instalación de software adicional."
49cat /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
50apt-get update; apt-get -y --force-yes install debootstrap subversion schroot squashfs-tools syslinux genisoimage gpxe qemu
51###################################################################3
52echo "FASE 3 - Creación del Sistema raiz RootFS (Segundo Sistema archivos (img)) "
53echo "Fase 3.1 Generar y formatear el disco virtual. Generar el dispositivo loop."
54file $BTROOTFSIMG | grep "partition 1: ID=0x83"
55if [ $? == 1 ]
56then
57        btogSetFsVirtual || exit 2
58fi
59echo "Fase 3.2 Generar sistema de archivos con debootstrap"
60schroot -p -c IMGogclient -- touch /tmp/ogclientOK
61if [ -f /tmp/ogclientOK ]
62then
63        rm /tmp/ogclientOK
64else
65        btogSetFsBase || exit 3
66fi
67###################################################################3
68echo "FASE 4 - Configurar acceso schroot al Segundo Sistema de archivos (img)"
69cat /etc/schroot/schroot.conf | grep $BTROOTFSIMG || btogSetFsAccess
70###########################################################################
71echo "FASE 5 - Incorporando ficheros OpenGnSys el sistema raiz rootfs "
72cp -av ${BTSVNBOOTTOOLS}/includes/usr/bin/* /tmp/
73chmod 777 /tmp/boot-tools/*.sh
74umount $BTROOTFSMNT 2>/dev/null
75schroot -p -c IMGogclient -- /tmp/boot-tools/boottoolsFsOpengnsys.sh
76############################################################################################
77echo "FASE 6 - Instalar software"
78echo "Fase 6.1 instalar paquetes deb con apt-get"
79schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareInstall.sh
80echo "Fase 6.2 compilar software."
81cd /
82schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareCompile.sh
83schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareCompile.sh
84cd -
85
86echo "FASE 7 - Personalizar el sistema creado"
87echo "Fase 7.1 Incorporar la clave publica del servidor"
88cd /
89ssh-keygen -q -f /root/.ssh/id_rsa -N ""
90cp /root/.ssh/id_rsa.pub /tmp
91schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshServer.sh
92cd -
93echo "Fase 7.2. Incorpoar la clave publica del propio  cliente"
94schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshClient.sh
95
96echo "Fase 7.3. Configurando las locales"
97schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsFsLocales.sh
98
99
100for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done
101for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done
102for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done
103
104#########################################################################
105echo "FASE 8 - Generar distribucion"
106echo "Fase 8.1 Generar el initrd"
107btogFsInitrd
108echo "Fase 8.2 Generar fichero sqfs a partir del fichero img"
109btogFsSqfs
110echo "Fase 8.3 Generar la ISO"
111btogIsoGenerator
112######################################################################3
113########################################################################
114# Mostrar sumario de la instalación e instrucciones de post-instalación.
115installationSummary
116echoAndLog "OpenGnSys installation finished at $(date)"
117
Note: See TracBrowser for help on using the repository browser.