summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrina Gómez <irinagomez@us.es>2020-05-05 12:53:47 +0200
committerIrina Gómez <irinagomez@us.es>2020-05-05 12:53:47 +0200
commit9fe0fe30b7b844c04f72b7506a503df257902c11 (patch)
tree69fb2b96807791e7de58b8430fc88dca79c8a568
parente521fb869b8734ee80b9541157109f4451560012 (diff)
#841 Fixes bug in partitioning wizard when configure MBR: ogGetBootMbr function is created for detect MBR content and used in wizard.
-rw-r--r--admin/WebConsole/asistentes/jscripts/asistentes.js4
-rwxr-xr-xclient/engine/Boot.lib30
2 files changed, 32 insertions, 2 deletions
diff --git a/admin/WebConsole/asistentes/jscripts/asistentes.js b/admin/WebConsole/asistentes/jscripts/asistentes.js
index 8f521e44..ccfcd0cc 100644
--- a/admin/WebConsole/asistentes/jscripts/asistentes.js
+++ b/admin/WebConsole/asistentes/jscripts/asistentes.js
@@ -298,7 +298,7 @@ if [ $EVAL -eq 0 ]; then \n \
ogSetPartitionActive "+n_disk+" 1 \n \
ogEcho log session \"[90] $MSG_HELP_ogListPartitions "+n_disk+"\"\n \
ogUpdatePartitionTable "+n_disk+" \n \
- ms-sys /dev/sda | grep unknow && ms-sys /dev/sda \n \
+ ogGetBootMbr "+n_disk+" | grep unknow && ogBootMbrGeneric "+n_disk+" \n \
ogExecAndLog command session log ogListPartitions "+n_disk+" \n\
"+ swapCode +"\
if ogFindCache &>/dev/null; then \n\
@@ -403,7 +403,7 @@ if [ $EVAL -eq 0 ]; then \n \
ogSetPartitionActive "+n_disk+" 1 \n \
ogEcho log session \"[90] $MSG_HELP_ogListPartitions "+n_disk+"\"\n \
ogUpdatePartitionTable "+n_disk+" \n \
- ms-sys /dev/sda | grep unknow && ms-sys /dev/sda \n \
+ ogGetBootMbr "+n_disk+" | grep -e unknow -e zeroed && ogBootMbrGeneric "+n_disk+" \n \
ogExecAndLog command session log ogListPartitions "+n_disk+" \n \
if ogFindCache &>/dev/null; then \n\
ogMountCache || ogFormatCache \n\
diff --git a/client/engine/Boot.lib b/client/engine/Boot.lib
index 81f28f83..aa77b4f9 100755
--- a/client/engine/Boot.lib
+++ b/client/engine/Boot.lib
@@ -505,6 +505,36 @@ rm -f $FILE
}
+#/**
+# ogGetBootMbr int_ndisk
+#@brief Obtiene el contenido del sector de arranque de un disco.
+#@param int_ndisk nº de orden del disco
+#@return str_MBR Descripción del contenido del MBR.
+#@exception OG_ERR_FORMAT Formato incorrecto.
+#@exception OG_ERR_NOTFOUND Dispositivo de disco no encontrado.
+#@version 1.1.1b - Primera versión
+#@author Irina Gómez (US). Propuesto por Antonio J. Doblas Viso (UMA)
+#@date 2020-04-05
+#*/ ##
+function ogGetBootMbr ()
+{
+# Variables locales.
+local DISK
+
+# Si se solicita, mostrar ayuda.
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk " \
+ "$FUNCNAME 1"
+ return
+fi
+
+# Error si no se recibe 1 parámetro.
+[ $# == 1 ] || ogRaiseError $OG_ERR_FORMAT "$FUNCNAME int_ndisk" || return $?
+
+DISK="$(ogDiskToDev $1)" || return $?
+
+ms-sys -f $DISK
+}
#/**
# ogWindowsBootParameters int_ndisk int_parition