source: client/shared/scripts/configureOs @ 3dd7b5d

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 3dd7b5d was f2138b0, checked in by adv <adv@…>, 12 years ago

#604 configureOs no injecta el agente ogAdmClient para MS Windows de manera automática. Detectado errores en entornos en producción.

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

  • Property mode set to 100755
File size: 2.9 KB
Line 
1#!/bin/bash
2
3#/**
4#         configureOs
5#@brief   Scirpt para realizar la configuracion del sistema operativo restaurado.
6#@param 1 disco
7#@param 2 particion
8#@return 
9#@TODO  comprobar que el tipo de particion corresponde con el sistema de archivos.
10#@exception OG_ERR_FORMAT     # 1 formato incorrecto.
11#@version 1.0.1 - Integracion cambio de nombre, extender fs, chequear particion activa
12#@author 
13#@date   2011-05-11
14#@version 1.0.1 - Configura el sector de la particion y el gestor de windows para iniciarse desde cualquier particion. 
15#@author Antonio J. Doblas Viso.    Universidad de Malaga.
16#@date   2011-05-20
17#@version 1.0.2 - Configura el sector de la particion y el gestor de linux para iniciarse desde cualquier particion. 
18#@author Antonio J. Doblas Viso.    Universidad de Malaga.
19#@date   2011-11-22
20#@version 1.0.3 - Configura el chkdisk en el arranque de windows, segun variable OGWINCHKDISK del engine.cfg. 
21#@author Antonio J. Doblas Viso.    Universidad de Malaga.
22#@date   2011-12-23
23#@version 1.0.4 - Inyecta el cliente para gestión del sistema operativo.
24#@author Ramon Gomez, ETSII Universidad de Sevilla
25#@date   2012-04-11
26
27# Carga el configurador del engine y los parámetros de red.
28[ -z $OGENGINECONFIGURATE ] && source /opt/opengnsys/etc/engine.cfg
29[ -f $DEVICECFG ] && source $DEVICECFG
30
31# Si el sistema de archivos no esta extendido, ampliarlo al tamaño de su partición.
32PARTSIZE=$(ogGetPartitionSize $1 $2) || exit $?
33FSSIZE=$(ogGetFsSize $1 $2)
34if [ $FSSIZE -lt $PARTSIZE ]; then
35        echo "Extender sistema de archivos."
36        ogExtendFs $1 $2
37fi
38
39# Si no existe partición activa, activar este sistema.
40FLAGACTIVE=$(ogGetPartitionActive $1)
41[ -z $FLAGACTIVE ] && ogSetPartitionActive $1 $2
42
43# Post-configuración personalizada para cada tipo de sistema operativo.
44OSTYPE="$(ogGetOsType $1 $2)"
45case "$OSTYPE" in
46    Windows)
47        # Cambiar nombre en sistemas Windows.
48        HOST=$(ogGetHostname)
49        HOST=${HOST:-"pc"}
50        ogSetWindowsName $1 $2 "$HOST"
51        # Descomentar la siguiente línea para cambiar usuario de inicio.
52        #ogSetWinlogonUser $1 $2 " "
53        # Configurar el boot sector de la partición Windows.
54        ogFixBootSector $1 $2
55        # Configurar el gestor de arranque de Windows XP/Vista/7.
56        ogWindowsBootParameters $1 $2
57        # Registrar en Windows que la partición indicada es su nueva unidad C:\
58        ogWindowsRegisterPartition $1 $2 C $1 $2
59        #ogLoadHiveWindows $1 $2; ogSetWindowsChkdisk $OGWINCHKDISK; ogUpdateHiveWindows
60        # Instalar cliente para Windows (no activar en sistema en produccion ver ticket 604).
61                #ogInstallMiniSetup $1 $2 postconf.cmd
62                #ogInstallWindowsClient $1 $2 postconf.cmd
63        ;;
64    Linux)
65        ## Install and Configure Grub based on OS installed and Grub 1st stage location.
66        ogGrubInstallPartition $1 $2
67        # Instalar cliente para Linux.
68        ogInstallLinuxClient $1 $2
69        ;;
70esac
71
Note: See TracBrowser for help on using the repository browser.