source: client/shared/scripts/bootOs

qndtest
Last change on this file was 927f98c, checked in by Irina Gómez <irinagomez@…>, 2 years ago

#1066 #1011 Fix the error when Windows is hibernated. "Error code 6" was displayed in the boot menu.

  • Property mode set to 100755
File size: 1.2 KB
Line 
1#!/bin/bash
2# Script de ejemplo para arancar un sistema operativo instalado.
3# Nota: se usa como base para el programa de arranque de OpenGnsys Admin.
4
5PROG="$(basename $0)"
6if [ $# -lt 2 -o $# -gt 3 ]; then
7    ogRaiseError $OG_ERR_FORMAT "Formato: $PROG ndisco nfilesys [str_kernel str_initrd str_kernelparams]"
8    exit $?
9fi
10
11# Comprobar errores.
12PART=$(ogDiskToDev "$1" "$2") || exit $?
13MNTDIR=$(ogMount $1 $2) || exit $?
14
15echo "[0] Inicio del proceso de arranque."
16
17# Si el equipo está hibernado chequeamos el f.s. y borramos el hiberfile (error cod.6)
18mount |grep -q "$MNTDIR.*(rw"
19if [ $? -ne 0 ]; then
20    ogEcho log session "${MSG_WARNING}: $MSG_MOUNTREADONLY"
21    ogUnmount $1 $2
22    ogCheckFs $1 $2
23
24    PART=$(ogDiskToDev "$1" "$2")
25    mkdir -p $MNTDIR
26    ntfs-3g -o remove_hiberfile $PART $MNTDIR
27    ogEcho log session "Particion desbloqueada"
28
29    ogUnmount $1 $2
30    ogMount $1 $2
31fi
32
33
34if which bootOsCustom  &>/dev/null; then
35    echo "[10] Configuración personalizada del inicio."
36    bootOsCustom $@
37fi
38
39echo "[70] Desmontar todos los sistemas de archivos."
40sync
41for (( i=1; i <= $(ogDiskToDev | wc -w); i++ )); do
42    ogUnmountAll $i &>/dev/null
43done
44echo "[80] Desmontar cache local."
45ogUnmountCache
46echo "[90] Arrancar sistema operativo."
47ogBoot "$@"
Note: See TracBrowser for help on using the repository browser.