ping @JesterOrNot How should we implement the fsh checking?
Reminder: This is done for binaries that are not in PATH like 70% of binaries on my system.
Currently i have this:
// Detect File System Hierarchy
// FIXME: Export as an invidual crate?
// FIXME: What do we want this to return?
pub fn detect_filesystem_hierarchy() -> ??? {
if cfg!(target_os = "unix") {
// See File System Hierarchy Standard https://refspecs.linuxfoundation.org/fhs.shtml
// FIXME-QA: What about lib32 and lib64?
// FIXME-QA: Not all systems follow standard for /srv
// FIXME-QA: Needs more definitions
let fsh3_0 = ["/bin", "/boot", "/etc", "/dev", "/etc", "/home", "/lib", "/media", "/mnt", "/opt", "/root", "/run", "/sbin", "/srv", "/tmp", "/usr" ];
} else if cfg!(target_os = "windows") {
unimplemented!("Windows is not implemented in detect_filesystem_hierarchy function")
} else {
// FIXME: Add msg
exit(255);
}
}
Where the issues are:
ostree shares the directories with fsh3.0
Some of the linux distros are not following fsh3.0 (like archlinux)
Custom filesystems like my LFS which has /kreyrock/strata/foo with other filesystems that are sandboxed to be accesible from the same terminal.
Proposed solutions
Assuming this being exported as a crate
Define arrays for known filesystems and then capture the data in enums to be used by developers i.e enum that defines all known binaries (could be used on my project as well)
Define arrays for known filesystems and export logic to output the filesystem.
Check only for known destinctions like /ostree to detect ostree
Assuming the being a non-crate
Same as 2.
Use something like find $ROOT -type f -executable to output all files with executable permission.
ping @JesterOrNot How should we implement the fsh checking?
Reminder: This is done for binaries that are not in PATH like 70% of binaries on my system.
Currently i have this:
Where the issues are:
/kreyrock/strata/foo
with other filesystems that are sandboxed to be accesible from the same terminal.Proposed solutions
Assuming this being exported as a crate
/ostree
to detect ostreeAssuming the being a non-crate
find $ROOT -type f -executable
to output all files with executable permission.