Improved bdmap output
This commit is contained in:
parent
0f6348e0a1
commit
7e7284ea02
9
bdmap
9
bdmap
@ -6,11 +6,14 @@ BLK_INFO="$(ls -l --color=never /sys/block | grep -v virtual | grep devices | se
|
|||||||
# STRIP OFF THE PCI BUS LOCATION INFORMATION
|
# STRIP OFF THE PCI BUS LOCATION INFORMATION
|
||||||
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|\.\.\/devices/pci[0-9a-f:]\{7\}\(/[0-9a-f:.]\{12\}\)\+/||g')"
|
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|\.\.\/devices/pci[0-9a-f:]\{7\}\(/[0-9a-f:.]\{12\}\)\+/||g')"
|
||||||
|
|
||||||
#STRIP OFF THE SUPERFLUOUS USB HOST INFORMATION
|
# STRIP OFF THE SUPERFLUOUS USB HOST INFORMATION
|
||||||
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|\(usb[0-9]\+\)/.*/host|\1/host|g')"
|
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|\(usb[0-9]\+\)/.*/host|\1/host|g')"
|
||||||
|
|
||||||
# CONDENSE THE TARGET INFORMATION
|
# STRIP OFF THE SUPERFLUOUS TARGET INFORMATION
|
||||||
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|target[0-9:]\+/[0-9:]\+:\([0-9]\+\)|target\1|g')"
|
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|/target\([0-9]\+\):\([0-9]\+\):\([0-9]\+\)/|/|g')"
|
||||||
|
|
||||||
|
# EXPAND THE SCSI INFORMATION
|
||||||
|
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|\([0-9]\+\):\([0-9]\+\):\([0-9]\+\):\([0-9]\+\)|ch\2/id\3/lun\4|g')"
|
||||||
|
|
||||||
# STRIP OFF BLOCKS
|
# STRIP OFF BLOCKS
|
||||||
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|/block/.*||g')"
|
BLK_INFO="$(echo "${BLK_INFO}" | sed 's|/block/.*||g')"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user