From: Raphaƫl Hertzog Date: Thu, 12 Jan 2017 15:31:05 +0000 (+0100) Subject: Improve removable_dev() in 9990-misc-helpers.sh when /sys/block/ is empty X-Git-Tag: debian/1%20170112~3 X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=commitdiff_plain;h=269069291cc11027e3fba8e295d272ec84577604 Improve removable_dev() in 9990-misc-helpers.sh when /sys/block/ is empty Closes: #847802 --- diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh index 1a06ccf..ee53b16 100755 --- a/components/9990-misc-helpers.sh +++ b/components/9990-misc-helpers.sh @@ -1169,6 +1169,10 @@ removable_dev () for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -vE "/(loop|ram|dm-|fd)") do + if [ ! -d "${sysblock}" ]; then + continue + fi + dev_ok= if [ "$(cat ${sysblock}/removable)" = "1" ] then @@ -1214,6 +1218,10 @@ non_removable_dev () for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -vE "/(loop|ram|dm-|fd)") do + if [ ! -d "${sysblock}" ]; then + continue + fi + if [ "$(cat ${sysblock}/removable)" = "0" ] then case "${output_format}" in diff --git a/debian/changelog b/debian/changelog index acae698..0504232 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ live-boot (1:20170112) unstable; urgency=medium * Team upload. * Fix nodhcp option to actually force DHCP off. Closes: #785345 Thanks to Frank Lillo for the report and Evgeni Golov for the patch. + * Improve 9990-misc-helpers.sh when /sys/block/ is empty. + Closes: #847802 [ Kristian Klausen ] * Add "nls_ascii" module in the initrd so that we can access FAT