https://github.com/quark-zju/mod_utsmod
A kernel module to make uname fancy
https://github.com/quark-zju/mod_utsmod
Last synced: 3 months ago
JSON representation
A kernel module to make uname fancy
- Host: GitHub
- URL: https://github.com/quark-zju/mod_utsmod
- Owner: quark-zju
- License: gpl-2.0
- Created: 2014-10-16T11:26:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-16T11:39:12.000Z (over 10 years ago)
- Last Synced: 2025-01-08T08:45:52.800Z (5 months ago)
- Language: C
- Homepage:
- Size: 129 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
utsmod
======Provide a sysctl interface to modify read-only UTS fields (ostype, osrelease, version).

Example
-------```
# ./build.sh
...
# insmod utsmod.ko
# sysctl -a | grep utsmod
utsmod.osrelease = 3.12-0.bpo.1-amd64
utsmod.ostype = Linux
utsmod.version = #1 SMP Debian 3.12.9-1~bpo70+1 (2014-02-07)
# uname -a
Linux debian 3.12-0.bpo.1-amd64 #1 SMP Debian 3.12.9-1~bpo70+1 (2014-02-07) x86_64 GNU/Linux# sysctl -w utsmod.ostype=Firefox
sysctl: setting key "utsmod.ostype": Operation not permitted# unshare --uts bash
# sysctl -w utsmod.ostype=Firefox
# sysctl -w utsmod.osrelease='1.0.0-foo-amd64'
# sysctl -w utsmod.version='Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101'
# hostname ZION
# uname -a
Firefox ZION 1.0.0-foo-amd64 Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 x86_64 GNU/Linux# exit
# uname -a
Linux debian 3.12-0.bpo.1-amd64 #1 SMP Debian 3.12.9-1~bpo70+1 (2014-02-07) x86_64 GNU/Linux
```Notes
-----
- Tested in Linux 3.2, 3.12, 3.16
- Root UTS namespace is read-only