mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
kernel: add section about /proc/version
Customize user, host and date
This commit is contained in:
20
README.adoc
20
README.adoc
@@ -5283,6 +5283,26 @@ Sources:
|
||||
|
||||
Bibliography: https://stackoverflow.com/questions/8516021/proc-create-example-for-kernel-module/18924359#18924359
|
||||
|
||||
===== /proc/version
|
||||
|
||||
Its data is shared with `uname()`, which is a POSIX C function and has a Linux syscall to back it up.
|
||||
|
||||
Where the data comes from and how to modify it:
|
||||
|
||||
* https://unix.stackexchange.com/questions/136959/where-does-uname-get-its-information-from/485962#485962
|
||||
* https://stackoverflow.com/questions/23424174/how-to-customize-or-remove-extra-linux-kernel-version-details-shown-at-boot
|
||||
|
||||
In this repo, leaking host information, and to make builds more reproducible, we are setting:
|
||||
|
||||
- user and date to dummy values
|
||||
- hostname to the kernel git commit
|
||||
|
||||
So the file contains something like:
|
||||
|
||||
....
|
||||
Linux version 4.19.0-dirty (lkmc@84df9525b0c27f3ebc2ebb1864fa62a97fdedb7d) (gcc version 6.4.0 (Buildroot 2018.05-00002-gbc60382b8f)) #1 SMP Thu Jan 1 00:00:00 UTC 1970
|
||||
....
|
||||
|
||||
==== sysfs
|
||||
|
||||
Sysfs is more restricted than <<procfs>>, as it does not take an arbitrary `file_operations`:
|
||||
|
||||
Reference in New Issue
Block a user