network-generator: rewrite unit if it already exists and its content changed
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 10 Apr 2023 13:18:53 +0000 (15:18 +0200)
committerAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 10 Apr 2023 13:18:53 +0000 (15:18 +0200)
commitf3e4d04298bb73b836dd7ca90f7c7b09de1e776b
treea43e9b262c58b20a4b46ecdd1397e0cb06785825
parent8a84e0d7960b7970c16a4efd4c5b0b26c810d22d
network-generator: rewrite unit if it already exists and its content changed

When the `systemd-network-generator` is included in the initrd and runs from
there first, the next times it runs after switching to real root it
thinks there is a duplicate entry on the kernel command line.

This patch rewrites the unit file if the content has changed, instead of
displaying an error message.
src/network/generator/main.c