source: client/shared/scripts/bootOs @ f160ff2

test-python-scriptsticket-693
Last change on this file since f160ff2 was 927f98c, checked in by Irina Gómez <irinagomez@…>, 3 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
RevLine 
[f5432db7]1#!/bin/bash
[6963f42]2# Script de ejemplo para arancar un sistema operativo instalado.
[5b825b50]3# Nota: se usa como base para el programa de arranque de OpenGnsys Admin.
[f5432db7]4
5PROG="$(basename $0)"
[5359439]6if [ $# -lt 2 -o $# -gt 3 ]; then
[dc4eac6]7    ogRaiseError $OG_ERR_FORMAT "Formato: $PROG ndisco nfilesys [str_kernel str_initrd str_kernelparams]"
[f5432db7]8    exit $?
9fi
10
[4dd4e42]11# Comprobar errores.
[c7d9af7]12PART=$(ogDiskToDev "$1" "$2") || exit $?
[927f98c]13MNTDIR=$(ogMount $1 $2) || exit $?
[4dd4e42]14
15echo "[0] Inicio del proceso de arranque."
[6963f42]16
[927f98c]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
[6963f42]34if which bootOsCustom  &>/dev/null; then
[c436360]35    echo "[10] Configuración personalizada del inicio."
[6963f42]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."
[bfeb89a]45ogUnmountCache
[180a07dd]46echo "[90] Arrancar sistema operativo."
[6963f42]47ogBoot "$@"
Note: See TracBrowser for help on using the repository browser.