Makefiles de Hidra y corrección en EAC

git-svn-id: https://opengnsys.es/svn/trunk@24 a21b9725-9963-47de-94b9-378ad31fedc9
remotes/github/debian-pkg
ramon 2009-04-21 10:54:25 +00:00
parent 27038c7ea9
commit fc01c78d41
9 changed files with 224 additions and 5 deletions

View File

@ -69,11 +69,11 @@ then
"NTFS")
case $CloneImageNTFS in
"ntfsclone")
imaged="ntfsclone --force --save-image -O - $disco | "
imaged="ntfsclone --force --save-image -O - $disco"
program=ntfsclone
;;
"partimage")
imaged="partimage -M -f3 -o -d -B gui=no -c -z0 --volume=0 save $disco stdout |"
imaged="partimage -M -f3 -o -d -B gui=no -c -z0 --volume=0 save $disco stdout"
program=partimage
;;
"partimage-ng")
@ -90,6 +90,11 @@ then
program=partimage
echo "imaged: $imaged"
;;
"partimage-ng")
echo "partimage-ng"
imaged="partimage-ng save $disco stdout"
program=partimage-ng
;;
esac
;;
esac
@ -98,10 +103,10 @@ then
CompresionImage=`echo $5 | cut -f2 -d.`
case $CompresionImage in
"gzip")
comando="$imaged gzip -c >"
comando="$imaged | gzip -c >"
;;
"lzop")
comando="$imaged lzop >"
comando="$imaged | lzop >"
;;
esac

View File

@ -0,0 +1,40 @@
# makefile
# Nombre del proyecto
PROYECTO := hidra
# Opciones de compilacion
CFLAGS := -O0 -g -Wall -I../includes # Depuracion
#CFLAGS := -O3 -Wall # Optimizacion
CPPFLAGS := $(CFLAGS)
# Opciones de linkado
LDFLAGS := -L/usr/lib -L/usr/lib/mysql -lpthread -lmysqlclient
# Ficheros objetos
OBJS := ../includes/Database.o ../includes/encriptacion.o fuentes/hidra.o
all: $(PROYECTO)
$(PROYECTO): $(OBJS)
g++ $(LDFLAGS) $(OBJS) -o $(PROYECTO)
# strip $(PROYECTO) # Optimizacion
install: $(PROYECTO)
cp $(PROYECTO) /usr/local/sbin
cp $(PROYECTO).cfg /usr/local/etc
clean:
rm -f $(PROYECTO) $(OBJS)
uninstall: clean
rm -f /usr/local/sbin/$(PROYECTO) /usr/local/etc/$(PROYECTO).cfg
fuentes/%.o: fuentes/%.cpp
g++ $(CPPFLAGS) -c -o"$@" "$<"
fuentes/%.o: fuentes/%.c
gcc $(CFLAGS) -c -o"$@" "$<"

View File

@ -0,0 +1,42 @@
# makefile
# Nombre del proyecto
PROYECTO := hidraboot
# Opciones de compilacion
CFLAGS := -O0 -g -Wall -I../includes # Depuracion
#CFLAGS := -O3 -Wall # Optimizacion
CPPFLAGS := $(CFLAGS)
# Opciones de linkado
LDFLAGS := -L/usr/lib -lpthread -lmysqlclient # Ubuntu
#LDFLAGS := -L/usr/lib -L/usr/lib/mysql \
-lpthread -lmysqlclient # Fedora
# Ficheros objetos
OBJS := ../includes/Database.o ../includes/encriptacion.o fuentes/hidraboot.o
all: $(PROYECTO)
$(PROYECTO): $(OBJS)
g++ $(LDFLAGS) $(OBJS) -o $(PROYECTO)
# strip $(PROYECTO) # Optimizacion
install: $(PROYECTO)
cp $(PROYECTO) /usr/local/sbin
cp $(PROYECTO).cfg /usr/local/etc
clean:
rm -f $(PROYECTO) $(OBJS)
uninstall: clean
rm -f /usr/local/sbin/$(PROYECTO) /usr/local/etc/$(PROYECTO).cfg
fuentes/%.o: fuentes/%.cpp
g++ $(CPPFLAGS) -c -o"$@" "$<"
fuentes/%.o: fuentes/%.c
gcc $(CFLAGS) -c -o"$@" "$<"

View File

@ -0,0 +1,33 @@
# makefile
# Nombre del proyecto
PROYECTO := hidrac
# Directorios y librerias
DIRS :=
LIBS := -static
# Opciones de compilacion
OPCS := -O0 -g -Wall # Depuracion
#OPCS := -O3 -Wall # Optimizacion
# Ficheros objetos
OBJS := fuentes/hidrac.o
all: $(PROYECTO)
$(PROYECTO): $(OBJS)
g++ $(DIRS) $(LIBS) $(OBJS) -o $(PROYECTO)
# strip $(PROYECTO) # Optimizacion
clean:
rm $(PROYECTO) $(OBJS)
fuentes/%.o: fuentes/%.cpp
g++ $(OPCS) -c -o"$@" "$<"
fuentes/%.o: fuentes/%.c
gcc $(OPCS) -c -o"$@" "$<"

