Make linux(4) create /dev/shm. Linux applications often expect
a tmpfs to be mounted there, and because they like to verify it's
actually a mountpoint, a symlink won't do.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 24356 Build 23178: arc lint + arc unit
Event Timeline
I would prefer put common code to the compat/linux/linux.c and put linux_dev_shm_destroy/linux_dev_shm_create decl to the linux.h
What do you mean? Or, ask another way, where should I call it from to make it work for i386?
Please also bump OSVERSION so the creation of /compat/linux/dev/shm can be made conditional in emulators/linux_base-c[67]
This is a bit hacky, even for my standards, so I've come up with this as an alternative: https://reviews.freebsd.org/D20411.
I have no objection
Further, I am not familiar enough with the devfs machinery to effectively review (previously I would not have suspected make_dev as the way to create a devfs directory), but I support the intent / effect of this change.
sys/compat/linux/linux.c | ||
---|---|---|
538 โ | (On Diff #57758) | Ah I see now. What about shm/.mountpoint in that case? |
sys/i386/linux/linux_sysvec.c | ||
---|---|---|
1009 โ | (On Diff #63735) | So if both 64 and 32bit linix.ko are loaded, one of them would print an error. If another one is unloaded before the module that printed an error, the node is destroyed. Which raises the next question, did you actually tried it ? I wonder what happens to the system when devfs directory goes away while being used as mount point (I have no idea and curious). |
Well, they don't print an error. I'm not quite sure why, but I've tested both scenarios - kldloading linux.ko and then linux64.ko, and the other way around; same with kldunloading.
As for what happens when the devfs goes away - you're left with a mount point that's not accessible with full path. You can unmount it just fine, though. And we depend on that behaviour for reroot.
Then there must be a bug either in the testing methodology or in the code, right ? Ensure that the make_dev line is executed in both cases.
I'm not sure how it works, but there seems to be some magic that makes sure it gets called in the right circumstances. Existing code already depends on it - eg linux_osd_jail_register() is called in the exact same way.
On amd64 the code is in linux_common.ko, not linux.ko and linux64.ko. So the directory is created/destroyed when linux_common is loaded/unloaded.