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 4fa252b was
199bdf3,
checked in by ramon <ramongomez@…>, 15 years ago
|
Script de arranque desmonta bien los sistemas de archivos; detección de parámetros de arranque de Linux en sistema de archivos /boot independiente.
git-svn-id: https://opengnsys.es/svn/trunk@1110 a21b9725-9963-47de-94b9-378ad31fedc9
|
-
Property mode set to
100755
|
File size:
1.6 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 | # Iniciación de porcentaje de la barra de progreso del Browser. |
---|
| 12 | echo "[0] Inicio del proceso de arranque." |
---|
| 13 | |
---|
[f5432db7] | 14 | # Procesos previos. |
---|
[c7d9af7] | 15 | PART=$(ogDiskToDev "$1" "$2") || exit $? |
---|
| 16 | NAME=$(ogGetHostname) |
---|
| 17 | NAME=${NAME:-"pc"} |
---|
[199bdf3] | 18 | OSTYPE=$(ogGetOsType $1 $2) |
---|
[f5432db7] | 19 | |
---|
| 20 | # Arrancar. |
---|
[36a4dfd] | 21 | echo "[10] Desmontar todos los sistemas de archivos." |
---|
| 22 | sync |
---|
| 23 | for (( i=1; i <= $(ogDiskToDev | wc -w); i++ )); do |
---|
| 24 | ogUnmountAll $i 2>/dev/null |
---|
| 25 | done |
---|
| 26 | echo "[20] Desmontar cache local." |
---|
| 27 | ogUnmountCache |
---|
[199bdf3] | 28 | case "$OSTYPE" in |
---|
[c7d9af7] | 29 | Windows) |
---|
[36a4dfd] | 30 | echo "30 Activar partición de Windows $PART." |
---|
[c7d9af7] | 31 | ogSetPartitionActive $1 $2 |
---|
[36a4dfd] | 32 | echo "40 Comprobar sistema de archivos." |
---|
[c7d9af7] | 33 | ogCheckFs $1 $2 |
---|
| 34 | NAME=$(ogGetHostname) |
---|
[4b9cdda] | 35 | echo "[50] Asignar nombre Windows \"$NAME\" y usuario por defecto." |
---|
[c7d9af7] | 36 | ogSetWindowsName $1 $2 "$NAME" |
---|
[4b9cdda] | 37 | ogSetWinlogonUser $1 $2 " " |
---|
[c7d9af7] | 38 | ;; |
---|
| 39 | Linux) |
---|
[36a4dfd] | 40 | echo "[30] Asignar nombre Linux \"$NAME\"." |
---|
[c7d9af7] | 41 | ETC=$(ogGetPath $1 $2 /etc) |
---|
| 42 | [ -d "$ETC" ] && echo "$NAME" >$ETC/hostname 2>/dev/null |
---|
| 43 | if [ -f "$ETC/fstab" ]; then |
---|
[36a4dfd] | 44 | echo "[50] Actaualizar fstab con partición raíz \"$PART\"." |
---|
[c7d9af7] | 45 | awk -v P="$PART " '{ if ($2=="/") {sub(/^.*$/, P, $1)} |
---|
| 46 | print } ' $ETC/fstab >/tmp/fstab |
---|
| 47 | mv /tmp/fstab $ETC/fstab |
---|
| 48 | fi |
---|
| 49 | ;; |
---|
| 50 | esac |
---|
[180a07dd] | 51 | echo "[90] Arrancar sistema operativo." |
---|
[3458879] | 52 | ogBoot $1 $2 |
---|
[f5432db7] | 53 | |
---|
Note: See
TracBrowser
for help on using the repository browser.