summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xclient/engine/Boot.lib27
-rwxr-xr-xinstaller/opengnsys_update.sh2
-rwxr-xr-xserver/bin/setclientmode17
-rw-r--r--server/etc/dhcpd.conf.tmpl2
4 files changed, 24 insertions, 24 deletions
diff --git a/client/engine/Boot.lib b/client/engine/Boot.lib
index a443e055..c1a9a5d0 100755
--- a/client/engine/Boot.lib
+++ b/client/engine/Boot.lib
@@ -69,21 +69,18 @@ case "$TYPE" in
# Activar la partición y copiar Grub4DOS.
ogSetPartitionActive $1 $2
#FIXME: activar seguimiento inicio sesion Windows con grub4dos
- #if `ogGetOsVersion $1 $2 | grep "Windows" > /dev/null`
- #then
- # for i in `ls /mnt/`; do rm /mnt/$i/ogboot.* &>/dev/null; done
- # dd if=/dev/zero of=${MNTDIR}/ogboot.me bs=1024 count=3
- # dd if=/dev/zero of=${MNTDIR}/ogboot.firstboot bs=1024 count=3
- # dd if=/dev/zero of=${MNTDIR}/ogboot.secondboot bs=1024 count=3
- # ogLoadHiveWindows $1 $2
- # ogHiveNTRunMachine "cmd /c del c:\ogboot.* " ogcleanboot
- # ogUpdateHiveWindows
- # reboot
- #else
- cp $OGLIB/grub4dos/* $MNTDIR # */ (Comentario Doxygen)
- ##kexec -l $MNTDIR/grub.exe --append=--config-file="find --set-root /$LOADER; chainloader /$LOADER; tpm --init"
- kexec -l $MNTDIR/grub.exe --append=--config-file="root (hd$[$1-1],$[$2-1]); chainloader (hd$[$1-1],$[$2-1])/$LOADER; tpm --init"
- #fi
+ if [ "$(ogGetOsType $1 $2)" == "Windows" ]; 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
+ dd if=/dev/zero of=${MNTDIR}/ogboot.secondboot bs=1024 count=3
+ ogLoadHiveWindows $1 $2
+ ogHiveNTRunMachine "cmd /c del c:\ogboot.*" ogcleanboot
+ ogUpdateHiveWindows
+ reboot
+ else
+ cp $OGLIB/grub4dos/* $MNTDIR # */ (Comentario Doxygen)
+ kexec -l $MNTDIR/grub.exe --append=--config-file="root (hd$[$1-1],$[$2-1]); chainloader (hd$[$1-1],$[$2-1])/$LOADER; tpm --init"
+ fi
;;
*) ogRaiseError $OG_ERR_PARTITION "$1, $2"
return $?
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh
index 015a9fca..127f3745 100755
--- a/installer/opengnsys_update.sh
+++ b/installer/opengnsys_update.sh
@@ -456,6 +456,8 @@ function updateServerFiles()
fi
done
popd >/dev/null
+ echoAndLog "${FUNCNAME}(): updating DHCP files"
+ perl -pi -e 's/pxelinux.0/grldr/' /etc/dhcp*/dhcpd*.conf
echoAndLog "${FUNCNAME}(): updating cron files"
echo "* * * * * root [ -x $INSTALL_TARGET/bin/torrent-creator ] && $INSTALL_TARGET/bin/torrent-creator" > /etc/cron.d/torrentcreator
echoAndLog "${FUNCNAME}(): server files updated successfully."
diff --git a/server/bin/setclientmode b/server/bin/setclientmode
index 0cc57002..a934783e 100755
--- a/server/bin/setclientmode
+++ b/server/bin/setclientmode
@@ -11,7 +11,8 @@
PROG=$(basename $0)
OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
SERVERCONF=$OPENGNSYS/etc/ogAdmServer.cfg
-PXEDIR=$OPENGNSYS/tftpboot/pxelinux.cfg
+PXEDIR=$OPENGNSYS/tftpboot/menu.lst
+TEMPLATE="$PXEDIR/templates/$1"
LOGFILE=$OPENGNSYS/log/opengnsys.log
# Control básico de errores.
@@ -24,8 +25,8 @@ if [ ! -r $SERVERCONF ]; then
echo "$PROG: Sin acceso a fichero de configuración"
exit 2
fi
-if [ ! -e $PXEDIR/"$1" ]; then
- echo "No existe archivo platilla: $PXEDIR/$1"
+if [ ! -e $TEMPLATE ]; then
+ echo "No existe archivo platilla: $TEMPLATE"
exit
fi
@@ -49,18 +50,18 @@ if [ -z "$ETHERNET" ]; then
exit 1
fi
-# Creamos los enlaces
-# PXE no permite enlaces simbolicos y las letras han de ir en minuscula
+# Copiar fichero de configuración y actualizar base de datos.
date +"%b %d %T $PROG: Configurando \"$1\" en \"$2\"" | tee -a $LOGFILE
NPC=0
for AUX in $ETHERNET; do
date +"%b %d %T $PROG: Detectada ethernet \"$AUX\" en \"$2\"" | tee -a $LOGFILE
- AUX=$(echo $AUX | awk '{print tolower($0)}')
AUX="01-${AUX:0:2}-${AUX:2:2}-${AUX:4:2}-${AUX:6:2}-${AUX:8:2}-${AUX:10:2}"
# Si existe anteriormente lo borra
[ -e $PXEDIR/$AUX ] && rm $PXEDIR/$AUX
- if [ "$1" != "default" ]; then
- ln $PXEDIR/"$1" $PXEDIR/$AUX
+ if [ "$1" != "default" ]; thenm
+ cp -a $TEMPLATE $PXEDIR/$AUX
+ mysql -u "$USUARIO" -p"$PASSWORD" -D "$CATALOG" -N -e \
+ "UPDATE ordenadores SET arranque=\"$1\" WHERE mac=\"$ETHERNET\";"
fi
let NPC=NPC+1
done
diff --git a/server/etc/dhcpd.conf.tmpl b/server/etc/dhcpd.conf.tmpl
index 687bbf0f..fb6afa00 100644
--- a/server/etc/dhcpd.conf.tmpl
+++ b/server/etc/dhcpd.conf.tmpl
@@ -10,7 +10,7 @@ subnet NETIP netmask NETMASK {
default-lease-time 600;
max-lease-time 7200;
next-server SERVERIP;
- filename "pxelinux.0";
+ filename "grldr";
use-host-decl-names on;
# host HOSTNAME1 {