We are trying to read information about internal SD cards on RPI to predict possible device failures. Is there no way to do this now?
For instance information about manufacturing date is here: /sys/block/mmcblk0/device/date and you can read the information about the name and the manufacturer in the same directory.
I initially thought that block-devices interface would help but when I used it, it turned out that was not helping.
On cat /sys/block/mmcblk0/device/date from inside the snap I am getting the apparmor denial with a following path /sys/devices/platform/soc/3f202000.mmc/mmc_host/mmc0/mmc0:aaaa/date.
Is it possible to do with existing snapd permissions or can a new interface be added for that?
This is a sample output. Unfortunately, there is no vendor id or manufacturing date. Some stuff shows up though indirectly. name of the device is the SC16G, and serial 0xc52340f1 which can be inferred from the id here.
I don’t really care about the id though. What’s more important is is the vendor and the model (oemid and name might be the answer for this I think) to see for what kind of cards there might be a higher chance of failure.
It also gets this info in some other way, unfortunately, so while my snap has the udisks interface and ships udisks inside I can’t access /sys/block/mmcblk0/device/*
Yes, I did enable block-devices. I thought it would give me access because of following line:
/dev/mmcblk[0-9]{,[0-9],[0-9][0-9]} rw, # MMC (up to 1000 devices)
cat /sys/block/mmcblk0/device/date
And accessing that causes following app armor denial:
Unfortunately, it did not work with either of those interfaces for me. Can this functionality be added to an existing interface?
I am open to writing a patch for it but Idk how generic that access would be as I am just interested in access to this internal SD card storage.