[Toybox] [PATCH] Fix truncate.test for macOS.
Rob Landley
rob at landley.net
Mon Jul 25 15:19:23 PDT 2022
On 7/25/22 11:48, enh wrote:
> > Is there a portable way to determine filesystem type, though? df .
> doesn't say,
> > I have to look in /proc/mounts and I doubt mac has that?
> >
> > $ grep -w "^$(df . | tail -n 1 | toybox cut -DF 1)" /proc/mounts | toybox
> > cut -DF 3
> >
> > (I THINK that if the device has a space in it df will output the escaped
> > version, which should match for grep... But again: Linux.)
> >
> > on the mac it looks like mount is your best bet:
> >
> > ~$ mount
> > /dev/disk3s1s1 on / (apfs, sealed, local, read-only, journaled)
> > ...
> >
> > but maybe just "it's a mac, it's probably using apple's default fs" is
> sufficient?
>
> Hmmm...
>
> sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
>
> Word 4 vs word 5. I guess I could check for "type" and advance, else strip off
> the starting "("... Of course now that I've sat down to implement an
> is_filesystem shell function, I'm trying to figure out what the right question
> to ask here, and checking for a single filesystem type is basically is_mkroot,
> while a whitelist of known filesystem types is bound to accordion out
> unpleasantly while STILL breaking for people...
>
> Blah. This is a design issue. What behavior do we WANT here?
>
> Query: what filesystem A) are you running this under on the android test system,
> B) is available as "scratch space" to an application on an android phone?
>
> depends on the device. there are some restrictions (and actually the writeable
> space might be (a) more restricted and (b) less likely something that the OEMs
> change) but since the toybox tests aren't (yet) in CTS, "works on Google's CI"
> is good enough for now. we can worry about "how do these tests work on every
> device configuration that it's possible to ship?" if/when that's an actual problem.
What are CTS and CI?
I am actively working on making it an actual problem. (Yeah yeah, horrible goos
causing problems on purpose.)
Rob
More information about the Toybox
mailing list