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 fa43c91 was
ec31855,
checked in by ramon <ramongomez@…>, 14 years ago
|
No comprobar consistencia de sistema de archivos antes de arrancar Windows para evitar pantalla de chequeo.
git-svn-id: https://opengnsys.es/svn/trunk@1342 a21b9725-9963-47de-94b9-378ad31fedc9
|
-
Property mode set to
100755
|
File size:
1.4 KB
|
Rev | Line | |
---|
[f5432db7] | 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 | |
---|
| 5 | PROG="$(basename $0)" |
---|
| 6 | if [ $# -ne 2 ]; then |
---|
| 7 | ogRaiseError $OG_ERR_FORMAT "Formato: $PROG ndisco nparticion" |
---|
| 8 | exit $? |
---|
| 9 | fi |
---|
| 10 | |
---|
[180a07dd] | 11 | echo "[0] Inicio del proceso de arranque." |
---|
[c7d9af7] | 12 | PART=$(ogDiskToDev "$1" "$2") || exit $? |
---|
| 13 | NAME=$(ogGetHostname) |
---|
| 14 | NAME=${NAME:-"pc"} |
---|
[199bdf3] | 15 | OSTYPE=$(ogGetOsType $1 $2) |
---|
[f5432db7] | 16 | |
---|
[36a4dfd] | 17 | echo "[10] Desmontar todos los sistemas de archivos." |
---|
| 18 | sync |
---|
| 19 | for (( i=1; i <= $(ogDiskToDev | wc -w); i++ )); do |
---|
| 20 | ogUnmountAll $i 2>/dev/null |
---|
| 21 | done |
---|
[199bdf3] | 22 | case "$OSTYPE" in |
---|
[c7d9af7] | 23 | Windows) |
---|
[bfeb89a] | 24 | echo "[30] Activar particion de Windows $PART." |
---|
[c7d9af7] | 25 | ogSetPartitionActive $1 $2 |
---|
[4b9cdda] | 26 | echo "[50] Asignar nombre Windows \"$NAME\" y usuario por defecto." |
---|
[c7d9af7] | 27 | ogSetWindowsName $1 $2 "$NAME" |
---|
| 28 | ;; |
---|
| 29 | Linux) |
---|
[36a4dfd] | 30 | echo "[30] Asignar nombre Linux \"$NAME\"." |
---|
[c7d9af7] | 31 | ETC=$(ogGetPath $1 $2 /etc) |
---|
| 32 | [ -d "$ETC" ] && echo "$NAME" >$ETC/hostname 2>/dev/null |
---|
| 33 | if [ -f "$ETC/fstab" ]; then |
---|
[bfeb89a] | 34 | echo "[50] Actaualizar fstab con particion raiz \"$PART\"." |
---|
[c7d9af7] | 35 | awk -v P="$PART " '{ if ($2=="/") {sub(/^.*$/, P, $1)} |
---|
| 36 | print } ' $ETC/fstab >/tmp/fstab |
---|
| 37 | mv /tmp/fstab $ETC/fstab |
---|
| 38 | fi |
---|
| 39 | ;; |
---|
| 40 | esac |
---|
[bfeb89a] | 41 | echo "[70] Desmontar cache local." |
---|
| 42 | ogUnmountCache |
---|
[180a07dd] | 43 | echo "[90] Arrancar sistema operativo." |
---|
[3458879] | 44 | ogBoot $1 $2 |
---|
[f5432db7] | 45 | |
---|
Note: See
TracBrowser
for help on using the repository browser.