From f408ce50920498114a9bbb3a28bd633beae9b401 Mon Sep 17 00:00:00 2001 From: ramon Date: Fri, 16 Mar 2018 13:18:47 +0000 Subject: #830: Función {{{ogGetDiskType}}} soporta discos NVM y propuesta para procesar discos a partir de {{{lsblk}}} con formato JSON. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://opengnsys.es/svn/branches/version1.1@5660 a21b9725-9963-47de-94b9-378ad31fedc9 --- client/engine/Disk.lib | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/engine/Disk.lib b/client/engine/Disk.lib index 95c80f2e..3316d0d3 100755 --- a/client/engine/Disk.lib +++ b/client/engine/Disk.lib @@ -494,6 +494,7 @@ fi # Listar dispositivos de discos. ALLDISKS=$((lsblk -n -e 1,2 -x MAJ:MIN 2>/dev/null || lsblk -n -e 1,2) | \ awk '$6~/^disk$/ {gsub(/!/,"/"); printf "/dev/%s ",$1}') +#ALLDISKS=$(lsblk -Jd -e 1,2 | jq -r '.blockdevices[] | "/dev/"+select(.type=="disk").name') # Listar volúmenes lógicos. VOLGROUPS=$(vgs -a --noheadings 2>/dev/null | awk '{printf "/dev/%s ",$1}') ALLDISKS="$ALLDISKS $VOLGROUPS" @@ -652,6 +653,9 @@ case "$TYPE" in TYPE="DISK" udevadm info -q property $1 2>/dev/null | grep -q "^ID_BUS=usb" && TYPE="USB" ;; + BLKEXT) + TYPE="NVM" + ;; SR|IDE*) TYPE="CDROM" # FIXME Comprobar discos IDE. ;; -- cgit v1.2.3-18-g5258