Open sprhawk opened 4 years ago
Great catch! Any thoughts on how I can discover the platform specific paths at build time?
Great catch! Any thoughts on how I can discover the platform specific paths at build time?
I guess as a start, simply we can check all possible position in /bin, /sbin, /usr/bin, /usr/sbin. and even provide an argument to provide binary path by caller.
Would you like to try a PR for this? If not I can try to get to it when I have some time.
Would you like to try a PR for this? If not I can try to get to it when I have some time.
I'm quite busy recently, I would try when I got available. I currently forked a repo to hardcod my path into it for hot fix.
However, I am also thinking whether I should even write a smaller crate for mkfs and block utils based on udev.
I think current block-utils
implements features by using both command line and udev based, not quite clean for my taste.
Sounds good! I agree this crate isn’t the cleanest code. It was meant largely to solve a problem. If I had to do it over again I’d avoid cli commands as much as possible. They’re slow and brittle
Sounds good! I agree this crate isn’t the cleanest code. It was meant largely to solve a problem. If I had to do it over again I’d avoid cli commands as much as possible. They’re slow and brittle
Sure, totally understand. After I finished the initial stage of my project, maybe we can discuss more about this. Part of my project will rely on these utils stable and usable.
Thanks for your lib!
On my Debian 10.2, mkfs.btrfs is under /usr/bin, not hard coded /sbin/mkfs.btrfs
Better to handle different path on different platforms.