Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,12 @@ The [devscan](services/devscan/README.md) service makes the calls: libsystemd
reports the mounts (dmfsi's `_mount_changed` dif, which dmvfs calls) as devices
of class `mount`, a rule starts `devscan add /dev <mount point>` for a mount and
`devscan remove /dev <mount point>` before an unmount, and both end when they
are done. So a mounted card or `/ext` just brings its drivers:
are done. So a mounted card or `/ext` just brings its configuration:

```
<mount point>/cfg/drivers/ driver configurations -> dmdevfs
<mount point>/cfg/drivers/ driver configurations -> dmdevfs (devscan)
<mount point>/cfg/services/ units -> libsystemd (by itself, on the mount)
<mount point>/cfg/rules/ device rules -> libsystemd (by itself, on the mount)
```

- **mounted** - the drivers are configured by the hot-plug thread. A mount
Expand Down
5 changes: 4 additions & 1 deletion services/devscan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ set(DMOD_AUTHOR_NAME "Patryk Kubiak")
# Its own stack: it only opens a file and calls an ioctl, but the thread that mounts (automount's) is far too small
# to do even that inline
set(DMOD_STACK_SIZE 2048)
set(DMOD_PRIORITY 0)
# Above the services (0): a mount's `remove` unit is waited for by the unmount, and on a busy system (the car HMI) a
# priority-0 process gets the CPU only in the gaps - it took the 20 s the unmount waits for it at most. It does
# a few file operations and ends.
set(DMOD_PRIORITY 3)
set(DMOD_DMR_PATH ${CMAKE_CURRENT_SOURCE_DIR}/devscan.dmr)

dmod_add_executable(${DMOD_MODULE_NAME} ${DMOD_MODULE_VERSION}
Expand Down
4 changes: 4 additions & 0 deletions services/devscan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ and does an ioctl on it - `DMDEVFS_IOCTL_ADD_CONFIG_DIR` /
[`include/dmdevfs.h`](../../include/dmdevfs.h) - then ends. dmdevfs queues the
work for its hot-plug thread. A mount point without `cfg/drivers` is left alone.

Only the drivers are dmdevfs's: the units and rules of a mount point
(`cfg/services`, `cfg/rules`) are loaded by libsystemd itself when the file
system is mounted.

## How it is started

Nothing here follows mounts. libsystemd reports every mount as a device of class
Expand Down
Loading