Rejecting zram[0-9] as candidate device

This commit is contained in:
2019-12-05 18:15:55 +01:00
parent c0b650bebb
commit 5e727b43ad
4 changed files with 52 additions and 22 deletions

View File

@ -334,8 +334,9 @@ list_devices() {
fi
if test -z "$devs"
then
# Obtain list of top-level names which do not look like CD or floppy.
devs=$("$lsblk_cmd" -d -n -o NAME | grep -v '^sr[0-9]' | grep -v '^fd[0-9]')
# Obtain list of top-level names which do not look like CD, floppy, RAM dev
devs=$("$lsblk_cmd" -d -n -o NAME | grep -v '^sr[0-9]' \
| grep -v '^fd[0-9]' | grep -v '^zram[0-9]')
fi
not_advised=0
@ -356,11 +357,18 @@ list_devices() {
then
yucky=y
reasons="${reasons}looks_like_disk_partition- "
fi
if echo "$name" | grep '^sr[0-9]' >/dev/null
elif echo "$name" | grep '^sr[0-9]' >/dev/null
then
yucky=y
reasons="${reasons}looks_like_cd_drive- "
elif echo "$name" | grep '^fd[0-9]' >/dev/null
then
yucky=y
reasons="${reasons}looks_like_floppy- "
elif echo "$name" | grep '^zram[0-9]' >/dev/null
then
yucky=y
reasons="${reasons}looks_like_ramdev- "
fi
# >>> recognize the device from which Debian Live booted