source: client/shared/scripts/bootOs @ ca0f67c6

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 ca0f67c6 was 4085f13, checked in by irina <irinagomez@…>, 12 years ago

#593 Optimiza inicio de sesión en winodws, se eliminan funciones obsoletas o repetidas

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

  • Property mode set to 100755
File size: 1.6 KB
Line 
1#!/bin/bash
2# Scirpt de ejemplo para arancar un sistema operativo instalado.
3# (puede usarse como base para el programa de arranque usado por OpenGNSys Admin).
4
5PROG="$(basename $0)"
6if [ $# -ne 2 ]; then
7    ogRaiseError $OG_ERR_FORMAT "Formato: $PROG ndisco nparticion"
8    exit $?
9fi
10
11echo "[0] Inicio del proceso de arranque."
12PART=$(ogDiskToDev "$1" "$2") || exit $?
13NAME="$(ogGetHostname)"
14NAME=${NAME:-"pc"}
15OSTYPE=$(ogGetOsType $1 $2)
16# Borrar marcas de arrranque de todos los Windows instalados en el disco.
17if [ "$OSTYPE" == "Windows" ]; then
18    for (( i=1; i<=$(ogGetPartitionsNumber $1); i++ )); do
19        [ "$(ogGetOsType $1 $i)" == "Windows" ] && ogMount $1 $i &>/dev/null
20    done
21    rm -f /mnt/*/ogboot.*
22fi
23
24echo "[10] Desmontar todos los sistemas de archivos."
25sync
26for (( i=1; i <= $(ogDiskToDev | wc -w); i++ )); do
27    ogUnmountAll $i &>/dev/null
28done
29case "$OSTYPE" in
30    Windows)
31        echo "[30] Mostrar y activar particion de Windows $PART."
32        [ $(ogGetPartitionType $1 $2) == "HNTFS" ] && ogUnhidePartition $1 $2
33        ;;
34    Linux)
35        echo "[30] Asignar nombre Linux \"$NAME\"."
36        ETC=$(ogGetPath $1 $2 /etc)
37        [ -d "$ETC" ] && echo "$NAME" >$ETC/hostname 2>/dev/null
38        if [ -f "$ETC/fstab" ]; then
39            echo "[50] Actaualizar fstab con particion raiz \"$PART\"."
40            awk -v P="$PART " '{ if ($2=="/") {sub(/^.*$/, P, $1)}
41                                 print } ' $ETC/fstab >/tmp/fstab
42            mv /tmp/fstab $ETC/fstab
43        fi
44        ;;
45esac
46echo "[70] Desmontar cache local."
47ogUnmountCache
48echo "[90] Arrancar sistema operativo."
49ogBoot $1 $2
50
Note: See TracBrowser for help on using the repository browser.