mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 20:35:42 +02:00
module/removable: 'ignore' is now applied to partitions too
This means you can now do either ignore: [/dev/sda] to ignore all partitions on /dev/sda, or ignore: [/dev/sda1] to ignore only the first partition on /dev/sda.
This commit is contained in:
parent
5d17f1eb57
commit
87a8054ae2
1 changed files with 11 additions and 0 deletions
|
@ -229,6 +229,7 @@ static struct partition *
|
||||||
add_partition(struct module *mod, struct block_device *block,
|
add_partition(struct module *mod, struct block_device *block,
|
||||||
struct udev_device *dev)
|
struct udev_device *dev)
|
||||||
{
|
{
|
||||||
|
struct private *m = mod->private;
|
||||||
const char *_size = udev_device_get_sysattr_value(dev, "size");
|
const char *_size = udev_device_get_sysattr_value(dev, "size");
|
||||||
uint64_t size = 0;
|
uint64_t size = 0;
|
||||||
if (_size != NULL)
|
if (_size != NULL)
|
||||||
|
@ -241,6 +242,16 @@ add_partition(struct module *mod, struct block_device *block,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char *devname = udev_device_get_property_value(dev, "DEVNAME");
|
||||||
|
if (devname != NULL) {
|
||||||
|
tll_foreach(m->ignore, it) {
|
||||||
|
if (strcmp(it->item, devname) == 0) {
|
||||||
|
LOG_DBG("ignoring %s because it is on the ignore list", devname);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const char *label = udev_device_get_property_value(dev, "ID_FS_LABEL");
|
const char *label = udev_device_get_property_value(dev, "ID_FS_LABEL");
|
||||||
if (label == NULL)
|
if (label == NULL)
|
||||||
label = udev_device_get_property_value(dev, "ID_LABEL");
|
label = udev_device_get_property_value(dev, "ID_LABEL");
|
||||||
|
|
Loading…
Add table
Reference in a new issue