meta data for this page
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| sw:yocto:overlayfs:machine-id [2026/04/10 13:23] – created niziak | sw:yocto:overlayfs:machine-id [2026/04/10 19:10] (current) – niziak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== machine-id ====== | ====== machine-id ====== | ||
| - | Read only rootfs: | + | Read only root FS: |
| - | * with tmpfs overlay on /etc | + | * with preinit script (before real / |
| - | * with preinit to bind mount persistent / | + | * tmpfs overlay on '' |
| - | * fist boot works well | + | * bind mount persistent |
| + | * first boot works well | ||
| * after reboot systemd complains: | * after reboot systemd complains: | ||
| Line 15: | Line 16: | ||
| </ | </ | ||
| + | [[https:// | ||
| - | < | + | It runs because |
| - | ### Editing / | + | |
| - | ### Anything between here and the comment below will become the contents | + | |
| + | <file ini systemd-machine-id-commit.service> | ||
| + | [Unit] | ||
| + | DefaultDependencies=no | ||
| + | Conflicts=shutdown.target | ||
| + | Before=shutdown.target | ||
| + | After=local-fs.target first-boot-complete.target | ||
| + | ConditionPathIsReadWrite=/ | ||
| + | ConditionPathIsMountPoint=/ | ||
| + | [Service] | ||
| + | Type=oneshot | ||
| + | RemainAfterExit=yes | ||
| + | ExecStart=systemd-machine-id-setup --commit | ||
| + | </ | ||
| - | ### Edits below this comment will be discarded | ||
| + | This unit is designed to be run when ''/ | ||
| + | so '' | ||
| - | ### /usr/lib/ | + | As workarund '' |
| - | # # SPDX-License-Identifier: | + | <file ini /etc/ |
| - | # # | + | [Unit] |
| - | # # This file is part of systemd. | + | ConditionPathIsReadWrite=|/etc |
| - | # # | + | ConditionPathIsReadWrite=|/mnt/state/ |
| - | # # systemd is free software; you can redistribute it and/or modify it | + | ConditionFirstBoot=yes |
| - | # # under the terms of the GNU Lesser General Public License as published by | + | ConditionPathIsMountPoint=/etc/machine-id |
| - | # # the Free Software Foundation; either version 2.1 of the License, or | + | </ |
| - | # # (at your option) any later version. | + | |
| - | # | + | |
| - | # [Unit] | + | |
| - | # Description=Commit a transient machine-id on disk | + | |
| - | # Documentation=man: | + | |
| - | # DefaultDependencies=no | + | |
| - | # Conflicts=shutdown.target | + | |
| - | # Before=shutdown.target | + | |
| - | # After=local-fs.target first-boot-complete.target | + | |
| - | # ConditionPathIsReadWrite=/ | + | |
| - | # ConditionPathIsMountPoint=/etc/ | + | |
| - | # | + | |
| - | # [Service] | + | |
| - | # Type=oneshot | + | |
| - | # RemainAfterExit=yes | + | |
| - | # ExecStart=systemd-machine-id-setup --commit | + | |
| - | # TimeoutSec=30s | + | |
| - | </code> | + | Second approach is [[https:// |
| + | |||
| + | <file ini /etc/ | ||
| + | [Unit] | ||
| + | ConditionPathIsReadWrite= | ||
| + | ConditionPathIsReadWrite=/ | ||
| + | ConditionPathIsMountPoint= | ||
| + | ConditionPathIsMountPoint=/ | ||
| + | |||
| + | [Service] | ||
| + | ExecStart= | ||
| + | ExecStart=systemd-machine-id-setup --commit --root=/ | ||
| + | </ | ||
| + | |||
| + | More about problem: | ||
| + | [[https:// | ||