#!/bin/sh | |
set -e | |
SYSFS_UBI_DIR=/sys/class/ubi | |
log() | |
{ | |
echo "$@" >&2 | |
} | |
usage() | |
{ | |
log "Usage: $0" | |
log " Lists all ubi volumes" | |
exit 9 | |
} | |
if [ "$#" != 0 ]; then | |
usage | |
fi | |
for i in $SYSFS_UBI_DIR/ubi*_*; do | |
[ -d $i ] || continue | |
echo -n ${i##*/} '' | |
head -n1 $i/name | |
done |