source: client/shared/scripts/updateBootCache @ 82ed0eb

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Last change on this file since 82ed0eb was bbb8225, checked in by irina <irinagomez@…>, 8 years ago

#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

  • Property mode set to 100755
File size: 1.6 KB
Line 
1#!/bin/bash
2
3#/**
4#         updateBootCache
5#@brief   acelerador arranque pxe. incorpora a la cache el initrd y el kernel.
6#@param 1
7#@param ejemplo: 
8#@return 
9#@exception OG_ERR_FORMAT     formato incorrecto.
10#@note   
11#@todo:
12#@version 1.0.1 - requiere el gestor de arranque grub2dos
13#@author  Antonio J. Doblas Viso. Universidad de Malaga.
14#@date    2010/07/27
15#@author Irina Gómez. ETSII Universidad de Sevilla
16#@version 1.1.0 - Permite varios ogLive dentro de subdirectorios
17#@date    2017/04/27
18#*/ ##
19
20OGLIVEDIR=${oglivedir:-"ogclient"}
21OGBTFTP="/opt/oglive/tftpboot/$OGLIVEDIR"
22ogMountCache || exit 1
23
24[ -d $OGCAC/boot ] || mkdir -p $OGCAC/boot
25       
26        # comparamos los del server
27        SERVERVMLINUZ=`cat ${OGBTFTP}/ogvmlinuz.sum`
28        SERVERINITRD=`cat  ${OGBTFTP}/oginitrd.img.sum`
29       
30        #comparamos los de la cache
31        CACHEVMLINUZ=`cat ${OGCAC}/boot/ogvmlinuz.sum`
32        CACHEINITRD=`cat  ${OGCAC}/boot/oginitrd.img.sum`
33       
34        echo "MD5 on SERVER: $SERVERVMLINUZ $SERVERINITRD"
35        echo "MD5  on CACHE: $CACHEVMLINUZ $CACHEINITRD"
36       
37
38        if [ "$CACHEVMLINUZ" != "$SERVERVMLINUZ" ]
39        then           
40                echo "ogvmlinuz updating"
41                cp ${OGBTFTP}/ogvmlinuz ${OGCAC}/boot/ogvmlinuz
42                cp ${OGBTFTP}/ogvmlinuz.sum ${OGCAC}/boot/ogvmlinuz.sum
43                DOREBOOT=true
44        fi
45        if [ "$CACHEINITRD" != "$SERVERINITRD" ]
46        then
47                echo "oginitrd updating"
48                cp ${OGBTFTP}/oginitrd.img ${OGCAC}/boot/oginitrd.img
49                cp ${OGBTFTP}/oginitrd.img.sum ${OGCAC}/boot/oginitrd.img.sum
50                DOREBOOT=true
51        fi
52
53echo $DOREBOOT
54#       [ "$DOREBOOT" == "true" ] && busybox reboot -f
55
56#TODO: Comprobar si es necesario
57#cp -prv cp ${OGBTFTP}/ ${OGCAC}/boot/
58
59#TODO
60#/opt/opengnsys/lib/grub4dos/bootlace.com /dev/sda
61
62
Note: See TracBrowser for help on using the repository browser.