[systemd-devel] Fwd: Does Systemd also mount sysfs, procfs?
유준봉
mountainlion0523 at gmail.com
Thu Dec 17 16:19:37 PST 2015
Hi I just started to understand systemd source code.
Now I'm curious about mounting linux pseudo-filesystemd like sysfs and
porcfs.
In main( ) function from /src/core/main.c, there is several mounting
related functions like:
1. mount_setup_early
2. mount_setup
3. mount_cgroupt_controllers
and also, there is table named 'mount_table'
I used log_info( ) to see which file systems that systemd mounts. But none
of them was sysfs or procfs(systemd only mounts: securityfs, tmpfs, devfs,
etc. but not sysfs and procfs).
I also tracked why systemd does not mount sysfs and procs.
Inside mount_one( ) function, systemd uses name_to_handle_at( ) to get
mount_id.
For sysfs('/sys'), or procfs('/proc'), name_to_handle_at( ) returns
fail(EOPNOTSUPP). But for its parent('/'), name_to_handle_at( ) returns
success. and in this case, systemd doesn't mount such file systems.
Now, this is my question:
What this situation means when child directory returns fail for
name_to_handle_at( ) but its parent returns success for the same function?
does it mean '/sys' is already mounted before '/sbin/init' is executed? If
so, then who mounts sysfs, procfs, and also rootfs?(script? other initial
process?)
I know it is very basic question for linux programmer, but please give me
some answer about this.
TIA.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20151218/7f98c670/attachment.html>
More information about the systemd-devel
mailing list