Skip to content

Commit d28e3e6

Browse files
committed
move the desciription to tips/containers.md
Signed-off-by: Koichi Imai <koichi.imai.2@tier4.jp>
1 parent 866b931 commit d28e3e6

3 files changed

Lines changed: 19 additions & 21 deletions

File tree

docs/environment-setup/scripts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Neither script requires `agnocast.ko` to be loaded or `libagnocast_heaphook.so`
1717

1818
| Script | Purpose |
1919
|---|---|
20-
| `switch_kmod.bash` | Swap the host's `agnocast-kmod-v<ver>` to another version. For container-based setups where the heaphook travels with the container image and only the host-side kmod needs to be replaced independently. See [Upgrading → Switching only the host kmod](./upgrading.md#switching-only-the-host-kmod-container-based-setups) for details. |
20+
| `switch_kmod.bash` | Swap the host's `agnocast-kmod-v<ver>` to another version. For container-based setups where the heaphook travels with the container image and only the host-side kmod needs to be replaced independently. See [Running in Containers → Swapping the host kernel module](../tips/containers.md#swapping-the-host-kernel-module) for details. |
2121

2222
## Sample application launchers
2323

docs/environment-setup/upgrading.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,3 @@ When upgrading, keep the [versioning rules](index.md) in mind:
4848
- **Patch upgrades** (e.g., 2.3.3 → 2.3.2) — Safe. No API or syscall changes.
4949
- **Minor upgrades** (e.g., 2.3.x → 2.4.0) — `agnocastlib` and `agnocast-kmod` must be upgraded together, as the kmod syscall API may have changed.
5050
- **Major upgrades** — User-facing API may have breaking changes. Review the changelog before upgrading.
51-
52-
## Switching only the host kmod (container-based setups)
53-
54-
When Agnocast workloads run inside a container, `agnocast-heaphook` is bundled with the container image and is swapped by rolling to a new container. In that setup, only the host-side `agnocast-kmod` needs to be replaced independently to keep the ioctl ABI in sync with the heaphook inside the container.
55-
56-
The [`switch_kmod.bash`](https://github.com/autowarefoundation/agnocast/blob/main/scripts/switch_kmod.bash) script automates the host-side kmod swap:
57-
58-
```bash
59-
sudo ./scripts/switch_kmod.bash <VERSION>
60-
# e.g.
61-
sudo ./scripts/switch_kmod.bash 2.4.0
62-
```
63-
64-
The script unloads the current module, purges every installed `agnocast-kmod-v*` package, cleans any leftover DKMS state, installs the target from apt, and verifies the new load via `dmesg`.
65-
66-
!!! warning
67-
All Agnocast containers and ROS nodes must be stopped before running this script — the module cannot be unloaded while `/dev/agnocast` is held open.
68-
69-
!!! warning
70-
The kmod version on the host and the `libagnocast_heaphook.so` version inside the container must share the same ioctl ABI. Mismatched versions cause runtime errors. This script does not touch the container; it is the operator's responsibility to roll the container to a matching version.

docs/tips/containers.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,21 @@ services:
9999
devices:
100100
- /dev/agnocast
101101
```
102+
103+
## Swapping the host kernel module
104+
105+
When you need to change the host's `agnocast-kmod` version independently of the heaphook bundled in the container (for example, after rolling the container image to a new version, or to reproduce a bug on an older kmod), use [`switch_kmod.bash`](https://github.com/autowarefoundation/agnocast/blob/main/scripts/switch_kmod.bash):
106+
107+
```bash
108+
sudo ./scripts/switch_kmod.bash <VERSION>
109+
# e.g.
110+
sudo ./scripts/switch_kmod.bash 2.4.0
111+
```
112+
113+
The script unloads the current module, purges every installed `agnocast-kmod-v*` package, cleans any leftover DKMS state, installs the target from apt, and verifies the new load via `dmesg`.
114+
115+
!!! warning
116+
All Agnocast containers and ROS nodes must be stopped before running this script — the module cannot be unloaded while `/dev/agnocast` is held open.
117+
118+
!!! warning
119+
The kmod version on the host and the `libagnocast_heaphook.so` version inside the container must share the same ioctl ABI. Mismatched versions cause runtime errors. This script does not touch the container; it is the operator's responsibility to roll the container to a matching version.

0 commit comments

Comments
 (0)