Skip to content

Commit 692fa16

Browse files
authored
Merge pull request #1049 from kernelkit/document-kernel-buildroot-update
Document process about upgrade buildroot and kernel Signed-off-by: Joachim Wiberg <[email protected]>
2 parents c5d9a7c + eabaaac commit 692fa16

File tree

1 file changed

+177
-16
lines changed

1 file changed

+177
-16
lines changed

doc/developers-guide.md

Lines changed: 177 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -168,36 +168,36 @@ Now you can rebuild `confd`, just as described above, and restart Infix:
168168

169169
### `statd`
170170

171-
The Infix status daemon, `src/statd`, is responsible for populating the
172-
sysrepo `operational` datastore. Like `confd`, it uses XPath subscriptions,
173-
but unlike `confd`, it relies entirely on `yanger`, a Python script that
171+
The Infix status daemon, `src/statd`, is responsible for populating the
172+
sysrepo `operational` datastore. Like `confd`, it uses XPath subscriptions,
173+
but unlike `confd`, it relies entirely on `yanger`, a Python script that
174174
gathers data from local linux services and feeds it into sysrepo.
175175

176176
To apply changes, rebuild the image:
177177

178178
make python-statd-rebuild statd-rebuild all
179179

180-
Rebuilding the image and testing on target for every change during
181-
development process can be tedious. Instead, `yanger` allows remote
182-
execution, running the script directly on the host system (test
180+
Rebuilding the image and testing on target for every change during
181+
development process can be tedious. Instead, `yanger` allows remote
182+
execution, running the script directly on the host system (test
183183
container):
184184

185185
infamy0:test # ../src/statd/python/yanger/yanger -x "../utils/ixll -A ssh d3a" ieee802-dot1ab-lldp
186186

187187
`ixll` is a utility script that lets you run network commands using an
188-
**interface name** instead of a hostname. It makes operations like
188+
**interface name** instead of a hostname. It makes operations like
189189
`ssh`, `scp`, and network discovery easier.
190190

191-
Normally, `yanger` runs commands **locally** to retrieve data
192-
(e.g., `lldpcli` when handling `ieee802-dot1ab-lldp`). However, when
193-
executed with `-x "../utils/ixll -A ssh d3a"` it redirects these
194-
commands to a remote system connected to the local `d3a` interface via
195-
SSH. This setup is used for running `yanger` in an
191+
Normally, `yanger` runs commands **locally** to retrieve data
192+
(e.g., `lldpcli` when handling `ieee802-dot1ab-lldp`). However, when
193+
executed with `-x "../utils/ixll -A ssh d3a"` it redirects these
194+
commands to a remote system connected to the local `d3a` interface via
195+
SSH. This setup is used for running `yanger` in an
196196
[interactive test environment](testing.md#interactive-usage). The yanger
197-
script runs on the `host` system, but key commands are executed on the
197+
script runs on the `host` system, but key commands are executed on the
198198
`target` system.
199199

200-
For debugging or testing, you can capture system command output and
200+
For debugging or testing, you can capture system command output and
201201
replay it later without needing a live system.
202202

203203
To capture:
@@ -211,12 +211,173 @@ To replay:
211211
This is especially useful when working in isolated environments or debugging
212212
issues without direct access to the DUT.
213213

214+
### Upgrading Packages
215+
216+
#### Buildroot
217+
218+
Kernelkit maintains an internal [fork of
219+
Buildroot](https://github.com/kernelkit/buildroot), with branches
220+
following the naming scheme `YYYY.MM.patch-kkit`
221+
e.g. `2025.02.1-kkit`, which means a new branch should be created
222+
whenever Buildroot is updated. These branches should contain **only**
223+
changes to existing packages (but no new patches), modifications to
224+
Buildroot itself or upstream backports.
225+
226+
KernelKit track the latest Buildroot LTS (Long-Term Support) release
227+
and updates. The upgrade of LTS minor releases is expected to have low
228+
impact and should be done as soon there is a patch release of
229+
Buildroot LTS is available.
230+
231+
> **Depending on your setup, follow the appropriate steps below.**
232+
233+
🔁 If you **already have** the Buildroot repo locally
234+
235+
1. Navigate to the Buildroot directory
236+
```bash
237+
$ cd buildroot
238+
```
239+
2. Pull the latest changes from KernelKit
240+
```bash
241+
$ git pull
242+
```
243+
3. Fetch the latest tags from upstream
244+
```bash
245+
$ git fetch upstream --tags
246+
```
247+
248+
249+
🆕 If you don't have the repo locally
250+
251+
1. Clone the Kernelkit Buildroot repository
252+
```bash
253+
$ git clone [email protected]:kernelkit/buildroot.git
254+
```
255+
256+
2. Add the upstream remote
257+
```bash
258+
$ git remote add upstream https://gitlab.com/buildroot.org/buildroot.git
259+
```
260+
3. Checkout old KernelKit branch
261+
```bash
262+
$ git checkout 2025.02.1-kkit
263+
```
264+
265+
266+
🛠 Continue from here (applies to both cases):
267+
268+
4. Create a new branch based on the **previous** KernelKit Buildroot
269+
release (e.g. `2025.02.1-kkit`) and name it according to the naming scheme (e.g. `2025.02.2-kkit`)
270+
```bash
271+
$ git checkout -b 2025.02.2-kkit
272+
```
273+
5. Rebase the new branch onto the corresponding upstream release
274+
```bash
275+
$ git rebase 2025.02.2
276+
```
277+
> [!NOTE] It is **not** allowed to rebase the branch when bumped in Infix.
278+
279+
6. Push the new branch and tags
280+
```bash
281+
$ git push origin 2025.02.2-kkit --tags
282+
```
283+
7. In Infix, checkout new branch of Buildroot
284+
```bash
285+
$ cd buildroot
286+
$ git fetch
287+
$ git checkout 2025.02.2-kkit
288+
```
289+
8. Push changes
290+
Commit and push the changes. Don’t forget to update the changelog.
291+
292+
9. Create a pull request.
293+
294+
> [!NOTE] Remember to set the pull request label to `ci:main` to ensure full CI coverage.
295+
296+
297+
#### Linux kernel
298+
299+
KernelKit maintains an internal [fork of Linux
300+
kernel](https://github.com/kernelkit/linux), with branches following
301+
the naming scheme `kkit-linux-[version].y`, e.g. `kkit-6.12.y`, which
302+
means a new branch should be created whenever the major kernel version
303+
is updated. This branch should contain *all* kernel patches used by
304+
Infix.
305+
306+
KernelKit track the latest Linux kernel LTS (Long-Term Support)
307+
release and updates. The upgrade of LTS minor releases is expected to
308+
have low impact and should be done as soon as a patch release of the
309+
LTS Linux kernel is available.
310+
311+
312+
🔁 If you **already have** the Linux kernel repo locally
313+
314+
1. Navigate to the Linux kernel directory
315+
```bash
316+
$ cd linux
317+
```
318+
2. Get latest changes from KernelKit
319+
```bash
320+
$ git pull
321+
```
322+
3. Fetch the latest tags from upstream
323+
```bash
324+
$ git fetch upstream --tags
325+
```
326+
327+
🆕 If you don't have the repo locally
328+
329+
1. Clone the KernelKit Linux kernel repository
330+
```bash
331+
$ git clone [email protected]:kernelkit/linux.git
332+
```
333+
2. Add the upstream remote
334+
```bash
335+
$ git remote add upstream git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
336+
```
337+
338+
3. Checkout correct kernel branch
339+
```bash
340+
$ git checkout kkit-linux-6.12.y
341+
```
342+
343+
🛠 Continue from here (applies to both cases)
344+
345+
346+
4. Rebase on the upstream release
347+
```bash
348+
$ git rebase v6.12.29
349+
```
350+
351+
6. Push changes and the tags
352+
```bash
353+
354+
$ git push -f origin kkit-linux-6.12.y --tags
355+
```
356+
357+
**Move to your infix directory**
358+
359+
7. Generate patches
360+
```bash
361+
$ make x86_64_defconfig
362+
$ cd output
363+
$ ../utils/kernel-refresh.sh -k /path/to/linux -o 6.12.28 -t v6.12.29
364+
```
365+
> [!NOTE] See help of `kernel-refresh.sh` script for more information
366+
367+
368+
8. Push changes
369+
Commit and push the changes. Don’t forget to update the s:changelog:doc/ChangeLog.md.
370+
371+
9. Create a pull request.
372+
> [!NOTE] Remember to set the pull request label to `ci:main` to ensure full CI coverage.
373+
374+
214375
### Agree on YANG Model
215376

216377
When making changes to the `confd` and `statd` services, you will often need to update
217-
the YANG models. If you are adding a new YANG module, it's best to follow the
378+
the YANG models. If you are adding a new YANG module, it's best to follow the
218379
structure of an existing one. However, before making any changes, **always discuss
219-
them with the Infix core team**. This helps avoid issues later in development and
380+
them with the Infix core team**. This helps avoid issues later in development and
220381
makes pull request reviews smoother.
221382
222383

0 commit comments

Comments
 (0)