source: client/shared/scripts/configureOs @ 53fba30

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 53fba30 was 5ccb999, checked in by adv <adv@…>, 13 years ago

configureOs #472

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

  • Property mode set to 100755
File size: 2.4 KB
Line 
1#!/bin/bash
2
3#/**
4#         configureOS
5#@brief   Scirpt de ejemplo para realizar la configuracion del sistema operativo restaurado.
6#@brief (puede usarse como base para el programa de creación de imágenes usado por OpenGnSys Admin).
7#@param 1 disco
8#@param 2 particion
9#@return 
10#@TODO  comprobar que el tipo de particion corresponde con el sistema de archivos.
11#@exception OG_ERR_FORMAT     # 1 formato incorrecto.
12#@version 1.0.1 - Integracion cambio de nombre, extender fs, chequear particion activa
13#@author 
14#@date   2011-05-11
15#@version 1.0.1 - Configura el sector de la particion y el gestor de windows para iniciarse desde cualquier particion. 
16#@author Antonio J. Doblas Viso.    Universidad de Malaga.
17#@date   2011-05-20
18#@version 1.0.2 - Configura el sector de la particion y el gestor de linux para iniciarse desde cualquier particion. 
19#@author Antonio J. Doblas Viso.    Universidad de Malaga.
20#@date   2011-11-22
21#@version 1.0.3 - Configura el chkdisk en el arranque de windows, segun variable OGWINCHKDISK del engine.cfg. 
22#@author Antonio J. Doblas Viso.    Universidad de Malaga.
23#@date   2011-12-23
24
25#Carga del configurador del engine
26[ -z $OGENGINECONFIGURATE ] && source /opt/opengnsys/etc/engine.cfg
27
28# Si el sistema de archivos no esta extendido. Realizar.
29PARTSIZE=$(ogGetPartitionSize $1 $2)
30FSSIZE=$(ogGetFsSize $1 $2)
31if [ $FSSIZE -lt $PARTSIZE ]; then
32        echo "Extender sistema de archivos."
33        ogExtendFs $1 $2
34fi
35
36#Si no existe particion activa, activar este sistema.
37FLAGACTIVE=$(ogGetPartitionActive $1)
38[ -z $FLAGACTIVE ] && ogSetPartitionActive $1 $2
39
40# Cambiar nombre en sistemas Windows y quitar usuario de acceso por defecto.
41if [ "$(ogGetOsType $1 $2)" = "Windows" ]; then
42    # Cambiar nombre en sistemas Windows.
43    HOST=$(ogGetHostname)
44    HOST=${HOST:-"pc"}
45    ogSetWindowsName $1 $2 "$HOST"
46    # Descomentar la siguiente línea para cambiar usuario de inicio.
47    #ogSetWinlogonUser $1 $2 " "
48    # Configurar el boot sector de la partición Windows.
49    ogFixBootSector $1 $2
50    # Configurar el gestor de arranque de Windows XP/Vista/7.
51    ogWindowsBootParameters $1 $2
52    # Registrar en Windows que la partición indicada es su nueva unidad C:\
53    ogWindowsRegisterPartition $1 $2 C $1 $2
54    ogLoadHiveWindows $1 $2; ogSetWindowsChkdisk $OGWINCHKDISK; ogUpdateHiveWindows
55fi
56
57if [ "$(ogGetOsType $1 $2)" = "Linux" ]; then
58        ogGrubInstallPartition $1 $2
59fi
Note: See TracBrowser for help on using the repository browser.