summaryrefslogtreecommitdiffstats
path: root/md/writeup
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2022-02-15 21:19:27 +0000
committerFreeArtMan <dos21h@gmail.com>2022-02-15 21:19:27 +0000
commit5c6adae24c8485fd882a10d76933bdba286882b1 (patch)
tree94d6b068127c1b9765d9f9f919a5c8e44d3ec57c /md/writeup
parentef76dc85d8ece6d11ea1cccd1044130ad55165d3 (diff)
downloadmd-content-5c6adae24c8485fd882a10d76933bdba286882b1.tar.gz
md-content-5c6adae24c8485fd882a10d76933bdba286882b1.zip
Final nmount post
Diffstat (limited to 'md/writeup')
-rw-r--r--md/writeup/writing_linux_mount_utility.md31
1 files changed, 25 insertions, 6 deletions
diff --git a/md/writeup/writing_linux_mount_utility.md b/md/writeup/writing_linux_mount_utility.md
index 9b71a84..05d3770 100644
--- a/md/writeup/writing_linux_mount_utility.md
+++ b/md/writeup/writing_linux_mount_utility.md
@@ -11,7 +11,7 @@ own mount utility. As its looks like only one syscall is needed to do that sys_m
Other part of it is to see how to get all different file systems and find
options that are possible to pass to mounted partition. All of this also preparations
to write my own linux userspace and to have non-Linux distro. Main inspiration
-taken form arsv/minibase soure code.
+taken form arsv/minibase soure code.
## Syscalls
@@ -46,7 +46,7 @@ Comparison to mount utility is straigforward.
### Supported filesystems
-Rund command to find filesystems supported by currently running kernel
+Run command to find filesystems supported by currently running kernel
```
cat /proc/filesystems
@@ -115,14 +115,34 @@ I spend some time to find all params that are supported for procfs,devtmps and t
| hidepid | __0__ - Everybody may access all proc, __1__ - User can access only their own proc, not other /proc/[pid], __2__ - As for mode 1, extra hides pid directories of others |
| gid | usergroup who sees /proc in mode 0 |
-### Devtmpfs
+## Examples
+### Mount proc
+```bash
+nmount_static -t proc -d ma_proc -f hidepid=0 -v
+```
+
+### Mount mqueue
-### Tempfs
+```bash
+nmount_static -t mqueue -d ma_quque -f noexec -v
+```
+### Mount devtmpfs
+```bash
+mount_static -t devtmpfs -d mq_dev -f noexec -v
+```
-## Implementation
+### Mount tmpfs
+```bash
+nmount_static -t mqueue -d ma_ram -f noexec -v
+```
+
+### Mount sysfs
+```bash
+nmount_static -t sysfs -d ma_sys -f silent -v
+```
## Links
@@ -139,7 +159,6 @@ https://man7.org/linux/man-pages/man7/file-hierarchy.7.html
[procsf]
https://www.man7.org/linux/man-pages/man5/proc.5.html
https://elixir.bootlin.com/linux/v4.14.184/source/fs/proc/root.c#L33
-[tmpfs]
https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt