diff options
author | ramon <ramongomez@us.es> | 2011-03-02 18:52:51 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2011-03-02 18:52:51 +0000 |
commit | c1e00e4d9169a59f4d89f98c62993b8afa10ef8c (patch) | |
tree | fbcf5312a8005ff40643197e2a7e415571c28d81 /installer | |
parent | 2338c95f5ab7569bbce01178ea1426555271e5a4 (diff) |
Rama version1.0:
* Corrección algunas erratas en el instalador.
* Preparar instalador para ser usado en otras distribuciones además de Ubuntu.
* Primeros pasos con el actualizador de la versión 1.0.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@1527 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'installer')
-rwxr-xr-x | installer/opengnsys_installer.sh | 28 | ||||
-rwxr-xr-x | installer/opengnsys_update.sh | 92 |
2 files changed, 74 insertions, 46 deletions
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh index 051f448f..db2d319f 100755 --- a/installer/opengnsys_installer.sh +++ b/installer/opengnsys_installer.sh @@ -27,6 +27,16 @@ then exit 1 fi +# Detectar sistema operativo del servidor (debe soportar LSB). +OSDISTRIB=$(lsb_release -is 2>/dev/null) +# Array con las dependencias que deben estar instaladas, según de la distribución detectada. +case "$OSDISTRIB" in + Ubuntu) DEPENDENCIES=( subversion apache2 php5 libapache2-mod-php5 mysql-server php5-mysql nfs-kernel-server dhcp3-server bittorrent tftp-hpa tftpd-hpa syslinux openbsd-inetd update-inetd build-essential g++-multilib libmysqlclient15-dev wget doxygen graphviz bittornado ctorrent samba unzip netpipes debootstrap schroot squashfs-tools ) + ;; + *) echo "ERROR: Distribution not supported by OpenGnSys." + exit 1 ;; +esac + # Comprobar si se ha descargado el paquete comprimido (USESVN=0) o sólo el instalador (USESVN=1). PROGRAMDIR=$(readlink -e $(dirname "$0")) if [ -d "$PROGRAMDIR/../installer" ]; then @@ -42,9 +52,6 @@ mkdir -p $WORKDIR INSTALL_TARGET=/opt/opengnsys LOG_FILE=/tmp/opengnsys_installation.log -# Array con las dependencias -DEPENDENCIES=( subversion apache2 php5 libapache2-mod-php5 mysql-server php5-mysql nfs-kernel-server dhcp3-server bittorrent tftp-hpa tftpd-hpa syslinux openbsd-inetd update-inetd build-essential g++-multilib libmysqlclient15-dev wget doxygen graphviz bittornado ctorrent samba unzip netpipes debootstrap subversion schroot squashfs-tools ) - # Base de datos OPENGNSYS_DB_CREATION_FILE=opengnsys/admin/Database/ogAdmBD.sql @@ -684,7 +691,7 @@ function smbConfigure() backupFile /etc/samba/smb.conf # Copiar plantailla de recursos para OpenGnSys - sed -e "s/OPENGNSYSDIR/$INSTALL_TARGET/g" \ + sed -e "s/OPENGNSYSDIR/${INSTALL_TARGET//\//\\/}/g" \ $WORKDIR/opengnsys/server/etc/smb-og.conf.tmpl > /etc/samba/smb-og.conf # Configurar y recargar Samba" perl -pi -e "s/WORKGROUP/OPENGNSYS/; s/server string \=.*/server string \= OpenGnSys Samba Server/; s/^\; *include \=.*$/ include \= \/etc\/samba\/smb-og.conf/" /etc/samba/smb.conf @@ -953,7 +960,7 @@ function servicesCompilation () #################################################################### # Copiar carpeta de Interface -function InterfaceAdm () +function copyInterfaceAdm () { local hayErrores=0 @@ -975,7 +982,7 @@ function InterfaceAdm () # Crear antiguo cliente initrd para OpenGnSys 0.10 function openGnsysOldClientCreate() { - local OSDISTRIB OSCODENAME + local OSCODENAME local hayErrores=0 @@ -991,7 +998,6 @@ function openGnsysOldClientCreate() fi # Cargar Kernel, Initrd y paquetes udeb para la distribución del servidor (o por defecto). - OSDISTRIB=$(lsb_release -is 2>/dev/null) OSCODENAME=$(lsb_release -cs 2>/dev/null) if [ "$OSDISTRIB" = "Ubuntu" -a -n "$OSCODENAME" ]; then echoAndLog "${FUNCNAME}(): Loading Kernel and Initrd files for $OSDISTRIB $OSCODENAME." @@ -1176,9 +1182,9 @@ if [ $? -ne 0 ]; then fi # Copiar carpeta Interface entre administración y motor de clonación. -InterfaceAdm +copyInterfaceAdm if [ $? -ne 0 ]; then - errorAndLog "Error while copying Interface Administration" + errorAndLog "Error while copying Administration Interface" exit 1 fi @@ -1192,10 +1198,10 @@ if [ $? -ne 0 ]; then exit 1 fi -# Configuración SMB +# Configuración Samba smbConfigure if [ $? -ne 0 ]; then - errorAndLog "Error while configuring nfs server!" + errorAndLog "Error while configuring Samba server!" exit 1 fi diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh index adb880cd..2faf3c25 100755 --- a/installer/opengnsys_update.sh +++ b/installer/opengnsys_update.sh @@ -6,6 +6,9 @@ #@version 0.9 - basado en opengnsys_installer.sh #@author Ramón Gómez - ETSII Univ. Sevilla #@date 2010/01/27 +#@version 1.0 - adaptación a OpenGnSys 1.0 +#@author Ramón Gómez - ETSII Univ. Sevilla +#@date 2011/03/02 #*/ @@ -18,12 +21,12 @@ fi # Comprobar si se ha descargado el paquete comprimido (USESVN=0) o sólo el instalador (USESVN=1). PROGRAMDIR=$(readlink -e $(dirname "$0")) -DEPS="rsync gcc ctorrent" +DEPS="build-essential g++-multilib rsync ctorrent samba unzip netpipes debootstrap schroot squashfs-tools" if [ -d "$PROGRAMDIR/../installer" ]; then USESVN=0 else USESVN=1 - SVN_URL=http://www.opengnsys.es/svn/trunk + SVN_URL=http://www.opengnsys.es/svn/branches/version1.0 DEPS="$DEPS subversion" fi @@ -117,22 +120,22 @@ function installDependencies () { if [ $# = 0 ]; then echoAndLog "${FUNCNAME}(): no deps needed." - else - while [ $# -gt 0 ]; do - dpkg -s $1 &>/dev/null | grep Status | grep -qw install - if [ $? -ne 0 ]; then - INSTALLDEPS="$INSTALLDEPS $1" - fi - shift - done - if [ -n "$INSTALLDEPS" ]; then - apt-get update && apt-get install $INSTALLDEPS - if [ $? -ne 0 ]; then - errorAndLog "${FUNCNAME}(): cannot install some dependencies: $INSTALLDEPS." - return 1 - fi - fi - fi + else + while [ $# -gt 0 ]; do + dpkg -s $1 &>/dev/null | grep Status | grep -qw install + if [ $? -ne 0 ]; then + INSTALLDEPS="$INSTALLDEPS $1" + fi + shift + done + if [ -n "$INSTALLDEPS" ]; then + apt-get update && apt-get install $INSTALLDEPS + if [ $? -ne 0 ]; then + errorAndLog "${FUNCNAME}(): cannot install some dependencies: $INSTALLDEPS." + return 1 + fi + fi + fi } @@ -213,6 +216,7 @@ function updateWebFiles() rsync --exclude .svn -irplt $WORKDIR/opengnsys/admin/WebConsole $INSTALL_TARGET ERRCODE=$? mv $INSTALL_TARGET/WebConsole $INSTALL_TARGET/www + unzip -o $WORKDIR/opengnsys/admin/xajax_0.5_standard.zip -d $INSTALL_TARGET/www/xajax if [ $ERRCODE != 0 ]; then errorAndLog "${FUNCNAME}(): Error updating web files." exit 1 @@ -292,22 +296,11 @@ function createDirs() # Copia ficheros de configuración y ejecutables genéricos del servidor. function updateServerFiles () { - local SOURCES=( client/boot/initrd-generator \ - client/boot/upgrade-clients-udeb.sh \ - client/boot/udeblist.conf \ - client/boot/udeblist-jaunty.conf \ - client/boot/udeblist-karmic.conf \ - client/boot/udeblist-lucid.conf \ - client/boot/udeblist-maverick.conf \ - repoman/bin \ + # No copiar ficheros del antiguo cliente Initrd + local SOURCES=( repoman/bin \ + server/bin \ doc ) - local TARGETS=( bin/initrd-generator \ - bin/upgrade-clients-udeb.sh \ - etc/udeblist.conf \ - etc/udeblist-jaunty.conf \ - etc/udeblist-karmic.conf \ - etc/udeblist-lucid.conf \ - etc/udeblist-maverick.conf \ + local TARGETS=( bin \ bin \ doc ) @@ -338,7 +331,7 @@ function recompileClient () # Compilar OpenGnSys Client echoAndLog "${FUNCNAME}(): recompiling OpenGnSys Client" pushd $WORKDIR/opengnsys/admin/Sources/Clients/ogAdmClient - make && mv ogAdmClient ../../../client/nfsexport/bin + make && mv ogAdmClient ../../../client/shared/bin if [ $? -ne 0 ]; then echoAndLog "${FUNCNAME}(): error while compiling OpenGnSys Client" hayErrores=1 @@ -353,7 +346,8 @@ function recompileClient () ### Funciones instalacion cliente opengnsys #################################################################### -function updateClient() +# Actualizar antiguo cliente Initrd. +function updateOldClient() { local OSDISTRIB OSCODENAME @@ -409,6 +403,32 @@ function updateClient() return $hayErrores } +# Actualizar nuevo cliente para OpenGnSys 1.0 +function updateClient() +{ + local DOWNLOADURL=http://www.opengnsys.es/downloads + local tmpfile=/tmp/ogclient.tgz + + echoAndLog "${FUNCNAME}(): Loading Client" + # Descargar y descomprimir cliente ogclient + wget $DOWNLOADURL/20 -O $tmpfile + wget $DOWNLOADURL/21 -O - >> $tmpfile + wget $DOWNLOADURL/22 -O - >> $tmpfile + if [ ! -s $tmpfile ]; then + errorAndLog "${FUNCNAME}(): Error loading client files" + return 1 + fi + echoAndLog "${FUNCNAME}(): Extranting Client files" + tar xzvf $tmpfile -C $INSTALL_TARGET/tftpboot + rm -f $tmpfile + # Usar la versión más reciente del Kernel y del Initrd para el cliente. + ln $(ls $INSTALL_TARGET/tftpboot/ogclient/vmlinuz-*|tail -1) $INSTALL_TARGET/tftpboot/ogclient/ogvmlinuz + ln $(ls $INSTALL_TARGET/tftpboot/ogclient/initrd.img-*|tail -1) $INSTALL_TARGET/tftpboot/ogclient/oginitrd.img + # Establecer los permisos. + chmod -R 755 $INSTALL_TARGET/tftpboot/ogclient + chown -R :$OPENGNSYS_CLIENT_USER $INSTALL_TARGET/tftpboot/ogclient + echoAndLog "${FUNCNAME}(): Client update successfully" +} ##################################################################### @@ -470,6 +490,8 @@ makeDoxygenFiles # Creando la estructura del cliente recompileClient +# NO se actualiza el antiguo cliente Initrd +#updateOldClient updateClient if [ $? -ne 0 ]; then errorAndLog "Error updating clients" |