diff --git a/boottoolsfunctions.lib b/boottoolsfunctions.lib index 252f34e..fb62b2c 100755 --- a/boottoolsfunctions.lib +++ b/boottoolsfunctions.lib @@ -29,11 +29,7 @@ export BTROOTFSIMGLABEL=ogClient export LOG_FILE=/tmp/boot-tools_installation.log -NAMEISOCLIENT=`cat /tmp/opengnsys_info_rootfs` -NAMEHOSTCLIENT=`cat /tmp/opengnsys_chroot` - -export NAMEISOCLIENT -export NAMEHOSTCLIENT +export VERSIONBOOTTOOLS="ogLive" } @@ -62,14 +58,20 @@ function btogGetOsInfo () export OSHTTP="http://es.archive.ubuntu.com/ubuntu/ " ;; host | HOST | *) - export OSDISTRIB=$(lsb_release -i | awk -F: '{sub(/\t/,""); print $2}') 2>/dev/null - export OSCODENAME=$(cat /etc/lsb-release | grep CODENAME | awk -F= '{print $NF}') + export OSDISTRIB=$(lsb_release -is) + export OSCODENAME=$(lsb_release -cs) 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/" ;; esac - echo $OSDISTRIB:$OSCODENAME:$OSRELEASE:$OSARCH:$OSHTTP +SVNURL="http://opengnsys.es/svn/branches/version1.0/client" +VERSIONSVN=$(LANG=C svn info $SVNURL | awk '/Revision:/ {print "r"$2}') +export NAMEISOCLIENT="$VERSIONBOOTTOOLS-$OSCODENAME-$OSRELEASE-$VERSIONSVN" +export NAMEHOSTCLIENT="$VERSIONBOOTTOOLS-$OSCODENAME-$VERSIONSVN" +echo "$VERSIONSVN" > /tmp/versionsvn.txt +echo "$NAMEISOCLIENT" > /tmp/opengnsys_info_rootfs +echo "$NAMEHOSTCLIENT" > /tmp/opengnsys_chroot } # btogSetFsVirtual: Crea y formatea el fichero - disco duro virtual @@ -92,7 +94,7 @@ echoAndLog "$FUNCNAME(): Creación y formateo del disco virtual $BTVIRTUALDISKSI #Desmontamos el dispositivo virtual mount | grep $BTROOTFSMNT && umount $BTROOTFSMNT -mount | grep $BTROOTFSMNTT && umount $BTROOTFSMNT +mount | grep $BTROOTFSMNT && umount $BTROOTFSMNT #echo "$FUNCNAME(): Creando el directorio donde se montará el disco virtual $BTROOTFSMNT" mkdir -p $BTROOTFSMNT diff --git a/boottoolsgenerator.sh b/boottoolsgenerator.sh index de28910..40d5aab 100755 --- a/boottoolsgenerator.sh +++ b/boottoolsgenerator.sh @@ -38,25 +38,25 @@ for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umo #funciones especificas del cliente. source $PROGRAMDIR/boottoolsfunctions.lib +####################################################################3 +echo "FASE 1 - Asignación de variables" +#obtenemos las variables necesarias y la información del host. +btogGetVar echoAndLog "OpenGnSys CLIENT installation begins at $(date)" - +btogGetOsInfo ########################################################################## -echo "FASE 1 - Instalación de software adicional." +echo "FASE 2 - Instalación de software adicional." cat /etc/apt/sources.list | grep "http://free.nchc.org.tw/drbl-core" || echo "deb http://free.nchc.org.tw/drbl-core drbl stable " >> /etc/apt/sources.list apt-get update; apt-get -y --force-yes install debootstrap subversion schroot squashfs-tools syslinux genisoimage gpxe qemu -####################################################################3 -echo "FASE 2 - Asignación de variables" -#obtenemos las variables necesarias y la información del host. -btogGetVar && btogGetOsInfo ###################################################################3 -echo " FASE 3: Creación del Sistema raiz RootFS (Segundo Sistema archivos (img)) " -echo "Fase 3.1 Generar y Formatear el disco virtual. generamos el dispositivo loop." +echo "FASE 3 - Creación del Sistema raiz RootFS (Segundo Sistema archivos (img)) " +echo "Fase 3.1 Generar y formatear el disco virtual. Generar el dispositivo loop." file $BTROOTFSIMG | grep "partition 1: ID=0x83" if [ $? == 1 ] then btogSetFsVirtual || exit 2 fi -echo "Fase 3.2 gener sistema de archivos con debootstrap" +echo "Fase 3.2 Generar sistema de archivos con debootstrap" schroot -p -c IMGogclient -- touch /tmp/ogclientOK if [ -f /tmp/ogclientOK ] then @@ -65,15 +65,16 @@ else btogSetFsBase || exit 3 fi ###################################################################3 -echo "FASE 4: Configurar acceso schroot al Segundo Sistema de archivos (img)" +echo "FASE 4 - Configurar acceso schroot al Segundo Sistema de archivos (img)" cat /etc/schroot/schroot.conf | grep $BTROOTFSIMG || btogSetFsAccess ########################################################################### -echo "FASE 5: Incorporando con ficheros OpenGnsys el sistema raiz rootfs " -cp -prv ${BTSVNBOOTTOOLS}/includes/usr/bin/* /tmp/ +echo "FASE 5 - Incorporando ficheros OpenGnSys el sistema raiz rootfs " +cp -av ${BTSVNBOOTTOOLS}/includes/usr/bin/* /tmp/ chmod 777 /tmp/boot-tools/*.sh +umount $BTROOTFSMNT 2>/dev/null schroot -p -c IMGogclient -- /tmp/boot-tools/boottoolsFsOpengnsys.sh ############################################################################################ -echo "FASE6: Instalar software" +echo "FASE 6 - Instalar software" echo "Fase 6.1 instalar paquetes deb con apt-get" schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareInstall.sh echo "Fase 6.2 compilar software." @@ -82,17 +83,17 @@ schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareCompile.sh schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSoftwareCompile.sh cd - -echo "Fase 7. Personalizar el sistema creado" -echo "Fase 7.1 incorporamos la clave publica del servidor" +echo "FASE 7 - Personalizar el sistema creado" +echo "Fase 7.1 Incorporar la clave publica del servidor" cd / ssh-keygen -q -f /root/.ssh/id_rsa -N "" cp /root/.ssh/id_rsa.pub /tmp schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshServer.sh cd - -echo "Fase 7.2. incorpoar la clave publica del propio cliente" +echo "Fase 7.2. Incorpoar la clave publica del propio cliente" schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsSshClient.sh -echo "Fase 7.1. configurando las locales" +echo "Fase 7.3. Configurando las locales" schroot -p -c IMGogclient -- /usr/bin/boot-tools/boottoolsFsLocales.sh @@ -101,12 +102,12 @@ for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umo for i in `mount | grep IMGogclient | grep /var | cut -f3 -d" "`; do echo $i; umount $i; done ######################################################################### -echo "Fase 8 . Generar distribucion " -echo "Fase 8.1 generar el initrd" +echo "FASE 8 - Generar distribucion" +echo "Fase 8.1 Generar el initrd" btogFsInitrd -echo "8.2. Generar fichero sqfs a partir del fichero img" +echo "Fase 8.2 Generar fichero sqfs a partir del fichero img" btogFsSqfs -echo "8.3. Generar la ISO" +echo "Fase 8.3 Generar la ISO" btogIsoGenerator ######################################################################3 ######################################################################## @@ -114,5 +115,3 @@ btogIsoGenerator installationSummary echoAndLog "OpenGnSys installation finished at $(date)" - -