I have an embedded system with a tiny initramfs which needs to mount an overlayfs over the rootfs partition and switch_root to the new merged filesystem.
It's just a couple operations run from the init shell script so I don't want to pull in the entire systemd infrastructure but I want to make sure all relevant block devices are already present in the system or wait for them to appear. I added the systemd-udevd component to my initramfs (considering even switching to eudev if I can get the same results).
I was unable to find any examples or figure out how to use udevadm to block and wait until a specific device appears. It seems to me that some combination of udevadm trigger and settle should do it, but no combination seemed to work in my case.
I can easily code it using libudev in C or pyudev in Python, but I guess there should be a way to achieve that using existing tools.
I would prefer to avoid some busy waiting with manual checking if given file exists already.