I need this rewrite now, because it's really hard to change anything FS-related while tripping over all this boilerplate code in /proc, /dev and /sys. Now, shim_fs_pseudo.c provides an extra abstraction layer: when I'm refactoring, hopefully I won't need to touch these individual filesystems again, just shim_fs_pseudo.
Also, hopefully code for individual filesystems is much nicer now.
I realize it's a huge change. The problem is that it's hard to split: I could submit a change that rewrites just, say, /dev, but then there would be two shim_fs_pseudo implementations: old one, and new one; and some names might collide (when I was working on it, I did exactly that, and had to change some function names to pseudo2_*).
Fixes issues with /proc (fixes #2385, fixes #948).
How to test this PR?
The tests for proc and sys are stronger: they literally look at every file and directory (then Python assertions check the result). You can examine what they do by running them (graphene-direct proc_common, graphene_direct sysfs_common).
If you want to examine the filesystems, I recommend the busybox example (e.g. graphene-direct busybox ls -la /proc).
Description of the changes
See commit message for details.
I need this rewrite now, because it's really hard to change anything FS-related while tripping over all this boilerplate code in
/proc
,/dev
and/sys
. Now,shim_fs_pseudo.c
provides an extra abstraction layer: when I'm refactoring, hopefully I won't need to touch these individual filesystems again, justshim_fs_pseudo
.Also, hopefully code for individual filesystems is much nicer now.
I realize it's a huge change. The problem is that it's hard to split: I could submit a change that rewrites just, say,
/dev
, but then there would be twoshim_fs_pseudo
implementations: old one, and new one; and some names might collide (when I was working on it, I did exactly that, and had to change some function names topseudo2_*
).Fixes issues with
/proc
(fixes #2385, fixes #948).How to test this PR?
The tests for
proc
andsys
are stronger: they literally look at every file and directory (then Python assertions check the result). You can examine what they do by running them (graphene-direct proc_common
,graphene_direct sysfs_common
).If you want to examine the filesystems, I recommend the
busybox
example (e.g.graphene-direct busybox ls -la /proc
).This change is