List contents of host directory or SD card

Hello all,

Is there a way to list the contents of a directory on the host filesystem?

I currently have a container that allows you to setup the network settings at runtime through dbus, similar to the docs, here, and a helper app, over bluetooth.

However, we now have a requirement for 802.1x cert based auth setup as well. The easiest way to get certs onto the device for setup with NetworkManager would probably be to drop them into system-connections on the SD card, so they get bind mounted to /etc/NetworkManager/system-connections.

At this point, I’ve modified my container to also allow setting the 802.1x NetworkManager fields, but would like to make the user setup a little easier.

Instead of having to type in the certificate names into the helper app, if I was able to read the directory contents of either /etc/NetworkManager/system-connections, or the system-connections folder on the SD card, I could add a drop down selection, since I would know the file names in advance.

I’m not sure if the best way to do this would be to mount the resin-state partition to a volume inside my container, or even something along the lines of ls --ignore '*.nmconnection --ignore '*.ignore' /etc/NetworkManager/system-connections >> fileInsideContainer.txt

Any advice would be appreciated, thanks