Skip to content

Commit

Permalink
fix(systemd-generator): write configuration to '/run'
Browse files Browse the repository at this point in the history
Write manufacturing-client-config to '/run' instead of
'/etc' as it seems to be a readonly filesystem.

Resolves: fedora-iot/iot-distro#64
Signed-off-by: Miguel Martín <[email protected]>
  • Loading branch information
mmartinv committed Oct 2, 2024
1 parent 25dc5f0 commit cba310e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions dracut/52fdo/manufacturing-client-generator
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ diun_pub_key_insecure=$(getarg fdo.diun_pub_key_insecure= ||:)
diun_pub_key_hash=$(getarg fdo.diun_pub_key_hash= ||:)
diun_pub_key_root_certs=$(getarg fdo.diun_pub_key_root_certs= ||:)
mfg_string_type_mac_iface=$(getarg fdo.di_mfg_string_type_mac_iface= ||:)
cat >"/etc/manufacturing-client-config" <<EOF
cat >"/run/manufacturing-client-config" <<EOF
# Automatically generated by live-generator
MANUFACTURING_SERVER_URL="${manufacturing_server_url}"
EOF
if [ -n "${diun_pub_key_insecure}" ]; then
cat >>"/etc/manufacturing-client-config" <<EOF
cat >>"/run/manufacturing-client-config" <<EOF
DIUN_PUB_KEY_INSECURE="${diun_pub_key_insecure}"
EOF
fi
if [ -n "${diun_pub_key_hash}" ]; then
cat >>"/etc/manufacturing-client-config" <<EOF
cat >>"/run/manufacturing-client-config" <<EOF
DIUN_PUB_KEY_HASH="${diun_pub_key_hash}"
EOF
fi
if [ -n "${diun_pub_key_root_certs}" ]; then
cat >>"/etc/manufacturing-client-config" <<EOF
cat >>"/run/manufacturing-client-config" <<EOF
DIUN_PUB_KEY_ROOTCERTS="${diun_pub_key_root_certs}"
EOF
fi

if [ -n "${mfg_string_type_mac_iface}" ]; then
cat >>"/etc/manufacturing-client-config" <<EOF
cat >>"/run/manufacturing-client-config" <<EOF
DI_MFG_STRING_TYPE_MAC_IFACE="${mfg_string_type_mac_iface}"
EOF
fi
4 changes: 2 additions & 2 deletions dracut/52fdo/manufacturing-client.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ After=coreos-installer.service
Before=coreos-installer-poweroff.service
Before=coreos-installer-noreboot.service
Before=coreos-installer-reboot.service
ConditionPathExists=/etc/manufacturing-client-config
ConditionPathExists=/run/manufacturing-client-config
Requires=dev-disk-by\x2dlabel-boot.device

OnFailure=emergency.target
Expand All @@ -15,6 +15,6 @@ OnFailureJobMode=replace-irreversibly
[Service]
Type=oneshot
Environment=LOG_LEVEL=info
EnvironmentFile=/etc/manufacturing-client-config
EnvironmentFile=/run/manufacturing-client-config
ExecStart=/usr/libexec/manufacturing-client-service
RemainAfterExit=yes

0 comments on commit cba310e

Please sign in to comment.