summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authoradv <adv@uma.es>2017-05-31 13:05:27 +0000
committeradv <adv@uma.es>2017-05-31 13:05:27 +0000
commit5e7555dc5a0092d68a8fe11853fe50169a7adc17 (patch)
treeeb6cde973c9f220d7986ef25e82c921e6ec6a906 /client
parente0e571de361289756b3bdfc6f4c83fb6a24824e8 (diff)
#768 #528 Multiples ogLives en la CACHE. Los componentes del ogLive están todos dentro de un solo directorio, identificado con su nombre y versión. En el servidor están en tftpboot/ogLivexxx y en la cache se almacenarán en /boot/ogLiveXXX
El tftp del busybox permite acceder a subdirectorios del recurso tftp. git-svn-id: https://opengnsys.es/svn/branches/version1.1@5326 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client')
-rw-r--r--client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions13
-rwxr-xr-xclient/shared/scripts/updateBootCache24
2 files changed, 21 insertions, 16 deletions
diff --git a/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions b/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions
index 27efc6d3..0204b5c6 100644
--- a/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions
+++ b/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions
@@ -365,9 +365,12 @@ ogGetROOTSERVER ()
#@version 0.9
#@author Antonio J. Doblas. Universidad de Malaga.
#@date 2011/05/24
-#@author Irina Gómez. ETSII Universidad de Sevilla
#@version 1.1.0 - Permite varios ogLive dentro de subdirectorios
+#@author Irina Gómez. ETSII Universidad de Sevilla
#@date 2017/04/27
+#@version 1.1.0 - Se permite varios ogLives en la CACHE
+#@author Antonio J. Doblas Viso. Universidad de Malaga
+#@date 2017/05/31
#*/ ##
ogUpdateInitrd ()
@@ -380,7 +383,7 @@ ogUpdateInitrd ()
# Salir si no se detecta caché.
[ -z "$TYPE" ] && return
mount -t $TYPE LABEL=CACHE /tmp/cache || return
- mkdir -p /tmp/cache/boot
+ mkdir -p /tmp/cache/boot/$OGLIVEDIR
# comparamos los del server
@@ -391,13 +394,13 @@ ogUpdateInitrd ()
#comparamos los de la cache
- CACHEVMLINUZ=`cat /tmp/cache/boot/ogvmlinuz.sum`
- CACHEINITRD=`cat /tmp/cache/boot/oginitrd.img.sum`
+ CACHEVMLINUZ=`cat /tmp/cache/boot/$OGLIVEDIR/ogvmlinuz.sum`
+ CACHEINITRD=`cat /tmp/cache/boot/$OGLIVEDIR/oginitrd.img.sum`
echo "MD5 on SERVER: $SERVERVMLINUZ $SERVERINITRD"
echo "MD5 on CACHE: $CACHEVMLINUZ $CACHEINITRD"
- cd /tmp/cache/boot
+ cd /tmp/cache/boot/$OGLIVEDIR || mkdir -p /tmp/cache/boot/$OGLIVEDIR
if [ "$CACHEVMLINUZ" != "$SERVERVMLINUZ" ]
then
diff --git a/client/shared/scripts/updateBootCache b/client/shared/scripts/updateBootCache
index 2ea7e2b4..4359bc43 100755
--- a/client/shared/scripts/updateBootCache
+++ b/client/shared/scripts/updateBootCache
@@ -12,24 +12,28 @@
#@version 1.0.1 - requiere el gestor de arranque grub2dos
#@author Antonio J. Doblas Viso. Universidad de Malaga.
#@date 2010/07/27
-#@author Irina Gómez. ETSII Universidad de Sevilla
#@version 1.1.0 - Permite varios ogLive dentro de subdirectorios
+#@author Irina Gómez. ETSII Universidad de Sevilla
#@date 2017/04/27
+#@version 1.1.0 - Se permite varios ogLives en la CACHE
+#@author Antonio J. Doblas Viso. Universidad de Malaga
+#@date 2017/05/31
#*/ ##
OGLIVEDIR=${oglivedir:-"ogclient"}
OGBTFTP="/opt/oglive/tftpboot/$OGLIVEDIR"
+OGBCACHE="$OGCAC/boot/$OGLIVEDIR"
ogMountCache || exit 1
-[ -d $OGCAC/boot ] || mkdir -p $OGCAC/boot
+[ -d $OGBCACHE ] || mkdir -p $OGBCACHE
# comparamos los del server
SERVERVMLINUZ=`cat ${OGBTFTP}/ogvmlinuz.sum`
SERVERINITRD=`cat ${OGBTFTP}/oginitrd.img.sum`
#comparamos los de la cache
- CACHEVMLINUZ=`cat ${OGCAC}/boot/ogvmlinuz.sum`
- CACHEINITRD=`cat ${OGCAC}/boot/oginitrd.img.sum`
+ CACHEVMLINUZ=`cat ${OGBCACHE}/ogvmlinuz.sum`
+ CACHEINITRD=`cat ${OGBCACHE}/oginitrd.img.sum`
echo "MD5 on SERVER: $SERVERVMLINUZ $SERVERINITRD"
echo "MD5 on CACHE: $CACHEVMLINUZ $CACHEINITRD"
@@ -38,15 +42,15 @@ ogMountCache || exit 1
if [ "$CACHEVMLINUZ" != "$SERVERVMLINUZ" ]
then
echo "ogvmlinuz updating"
- cp ${OGBTFTP}/ogvmlinuz ${OGCAC}/boot/ogvmlinuz
- cp ${OGBTFTP}/ogvmlinuz.sum ${OGCAC}/boot/ogvmlinuz.sum
+ cp "${OGBTFTP}/ogvmlinuz" "${OGBCACHE}/ogvmlinuz"
+ cp "${OGBTFTP}/ogvmlinuz.sum" "${OGBCACHE}/ogvmlinuz.sum"
DOREBOOT=true
fi
if [ "$CACHEINITRD" != "$SERVERINITRD" ]
then
echo "oginitrd updating"
- cp ${OGBTFTP}/oginitrd.img ${OGCAC}/boot/oginitrd.img
- cp ${OGBTFTP}/oginitrd.img.sum ${OGCAC}/boot/oginitrd.img.sum
+ cp "${OGBTFTP}/oginitrd.img" "${OGBCACHE}/oginitrd.img"
+ cp "${OGBTFTP}/oginitrd.img.sum" "${OGBCACHE}/oginitrd.img.sum"
DOREBOOT=true
fi
@@ -54,9 +58,7 @@ echo $DOREBOOT
# [ "$DOREBOOT" == "true" ] && busybox reboot -f
#TODO: Comprobar si es necesario
-#cp -prv cp ${OGBTFTP}/ ${OGCAC}/boot/
+#cp -prv cp ${OGBTFTP}/ ${OGBCACHE}
#TODO
#/opt/opengnsys/lib/grub4dos/bootlace.com /dev/sda
-
-