summaryrefslogtreecommitdiffstats
path: root/client/nfsexport
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2010-05-11 15:28:10 +0000
committerramon <ramongomez@us.es>2010-05-11 15:28:10 +0000
commit87a7a799e6e987150031376ab1e40ada4df18887 (patch)
treefbf0468b883896c030c1aa60de9f103694203c45 /client/nfsexport
parent6354c7bc52010911cd9e1e590068c049ea158878 (diff)
Script restoreImage preparado para nuevos protocolos de clonación; corregir librería dinámcia para partprobe en el Initrd del cliente.
git-svn-id: https://opengnsys.es/svn/trunk@926 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/nfsexport')
-rwxr-xr-xclient/nfsexport/etc/preinit/fileslinks.sh3
-rwxr-xr-xclient/nfsexport/etc/preinit/loadudeb.sh6
-rwxr-xr-xclient/nfsexport/scripts/restoreImage30
3 files changed, 27 insertions, 12 deletions
diff --git a/client/nfsexport/etc/preinit/fileslinks.sh b/client/nfsexport/etc/preinit/fileslinks.sh
index 132c8902..2c27cc79 100755
--- a/client/nfsexport/etc/preinit/fileslinks.sh
+++ b/client/nfsexport/etc/preinit/fileslinks.sh
@@ -25,9 +25,6 @@ if [ -n "$OPENGNSYS" ]; then
mkdir -p $QTLIBS
ln -fs $OGLIB/fonts $QTLIBS
- # TEMPORAL: corregir biblioteca dinámica para "partprobe".
- ln -s $(find /lib -type f -name "libparted*.so.*") /lib/$(grep libparted $OGBIN/partprobe) 2>/dev/null
-
# Datos de dispositivos PCI en /etc
ln -fs $OGLIB/pci.ids /etc
else
diff --git a/client/nfsexport/etc/preinit/loadudeb.sh b/client/nfsexport/etc/preinit/loadudeb.sh
index 72d8d379..a8f52eba 100755
--- a/client/nfsexport/etc/preinit/loadudeb.sh
+++ b/client/nfsexport/etc/preinit/loadudeb.sh
@@ -17,9 +17,11 @@ if [ -n "$OPENGNSYS" ]; then
for i in $OGLIB/udeb/*.udeb; do
udpkg -i "$i" >/dev/null || printf "$MSG_ERRLOADUDEB\n" $(basename $i)
done
+ # TEMPORAL: corregir biblioteca dinámica para "partprobe".
+ ln -s $(find /lib -type f -name "libparted*.so.*") /lib/$(grep libparted $OGBIN/partprobe) 2>/dev/null
else
- # FIXME Error: entorno de OpenGNSys no configurado.
- echo "Error: OpenGNSys environment is not configured." # FIXME: definir mensaje.
+ # FIXME Error: entorno de OpenGnSys no configurado.
+ echo "Error: OpenGnSys environment is not configured." # FIXME: definir mensaje.
exit 1
fi
diff --git a/client/nfsexport/scripts/restoreImage b/client/nfsexport/scripts/restoreImage
index f8dcc50a..27e4e8ac 100755
--- a/client/nfsexport/scripts/restoreImage
+++ b/client/nfsexport/scripts/restoreImage
@@ -4,13 +4,14 @@
TIME1=$SECONDS
PROG="$(basename $0)"
-if [ $# -ne 4 ]; then
- ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO|CACHE imagen ndisco nparticion"
+if [ $# -lt 4 ]; then
+ ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO|CACHE imagen ndisco nparticion [ UNICAST|MULTICAST|TORRENT opciones ]"
exit $?
fi
# Procesar parámetros de entrada
IMGFILE=$(ogGetPath "$1" "$2.img")
+PROTO=${5:-"UNICAST"}
if [ "$1" == "CACHE" -o "$1" == "cache" ]; then
IMGDIR=$(ogGetParentPath "$1" "$2")
# Si no existe el directorio de la imagen, crearlo.
@@ -19,11 +20,26 @@ if [ "$1" == "CACHE" -o "$1" == "cache" ]; then
ogMakeDir "$1" "${2%/*}" || ogRaiseError $OG_ERR_NOTFOUND "$1, ${2%/*}" || exit $?
fi
IMGDIR=$(ogGetParentPath "$1" "$2") || ogRaiseError $OG_ERR_NOTFOUND "$1, ${2%/*}" || exit $?
- if [ -z "$IMGFILE" ]; then
- echo "[10] Copiando imagen \"$2\" del repositorio a caché local"
- ogCopyFile "repo" "$2.img" "$IMGDIR" || exit $?
- IMGFILE=$(ogGetPath "cache" "$2.img")
- fi
+ # Procesar protocolos de transferencia.
+ case "$PROTO" in
+ UNICAST|unicast)
+ # Copiar fichero del repositorio al caché local.
+ if [ -z "$IMGFILE" ]; then
+ echo "[10] Copiando imagen \"$2\" del repositorio a caché local"
+ ogCopyFile "repo" "$2.img" "$IMGDIR" || exit $?
+ IMGFILE=$(ogGetPath "cache" "$2.img")
+ fi
+ ;;
+ MULTICAST|multicast)
+ # Proceso Multicast.
+ ;;
+ TORRENT|torrent)
+ # Proceso Torrent.
+ ;;
+ *) # Protocolo desconocido.
+ ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG REPO|CACHE imagen ndisco nparticion [ UNICAST|MULTICAST|TORRENT opciones ]"
+ exit $?
+ esac
fi
if [ -z "$IMGFILE" ]; then
ogRaiseError $OG_ERR_NOTFOUND "$1, $2"