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 3f73876 was
b0ff94d,
checked in by ramon <ramongomez@…>, 14 years ago
|
Versión 1.0.2: Correcciones en scripts de arranque y restauración:
bootOs - elimina las marcas de Windows (arranque con varios Windows instalados).
bootLinux y bootWindows - son enlaces simbólicos de bootOs (posible eliminación).
restoreImage - llama a configureOs para proceso de postconfiguración.
Cerrar ticket #444.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@2343 a21b9725-9963-47de-94b9-378ad31fedc9
|
-
Property mode set to
100755
|
File size:
1.5 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 $? |
---|
[b0ff94d] | 13 | NAME="$(ogGetHostname)" |
---|
[c7d9af7] | 14 | NAME=${NAME:-"pc"} |
---|
[199bdf3] | 15 | OSTYPE=$(ogGetOsType $1 $2) |
---|
[b0ff94d] | 16 | # Borrar marcas de arrranque Windows. |
---|
| 17 | [ "$OSTYPE" == "Windows" ] && rm -f /mnt/*/ogboot.* |
---|
[f5432db7] | 18 | |
---|
[36a4dfd] | 19 | echo "[10] Desmontar todos los sistemas de archivos." |
---|
| 20 | sync |
---|
| 21 | for (( i=1; i <= $(ogDiskToDev | wc -w); i++ )); do |
---|
| 22 | ogUnmountAll $i 2>/dev/null |
---|
| 23 | done |
---|
[199bdf3] | 24 | case "$OSTYPE" in |
---|
[c7d9af7] | 25 | Windows) |
---|
[bfeb89a] | 26 | echo "[30] Activar particion de Windows $PART." |
---|
[c7d9af7] | 27 | ogSetPartitionActive $1 $2 |
---|
[4b9cdda] | 28 | echo "[50] Asignar nombre Windows \"$NAME\" y usuario por defecto." |
---|
[c7d9af7] | 29 | ogSetWindowsName $1 $2 "$NAME" |
---|
| 30 | ;; |
---|
| 31 | Linux) |
---|
[36a4dfd] | 32 | echo "[30] Asignar nombre Linux \"$NAME\"." |
---|
[c7d9af7] | 33 | ETC=$(ogGetPath $1 $2 /etc) |
---|
| 34 | [ -d "$ETC" ] && echo "$NAME" >$ETC/hostname 2>/dev/null |
---|
| 35 | if [ -f "$ETC/fstab" ]; then |
---|
[bfeb89a] | 36 | echo "[50] Actaualizar fstab con particion raiz \"$PART\"." |
---|
[c7d9af7] | 37 | awk -v P="$PART " '{ if ($2=="/") {sub(/^.*$/, P, $1)} |
---|
| 38 | print } ' $ETC/fstab >/tmp/fstab |
---|
| 39 | mv /tmp/fstab $ETC/fstab |
---|
| 40 | fi |
---|
| 41 | ;; |
---|
| 42 | esac |
---|
[bfeb89a] | 43 | echo "[70] Desmontar cache local." |
---|
| 44 | ogUnmountCache |
---|
[180a07dd] | 45 | echo "[90] Arrancar sistema operativo." |
---|
[3458879] | 46 | ogBoot $1 $2 |
---|
[f5432db7] | 47 | |
---|
Note: See
TracBrowser
for help on using the repository browser.