Skip to content

Commit 5f01a50

Browse files
committed
Document process about upgrade buildroot and kernel
1 parent a6889fa commit 5f01a50

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