[b094c59] | 1 | #!/bin/bash |
---|
| 2 | #/** |
---|
| 3 | #@file Boot.lib |
---|
| 4 | #@brief Librería o clase Boot |
---|
| 5 | #@class Boot |
---|
| 6 | #@brief Funciones para arranque y post-configuración de sistemas de archivos. |
---|
| 7 | #@version 0.9 |
---|
| 8 | #@warning License: GNU GPLv3+ |
---|
| 9 | #*/ |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | #/** |
---|
| 13 | # ogBoot int_ndisk int_npartition |
---|
| 14 | #@brief Inicia el proceso de arranque de un sistema de archivos. |
---|
[f5432db7] | 15 | #@arg \c int_ndisk nº de orden del disco |
---|
| 16 | #@arg \c int_npartition nº de orden de la partición |
---|
[b094c59] | 17 | #@return (activar el sistema de archivos). |
---|
| 18 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
| 19 | #@exception OG_ERR_NOTFOUND Disco o particion no corresponden con un dispositivo. |
---|
| 20 | #@exception OG_ERR_PARTITION Tipo de partición desconocido o no se puede montar. |
---|
| 21 | #@exception OG_ERR_NOTOS La partición no tiene instalado un sistema operativo. |
---|
[f5432db7] | 22 | #@note En Linux, debe arrancarse la partición del directorio \c /boot |
---|
| 23 | #@version 0.9 - Adaptación para OpenGNSys. |
---|
[b094c59] | 24 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
| 25 | #@date 2009-09-11 |
---|
| 26 | #*/ |
---|
| 27 | function ogBoot () { |
---|
| 28 | |
---|
| 29 | # Variables locales. |
---|
[326cec3] | 30 | local PART TYPE MNTDIR PARAMS KERNEL INITRD APPEND FILE LOADER |
---|
[b094c59] | 31 | |
---|
| 32 | #/// Si se solicita, mostrar ayuda. |
---|
| 33 | if [ "$*" == "help" ]; then |
---|
| 34 | ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npartition" \ |
---|
| 35 | "$FUNCNAME 1 1" |
---|
| 36 | return |
---|
| 37 | fi |
---|
| 38 | #/// Error si no se reciben 2 parámetros. |
---|
| 39 | [ $# == 2 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 40 | |
---|
[4c63eb9] | 41 | #/// Detectar tipo de sistema de archivos y montarlo. |
---|
[b094c59] | 42 | TYPE=$(ogGetFsType $1 $2) || return $? |
---|
[f5432db7] | 43 | MNTDIR=$(ogMount $1 $2) 2>/dev/null |
---|
| 44 | [ -z "$MNTDIR" ] && ogRaiseError OG_ERR_PARTITION "$1, $2" && return $? |
---|
[b094c59] | 45 | |
---|
| 46 | case "$TYPE" in |
---|
[f5432db7] | 47 | EXT[234]|REISERFS|REISER4) |
---|
| 48 | #/// Obtiene los parámetros de arranque para Linux. |
---|
| 49 | PARAMS=$(ogLinuxBootParameters $1 $2) || return $? |
---|
| 50 | read -e KERNEL INITRD APPEND <<<"$PARAMS" |
---|
| 51 | # Si no hay kernel, no hay sistema operativo. |
---|
| 52 | [ -z "$KERNEL" ] && ogRaiseError $OG_ERR_NOTOS && return $? |
---|
| 53 | # Configurar kernel Linux con los parámetros leídos de su GRUB. |
---|
| 54 | kexec -l ${MNTDIR}${KERNEL} --append="$APPEND" --initrd=${MNTDIR}${INITRD} |
---|
| 55 | ;; |
---|
| 56 | NTFS|HNTFS|FAT32|HFAT32) |
---|
| 57 | #/// Compruebar si hay un cargador de Windows. |
---|
| 58 | for f in io.sys ntldr bootmgr; do |
---|
| 59 | FILE="$(ogGetPath $1 $2 $f 2>/dev/null)" |
---|
| 60 | [ -n "$FILE" ] && LOADER="$(basename $FILE)" |
---|
| 61 | done |
---|
| 62 | [ -z "$LOADER" ] && ogRaiseError $OG_ERR_NOTOS && return $? |
---|
| 63 | # Activar la partición y copiar Grub4DOS. |
---|
| 64 | ogSetPartitionActive $1 $2 |
---|
| 65 | cp $OGLIB/grub4dos/* $MNTDIR # */ (necesario para Doxygen) |
---|
| 66 | kexec -l $MNTDIR/grub.exe --append=--config-file="find --set-root /$LOADER; chainloader /$LOADER; tpm --init" |
---|
| 67 | ;; |
---|
| 68 | *) ogRaiseError $OG_ERR_PARTITION "$1, $2" |
---|
[326cec3] | 69 | return $? |
---|
[f5432db7] | 70 | ;; |
---|
[b094c59] | 71 | esac |
---|
| 72 | |
---|
[4c63eb9] | 73 | #/// Arrancar. |
---|
[b094c59] | 74 | kexec -e |
---|
| 75 | } |
---|
| 76 | |
---|
| 77 | |
---|
| 78 | #/** |
---|
[3e1561d] | 79 | # ogGetRegistryValue path_mountpoint str_registrytype str_valuename |
---|
| 80 | #@brief Devuelve el dato de un valor del registro de Windows. |
---|
[f5432db7] | 81 | #@arg \c path_mountpoint directorio donde está montado el sistema Windows |
---|
| 82 | #@arg \c str_registrytype tipo de registro a leer |
---|
| 83 | #@arg \c str_valuename valor de registro |
---|
[3e1561d] | 84 | #@return str_valuedata - valor de la clave. |
---|
[055adcf] | 85 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
[f5432db7] | 86 | #@exception OG_ERR_NOTFOUND Disco o partición no corresponden con un dispositivo. |
---|
[055adcf] | 87 | #@exception OG_ERR_PARTITION Tipo de partición desconocido o no se puede montar. |
---|
| 88 | #@note registrytype = { default, sam, security, software, system, components } |
---|
| 89 | #@warning Requisitos: chntpw, awk |
---|
| 90 | #@warning La partición de Windows debe estar montada previamente. |
---|
[f5432db7] | 91 | #@version 0.9 - Adaptación para OpenGNSys. |
---|
[055adcf] | 92 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
| 93 | #@date 2009-09-11 |
---|
| 94 | #*/ |
---|
[3e1561d] | 95 | function ogGetRegistryValue () { |
---|
[055adcf] | 96 | |
---|
| 97 | # Variables locales. |
---|
[50a094c] | 98 | local FILE FILENT FILEXP |
---|
[055adcf] | 99 | |
---|
| 100 | #/// Si se solicita, mostrar ayuda. |
---|
| 101 | if [ "$*" == "help" ]; then |
---|
| 102 | ogHelp "$FUNCNAME" "$FUNCNAME path_mountpoint str_registrytype str_key" |
---|
| 103 | return |
---|
| 104 | fi |
---|
| 105 | #/// Error si no se reciben 3 parámetros. |
---|
| 106 | [ $# == 3 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 107 | |
---|
| 108 | #/// Camino del fichero de registro en NT/2000 o XP/Vista/7. |
---|
| 109 | FILENT=$(ogGetPath "/$1/winnt/system32/config/$2") |
---|
[945b003] | 110 | [ -f $FILENT ] && FILE="$FILENT" |
---|
[055adcf] | 111 | FILEXP=$(ogGetPath "/$1/windows/system32/config/$2") |
---|
[945b003] | 112 | [ -f $FLEHXP ] && FILE="$FILEXP" |
---|
[055adcf] | 113 | [ ! -f $FILE ] && ogRaiseError OG_ERR_NOTFOUND "$1,$2" && return $? |
---|
| 114 | |
---|
[3e1561d] | 115 | #/// Devolver el dato del valor de registro. |
---|
[055adcf] | 116 | chntpw $FILE << FIN 2>/dev/null | awk '/> Value/ {getline;print $0;}' |
---|
| 117 | cd ${3%\\*} |
---|
| 118 | cat ${3##*\\} |
---|
| 119 | q |
---|
| 120 | FIN |
---|
| 121 | } |
---|
| 122 | |
---|
| 123 | |
---|
| 124 | #/** |
---|
[3e1561d] | 125 | # ogGetWindowsName int_ndisk int_npartition |
---|
| 126 | #@brief Muestra el nombre del equipo en el registro de Windows. |
---|
[f5432db7] | 127 | #@arg \c int_ndisk nº de orden del disco |
---|
| 128 | #@arg \c int_npartition nº de orden de la partición |
---|
[3e1561d] | 129 | #@return str_name - nombre del equipo |
---|
| 130 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
| 131 | #@exception OG_ERR_NOTFOUND Disco o particion no corresponden con un dispositivo. |
---|
| 132 | #@exception OG_ERR_PARTITION Tipo de partición desconocido o no se puede montar. |
---|
[f5432db7] | 133 | #@version 0.9 - Adaptación para OpenGNSys. |
---|
[3e1561d] | 134 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
| 135 | #@date 2009-09-23 |
---|
| 136 | #*/ |
---|
| 137 | function ogGetWindowsName () { |
---|
| 138 | |
---|
| 139 | # Variables locales. |
---|
| 140 | local PART MNTDIR |
---|
| 141 | |
---|
| 142 | #/// Si se solicita, mostrar ayuda. |
---|
| 143 | if [ "$*" == "help" ]; then |
---|
| 144 | ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npartition" \ |
---|
| 145 | "$FUNCNAME 1 1 ==> PRACTICA-PC" |
---|
| 146 | return |
---|
| 147 | fi |
---|
| 148 | #/// Error si no se reciben 2 parámetros. |
---|
| 149 | [ $# == 2 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 150 | |
---|
| 151 | #/// Montar el sistema de archivos. |
---|
[f5432db7] | 152 | MNTDIR=$(ogMount $1 $2) 2>/dev/null |
---|
| 153 | [ -z "$MNTDIR" ] && ogRaiseError OG_ERR_PARTITION "$1, $2" && return $? |
---|
[3e1561d] | 154 | |
---|
| 155 | #/// Obtener dato del valor de registro. |
---|
| 156 | ogGetRegistryValue $MNTDIR system '\ControlSet001\Control\ComputerName\ComputerName\ComputerName' |
---|
| 157 | } |
---|
| 158 | |
---|
| 159 | |
---|
| 160 | #/** |
---|
[50a094c] | 161 | # ogListRegistryKeys path_mountpoint str_registrytype str_key |
---|
[3e1561d] | 162 | #@brief Lista los nombres de claves de una determinada clave del registro de Windows. |
---|
[f5432db7] | 163 | #@arg \c path_mountpoint directorio donde está montado el sistema Windows |
---|
| 164 | #@arg \c str_registrytype tipo de registro a leer |
---|
| 165 | #@arg \c str_key clave de registro |
---|
[945b003] | 166 | #@return |
---|
[50a094c] | 167 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
| 168 | #@exception OG_ERR_NOTFOUND Disco o particion no corresponden con un dispositivo. |
---|
| 169 | #@exception OG_ERR_PARTITION Tipo de partición desconocido o no se puede montar. |
---|
| 170 | #@note registrytype = { default, sam, security, software, system, components } |
---|
| 171 | #@warning Requisitos: chntpw, awk |
---|
| 172 | #@warning La partición de Windows debe estar montada previamente. |
---|
[f5432db7] | 173 | #@version 0.9 - Adaptación para OpenGNSys. |
---|
[50a094c] | 174 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
| 175 | #@date 2009-09-23 |
---|
| 176 | #*/ |
---|
| 177 | function ogListRegistryKeys () { |
---|
| 178 | |
---|
| 179 | # Variables locales. |
---|
| 180 | local FILE FILENT FILEXP |
---|
| 181 | |
---|
| 182 | #/// Si se solicita, mostrar ayuda. |
---|
| 183 | if [ "$*" == "help" ]; then |
---|
| 184 | ogHelp "$FUNCNAME" "$FUNCNAME path_mountpoint str_registrytype str_key" |
---|
| 185 | return |
---|
| 186 | fi |
---|
| 187 | #/// Error si no se reciben 3 parámetros. |
---|
| 188 | [ $# == 3 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 189 | |
---|
| 190 | #/// Camino del fichero de registro en NT/2000 o XP/Vista/7. |
---|
| 191 | FILENT=$(ogGetPath "/$1/winnt/system32/config/$2") |
---|
[945b003] | 192 | [ -f $FILENT ] && FILE="$FILENT" |
---|
[50a094c] | 193 | FILEXP=$(ogGetPath "/$1/windows/system32/config/$2") |
---|
[945b003] | 194 | [ -f $FLEHXP ] && FILE="$FILEXP" |
---|
[50a094c] | 195 | [ ! -f $FILE ] && ogRaiseError OG_ERR_NOTFOUND "$1,$2" && return $? |
---|
| 196 | |
---|
| 197 | #/// Devolver la lista de claves de registro. |
---|
| 198 | chntpw $FILE << FIN 2>/dev/null | awk 'BEGIN {FS="[<>]"} $1~/^ $/ {print $2}' |
---|
| 199 | ls $3 |
---|
| 200 | q |
---|
| 201 | FIN |
---|
| 202 | } |
---|
| 203 | |
---|
| 204 | |
---|
| 205 | #/** |
---|
[4c63eb9] | 206 | # ogLinuxBootParameters int_ndisk int_npartition |
---|
[b094c59] | 207 | #@brief Muestra los parámetros de arranque de un sistema de archivos Linux. |
---|
[f5432db7] | 208 | #@arg \c int_ndisk nº de orden del disco |
---|
| 209 | #@arg \c int_npartition nº de orden de la partición |
---|
[b094c59] | 210 | #@return kernel initrd parámetros ... |
---|
| 211 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
| 212 | #@exception OG_ERR_NOTFOUND Disco o particion no corresponden con un dispositivo. |
---|
| 213 | #@exception OG_ERR_PARTITION Tipo de partición desconocido o no se puede montar. |
---|
[055adcf] | 214 | #@warning Función básica usada por \c ogBoot |
---|
| 215 | #@version 0.9 - Primera adaptación para OpenGNSys. |
---|
[b094c59] | 216 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
| 217 | #@date 2009-09-11 |
---|
| 218 | #*/ |
---|
| 219 | function ogLinuxBootParameters () { |
---|
| 220 | |
---|
| 221 | # Variables locales. |
---|
[4c63eb9] | 222 | local MNTDIR CONF |
---|
[b094c59] | 223 | |
---|
| 224 | #/// Si se solicita, mostrar ayuda. |
---|
| 225 | if [ "$*" == "help" ]; then |
---|
| 226 | ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npartition" \ |
---|
| 227 | "$FUNCNAME 1 2 ==> ..." |
---|
| 228 | return |
---|
| 229 | fi |
---|
| 230 | #/// Error si no se reciben 2 parámetros. |
---|
| 231 | [ $# == 2 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 232 | |
---|
| 233 | #/// Detectar id. de tipo de partición y codificar al mnemonico. |
---|
[f5432db7] | 234 | MNTDIR=$(ogMount $1 $2) 2>/dev/null |
---|
| 235 | [ -z "$MNTDIR" ] && ogRaiseError OG_ERR_PARTITION "$1, $2" && return $? |
---|
[b094c59] | 236 | |
---|
| 237 | # Fichero de configuración de GRUB. |
---|
| 238 | CONF="$MNTDIR/boot/grub/menu.lst" |
---|
[ee4a96e] | 239 | [ ! -e $CONF ] && CONF="$MNTDIR/boot/grub/grub.cfg" |
---|
| 240 | [ ! -e $CONF ] && ogRaiseError $OG_ERR_NOTFOUND "grub.cfg" && return $? |
---|
[b094c59] | 241 | |
---|
[4c63eb9] | 242 | #/** Toma del fichero de configuracion los valores del kernel, initrd |
---|
[ee4a96e] | 243 | # y parámetros de arranque usando las cláusulas por defecto |
---|
| 244 | # ("default" en GRUB1, "set default" en GRUB2) |
---|
| 245 | # y los formatea para que sean compatibles con \c kexec . */ |
---|
[3d0750f] | 246 | #/* (ncesario para Doxygen) |
---|
[b094c59] | 247 | awk 'BEGIN {cont=-1;} |
---|
| 248 | $1~/^default/ {sub(/=/," "); def=$2;} |
---|
[18f4bc2] | 249 | $1~/^set/ && $2~/^default/ {gsub(/[="]/," "); def=$3;} |
---|
[ee4a96e] | 250 | $1~/^title|^menuentry/ {cont++} |
---|
| 251 | $1~/^kernel|^linux/ {if (def==cont) { |
---|
[b094c59] | 252 | kern=$2; |
---|
[c56dec5] | 253 | sub($1,"");sub($1,"");sub(/^[ \t]*/,"");app=$0} |
---|
[b094c59] | 254 | } |
---|
| 255 | $1~/^initrd/ {if (def==cont) init=$2} |
---|
| 256 | END {if (kern!="") printf("%s %s %s", kern,init,app)} |
---|
| 257 | ' $CONF |
---|
| 258 | } |
---|
| 259 | |
---|
[3e1561d] | 260 | |
---|
| 261 | |
---|
| 262 | #/** |
---|
| 263 | # ogSetRegistryValue path_mountpoint str_registrytype str_valuename str_valuedata |
---|
| 264 | #@brief Establece el dato asociado a un valor del registro de Windows. |
---|
[f5432db7] | 265 | #@arg \c path_mountpoint directorio donde está montado el sistema Windows |
---|
| 266 | #@arg \c str_registrytype tipo de registro |
---|
| 267 | #@arg \c str_valuename nombre del valor de registro |
---|
| 268 | #@arg \c str_valuedata dato del valor de registro |
---|
[3e1561d] | 269 | #@return (nada) |
---|
| 270 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
[f5432db7] | 271 | #@exception OG_ERR_NOTFOUND Disco o partición no corresponden con un dispositivo. |
---|
[3e1561d] | 272 | #@exception OG_ERR_PARTITION Tipo de partición desconocido o no se puede montar. |
---|
| 273 | #@note registrytype = { default, sam, security, software, system, components } |
---|
| 274 | #@warning Requisitos: chntpw, awk |
---|
| 275 | #@warning La partición de Windows debe estar montada previamente. |
---|
[f5432db7] | 276 | #@version 0.9 - Adaptación para OpenGNSys. |
---|
[3e1561d] | 277 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
| 278 | #@date 2009-09-24 |
---|
| 279 | #*/ |
---|
| 280 | function ogSetRegistryValue () { |
---|
| 281 | |
---|
| 282 | # Variables locales. |
---|
| 283 | local FILE FILENT FILEXP |
---|
| 284 | |
---|
| 285 | #/// Si se solicita, mostrar ayuda. |
---|
| 286 | if [ "$*" == "help" ]; then |
---|
| 287 | ogHelp "$FUNCNAME" "$FUNCNAME path_mountpoint str_registrytype str_key" |
---|
| 288 | return |
---|
| 289 | fi |
---|
| 290 | #/// Error si no se reciben 4 parámetros. |
---|
| 291 | [ $# == 4 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 292 | |
---|
| 293 | #/// Camino del fichero de registro en NT/2000 o XP/Vista/7. |
---|
| 294 | FILENT=$(ogGetPath "/$1/winnt/system32/config/$2") |
---|
[945b003] | 295 | [ -f $FILENT ] && FILE="$FILENT" |
---|
[3e1561d] | 296 | FILEXP=$(ogGetPath "/$1/windows/system32/config/$2") |
---|
[945b003] | 297 | [ -f $FLEHXP ] && FILE="$FILEXP" |
---|
[3e1561d] | 298 | [ ! -f $FILE ] && ogRaiseError OG_ERR_NOTFOUND "$1,$2" && return $? |
---|
| 299 | |
---|
| 300 | #/// Cambiar el dato del valor de registro. |
---|
[f5432db7] | 301 | chntpw $FILE << FIN &>/dev/null |
---|
[3e1561d] | 302 | ed $3 |
---|
| 303 | $4 |
---|
| 304 | q |
---|
| 305 | y |
---|
| 306 | FIN |
---|
| 307 | } |
---|
| 308 | |
---|
| 309 | |
---|
| 310 | #/** |
---|
| 311 | # ogSetWindowsName int_ndisk int_npartition str_name |
---|
| 312 | #@brief Establece el nombre del equipo en el registro de Windows. |
---|
[f5432db7] | 313 | #@arg \c int_ndisk nº de orden del disco |
---|
| 314 | #@arg \c int_npartition nº de orden de la partición |
---|
| 315 | #@arg \c str_name nombre asignado |
---|
[3e1561d] | 316 | #@return (nada) |
---|
| 317 | #@exception OG_ERR_FORMAT Formato incorrecto. |
---|
| 318 | #@exception OG_ERR_NOTFOUND Disco o particion no corresponden con un dispositivo. |
---|
| 319 | #@exception OG_ERR_PARTITION Tipo de partición desconocido o no se puede montar. |
---|
[f5432db7] | 320 | #@version 0.9 - Adaptación a OpenGNSys. |
---|
[3e1561d] | 321 | #@author Ramon Gomez, ETSII Universidad de Sevilla |
---|
| 322 | #@date 2009-09-24 |
---|
| 323 | #*/ |
---|
| 324 | function ogSetWindowsName () { |
---|
| 325 | |
---|
| 326 | # Variables locales. |
---|
| 327 | local PART MNTDIR NAME |
---|
| 328 | |
---|
| 329 | #/// Si se solicita, mostrar ayuda. |
---|
| 330 | if [ "$*" == "help" ]; then |
---|
| 331 | ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk int_npartition" \ |
---|
| 332 | "$FUNCNAME 1 1 PRACTICA-PC" |
---|
| 333 | return |
---|
| 334 | fi |
---|
| 335 | #/// Error si no se reciben 3 parámetros. |
---|
| 336 | [ $# == 3 ] || ogRaiseError $OG_ERR_FORMAT || return $? |
---|
| 337 | |
---|
| 338 | #/// Montar el sistema de archivos. |
---|
[f5432db7] | 339 | MNTDIR=$(ogMount $1 $2) 2>/dev/null |
---|
| 340 | [ -z "$MNTDIR" ] && ogRaiseError OG_ERR_PARTITION "$1, $2" && return $? |
---|
[3e1561d] | 341 | NAME="$3" |
---|
| 342 | |
---|
| 343 | #/// Modificar datos de los valores de registro. |
---|
[f5432db7] | 344 | ogSetRegistryValue $MNTDIR system '\ControlSet001\Control\ComputerName\ComputerName\ComputerName' "$NAME" |
---|
| 345 | ogSetRegistryValue $MNTDIR system '\ControlSet001\Services\Tcpip\Parameters\Hostname' "$NAME" |
---|
| 346 | ogSetRegistryValue $MNTDIR system '\ControlSet001\Services\Tcpip\Parameters\NV Hostname' "$NAME" |
---|
[3e1561d] | 347 | } |
---|
| 348 | |
---|
[f5432db7] | 349 | |
---|
[a781d7b] | 350 | function ogNewMbrXP () { |
---|
[945b003] | 351 | #/** @function NewMbrXP: @brief Genera un nuevo Master Boot Record en el disco duro indicado, compatible con los SO tipo Windows |
---|
| 352 | #@param $1 obligatorio int_numdisk |
---|
| 353 | #@return salida del programa my-sys |
---|
| 354 | #@warning no definidos |
---|
| 355 | #@attention Requisitos: my-sys, compilado ubicado en /var/EAC/admin/source |
---|
| 356 | #@note |
---|
| 357 | #@version 0.1 Date: 27/10/2008 Author Antonio J. Doblas Viso. Universidad de Malaga |
---|
| 358 | #*/ |
---|
| 359 | # |
---|
| 360 | if [ $# = 0 ] |
---|
| 361 | then |
---|
| 362 | Msg "sintaxis: ogNewMbrXP int_disco " red |
---|
| 363 | return |
---|
| 364 | fi |
---|
| 365 | if [ $# = 1 ] |
---|
| 366 | then |
---|
| 367 | particion=`ogDiskToDev $1` |
---|
| 368 | ms-sys -z -f $particion |
---|
| 369 | ms-sys -m -f $particion |
---|
| 370 | fi |
---|
| 371 | } |
---|