]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
scripts/contrib/ddimage: replace blacklist with mount check
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Thu, 22 Nov 2018 20:53:22 +0000 (09:53 +1300)
committerPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 2 Jul 2019 04:11:06 +0000 (16:11 +1200)
commit24303f66435b1e8a5b58948ce97530b055631ecd
tree3d49f40f8bd23c0f2b95d5ca72c8b39666555ec2
parente13c9e9e04c3df56087dd8d63e144134ed9badaf
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>
scripts/contrib/ddimage