From 4a35dbe6a78a4ac57d986398520efcc99536feb5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 4 Apr 2022 19:35:19 +0200 Subject: [PATCH] systemd: describe import of systemd code in README.md --- src/libnm-systemd-core/README.md | 11 +++++++++-- src/libnm-systemd-shared/README.md | 31 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/libnm-systemd-core/README.md b/src/libnm-systemd-core/README.md index b9792ca705..e47eb8ed78 100644 --- a/src/libnm-systemd-core/README.md +++ b/src/libnm-systemd-core/README.md @@ -7,10 +7,17 @@ as a static library with network helpers. We use systemd's DHCPv6 and LLDP library, by forking their code. We also still use their DHCPv4 library, but that is about to be replaced -by nettools' n-dhcp4. +by nettools' n-dhcp4 and not used unless you configure the undocumented +`[main].dhcp=systemd` plugin. This approach of code-reuse is very cumbersome, and we should replace -systemd code by a proper library (like nettools). +systemd code by a proper library (like [nettools](https://github.com/nettools/)). We should not use systemd directly from our sources, beyond what we really need. + + +Reimport Upstream Code +---------------------- + +Read [here](../libnm-systemd-shared/README.md#reimport-upstream-code). diff --git a/src/libnm-systemd-shared/README.md b/src/libnm-systemd-shared/README.md index 67ad4875c2..7016c22eb2 100644 --- a/src/libnm-systemd-shared/README.md +++ b/src/libnm-systemd-shared/README.md @@ -9,3 +9,34 @@ which contains systemd library with network tools (like DHCPv6). We should not use systemd directly from our sources, beyond what we really need to make get libnm-systemd-core working. + + +Reimport Upstream Code +---------------------- + +We want to avoid deviations in our fork, and frequently re-import +latest systemd version (every 4 to 8 weeks). The reason is that we +frequently should check whether important fixes were done in upstream +systemd, and the effort of doing that is half the work of just reimporting. +Also, by reimporting frequently, we avoid deviating hugely (instead we only deviate +largely). + +Of course this is cumbersome. We should replace systemd code with something else. + +To do a re-import, do: + +- checkout `systemd` branch. + +- Use the last commit message (`git commit --allow-empty -C origin/systemd`). + Then modify the commit message (`git commit --allow-empty --amend`). The + commit message contains a long script that is used to re-import the code. + Adjust the script in the commit message, and run it. Commit the changes on + `systemd` branch. + +- checkout `main` branch, and `git merge systemd`. Fix all issues, test, + repeat. + +- open merge request, check that all tests pass. In particular, enable build + on all test distributions. + +- push `main` and `systemd` branch.