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 | #@version 1.1.0 - Permite varios ogLive dentro de subdirectorios |
---|
16 | #@author Irina Gómez. ETSII Universidad de Sevilla |
---|
17 | #@date 2017/04/27 |
---|
18 | #@version 1.1.0 - Se permite varios ogLives en la CACHE |
---|
19 | #@author Antonio J. Doblas Viso. Universidad de Malaga |
---|
20 | #@date 2017/05/31 |
---|
21 | #*/ ## |
---|
22 | |
---|
23 | OGLIVEDIR=${oglivedir:-"ogLive"} |
---|
24 | OGBTFTP="/opt/oglive/tftpboot/$OGLIVEDIR" |
---|
25 | OGBCACHE="$OGCAC/boot/$OGLIVEDIR" |
---|
26 | ogMountCache || exit 1 |
---|
27 | |
---|
28 | [ -d $OGBCACHE ] || mkdir -p $OGBCACHE |
---|
29 | |
---|
30 | # comparamos los del server |
---|
31 | SERVERVMLINUZ=`cat ${OGBTFTP}/ogvmlinuz.sum` |
---|
32 | SERVERINITRD=`cat ${OGBTFTP}/oginitrd.img.sum` |
---|
33 | |
---|
34 | #comparamos los de la cache |
---|
35 | CACHEVMLINUZ=`cat ${OGBCACHE}/ogvmlinuz.sum` |
---|
36 | CACHEINITRD=`cat ${OGBCACHE}/oginitrd.img.sum` |
---|
37 | |
---|
38 | echo "MD5 on SERVER: $SERVERVMLINUZ $SERVERINITRD" |
---|
39 | echo "MD5 on CACHE: $CACHEVMLINUZ $CACHEINITRD" |
---|
40 | |
---|
41 | |
---|
42 | if [ "$CACHEVMLINUZ" != "$SERVERVMLINUZ" ] |
---|
43 | then |
---|
44 | echo "ogvmlinuz updating" |
---|
45 | cp "${OGBTFTP}/ogvmlinuz" "${OGBCACHE}/ogvmlinuz" |
---|
46 | cp "${OGBTFTP}/ogvmlinuz.sum" "${OGBCACHE}/ogvmlinuz.sum" |
---|
47 | DOREBOOT=true |
---|
48 | fi |
---|
49 | if [ "$CACHEINITRD" != "$SERVERINITRD" ] |
---|
50 | then |
---|
51 | echo "oginitrd updating" |
---|
52 | cp "${OGBTFTP}/oginitrd.img" "${OGBCACHE}/oginitrd.img" |
---|
53 | cp "${OGBTFTP}/oginitrd.img.sum" "${OGBCACHE}/oginitrd.img.sum" |
---|
54 | DOREBOOT=true |
---|
55 | fi |
---|
56 | |
---|
57 | echo $DOREBOOT |
---|
58 | # [ "$DOREBOOT" == "true" ] && busybox reboot -f |
---|
59 | |
---|
60 | #TODO: Comprobar si es necesario |
---|
61 | #cp -prv cp ${OGBTFTP}/ ${OGBCACHE} |
---|
62 | |
---|
63 | #TODO |
---|
64 | #/opt/opengnsys/lib/grub4dos/bootlace.com /dev/sda |
---|