[Toybox] [PATCH] Fix truncate.test for macOS.

enh enh at google.com
Mon Jul 25 16:10:33 PDT 2022


On Mon, Jul 25, 2022 at 3:12 PM Rob Landley <rob at landley.net> wrote:

> 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?
>

https://source.android.com/compatibility/cts

https://en.wikipedia.org/wiki/Continuous_integration


> I am actively working on making it an actual problem. (Yeah yeah, horrible
> goos
> causing problems on purpose.)
>

_you_ can't add the toybox tests to CTS, and i'm not sure i'm foolhardy
enough to do that myself :-)


> Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20220725/d1a3f6d9/attachment.htm>


More information about the Toybox mailing list