summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoririna <irinagomez@us.es>2017-04-27 11:01:18 +0000
committeririna <irinagomez@us.es>2017-04-27 11:01:18 +0000
commitbbb8225c47409b3fc4aabbf64142e6ca1fe878f7 (patch)
treeb212dd8915333250473a248976359fe450842dee
parente2b390451539e65c9d562957ba29b7926af25ffa (diff)
#768 Script updateBootCache y función ogUpdateInitrd permiten guardar en la cache el kernel y el initrd de ogLive situados en subdirectorios definido en la variable del kernel oglivedir
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5282 a21b9725-9963-47de-94b9-378ad31fedc9
-rw-r--r--client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions19
-rwxr-xr-xclient/shared/scripts/updateBootCache8
2 files changed, 17 insertions, 10 deletions
diff --git a/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions b/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions
index 13a303e9..27efc6d3 100644
--- a/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions
+++ b/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions
@@ -358,17 +358,22 @@ ogGetROOTSERVER ()
# ogUpdateInitrd
-#@brief Actualiza el intird de la cache desde el servidor. Si el arranque ha disdo desde cache, compueba desde el servidor nueva version del initird.
+#@brief Actualiza el initrd de la cache desde el servidor. Si el arranque ha sido desde cache, comprueba desde el servidor nueva version del initird.
#@param1
#@return
#@exception OG_ERR_FORMAT Formato incorrecto.
#@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
+#@date 2017/04/27
#*/ ##
ogUpdateInitrd ()
{
+ local OGLIVEDIR
+ OGLIVEDIR=${oglivedir:-"ogclient"}
cd /tmp
mkdir /tmp/cache
TYPE=$(blkid -po export $(blkid -L CACHE) 2>/dev/null | awk -F= '$1=="TYPE" { print $2}')
@@ -379,8 +384,8 @@ ogUpdateInitrd ()
# comparamos los del server
- busybox tftp -g -r ogvmlinuz.sum $ROOTSERVER
- busybox tftp -g -r oginitrd.img.sum $ROOTSERVER
+ busybox tftp -g -r $OGLIVEDIR/ogvmlinuz.sum $ROOTSERVER
+ busybox tftp -g -r $OGLIVEDIR/oginitrd.img.sum $ROOTSERVER
SERVERVMLINUZ=`cat ogvmlinuz.sum`
SERVERINITRD=`cat oginitrd.img.sum`
@@ -397,15 +402,15 @@ ogUpdateInitrd ()
if [ "$CACHEVMLINUZ" != "$SERVERVMLINUZ" ]
then
echo "ogvmlinuz updating"
- busybox tftp -g -r ogvmlinuz $ROOTSERVER
- busybox tftp -g -r ogvmlinuz.sum $ROOTSERVER
+ busybox tftp -g -r $OGLIVEDIR/ogvmlinuz $ROOTSERVER
+ busybox tftp -g -r $OGLIVEDIR/ogvmlinuz.sum $ROOTSERVER
DOREBOOT=true
fi
if [ "$CACHEINITRD" != "$SERVERINITRD" ]
then
echo "oginitrd updating"
- busybox tftp -g -r oginitrd.img $ROOTSERVER
- busybox tftp -g -r oginitrd.img.sum $ROOTSERVER
+ busybox tftp -g -r $OGLIVEDIR/oginitrd.img $ROOTSERVER
+ busybox tftp -g -r $OGLIVEDIR/oginitrd.img.sum $ROOTSERVER
DOREBOOT=true
fi
diff --git a/client/shared/scripts/updateBootCache b/client/shared/scripts/updateBootCache
index f45e9344..2ea7e2b4 100755
--- a/client/shared/scripts/updateBootCache
+++ b/client/shared/scripts/updateBootCache
@@ -12,11 +12,13 @@
#@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
+#@date 2017/04/27
#*/ ##
-
-
-OGBTFTP="/opt/oglive/tftpboot/ogclient"
+OGLIVEDIR=${oglivedir:-"ogclient"}
+OGBTFTP="/opt/oglive/tftpboot/$OGLIVEDIR"
ogMountCache || exit 1
[ -d $OGCAC/boot ] || mkdir -p $OGCAC/boot