source: ogLive-Builder-Git/boottoolsgenerator.sh @ 8212e10

browserbuild-browserdeps-vadimfilebeat-installerimprove-versionlgromero-testsmainno-apt-moduleoglive-ipv6pull-from-cloning-enginepybuilderqndtest
Last change on this file since 8212e10 was 8428ee5, checked in by ramon <ramongomez@…>, 11 years ago

Adaptar la generación del cliente ogLive a Ubuntu 14.04.

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

  • Property mode set to 100755
File size: 4.7 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
[b3d380b]13 #mkdir -p /tmp/opengnsys_installer/opengnsys
14 #svn export http://opengnsys.es/svn/branches/version1.0/client /tmp/opengnsys_installer/opengnsys
[ad828d4]15
[2cffa56]16
17#Variables
[944b467]18TYPECLIENT="host"
[2cffa56]19WORKDIR=/tmp/opengnsys_installer
20INSTALL_TARGET=/opt/opengnsys
21PROGRAMDIR=$(readlink -e $(dirname "$0"))
22
23# Solo ejecutable por usuario root
24if [ "$(whoami)" != 'root' ]
25then
26        echo "ERROR: this program must run under root privileges!!"
27        exit 1
28fi
29
[8428ee5]30# Cambiar a directorio temporal.
31cd /tmp
32
[e0efe8a]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
[2cffa56]38#funciones especificas del cliente.
39source $PROGRAMDIR/boottoolsfunctions.lib
40
[c4105e1]41####################################################################3
42echo "FASE 1 - Asignación de variables"
43#obtenemos las variables necesarias y la información del host.
44btogGetVar
[2cffa56]45echoAndLog "OpenGnSys CLIENT installation begins at $(date)"
[944b467]46btogGetOsInfo $TYPECLIENT
[2cffa56]47##########################################################################
[c4105e1]48echo "FASE 2 - Instalación de software adicional."
[0714cda]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
[b3d380b]50apt-get update; apt-get -y --force-yes install debootstrap subversion schroot squashfs-tools syslinux genisoimage gpxe qemu lsof
[8ebae0e]51###################################################################3
[c4105e1]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."
[2cffa56]54file $BTROOTFSIMG | grep "partition 1: ID=0x83"
55if [ $? == 1 ]
56then
57        btogSetFsVirtual || exit 2
58fi
[c4105e1]59echo "Fase 3.2 Generar sistema de archivos con debootstrap"
[2cffa56]60schroot -p -c IMGogclient -- touch /tmp/ogclientOK
61if [ -f /tmp/ogclientOK ]
62then
63        rm /tmp/ogclientOK
64else
65        btogSetFsBase || exit 3
66fi
[8ebae0e]67###################################################################3
[c4105e1]68echo "FASE 4 - Configurar acceso schroot al Segundo Sistema de archivos (img)"
[2cffa56]69cat /etc/schroot/schroot.conf | grep $BTROOTFSIMG || btogSetFsAccess
[8ebae0e]70###########################################################################
[c4105e1]71echo "FASE 5 - Incorporando ficheros OpenGnSys el sistema raiz rootfs "
[dfbf4fa]72cp -a ${BTSVNBOOTTOOLS}/includes/usr/bin/* /tmp
73chmod +x /tmp/boot-tools/*.sh
[b3d380b]74# En Ubuntu 13.04+ es necesario matar proceso de "udev" antes de desmontar.
75umount $BTROOTFSMNT 2>/dev/null || (kill -9 $(lsof -t $BTROOTFSMNT); umount $BTROOTFSMNT 2>/dev/null)
[ad828d4]76schroot -p -c IMGogclient -- /tmp/boot-tools/boottoolsFsOpengnsys.sh
[8ebae0e]77############################################################################################
[c4105e1]78echo "FASE 6 - Instalar software"
[8ebae0e]79echo "Fase 6.1 instalar paquetes deb con apt-get"
[0714cda]80schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareInstall.sh
[8ebae0e]81echo "Fase 6.2 compilar software."
[2cffa56]82cd /
[0714cda]83schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareCompile.sh
[2cffa56]84cd -
85
[c4105e1]86echo "FASE 7 - Personalizar el sistema creado"
87echo "Fase 7.1 Incorporar la clave publica del servidor"
[2cffa56]88cd /
89ssh-keygen -q -f /root/.ssh/id_rsa -N ""
90cp /root/.ssh/id_rsa.pub /tmp
[0714cda]91schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshServer.sh
[2cffa56]92cd -
[c4105e1]93echo "Fase 7.2. Incorpoar la clave publica del propio  cliente"
[8ebae0e]94schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshClient.sh
95
[c4105e1]96echo "Fase 7.3. Configurando las locales"
[8ebae0e]97schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsFsLocales.sh
[2cffa56]98
99
[e0efe8a]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
[8ebae0e]104#########################################################################
[c4105e1]105echo "FASE 8 - Generar distribucion"
106echo "Fase 8.1 Generar el initrd"
[2cffa56]107btogFsInitrd
[c4105e1]108echo "Fase 8.2 Generar fichero sqfs a partir del fichero img"
[0714cda]109btogFsSqfs
[944b467]110umount $BTROOTFSMNT 2>/dev/null
[c4105e1]111echo "Fase 8.3 Generar la ISO"
[0714cda]112btogIsoGenerator
[8ebae0e]113######################################################################3
114########################################################################
[2cffa56]115echoAndLog "OpenGnSys installation finished at $(date)"
[e0efe8a]116
Note: See TracBrowser for help on using the repository browser.