diff options
Diffstat (limited to 'client')
-rwxr-xr-x | client/boot-tools/boottoolsfunctions.lib | 9 | ||||
-rw-r--r-- | client/boot-tools/includes/etc/initramfs-tools/scripts/VERSION.txt | 2 | ||||
-rw-r--r-- | client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.basic | 3 | ||||
-rwxr-xr-x | client/engine/Cache.lib | 15 | ||||
-rwxr-xr-x | client/engine/Disk.lib | 29 | ||||
-rwxr-xr-x | client/shared/scripts/configureOs | 4 | ||||
-rwxr-xr-x | client/shared/scripts/deployImage | 2 |
7 files changed, 50 insertions, 14 deletions
diff --git a/client/boot-tools/boottoolsfunctions.lib b/client/boot-tools/boottoolsfunctions.lib index f364f174..7f7bbb38 100755 --- a/client/boot-tools/boottoolsfunctions.lib +++ b/client/boot-tools/boottoolsfunctions.lib @@ -116,13 +116,20 @@ case "${1,,}" in OSARCH="amd64" OSHTTP="http://es.archive.ubuntu.com/ubuntu/" ;; - bionic) # ogLive 1.1.1-rc1 basado en Ubuntu 18.04 y Kernel 4.15. + bionic|bionic-4.15) # ogLive 1.1.1-rc1 basado en Ubuntu 18.04 y Kernel 4.15. OSDISTRIB="ubuntu" OSCODENAME="bionic" OSRELEASE="4.15.0-32-generic" OSARCH="amd64" OSHTTP="http://es.archive.ubuntu.com/ubuntu/" ;; + bionic-4.18) # ogLive 1.1.1-rc3 basado en Ubuntu 18.04 y Kernel 4.18. + OSDISTRIB="ubuntu" + OSCODENAME="bionic" + OSRELEASE="4.18.0-17-generic" + OSARCH="amd64" + OSHTTP="http://es.archive.ubuntu.com/ubuntu/" + ;; host) # ogLive basado en la distribución del servidor. OSDISTRIB=$(lsb_release -is) OSCODENAME=$(lsb_release -cs) diff --git a/client/boot-tools/includes/etc/initramfs-tools/scripts/VERSION.txt b/client/boot-tools/includes/etc/initramfs-tools/scripts/VERSION.txt index 45805bd6..bc92b96f 100644 --- a/client/boot-tools/includes/etc/initramfs-tools/scripts/VERSION.txt +++ b/client/boot-tools/includes/etc/initramfs-tools/scripts/VERSION.txt @@ -1 +1 @@ -OpenGnsys Client 1.1.1-rc2 +OpenGnsys Client 1.1.1-rc3 diff --git a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.basic b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.basic index afd8ff4c..31f2b559 100644 --- a/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.basic +++ b/client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.basic @@ -9,7 +9,8 @@ install console-data install locales install lshw install gawk -install subversion +#install subversion # ogLive anterior a Ubuntu 18.04 +install git # ogLive a partir de Ubuntu 18.04 install python-openssl install python #install php5-cli # ogLive anterior a Ubuntu 16.04 diff --git a/client/engine/Cache.lib b/client/engine/Cache.lib index 0e7f51ef..bda02951 100755 --- a/client/engine/Cache.lib +++ b/client/engine/Cache.lib @@ -4,7 +4,7 @@ #@brief Librería o clase Cache #@class Cache #@brief Funciones para gestión de la caché local de disco. -#@version 1.1.0 +#@version 1.1.1 #@warning License: GNU GPLv3+ #*/ @@ -44,7 +44,8 @@ function ogCreateCache () { # Variables locales. -local FINDCACHE IOSIZE NDSK SIZECACHE PART DISK START END ENDPREVPART SIZE MINSIZE MAXSIZE PTTYPE ID TMPFILE +local FINDCACHE IOSIZE NDSK SIZECACHE PART DISK START END ENDPREVPART SIZE MINSIZE MAXSIZE +local PTTYPE ID TMPFILE NVME_PREFIX # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME [int_ndisk [int_npart]] int_partsize" \ @@ -81,6 +82,14 @@ esac TMPFILE=/tmp/sfdisk$$ DISK=$(ogDiskToDev $NDSK) || return $? + + # PATCH Para discos nvme la particion debe ser p1, p2, etc...en lugar de 1,2, sino falla sfdisk +NVME_PREFIX="" +if [[ $DISK == *"nvme"* ]]; then + NVME_PREFIX="p" +fi + + END=$[$(ogGetLastSector $NDSK 2>/dev/null)] # Sector final del disco. SIZE=$[$SIZECACHE*2] # Tamaño en sectores de 512 B. # Inicio partición cache según el disco tenga sectores de 4k o menores @@ -127,7 +136,7 @@ case "$(ogGetPartitionTableType $NDSK)" in # Salvamos la configuración de las particiones e incluimos la cache. trap "rm -f $TMPFILE" 1 2 3 9 15 sfdisk --dump $DISK | grep -v $DISK$PART > $TMPFILE - echo "$DISK$PART : start= $START, size= $SIZE, Id=$ID" >> $TMPFILE + echo "$DISK$NVME_PREFIX$PART : start= $START, size= $SIZE, Id=$ID" >> $TMPFILE # Ordenamos las líneas de los dispositivos UNIT=$(grep unit $TMPFILE) grep ^/dev $TMPFILE|sort -o $TMPFILE diff --git a/client/engine/Disk.lib b/client/engine/Disk.lib index 050438d7..f7535370 100755 --- a/client/engine/Disk.lib +++ b/client/engine/Disk.lib @@ -4,7 +4,7 @@ #@brief Librería o clase Disk #@class Disk #@brief Funciones para gestión de discos y particiones. -#@version 1.1.0 +#@version 1.1.1 #@warning License: GNU GPLv3+ #*/ @@ -47,7 +47,8 @@ timeout -k 5s -s KILL 3s $(which parted) "$@" function ogCreatePartitions () { # Variables locales. -local ND DISK PTTYPE PART SECTORS START SIZE TYPE CACHEPART IODISCO IOSIZE CACHESIZE EXTSTART EXTSIZE tmpsfdisk +local ND DISK PTTYPE PART SECTORS START SIZE TYPE CACHEPART IODISCO IOSIZE CACHESIZE +local EXTSTART EXTSIZE NVME_PREFIX tmpsfdisk # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME int_ndisk str_parttype:int_partsize ..." \ @@ -94,12 +95,18 @@ trap "rm -f $tmpsfdisk" 1 2 3 9 15 echo "unit: sectors" >$tmpsfdisk echo >>$tmpsfdisk +NVME_PREFIX="" +if [[ $DISK == *"nvme"* ]]; then + NVME_PREFIX="p" +fi + + # Generar fichero de entrada para "sfdisk" con las particiones. shift while [ $# -gt 0 ]; do # Conservar los datos de la partición de caché. if [ "$ND $PART" == "$CACHEPART" -a -n "$CACHESIZE" ]; then - echo "$DISK$PART : start=$[SECTORS+1], size=$CACHESIZE, Id=ca" >>$tmpsfdisk + echo "$DISK$NVME_PREFIX$PART : start=$[SECTORS+1], size=$CACHESIZE, Id=ca" >>$tmpsfdisk PART=$[PART+1] fi # Leer formato de cada parámetro - Tipo:Tamaño @@ -125,7 +132,7 @@ while [ $# -gt 0 ]; do SECTORS=$[EXTSTART+EXTSIZE] fi # Generar datos para la partición. - echo "$DISK$PART : start=$START, size=$SIZE, Id=$ID" >>$tmpsfdisk + echo "$DISK$NVME_PREFIX$PART : start=$START, size=$SIZE, Id=$ID" >>$tmpsfdisk # Error si se supera el nº total de sectores. START=$[START+SIZE] if [ "$IOSIZE" == "4096" -a $PART -gt 4 ]; then @@ -138,9 +145,9 @@ done # Si no se indican las 4 particiones primarias, definirlas como vacías, conservando la partición de caché. while [ $PART -le 4 ]; do if [ "$ND $PART" == "$CACHEPART" -a -n "$CACHESIZE" ]; then - echo "$DISK$PART : start=$[SECTORS+1], size=$CACHESIZE, Id=ca" >>$tmpsfdisk + echo "$DISK$NVME_PREFIX$PART : start=$[SECTORS+1], size=$CACHESIZE, Id=ca" >>$tmpsfdisk else - echo "$DISK$PART : start=0, size=0, Id=0" >>$tmpsfdisk + echo "$DISK$NVME_PREFIX$PART : start=0, size=0, Id=0" >>$tmpsfdisk fi PART=$[PART+1] done @@ -396,7 +403,7 @@ esac function ogDevToDisk () { # Variables locales. -local CACHEFILE DEV PART d n +local CACHEFILE DEV PART NVME_PREFIX d n # Si se solicita, mostrar ayuda. if [ "$*" == "help" ]; then ogHelp "$FUNCNAME" "$FUNCNAME path_device | LABEL=str_label | UUID=str_uuid" \ @@ -431,7 +438,13 @@ fi # Si no se encuentra, procesa todos los discos para devolver su nº de orden y de partición. n=1 for d in $(ogDiskToDev); do - [ -n "$(echo $DEV | grep $d)" ] && echo "$n ${DEV#$d}" && return +NVME_PREFIX="" +if [[ $d == *"nvme"* ]]; then + NVME_PREFIX="p" +fi + + + [ -n "$(echo $DEV | grep $d)" ] && echo "$n ${DEV#$d$NVME_PREFIX}" && return n=$[n+1] done ogRaiseError $OG_ERR_NOTFOUND "$1" diff --git a/client/shared/scripts/configureOs b/client/shared/scripts/configureOs index cf3980db..2e529c9e 100755 --- a/client/shared/scripts/configureOs +++ b/client/shared/scripts/configureOs @@ -101,6 +101,10 @@ case "$OSTYPE" in [ -n "$(find $MNTDIR/usr/sbin $MNTDIR/sbin $MNTDIR/usr/local/sbin -name ogAdmLnxClient -print)" ] && ogUninstallLinuxClient $1 $2 # Configurar nuevo agente OGAgent. ogConfigureOgagent $1 $2 + ## Modificar el nombre del equipo + echo "Asignar nombre Linux \"$HOST\"." + ETC=$(ogGetPath $1 $2 /etc) + [ -d "$ETC" ] && echo "$HOST" >$ETC/hostname 2>/dev/null ;; MacOS) # Postconfiguración de Mac OS X. # Fichero indicador de activación de postconfiguración. diff --git a/client/shared/scripts/deployImage b/client/shared/scripts/deployImage index 824da2af..b6696443 100755 --- a/client/shared/scripts/deployImage +++ b/client/shared/scripts/deployImage @@ -119,6 +119,8 @@ case "$MODE" in # Si protocolo es torrent|torrent-cache o multicast|multicast-cache TORRENT|TORRENT-CACHE|MULTICAST|MULTICAST-CACHE|UNICAST|UNICAST-CACHE) + # Eliminamos CACHE o DIRECT + PROTO=${PROTO%%-*} ogEcho log session "[2] updateCache "$REPO" \"/$IMGNAME.img\" $PROTO $PROTOOPT" TIME2=$SECONDS updateCache "$REPO" "/$IMGNAME.img" "$PROTO" "$PROTOOPT" |