View File

@ -0,0 +1,40 @@
# makefile
# Nombre del proyecto
PROYECTO := hidrarepos
# Opciones de compilacion
CFLAGS := -O0 -g -Wall -I../includes # Depuracion
#CFLAGS := -O3 -Wall # Optimizacion
CPPFLAGS := $(CFLAGS)
# Opciones de linkado
LDFLAGS := -L/usr/lib -L/usr/lib/mysql -lpthread -lmysqlclient
# Ficheros objetos
OBJS := ../includes/Database.o ../includes/encriptacion.o fuentes/hidrarepos.o
all: $(PROYECTO)
$(PROYECTO): $(OBJS)
g++ $(LDFLAGS) $(OBJS) -o $(PROYECTO)
# strip $(PROYECTO) # Optimizacion
install: $(PROYECTO)
cp $(PROYECTO) /usr/local/sbin
cp $(PROYECTO).cfg /usr/local/etc
clean:
rm -f $(PROYECTO) $(OBJS)
uninstall: clean
rm -f /usr/local/sbin/$(PROYECTO) /usr/local/etc/$(PROYECTO).cfg
fuentes/%.o: fuentes/%.cpp
g++ $(CPPFLAGS) -c -o"$@" "$<"
fuentes/%.o: fuentes/%.c
gcc $(CFLAGS) -c -o"$@" "$<"

View File

@ -24,9 +24,10 @@ hidraUnmount $1 $2 || exit $?
# ATENCION: la funcion CreateImageFromPartition no comprueba que se genere la
# imagen en el directorio exportado por el servidor y la puede crear en
# local. El codigo comprueba que el directorio este importado.
DIRIMG=$(ConnectToRepo $IPservidor "$4" / | grep "$d")
if [ "$3" = "$IPservidor" ]; then
for d in $(showmount -d $IPservidor | grep $REPO); do
DIR=$(ConnectToRepo $IPservidor "$4" / | grep "$d")
DIR=$DIR$(echo $DIRIMG|grep $d)
done
[ -z "$DIR" ] && exit $ERRNOTFOUND
fi

View File

@ -0,0 +1,28 @@
#!/bin/bash
# Nombre: hidraImageInfo
# Descripcion: Muestra informacion de un fichero de imagen.
# Formato: hidraImageInfo iprepo dirbase imagen
# El fichero imagen tiene el formato:
# nombre.compresor-numparticion[.metodotransferencia]
# Salida: (por determinar)
# Error: 1 - formato incorrecto.
# 2 - fichero no encontrado.
# Requisitos: partimage, ConnectToRepo (EAC)
# Notas: Solo ejecutable por root
# Version: 1.0 - Compatible con EAC: nueva funcion.
# Autor: Ramon Gomez, ETSII Univ. Sevilla
# Fecha: 14/04/2009
source $(dirname $0)/hidraEnviron
# Error si no se reciben 3 parametros.
[ $# -ne 3 ] && exit $ERRFORMAT
# Error si no existe el fichero.
FICH=$(ConnectToRepo "$1" "${2%/}/" "$3")
[ -f "$FICH" ] || exit $ERRNOTFOUND
# Formato por determinar (por el momento solo el tamano en KB).
partimage -B gui=no imginfo "$FICH"
# awk '/Partition size/ {sub(/\.\.+/," "); printf "%d",$3*1024*1024;}'

View File

@ -0,0 +1,15 @@
#!/bin/bash
# Nombre: hidraMountRepo
# Descripcion: Monta un repositorio alternaivo y devuelve el punto de montaje
# Formato: hidraMountRempo iprepo
# Salida: Punto de montaje (por determinar).
# Error: (definido por EAC)
# Requisitos: MountRepo (EAC)
# Notas: Solo ejecutable por root
# Version: 1.0 - Compatibilidad Con EAC: llama a la funcion MountCache
# Autor: Ramon Gomez, ETSII Univ. Sevilla
# Fecha: 20/04/2009
source $(dirname $0)/hidraEnviron
MountRepo $*

View File

@ -0,0 +1,15 @@
#!/bin/bash
# Nombre: hidraUnmountRepo
# Descripcion: Desmonta el directorio de un repositorio alternaivo.
# Formato: hidraUnmountRempo iprepo
# Salida: Punto de montaje (por determinar).
# Error: (definido por EAC)
# Requisitos: UmountRepo (EAC)
# Notas: Solo ejecutable por root
# Version: 1.0 - Compatibilidad Con EAC: llama a la funcion MountCache
# Autor: Ramon Gomez, ETSII Univ. Sevilla
# Fecha: 20/04/2009
source $(dirname $0)/hidraEnviron
UmountRepo $*