From e0efe8adf0428330fd24eecc928b7ee1d878a0cd Mon Sep 17 00:00:00 2001 From: adv Date: Fri, 5 Aug 2011 08:59:19 +0000 Subject: [PATCH] version 1.0.2 boot-tools #404 #420 #393 #429 #430 #431 #423 git-svn-id: https://opengnsys.es/svn/branches/version1.0@2268 a21b9725-9963-47de-94b9-378ad31fedc9 --- boottoolsfunctions.lib | 3 + boottoolsgenerator.sh | 32 +++-- clientstructure/etc/profile.d/loadenviron.sh | 2 +- .../etc/initramfs-tools/scripts/ogfunctions | 66 +++++++++- includes/etc/initramfs-tools/scripts/oginit | 53 ++++---- includes/etc/profile.d/loadenviron.sh | 91 +------------- .../bin/boot-tools/boottoolsBootGraphics.sh | 8 +- .../usr/bin/boot-tools/boottoolsFsLocales.sh | 4 +- .../bin/boot-tools/boottoolsFsOpengnsys.sh | 12 +- .../boottoolsFsPostconfiguration.sh | 3 + .../bin/boot-tools/boottoolsInitrdGenerate.sh | 4 +- .../boot-tools/boottoolsSoftwareCompile.sh | 28 ++--- .../boot-tools/boottoolsSoftwareInstall.sh | 118 ++++++++---------- .../bin/boot-tools/boottoolsSoftwareXwindows | 4 +- .../usr/bin/boot-tools/boottoolsSshClient.sh | 4 +- .../usr/bin/boot-tools/boottoolsSshServer.sh | 3 +- .../bin/boot-tools/listpackages/sw.Xwindow | 8 ++ .../bin/boot-tools/listpackages/sw.Zinitrd | 3 + .../usr/bin/boot-tools/listpackages/sw.basic | 13 ++ .../bin/boot-tools/listpackages/sw.cloning | 10 ++ .../bin/boot-tools/listpackages/sw.compile | 10 ++ .../bin/boot-tools/listpackages/sw.compresor | 12 ++ .../listpackages/sw.filesystem.local | 21 ++++ .../listpackages/sw.filesystem.remote | 9 ++ .../bin/boot-tools/listpackages/sw.monitoring | 12 ++ .../bin/boot-tools/listpackages/sw.networking | 14 +++ .../bin/boot-tools/listpackages/sw.testing | 4 + 27 files changed, 317 insertions(+), 234 deletions(-) create mode 100644 includes/usr/bin/boot-tools/listpackages/sw.Xwindow create mode 100644 includes/usr/bin/boot-tools/listpackages/sw.Zinitrd create mode 100644 includes/usr/bin/boot-tools/listpackages/sw.basic create mode 100644 includes/usr/bin/boot-tools/listpackages/sw.cloning create mode 100644 includes/usr/bin/boot-tools/listpackages/sw.compile create mode 100644 includes/usr/bin/boot-tools/listpackages/sw.compresor create mode 100644 includes/usr/bin/boot-tools/listpackages/sw.filesystem.local create mode 100644 includes/usr/bin/boot-tools/listpackages/sw.filesystem.remote create mode 100644 includes/usr/bin/boot-tools/listpackages/sw.monitoring create mode 100644 includes/usr/bin/boot-tools/listpackages/sw.networking create mode 100644 includes/usr/bin/boot-tools/listpackages/sw.testing diff --git a/boottoolsfunctions.lib b/boottoolsfunctions.lib index 04b5f46..2f7aff6 100644 --- a/boottoolsfunctions.lib +++ b/boottoolsfunctions.lib @@ -401,6 +401,9 @@ mkisofs -V ogClient -o ${NAMEISOCLIENT}.iso -b isolinux/isolinux.bin -c isolinux DATASUM=`md5sum ${NAMEISOCLIENT}.iso | cut -f1 -d" "` echo $DATASUM > ${NAMEISOCLIENT}.iso.sum +mv /tmp/${NAMEISOCLIENT}.iso /var/lib/tftpboot/ogclient/ +mv /tmp/${NAMEISOCLIENT}.iso.sum /var/lib/tftpboot/ogclient/ + ### vi /etc/grub.d/40_custom ## diff --git a/boottoolsgenerator.sh b/boottoolsgenerator.sh index 56d6b30..70a7735 100755 --- a/boottoolsgenerator.sh +++ b/boottoolsgenerator.sh @@ -14,7 +14,6 @@ #mkdir -p /tmp/opengnsys_installer/opengnsys2; #cp -prv /home/administrador/workspace/OpenGnsys/branches/version2/* /tmp/opengnsys_installer/opengnsys2/; #cp -prv /home/administrador/workspace/OpenGnsys/branches/version1.0/client/ /tmp/opengnsys_installer/opengnsys/; - #find /tmp/opengnsys_installer/ -name .svn -type d -exec rm -fr {} \; 2>/dev/null; @@ -31,6 +30,11 @@ then exit 1 fi +for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done +for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done +for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done + + #funciones especificas del cliente. source $PROGRAMDIR/boottoolsfunctions.lib @@ -74,20 +78,22 @@ schroot -p -c IMGogclient -- /tmp/boot-tools/boottoolsFsOpengnsys.sh # FASE6: Instalacion de software # 6.1 instalacion de software con apt-get +#cp /etc/apt/sources.list /tmp schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareInstall.sh -echo "saltando" - if [ $? -ne 0 ]; then - errorAndLog "Instalando sofware adicional OG : ERROR" - exit -else - echoAndLog "Instalando sofware adicional OG: OK" -fi + + # 6.2 compilación de software. cd / schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareCompile.sh +schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareCompile.sh + cd - #Fase 7. Personalizando + +schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsFsLocales.sh + + ### 7.1 incorporamos la clave publica del servidor cd / ssh-keygen -q -f /root/.ssh/id_rsa -N "" @@ -100,6 +106,13 @@ schroot -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshClient.sh ## 7.3 configuramos los locales. schroot -c IMGogclient -- /usr/bin/boot-tools/boottoolsFsLocales.sh +for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done +for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done +for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done + + + + #Fase 7. Generando la ISO. #7.1 el initrd @@ -116,3 +129,6 @@ btogIsoGenerator installationSummary echoAndLog "OpenGnSys installation finished at $(date)" + + + diff --git a/clientstructure/etc/profile.d/loadenviron.sh b/clientstructure/etc/profile.d/loadenviron.sh index 083ee54..f7dc8dd 100755 --- a/clientstructure/etc/profile.d/loadenviron.sh +++ b/clientstructure/etc/profile.d/loadenviron.sh @@ -71,7 +71,7 @@ if [ -d $OPENGNSYS ]; then if [ -n "$ARCH" ]; then # export PATH=$OGBIN/$ARCH:$PATH # export LD_LIBRARY_PATH=$OGLIB/$ARCH:$LD_LIBRARY_PATH - export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:/opt/og2fs/2ndfs/opt/drbl/sbin + export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:/opt/oglive/rootfs/opt/drbl/sbin export PATH=$OGSCRIPTS:$PATH:$OGAPI:$OGBIN:$OGBIN/$ARCH fi # Fichero de registros. diff --git a/includes/etc/initramfs-tools/scripts/ogfunctions b/includes/etc/initramfs-tools/scripts/ogfunctions index 7b4c148..773e413 100644 --- a/includes/etc/initramfs-tools/scripts/ogfunctions +++ b/includes/etc/initramfs-tools/scripts/ogfunctions @@ -224,16 +224,71 @@ ogGetROOTSERVER () echo "ROOTSERVER=$ROOTSERVER" >> $CFGINITRD #si oglive no oglive=R - export OGSERVERIMAGES="${ogrepo:-$ROOTSERVER}" - export OGSERVERSHARE="${ogshare:-$ROOTSERVER}" - export OGSERVERLOG="${oglog:-$ROOTSERVER}" - export OGSERVERLIVE="${oglive:-$OGSERVERIMAGES}" - + export OGSERVERIMAGES="${ogrepo:-$ROOTSERVER}" && echo "OGSERVERIMAGES=$OGSERVERIMAGES" >> $CFGINITRD + export OGSERVERSHARE="${ogshare:-$ROOTSERVER}" && echo "OGSERVERSHARE=$OGSERVERSHARE" >> $CFGINITRD + export OGSERVERLOG="${oglog:-$ROOTSERVER}" && echo "OGSERVERLOG=$OGSERVERLOG" >> $CFGINITRD + export OGSERVERLIVE="${oglive:-$OGSERVERIMAGES}" && echo "OGSERVERLIVE=$OGSERVERLIVE" >> $CFGINITRD + return 0 } +# ogUpdateInitrd +#@brief Actualiza el intird de la cache desde el servidor. Si el arranque ha disdo desde cache, compueba desde el servidor nueva version del initird. +#@param1 +#@return +#@exception OG_ERR_FORMAT Formato incorrecto. +#@version 0.9 +#@author Antonio J. Doblas. Universidad de Malaga. +#@date 2011/05/24 +#*/ ## + +ogUpdateInitrd () +{ + cd /tmp + mkdir /tmp/cache + mount -t reiserfs LABEL=CACHE /tmp/cache || return + mkdir /tmp/cache/boot + + + # comparamos los del server + busybox tftp -g -r ogvmlinuz.sum $ROOTSERVER + busybox tftp -g -r oginitrd.img.sum $ROOTSERVER + SERVERVMLINUZ=`cat ogvmlinuz.sum` + SERVERINITRD=`cat oginitrd.img.sum` + + + #comparamos los de la cache + CACHEVMLINUZ=`cat /tmp/cache/boot/ogvmlinuz.sum` + CACHEINITRD=`cat /tmp/cache/boot/oginitrd.img.sum` + + echo "MD5 on SERVER: $SERVERVMLINUZ $SERVERINITRD" + echo "MD5 on CACHE: $CACHEVMLINUZ $CACHEINITRD" + + cd /tmp/cache/boot + + if [ "$CACHEVMLINUZ" != "$SERVERVMLINUZ" ] + then + echo "ogvmlinuz updating" + busybox tftp -g -r ogvmlinuz $ROOTSERVER + busybox tftp -g -r ogvmlinuz.sum $ROOTSERVER + DOREBOOT=true + fi + if [ "$CACHEINITRD" != "$SERVERINITRD" ] + then + echo "oginitrd updating" + busybox tftp -g -r oginitrd.img $ROOTSERVER + busybox tftp -g -r oginitrd.img.sum $ROOTSERVER + DOREBOOT=true + fi + + cd /; umount /tmp/cache + + [ "$DOREBOOT" == "true" ] && busybox reboot -f + +} + #/** # ogConnect #@brief Conecta con los recursos necesarios para opengnsys @@ -317,6 +372,7 @@ then if [ "$og2nd" == "img" ] then #Montamos el ROOTFS tipo img, para desarrolladores + #TODO: comprobar que se tiene acceso de escritura losetup /dev/loop0 $DSTOGLIVE/ogclient/ogclient.img -o 32256 mount /dev/loop0 $OGLIVEROOTFS else diff --git a/includes/etc/initramfs-tools/scripts/oginit b/includes/etc/initramfs-tools/scripts/oginit index bdf4e7f..cc179f9 100755 --- a/includes/etc/initramfs-tools/scripts/oginit +++ b/includes/etc/initramfs-tools/scripts/oginit @@ -3,30 +3,30 @@ #@file oginit #@brief Guion modificador inicio initrd para OpenGnSys #@warning -#@version 0.1 - basado en ROOTfs +#@version 0.1 - basado en ROOTfs - rootfs over nfs - #@author Antonio J. Doblas Viso. Universidad de Málaga #@date 2009/00/00 -#@version 0.2 - basado en el instalador de ubunto -#@author Alejandro Castillo -#@author Ramón Gómez -#@author Irina -#@author Antonio Doblas +#@version 0.2 - basado en RAMFS - instalador de ubunto - +#@author Alejandro Castillo, Ramón Gómez, Irina, Antonio Doblas #@date 2010/00/00 -#@version 0.7 - Generación limpia con mkinitrd, busybox +#@version 0.7 - Hibrido en RAMFS + ROOTFS -mkinitrd, busybox, deboostrap- #@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT. #@date 2010/05/24 -#@version 0.8 - Integración con FileSystem externo +#@version 0.8 - Soporte smb, asignación ip estática #@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT. #@date 2010/06/24 -#@version 0.8.1 - UnionFS + squasfs +#@version 0.8.1 - Integración RAMFS+ROOTFS con UnionFS y squasfs #@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT. #@date 2010/06/29 #@version 1.0. - Adaptacion variables. Corrección enlace red #@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT. #@date 2011/06/16 -#@version 1.0.1 - Adaptacion inicio multiples dispositivos, usb, red, cd +#@version 1.0.1 - Logica para inicio multiples dispositivos, usb, red, cd #@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT. #@date 2011/07/4 +#@version 1.0.2 - RAMFS: instalación y actualización automatica en cache +#@author Antonio J. Doblas Viso. Universidad de Málaga. EVLT. +#@date 2011/08/4 #*/ @@ -80,39 +80,30 @@ mountroot () [ $? == 0 ] && sh || echo " " ogGetROOTSERVER && log_success_msg "Get Info from pxe server and ckeck distribuited OG services " - [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect and merging the rootfs -ogLive- : y/N " + + if [ "$ogdebug" == "true" -a "$ogupdateinitrd" == "true" ]; then + ogYesNo --timeout 5 --default no "Stop before check updating initrd: y/N " + [ $? == 0 ] && sh || echo " " + fi + [ "$ogupdateinitrd" == "true" ] && ogUpdateInitrd + + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect and merging the rootfs -ogLive- with $OGSERVERLIVE: y/N " [ $? == 0 ] && sh || echo " " - ogConnectOgLive && log_success_msg "Merge the initrd with the remote rootfs -ogLive-" || sh + ogConnectOgLive && log_success_msg "Merge the initrd with the remote rootfs -ogLive- on $OGSERVERLIVE" || sh # si es necesario realiza ogConnect $OGSERVERLIVE $OGPROTOCOL $SRCOGLIVE $DSTOGLIVE - [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir SHARE -engine,scripts,interface, -share- : y/N " + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir SHARE -engine,scripts,interface, -share- on $OGSERVERSHARE : y/N " [ $? == 0 ] && sh || echo " " ogConnect $OGSERVERSHARE $OGPROTOCOL $SRCOGSHARE $DSTOGSHARE - [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir LOG STORAGE : y/N " + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with client dir LOG STORAGE on $OGSERVERLOG : y/N " [ $? == 0 ] && sh || echo " " ogConnect $OGSERVERLOG $OGPROTOCOL $SRCOGLOG $DSTOGLOG - [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with REPOSITORY STORAGE : y/N " + [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before connect with REPOSITORY STORAGE on $OGSERVERIMAGES : y/N " [ $? == 0 ] && sh || echo " " ogConnect $OGSERVERIMAGES $OGPROTOCOL $SRCOGIMAGES $DSTOGIMAGES - - - #[ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before conect with og Services : y/N " - #[ $? == 0 ] && sh || echo " " - #ogConectROOTSERVER && log_success_msg "Conecting with og services" || sh - - - #[ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before merge the Second File System with initrd (First File System) : y/N " - #[ $? == 0 ] && sh || echo " " - #ogMerge2ndFile && log_success_msg "Merge onto Second File System" - - - ####[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/og-bottom" - ####run_scripts /scripts/og-bottom - ####[ "$quiet" != "y" ] && log_end_msg - [ "$ogdebug" == "true" ] && ogYesNo --timeout 5 --default no "Stop before doing the postconfiguration: y/N " [ $? == 0 ] && sh || echo " " diff --git a/includes/etc/profile.d/loadenviron.sh b/includes/etc/profile.d/loadenviron.sh index 083ee54..e2ad014 100755 --- a/includes/etc/profile.d/loadenviron.sh +++ b/includes/etc/profile.d/loadenviron.sh @@ -1,93 +1,4 @@ #!/bin/bash -### NOTA este archivo se sobreescribe al conectarse con el ogSHARE - - - - -#/** -#@file loadenviron.sh -#@brief Script de carga de la API de funciones de OpenGNSys. -#@warning License: GNU GPLv3+ -#@version 0.9 -#@author Ramon Gomez, ETSII Universidad de Sevilla -#@date 2009-10-10 -#*/ - - GLOBAL="cat /proc/cmdline" - for i in `${GLOBAL}` - do - echo $i | grep "=" > /dev/null && export $i - done - - -# FIXME Temporal -export LANG="${LANG:-es_ES}" - -#/// Directorios del projecto OpenGNSys. -export OPENGNSYS="${OPENGNSYS:-/opt/opengnsys}" -if [ -d $OPENGNSYS ]; then - export OGBIN=$OPENGNSYS/bin - export OGETC=$OPENGNSYS/etc - export OGLIB=$OPENGNSYS/lib - export OGAPI=$OGLIB/engine/bin - export OGSCRIPTS=$OPENGNSYS/scripts - export OGIMG=$OPENGNSYS/images - export OGCAC=$OPENGNSYS/cache - export OGLOG=$OPENGNSYS/log - -# export PATH=$OGBIN:$OGAPI:$OGSCRIPTS:$PATH - # export LD_LIBRARY_PATH=$OGLIB:$LD_LIBRARY_PATH - - #/// Cargar fichero de idioma. - LANGFILE=$OGETC/lang.$LANG.conf - if [ -f $LANGFILE ]; then - source $LANGFILE - #for i in $(grep "^[a-zA-Z].*=" $LANGFILE | cut -f1 -d=); do - for i in $(awk -F= '{if (NF==2) print $1}' $LANGFILE); do - export $i - done - fi - #/// Cargar API de funciones. - echo "$MSG_LOADAPI" - for i in $OGAPI/*.lib; do - source $i - done - for i in $(typeset -F | cut -f3 -d" "); do - export -f $i - done - # Carga de las API testing - if [ "$engine" = "testing" ] - then - for i in $OGAPI/*.testing; do - source $i - done - fi - - source /tmp/net-eth* 2>/dev/null - - # Añadir dependencia de arquitectura - ARCH=$(ogGetArch) - if [ -n "$ARCH" ]; then - # export PATH=$OGBIN/$ARCH:$PATH - # export LD_LIBRARY_PATH=$OGLIB/$ARCH:$LD_LIBRARY_PATH - export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:/opt/og2fs/2ndfs/opt/drbl/sbin - export PATH=$OGSCRIPTS:$PATH:$OGAPI:$OGBIN:$OGBIN/$ARCH - fi - # Fichero de registros. - export OGLOGFILE="$OGLOG/$(ogGetIpAddress).log" - # FIXME Pruebas para grupos de ordenadores - #export OGGROUP=$(ogGetGroup) - export OGGROUP=aula3 -fi - -#/// Declaración de códigos de error. -export OG_ERR_FORMAT=1 # Formato de ejecución incorrecto. -export OG_ERR_NOTFOUND=2 # Fichero o dispositivo no encontrado. -export OG_ERR_PARTITION=3 # Error en partición de disco. -export OG_ERR_LOCKED=4 # Partición o fichero bloqueado. -export OG_ERR_IMAGE=5 # Error al crear o restaurar una imagen. -export OG_ERR_NOTOS=6 # Sin sistema operativo. -export OG_ERR_NOTEXEC=7 # Programa o función no ejecutable. - +### NOTA este archivo se debe de copiar desde el fichero etc/init/default diff --git a/includes/usr/bin/boot-tools/boottoolsBootGraphics.sh b/includes/usr/bin/boot-tools/boottoolsBootGraphics.sh index b12eeb2..edd0dc0 100644 --- a/includes/usr/bin/boot-tools/boottoolsBootGraphics.sh +++ b/includes/usr/bin/boot-tools/boottoolsBootGraphics.sh @@ -1,12 +1,12 @@ #!/bin/bash -#TODO Comprobar si esta los source. +#TODO Comprobar si esta los source. #svn checkout http://www.opengnsys.es/svn/branches/version1.0/client /tmp/opengnsys_installer/opengnsys/client/; #svn checkout http://www.opengnsys.es/svn/branches/version2/ /tmp/opengnsys_installer/opengnsys2 find /tmp/opengnsys_installer/ -name .svn -type d -exec rm -fr {} \; 2>/dev/null; #plymouth -apt-get install plymouth plymouth-theme-script +apt-get -y install plymouth plymouth-theme-script #plymoutyh @@ -14,4 +14,6 @@ update-alternatives --install /lib/plymouth/themes/default.plymouth default.plym update-alternatives --set default.plymouth /lib/plymouth/themes/opengnsys/opengnsys.plymouth mkdir -p /etc/initramfs-tools/conf.d -echo "FRAMEBUFFER=y" > /etc/initramfs-tools/conf.d/splash \ No newline at end of file +echo "FRAMEBUFFER=y" > /etc/initramfs-tools/conf.d/splash + +history -c \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/boottoolsFsLocales.sh b/includes/usr/bin/boot-tools/boottoolsFsLocales.sh index 5480d14..63d3694 100755 --- a/includes/usr/bin/boot-tools/boottoolsFsLocales.sh +++ b/includes/usr/bin/boot-tools/boottoolsFsLocales.sh @@ -1,4 +1,6 @@ #!/bin/bash dpkg-reconfigure console-data dpkg-reconfigure console-setup -dpkg-reconfigure locales \ No newline at end of file +dpkg-reconfigure locales + +history -c \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh b/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh index a93924f..21b7a54 100644 --- a/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh +++ b/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh @@ -43,16 +43,7 @@ then exit 1 fi -#parseamos el script de generación del initrd. -#sed -e "s/OSRELEASE/$OSRELEASE/g" ${SVNCLIENTDIR}/clientstructure/root/GenerateInitrd.generic.sh > ${SVNCLIENTDIR}/clientstructure/root/GenerateInitrd.sh -# -#if [ $? -ne 0 ] -#then -# echo "$FUNCNAME(): Parsing GenerateInitrd.sh : ERROR" -# exit 1 -#else -# rm /root/GenerateInitrd.generic.sh -#fi + #damos permiso al directorio de scripts chmod -R 775 ${SVNCLIENTDIR}/includes/usr/bin/* @@ -129,4 +120,5 @@ echo ${VERSIONBOOTTOOLS}-${OSCODENAME}-${VERSIONSVN} > $NAMEHOSTCLIENT echo ${VERSIONBOOTTOOLS}-${OSCODENAME}-${VERSIONSVN} > /etc/debian_chroot echo ${VERSIONBOOTTOOLS}-${OSCODENAME}-${VERSIONSVN} > /etc/opengnsys_chroot +history -c diff --git a/includes/usr/bin/boot-tools/boottoolsFsPostconfiguration.sh b/includes/usr/bin/boot-tools/boottoolsFsPostconfiguration.sh index 05a7907..140cffb 100755 --- a/includes/usr/bin/boot-tools/boottoolsFsPostconfiguration.sh +++ b/includes/usr/bin/boot-tools/boottoolsFsPostconfiguration.sh @@ -1,2 +1,5 @@ #!/bin/bash + + +history -c \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/boottoolsInitrdGenerate.sh b/includes/usr/bin/boot-tools/boottoolsInitrdGenerate.sh index eaeb475..fe9fe4f 100755 --- a/includes/usr/bin/boot-tools/boottoolsInitrdGenerate.sh +++ b/includes/usr/bin/boot-tools/boottoolsInitrdGenerate.sh @@ -13,4 +13,6 @@ rm * cp /bin/busybox ./ cd /tmp/ mkinitramfs -o /tmp/initrd.img-$OSRELEASE -v $OSRELEASE -cp /boot/vmlinuz-$OSRELEASE /tmp \ No newline at end of file +cp /boot/vmlinuz-$OSRELEASE /tmp + +history -c \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/boottoolsSoftwareCompile.sh b/includes/usr/bin/boot-tools/boottoolsSoftwareCompile.sh index 3c9b1a2..c931336 100755 --- a/includes/usr/bin/boot-tools/boottoolsSoftwareCompile.sh +++ b/includes/usr/bin/boot-tools/boottoolsSoftwareCompile.sh @@ -6,25 +6,23 @@ export LANGUAGE=C export LC_ALL=C export LANG=C -#dpkg-divert --local --rename --add /sbin/initctl -#ln -s /bin/true /sbin/initctl -apt-get -y update -# software to compile code -apt-get -y --force-yes install build-essential libattr* attr make m4 gettext libmhash-dev gdebi-core gawk +source /opt/opengnsys/lib/engine/bin/ToolsGNU.c &>/dev/null +cd /tmp -source /opt/opengnsys/lib/engine/bin/ToolsGNU.c +echo "ctorrent " +which ctorrent || ctorrent install &>/dev/null -which ctorrent || ctorrent install +echo "udp-sender " +which udp-sender || udpcast install &>/dev/null -which udp-sender || udpcast install - -which ms-sys || ms-sys install - -which partclone.ntfs || $(wget -O partclone_0.2.16_i386.deb http://downloads.sourceforge.net/project/partclone/stable/0.2.16/partclone_0.2.16_i386.deb?use_mirror=ovh; gdebi -n partclone_0.2.16_i386.deb) - - -which spartlnx.run || $(cd /tmp; wget http://damien.guibouret.free.fr/savepart.zip; unzip savepart.zip -d /sbin/) +echo "ms-sys " +which ms-sys || ms-sys install &>/dev/null +echo "echo partclone " +which partclone.ntfs || $(wget -O partclone_0.2.16_i386.deb http://downloads.sourceforge.net/project/partclone/stable/0.2.16/partclone_0.2.16_i386.deb?use_mirror=ovh &>/dev/null; gdebi -n partclone_0.2.16_i386.deb &>/dev/null) +echo "spartlnx" +which spartlnx.run || $(wget http://damien.guibouret.free.fr/savepart.zip &>/dev/null; unzip -o savepart.zip -d /sbin/) +history -c \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/boottoolsSoftwareInstall.sh b/includes/usr/bin/boot-tools/boottoolsSoftwareInstall.sh index 1c4a978..9af7219 100755 --- a/includes/usr/bin/boot-tools/boottoolsSoftwareInstall.sh +++ b/includes/usr/bin/boot-tools/boottoolsSoftwareInstall.sh @@ -1,83 +1,69 @@ #!/bin/bash -################################################################ -##################### SOFTWARE ##################### -################################################################ export LANGUAGE=C export LC_ALL=C export LANG=C +#LOG_FILE=/tmp/boot-tools-software.txt +#Desactivamos upstart +dpkg-divert --local --rename --add /sbin/initctl +ln -s /bin/true /sbin/initctl + +#cp /tmp/sources.list /etc/apt/sources.list +#Limpiamos y actualizamos los repositorios apt +apt-get clean +apt-get update + +#Desactivamos el hook del oginitrd.img para evitar problemas. +mv /etc/initramfs-tools/hooks/oghooks /etc/initramfs-tools/ + +echo " /dev/sda1 / ext4 rw,errors=remount-ro 0 0 " > /etc/mtab + + +#Instalamos el kernel. export OSDISTRIB=$(lsb_release -i | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null -#OSCODENAME=$(lsb_release -c | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null export OSCODENAME=$(cat /etc/lsb-release | grep CODENAME | awk -F= '{print $NF}') export OSRELEASE=$(uname -a | awk '{print $3}') uname -a | grep x86_64 > /dev/null && export OSARCH=amd64 || export OSARCH=i386 export OSHTTP="http://es.archive.ubuntu.com/ubuntu/" +# software Kernel +apt-get -y --force-yes install linux-image-${OSRELEASE} linux-headers-${OSRELEASE} linux-image-$RELEASE - -dpkg-divert --local --rename --add /sbin/initctl -ln -s /bin/true /sbin/initctl - - -apt-get clean -apt-get -y update - - -# software system -apt-get -y --force-yes install linux-image-${OSRELEASE} linux-headers-${OSRELEASE} linux-image-$RELEASE wget dialog man-db htop fbset gdebi-core busybox-static - -apt-get -y --force-yes install console-data locales - -# sofware networking -apt-get -y --force-yes install netpipes nfs-common sshfs smbfs smbclient davfs2 unionfs-fuse open-iscsi nmap tcpdump arping dnsutils tftp - -apt-get clean -# software services -apt-get -y --force-yes install openssh-server bittornado trickle iptraf screen schroot grub lighttpd - -# software disk and filesystem -apt-get -y --force-yes install drbl-ntfsprogs ntfsprogs parted ntfs-3g dosfstools ncdu -apt-get -y --force-yes install dmraid dmsetup lvm2 e2fsprogs jfsutils reiserfsprogs xfsprogs unionfs-fuse mhddfs squashfs-tools -apt-get -y --force-yes install hfsplus hfsprogs hfsutils nilfs-tools reiser4progs ufsutils - -#btrfs-tools - -# software cloning -apt-get -y --force-yes install drbl-partimage fsarchiver pv kexec-tools -apt-get -y --force-yes install mbuffer - -#monitor -apt-get -y --force-yes install bwbar bmon iftop ifstat dstat hdparm sdparm blktool testdisk ssmping mii-diag - -## software postconf -apt-get -y --force-yes install drbl-chntpw chntpw ethtool lshw gawk subversion - -# software compressor -apt-get -y --force-yes install lzma zip unzip gzip lzop drbl-lzop pigz pbzip2 lbzip2 rzip p7zip-full unzip - - -#compatibilidad og2 -apt-get -y --force-yes install python-openssl python - - - +#Eliminamos cualquier busybox previo: antes del busybox. apt-get -y --force-yes remove busybox -apt-get -y --force-yes install busybox-static bash-static + +#estos paquetes ofrecen interaccion. +# si es actualización, ya existe el fichero /etc/ssh/ssh_config +apt-get -y install sshfs + +apt-get -y install console-data + +for group in `find /usr/bin/boot-tools/listpackages/ -name sw.*` +do + echo "Instalando el grupo de paquetes almacenados en $group" + for package in ` awk /^install/'{print $2}' $group ` + do + echo -n $package + apt-get -y --force-yes install $package &>/dev/null + RETVAL=$? + if [ $RETVAL == 0 ] + then + echo " : OK - Paquete instalado correctamente (codigo interno de apt-get $RETVAL)" + else + echo " : Error Paquete $package del grupo $group (codigo interno de apt-get $RETVAL) " + echo "Pulse pause para continuar" + read + fi + done +done -#apt-get -y --force-yes install xorg-dev xorg lxde roxterm +#Activamos el hook del oginitrd.img +mv /etc/initramfs-tools/oghooks /etc/initramfs-tools/hooks/ + +echo " " > /etc/mtab apt-get clean -# -#################################################################### -###################### Reconfigurando paquetes ###################### -################################################################### - - -#dpkg-reconfigure console-data -#dpkg-reconfigure console-setup -#dpkg-reconfigure locales -apt-get clean -##TODO################# Borrar algunos binarios del mkinitramfs - - +apt-get autoclean +apt-get autoremove +history -c diff --git a/includes/usr/bin/boot-tools/boottoolsSoftwareXwindows b/includes/usr/bin/boot-tools/boottoolsSoftwareXwindows index ce7042c..41824f1 100644 --- a/includes/usr/bin/boot-tools/boottoolsSoftwareXwindows +++ b/includes/usr/bin/boot-tools/boottoolsSoftwareXwindows @@ -9,4 +9,6 @@ apt-get -y update apt-get -y --force-yes install xorg-dev xorg lxde roxterm -apt-get clean \ No newline at end of file +apt-get clean + +history -c \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/boottoolsSshClient.sh b/includes/usr/bin/boot-tools/boottoolsSshClient.sh index 9857ad4..10aa673 100755 --- a/includes/usr/bin/boot-tools/boottoolsSshClient.sh +++ b/includes/usr/bin/boot-tools/boottoolsSshClient.sh @@ -20,4 +20,6 @@ ssh-keygen -q -f /root/.ssh/id_rsa -N "" cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys ## TODO: exportamos la publica a los repos -cp /root/.ssh/id_rsa.pub /tmp/rsa.ogclient.pub \ No newline at end of file +cp /root/.ssh/id_rsa.pub /tmp/rsa.ogclient.pub + +history -c \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/boottoolsSshServer.sh b/includes/usr/bin/boot-tools/boottoolsSshServer.sh index 17a797f..02ea71c 100755 --- a/includes/usr/bin/boot-tools/boottoolsSshServer.sh +++ b/includes/usr/bin/boot-tools/boottoolsSshServer.sh @@ -14,4 +14,5 @@ echo "importando la clave publica del servidor OG" cat /tmp/id_rsa.pub [ -f /tmp/id_rsa.pub ] && cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys || echo "no key publica og" - \ No newline at end of file + + history -c \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/listpackages/sw.Xwindow b/includes/usr/bin/boot-tools/listpackages/sw.Xwindow new file mode 100644 index 0000000..a5da754 --- /dev/null +++ b/includes/usr/bin/boot-tools/listpackages/sw.Xwindow @@ -0,0 +1,8 @@ +#sw.X +#+300M +#install xorg-dev +#install xorg +#install lxde +#+80M roxterm y gparted +install roxterm +install gparted \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/listpackages/sw.Zinitrd b/includes/usr/bin/boot-tools/listpackages/sw.Zinitrd new file mode 100644 index 0000000..4843879 --- /dev/null +++ b/includes/usr/bin/boot-tools/listpackages/sw.Zinitrd @@ -0,0 +1,3 @@ +#sw.zinitrd +install busybox-static +install bash-static diff --git a/includes/usr/bin/boot-tools/listpackages/sw.basic b/includes/usr/bin/boot-tools/listpackages/sw.basic new file mode 100644 index 0000000..4286d65 --- /dev/null +++ b/includes/usr/bin/boot-tools/listpackages/sw.basic @@ -0,0 +1,13 @@ +#Format install paquete +install dialog +install man-db +install fbset +install gdebi-core +install busybox-static +install console-data +install locales +install lshw +install gawk +install subversion +install python-openssl +install python \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/listpackages/sw.cloning b/includes/usr/bin/boot-tools/listpackages/sw.cloning new file mode 100644 index 0000000..622b8bd --- /dev/null +++ b/includes/usr/bin/boot-tools/listpackages/sw.cloning @@ -0,0 +1,10 @@ +#sw.cloning +install drbl-partimage +install fsarchiver +install pv +install kexec-tools +install mbuffer +install parted +install drbl-chntpw +install chntpw +install clonezilla \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/listpackages/sw.compile b/includes/usr/bin/boot-tools/listpackages/sw.compile new file mode 100644 index 0000000..8b1d100 --- /dev/null +++ b/includes/usr/bin/boot-tools/listpackages/sw.compile @@ -0,0 +1,10 @@ +install build-essential +install libattr* +install attr +install make +install m4 +install gettext +install libmhash-dev +install gdebi-core +install gawk + diff --git a/includes/usr/bin/boot-tools/listpackages/sw.compresor b/includes/usr/bin/boot-tools/listpackages/sw.compresor new file mode 100644 index 0000000..113e885 --- /dev/null +++ b/includes/usr/bin/boot-tools/listpackages/sw.compresor @@ -0,0 +1,12 @@ +#sw.compressor +install lzma +install zip +install unzip +install gzip +install lzop +install drbl-lzop +install pigz +install pbzip2 +install lbzip2 +install rzip +install p7zip-full \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/listpackages/sw.filesystem.local b/includes/usr/bin/boot-tools/listpackages/sw.filesystem.local new file mode 100644 index 0000000..16d67da --- /dev/null +++ b/includes/usr/bin/boot-tools/listpackages/sw.filesystem.local @@ -0,0 +1,21 @@ +#sw.filesystem.local +install squashfs-tools +install unionfs-fuse +install drbl-ntfsprogs +install ntfsprogs +install ntfs-3g +install dosfstools +install dmraid +install dmsetup +install lvm2 +install e2fsprogs +install jfsutils +install reiserfsprogs +install xfsprogs +install mhddfs +install hfsplus +install hfsprogs +install hfsutils +install nilfs-tools +install reiser4progs +install ufsutils \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/listpackages/sw.filesystem.remote b/includes/usr/bin/boot-tools/listpackages/sw.filesystem.remote new file mode 100644 index 0000000..192a401 --- /dev/null +++ b/includes/usr/bin/boot-tools/listpackages/sw.filesystem.remote @@ -0,0 +1,9 @@ +#sw.filesystem.remote +install nfs-common +install sshfs +install smbfs +install smbclient +install davfs2 +install open-iscsi +install openssh-server +install bittornado \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/listpackages/sw.monitoring b/includes/usr/bin/boot-tools/listpackages/sw.monitoring new file mode 100644 index 0000000..49adc6f --- /dev/null +++ b/includes/usr/bin/boot-tools/listpackages/sw.monitoring @@ -0,0 +1,12 @@ +#sw.monitoring +install htop +install ncdu +install bwbar +install bmon +install iftop +install ifstat +install dstat +install hdparm +install sdparm +install blktool +install testdisk \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/listpackages/sw.networking b/includes/usr/bin/boot-tools/listpackages/sw.networking new file mode 100644 index 0000000..d8efd04 --- /dev/null +++ b/includes/usr/bin/boot-tools/listpackages/sw.networking @@ -0,0 +1,14 @@ +#sw.networking +install netpipes +install wget +install tftp +install dnsutils +install trickle +install lighttpd +install ethtool +install ssmping +install mii-diag +install tcpdump +install nmap +install arping +install iptraf \ No newline at end of file diff --git a/includes/usr/bin/boot-tools/listpackages/sw.testing b/includes/usr/bin/boot-tools/listpackages/sw.testing new file mode 100644 index 0000000..282de9e --- /dev/null +++ b/includes/usr/bin/boot-tools/listpackages/sw.testing @@ -0,0 +1,4 @@ +#sw.other +install screen +install schroot +install grub \ No newline at end of file