diff options
author | Juan Manuel Bardallo <juanmanuel.bardallo@sic.uhu.es> | 2019-03-26 12:04:01 +0100 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2019-03-27 07:50:42 +0100 |
commit | 30fa5b494415c05d135f7b18e6eb44a48dbe2feb (patch) | |
tree | 239fac362ffa9973abf40a8ab0ad0dde8e009b1c /client/engine/Cache.lib | |
parent | ce1aa0b33271d3cad06ee52004f011d00195aebc (diff) |
#906 Operations with partitions and images support NVMe
Diffstat (limited to 'client/engine/Cache.lib')
-rwxr-xr-x | client/engine/Cache.lib | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/client/engine/Cache.lib b/client/engine/Cache.lib index 0e7f51ef..8565fe1c 100755 --- a/client/engine/Cache.lib +++ b/client/engine/Cache.lib @@ -81,6 +81,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 +135,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 |