diff options
Diffstat (limited to 'client')
4 files changed, 14 insertions, 18 deletions
diff --git a/client/boot-tools/boottoolsfunctions.lib b/client/boot-tools/boottoolsfunctions.lib index 308c5a77..5d22e11f 100755 --- a/client/boot-tools/boottoolsfunctions.lib +++ b/client/boot-tools/boottoolsfunctions.lib @@ -14,12 +14,7 @@ function btogGetVar() { -export BTSVNBOOTTOOLS=/tmp/opengnsys_installer/opengnsys/client/boot-tools -export BTSVNSHARE=/tmp/opengnsys_installer/opengnsys/client/shared -export BTSVNENGINE=/tmp/opengnsys_installer/opengnsys/client/engine - -export BTSVNOG2=/tmp/opengnsys_installer/opengnsys2 - +export BTDIR=/tmp/opengnsys_installer/opengnsys/client/boot-tools export BTTARGETDIR=/var/lib/tftpboot/ogclient/ export BTROOTFSIMG=${BTTARGETDIR}ogclient.img export BTROOTFSMNT=${BTTARGETDIR}ogclientmount @@ -127,12 +122,13 @@ case "${1,,}" in exit 1 ;; esac -SVNURL="https://opengnsys.es/svn/trunk/client" -VERSIONSVN=$(LANG=C svn info $SVNURL | awk '/Rev:/ {print "r"$4}') -NAMEISOCLIENT="$VERSIONBOOTTOOLS-$OSCODENAME-$OSRELEASE-$OSARCH-$VERSIONSVN" -NAMEHOSTCLIENT="$VERSIONBOOTTOOLS-$OSCODENAME-$VERSIONSVN" +BRANCH="master" +GITURL="https://api.github.com/repos/opengnsys/OpenGnsys/commits?sha=$BRANCH&path=/client" +GITRELEASE=$(curl -s "$GITURL" | jq -r '"r" + (.[0].commit.committer.date | gsub("-"; "")[:8]) + "." + (.[0].sha[:7])') +NAMEISOCLIENT="$VERSIONBOOTTOOLS-$OSCODENAME-$OSRELEASE-$OSARCH-$GITRELEASE" +NAMEHOSTCLIENT="$VERSIONBOOTTOOLS-$OSCODENAME-$GITRELEASE" export OSDISTRIB OSCODENAME OSRELEASE OSARCH OSHTTP -export TYPECLIENT VERSIONSVN NAMEISOCLIENT NAMEHOSTCLIENT +export TYPECLIENT GITRELEASE NAMEISOCLIENT NAMEHOSTCLIENT ### El fichero de configuración debe sustituir a estos 3 ficheros (borrar las 3 líneas siguientes). echo "$NAMEISOCLIENT" > /tmp/opengnsys_info_rootfs echo "$NAMEHOSTCLIENT" > /tmp/opengnsys_chroot @@ -144,7 +140,7 @@ OSCODENAME="$OSCODENAME" OSRELEASE="$OSRELEASE" OSARCH="$OSARCH" OSHTTP="$OSHTTP" -VERSIONSVN="$VERSIONSVN" +GITRELEASE="$GITRELEASE" NAMEISOCLIENT="$NAMEISOCLIENT" NAMEHOSTCLIENT="$NAMEHOSTCLIENT" EOT diff --git a/client/boot-tools/boottoolsgenerator.sh b/client/boot-tools/boottoolsgenerator.sh index 4c19de07..cdbe8cf7 100755 --- a/client/boot-tools/boottoolsgenerator.sh +++ b/client/boot-tools/boottoolsgenerator.sh @@ -72,10 +72,10 @@ echo "FASE 4 - Configurar acceso schroot al Segundo Sistema de archivos (img)" cat /etc/schroot/schroot.conf | grep $BTROOTFSIMG || btogSetFsAccess ########################################################################### echo "FASE 5 - Incorporando ficheros OpenGnsys al sistema raíz rootfs " -cp -a ${BTSVNBOOTTOOLS}/includes/usr/bin/* /tmp +cp -a ${BTDIR}/includes/usr/bin/* /tmp chmod +x /tmp/boot-tools/*.sh # Incluir revisión. -sed -i "1 s/$/ $VERSIONSVN/" ${BTSVNBOOTTOOLS}/includes/etc/initramfs-tools/scripts/VERSION.txt +sed -i "1 s/$/ $GITRELEASE/" ${BTDIR}/includes/etc/initramfs-tools/scripts/VERSION.txt # En Ubuntu 13.04+ es necesario matar proceso de "udev" antes de desmontar. umount $BTROOTFSMNT 2>/dev/null || (kill -9 $(lsof -t $BTROOTFSMNT); umount $BTROOTFSMNT 2>/dev/null) schroot -p -c IMGogclient -- /tmp/boot-tools/boottoolsFsOpengnsys.sh diff --git a/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions b/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions index d46ab875..b25fcc5f 100644 --- a/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions +++ b/client/boot-tools/includes/etc/initramfs-tools/scripts/ogfunctions @@ -550,7 +550,7 @@ then for i in bin sbin lib $LIBS etc var usr root boot; do ogUnionLiveDir $i done - cat /tmp/mtab.preunion > /etc/mtab + [ -L /etc/mtab ] || cat /tmp/mtab.preunion > /etc/mtab else echo "Fichero imagen del cliente no encontrado" return 1 diff --git a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh index 0e42a7ed..85b00b69 100755 --- a/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh +++ b/client/boot-tools/includes/usr/bin/boot-tools/boottoolsFsOpengnsys.sh @@ -24,7 +24,7 @@ echo "$OSDISTRIB:$OSCODENAME:$OSRELEASE:$OSARCH:$OSHTTP" LERROR=TRUE -echo "$FUNCNAME: Iniciando la personalización con datos del SVN " +echo "$FUNCNAME: Iniciando la personalización con datos del repositorio" # parseamos el apt.source de la distribución (en minúsculas) sed -e "s/OSCODENAME/$OSCODENAME/g" ${SVNCLIENTDIR}/includes/etc/apt/sources.list.${OSDISTRIB,,} > ${SVNCLIENTDIR}/includes/etc/apt/sources.list @@ -77,8 +77,8 @@ if [ $? -ne 0 ]; then fi # El fichero de configuración debe sustituir a los 2 ficheros (borrar las 2 líneas). -echo "${VERSIONBOOTTOOLS}-${OSCODENAME}-${OSRELEASE}-${VERSIONSVN}" > /$NAMEISOCLIENTFILE -echo "${VERSIONBOOTTOOLS}-${OSCODENAME}-${VERSIONSVN}" > $NAMEHOSTCLIENTFILE +echo "${VERSIONBOOTTOOLS}-${OSCODENAME}-${OSRELEASE}-${GITRELEASE}" > /$NAMEISOCLIENTFILE +echo "${VERSIONBOOTTOOLS}-${OSCODENAME}-${GITRELEASE}" > $NAMEHOSTCLIENTFILE history -c |