version 1.0.1 #402 Gestion completa restauracion/arranque windows en particiones distintas a la original de la imagen. Permite varios windows independientes.

git-svn-id: https://opengnsys.es/svn/branches/version1.0@2013 a21b9725-9963-47de-94b9-378ad31fedc9
remotes/github/debian-pkg
Antonio Doblas Viso 2011-05-22 18:13:08 +00:00
parent 276d88fbb8
commit 78b5dfe77e
5 changed files with 36 additions and 16 deletions

View File

@ -69,7 +69,7 @@ case "$TYPE" in
# Activar la partición y copiar Grub4DOS.
ogSetPartitionActive $1 $2
#FIXME: activar seguimiento inicio sesion XP con grub4dos
#if `ogGetOsVersion 1 1 | grep "XP" > /dev/null`
#if `ogGetOsVersion $1 $2 | grep "XP" > /dev/null`
#then
# dd if=/dev/zero of=${MNTDIR}/ogboot.me bs=1024 count=3
# dd if=/dev/zero of=${MNTDIR}/ogboot.firstboot bs=1024 count=3
@ -506,15 +506,18 @@ spartlnx.run -cui -nm -a -f $FILE
#/**
# ogWindowsBootParameters int_ndisk int_parition
#@brief Configura el gestor de arranque de windows 7 / vista
#@brief Configura el gestor de arranque de windows 7 / vista / XP / 2000
#@param int_ndisk nº de orden del disco
#@param int_partition nº de particion
#@return
#@exception OG_ERR_FORMAT Formato incorrecto.
#@exception OG_ERR_PARTITION Tipo de partición desconocido o no se puede montar.
#@version 0.9 - Adaptación a OpenGNSys.
#@version 0.9 - Integración desde EAC para OpenGNSys.
#@author Antonio J. Doblas Viso. Universidad de Málaga
#@date 2009-09-24
#@version 1.0.1 - Adapatacion para OpenGnsys.
#@author Antonio J. Doblas Viso. Universidad de Málaga
#@date 2011-05-20
#*/ ##
@ -522,6 +525,10 @@ function ogWindowsBootParameters ()
{
# Variables locales.
local PART DISK FILE
#Preparando variables adaptadas a sintaxis windows.
let DISK=$1-1
PART=$2
FILE=/tmp/temporal
# Si se solicita, mostrar ayuda.
if [ "$*" == "help" ]; then
@ -537,21 +544,24 @@ ogDiskToDev $1 $2 || return $(ogRaiseError $OG_ERR_PARTITION; echo $?)
VERSION=$(ogGetOsVersion $1 $2)
if echo $VERSION | grep "Windows 7"
if echo "$VERSION" | grep "Windows 7"
then
WINVER="Windows 7"
elif echo $VERSION | grep "Windows Seven"
elif echo "$VERSION" | grep "Windows Seven"
then
WINVER="Windows Vista"
elif echo "$VERSION" | grep "XP"
then
MOUNT=$(ogMount $1 $2)
[ -f ${MOUNT}/boot.ini ] || return $(ogRaiseError $OG_ERR_NOTOS; echo $?)
cat ${MOUNT}/boot.ini | sed s/partition\([0-9]\)/partition\($PART\)/g | sed s/rdisk\([0-9]\)/rdisk\($DISK\)/g > ${MOUNT}/tmp.boot.ini; mv ${MOUNT}/tmp.boot.ini ${MOUNT}/boot.ini
return 0
else
return $(ogRaiseError $OG_ERR_NOTOS; echo $?)
fi
ogUnmount $1 $2 || return $(ogRaiseError $OG_ERR_PARTITION; echo $?)
#Preparando instruccion
let DISK=$1-1
PART=$2
FILE=/tmp/temporal
#Preparando instruccion Windows Resume Application
cat > $FILE <<EOF
@ -606,7 +616,7 @@ spartlnx.run -cui -nm -w -f $FILE
}
# ogWinRegistrePartition int_ndisk int_partiton str_volume int_disk int_partition
# ogWindowsRegisterPartition int_ndisk int_partiton str_volume int_disk int_partition
#@brief Registra una partición en windows con un determinado volumen.
#@param int_ndisk nº de orden del disco a registrar
#@param int_partition nº de particion a registrar
@ -622,7 +632,7 @@ spartlnx.run -cui -nm -w -f $FILE
#*/ ##
function ogWinRegistrePartition ()
function ogWindowsRegisterPartition ()
{
# Variables locales.
local PART DISK FILE

View File

@ -12,6 +12,10 @@
#@version 1.0.1 - Integracion cambio de nombre, extender fs, chequear particion activa
#@author
#@date 2011-05-11
#@version 1.0.1 - Configura el sector de la particion y el gestor de windows para iniciarse desde cualquier particion.
#@author Antonio J. Doblas Viso. Universidad de Malaga.
#@date 2011-05-20
# Si el sistema de archivos no esta extendido. Realizar.
@ -33,4 +37,10 @@ if [ "$(ogGetOsType $1 $2)" = "Windows" ]; then
echo " Cambiar nombre Windows a \"$HOST\" "
ogSetWindowsName $1 $2 "$HOST"
#ogSetWinlogonUser $1 $2 " " # Descomentar para cambiar usuario de inicio.
# Configurar el boot sector de la particion windows.
ogFixBootSector $1 $2
# Configura el gestor de arranque de windows xp vista seven
ogWindowsBootParameters $1 $2
# Registra en windows que la particion indicada es su nueva unidad c:\
ogWindowsRegisterPartition $1 $2 C $1 $2
fi

View File

@ -19,7 +19,7 @@ Activar el grldr del grub4dos
4)
En la funcion ogBoot, de la libreria Boot.lib descomentar los comentarios del if de las líneas 71 a 85, para que quede
#FIXME: activar seguimiento inicio sesion XP con grub4dos
if `ogGetOsVersion 1 1 | grep "XP" > /dev/null`
if `ogGetOsVersion $1 $2 | grep "XP" > /dev/null`
then
dd if=/dev/zero of=${MNTDIR}/ogboot.me bs=1024 count=3
dd if=/dev/zero of=${MNTDIR}/ogboot.firstboot bs=1024 count=3

View File

@ -7,7 +7,7 @@ title firsboot
find --set-root --ignore-floppies --ignore-cd /ogboot.me
cmp /ogboot.me /ogboot.firstboot || ls FALLBACK
write /ogboot.firstboot iniciado
chainloader /ntldr
chainloader +1
savedefault fallback
boot
@ -15,7 +15,7 @@ title secondboot
find --set-root --ignore-floppies --ignore-cd /ogboot.me
cmp /ogboot.me /ogboot.secondboot || ls FALLBACK
write /ogboot.secondboot iniciado
chainloader /ntldr
chainloader +1
savedefault fallback
boot

View File

@ -7,7 +7,7 @@ title firsboot
find --set-root --ignore-floppies --ignore-cd /ogboot.me
cmp /ogboot.me /ogboot.firstboot || ls FALLBACK
write /ogboot.firstboot iniciado
chainloader /ntldr
chainloader +1
savedefault fallback
boot
@ -15,7 +15,7 @@ title secondboot
find --set-root --ignore-floppies --ignore-cd /ogboot.me
cmp /ogboot.me /ogboot.secondboot || ls FALLBACK
write /ogboot.secondboot iniciado
chainloader /ntldr
chainloader +1
savedefault fallback
boot