Page MenuHomeFreeBSD

Make linux_enable="YES" result in mounting linprocfs, linsysfs, and handling /dev/shm/
AbandonedPublic

Authored by trasz on May 20 2019, 5:01 PM.

Details

Reviewers
tijl
dchagin
Summary

Make linux_enable="YES" result in mounting linprocfs, linsysfs,
and handling /dev/shm/.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 24331
Build 23153: arc lint + arc unit

Event Timeline

trasz created this revision.May 20 2019, 5:01 PM

I like the idea and I propose to add fdescfs also

emaste added a subscriber: emaste.May 20 2019, 8:09 PM

I like the idea although have users already put entries in /etc/fstab?

tijl added a comment.May 20 2019, 8:29 PM

We used to tell people to symlink /dev/shm to /tmp in pkg-message but some programs check the file system type of /dev/shm (using statfs) so after https://svnweb.freebsd.org/base?view=revision&revision=283461 /dev/shm must be tmpfs for these programs to work properly and /tmp isn't necessarily tmpfs. So I created /compat/linux/dev/shm in https://svnweb.freebsd.org/ports?view=revision&revision=424237. This also makes /dev/shm and /tmp separate namespaces like they are on Linux. The only problem I've encountered with this is when running 'command > /dev/null' as root it will create /compat/linux/dev/null as a regular file. There's no such problem when running commands as a regular user. I think the proper fix is to have a real /dev/shm directory, either by default or created by linux_common.ko. And then let linux_enable mount a tmpfs there.

In D20322#438209, @tijl wrote:

We used to tell people to symlink /dev/shm to /tmp in pkg-message but some programs check the file system type of /dev/shm (using statfs) so after https://svnweb.freebsd.org/base?view=revision&revision=283461 /dev/shm must be tmpfs for these programs to work properly and /tmp isn't necessarily tmpfs. So I created /compat/linux/dev/shm in https://svnweb.freebsd.org/ports?view=revision&revision=424237. This also makes /dev/shm and /tmp separate namespaces like they are on Linux. The only problem I've encountered with this is when running 'command > /dev/null' as root it will create /compat/linux/dev/null as a regular file. There's no such problem when running commands as a regular user. I think the proper fix is to have a real /dev/shm directory, either by default or created by linux_common.ko. And then let linux_enable mount a tmpfs there.

Thank you, that's very useful to know. How about https://reviews.freebsd.org/D20333?

I like the idea although have users already put entries in /etc/fstab?

I wonder if we could add those to the default fstab, marked noauto. Do we have a default fstab, though?