]> code.ossystems Code Review - openembedded-core.git/commit
scripts/contrib/ddimage: replace blacklist with mount check
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 2 Jul 2019 04:12:45 +0000 (16:12 +1200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 3 Jul 2019 08:09:49 +0000 (09:09 +0100)
commit49043de1a7716ad612fb92a2e8a52e43d253c800
tree6fa0907607ef6b7db8ce5e44005b38c0f108ab21
parentadf632c959e7f6595b697726fe64ddda40b9f249
scripts/contrib/ddimage: replace blacklist with mount check

The blacklist, whilst previously useful for safety, is now becoming
obsolete - on my current system, the main storage is at /dev/nvme* and
if I plug in a USB stick it shows up as /dev/sdb which was previously
blacklisted. To make this more flexible, remove the blacklist and
instead check if the specified device is mounted, has a partition
that is mounted, or is otherwise in use according to the kernel, and
show an appropriate error and quit if so.

To make this robust, also ensure we handle where the specified device is
a symlink to another device.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/contrib/ddimage