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