5 Commits

Author SHA1 Message Date
Andrey Smirnov
33d1c3e425
chore: run apid and trustd services as non-root user
For the `trustd`, this change is simple as it doesn't access any files
on the host filesystem.

For the `apid`, there are more things involved:

* `apid.sock` used for internal API calls should be createable by `apid`
* `runtime.sock` used for apid to COSI communication should be
accessible for `apid`
* `machined.sock` used for proxying calls to machined should be as well
made available to the `apid`.

Plus fixes default permissions for `tmpfs` mountpoints.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2021-08-13 16:50:44 +03:00
Andrew Rynhard
9947ec84d7 fix: use hugetlbfs instead of none
Specifies the mount source as `hugetlbfs`.

Signed-off-by: Andrew Rynhard <andrew@rynhard.io>
2021-02-02 10:18:26 -08:00
Andrew Rynhard
b441915c0c feat: mount hugetlbfs
This adds a hugetlbfs. Some applications may depend on it.

Signed-off-by: Andrew Rynhard <andrew@rynhard.io>
2021-02-01 15:37:42 -08:00
Andrew Rynhard
888c8b948a feat: add /system directory
This adds the `/system` directory to provide a dedicated
directory for all system related runtime files.

Signed-off-by: Andrew Rynhard <andrew@rynhard.io>
2020-07-01 09:51:56 -07:00
Andrew Rynhard
49307d554d refactor: improve machined
This is a rewrite of machined. It addresses some of the limitations and
complexity in the implementation. This introduces the idea of a
controller. A controller is responsible for managing the runtime, the
sequencer, and a new state type introduced in this PR.

A few highlights are:

- no more event bus
- functional approach to tasks (no more types defined for each task)
  - the task function definition now offers a lot more context, like
    access to raw API requests, the current sequence, a logger, the new
    state interface, and the runtime interface.
- no more panics to handle reboots
- additional initialize and reboot sequences
- graceful gRPC server shutdown on critical errors
- config is now stored at install time to avoid having to download it at
  install time and at boot time
- upgrades now use the local config instead of downloading it
- the upgrade API's preserve option takes precedence over the config's
  install force option

Additionally, this pulls various packes in under machined to make the
code easier to navigate.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2020-04-28 08:20:55 -07:00