From 6f61b14d5359fad70ffb20aafee076a0481a60bc Mon Sep 17 00:00:00 2001 From: =?utf8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?utf8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= Date: Thu, 31 Jan 2019 14:28:59 +0100 Subject: [PATCH] portable: document /etc/machine-id and /etc/resolv.conf MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit … requirement for portable service images. systemd will mount the host machine-id and resolv.conf at these locations, so for read-only images these must exist in the image, because they can't be created. --- docs/PORTABLE_SERVICES.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/PORTABLE_SERVICES.md b/docs/PORTABLE_SERVICES.md index 2dbeeee760b..5b6c085af09 100644 --- a/docs/PORTABLE_SERVICES.md +++ b/docs/PORTABLE_SERVICES.md @@ -89,8 +89,9 @@ If you have portable service image, maybe in a raw disk image called This command does the following: -1. It dissects the image, checks and validates the `/etc/os-release` data of - the image, and looks for all included unit files. +1. It dissects the image, checks and validates the `/etc/os-release` + (or `/usr/lib/os-release`, see below) data of the image, and looks for + all included unit files. 2. It copies out all unit files with a suffix of `.service`, `.socket`, `.target`, `.timer` and `.path`. whose name begins with the image's name @@ -170,8 +171,11 @@ requirements are made for an image that can be attached/detached with image. (The implementation will check a couple of other paths too, but it's recommended to use these two paths.) -4. The image must contain an os-release file, either in /etc/os-release or - /usr/lib/os-release. The file should follow the standard format. +4. The image must contain an os-release file, either in `/etc/os-release` or + `/usr/lib/os-release`. The file should follow the standard format. + +5. The image must contain the files `/etc/resolv.conf` and `/etc/machine-id` + (empty files are ok), they will be bind mounted from the host at runtime. Note that generally images created by tools such as `debootstrap`, `dnf --installroot=` or `mkosi` qualify for all of the above in one way or -- 2.47.3