Skip to content

Commit 7ccddc0

Browse files
authored
Merge pull request #1422 from kernelkit/container-fixes
Container and Coverity fixes
2 parents da06ca1 + fb9a1fa commit 7ccddc0

31 files changed

Lines changed: 107 additions & 74 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ APIs.
167167
[0]: https://www.kernel.org
168168
[1]: https://buildroot.org/ "Buildroot Homepage"
169169
[2]: https://www.sysrepo.org/ "Sysrepo Homepage"
170-
[3]: https://kernelkit.org/infix/latest/cli/introduction/
171-
[4]: https://kernelkit.org/infix/
170+
[3]: https://www.kernelkit.org/infix/latest/cli/introduction/
171+
[4]: https://www.kernelkit.org/infix/
172172
[5]: https://github.com/kernelkit/infix/releases
173173
[Latest Build]: https://github.com/kernelkit/infix/releases/tag/latest "Latest build"
174174
[License]: https://en.wikipedia.org/wiki/GPL_license

board/aarch64/bananapi-bpi-r3/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ make aarch64
262262
./utils/mkimage.sh -odt emmc bananapi-bpi-r3
263263
```
264264

265-
[0]: https://kernelkit.org/posts/flashing-sdcard/
266-
[1]: https://kernelkit.org/infix/latest/
265+
[0]: https://www.kernelkit.org/posts/flashing-sdcard/
266+
[1]: https://www.kernelkit.org/infix/latest/
267267
[2]: https://github.com/kernelkit/infix/releases/download/latest-boot/infix-bpi-r3-sdcard.img
268268
[3]: https://github.com/kernelkit/infix/releases/download/latest-boot/infix-bpi-r3-emmc.img
269269
[4]: https://github.com/kernelkit/infix/releases/download/latest-boot/bpi-r3-emmc-boot-2025.01-latest.tar.gz

board/aarch64/raspberrypi-rpi64/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,13 @@ While capable of basic routing tasks, be aware of limitations:
312312
For applications requiring multiple ports or high performance, consider
313313
dedicated networking hardware like the [Banana Pi R3][12].
314314

315-
[0]: https://kernelkit.org/posts/flashing-sdcard/
316-
[1]: https://kernelkit.org/infix/latest/
315+
[0]: https://www.kernelkit.org/posts/flashing-sdcard/
316+
[1]: https://www.kernelkit.org/infix/latest/
317317
[2]: https://github.com/kernelkit/infix/releases/download/latest-boot/infix-rpi64-sdcard.img
318-
[3]: https://kernelkit.org/infix/latest/container/#content-mounts
319-
[4]: https://kernelkit.org/infix/latest/scripting-restconf/
318+
[3]: https://www.kernelkit.org/infix/latest/container/#content-mounts
319+
[4]: https://www.kernelkit.org/infix/latest/scripting-restconf/
320320
[8]: https://github.com/kernelkit/infix/releases/tag/latest-boot
321-
[9]: https://kernelkit.org/infix/latest/networking/#wifi
321+
[9]: https://www.kernelkit.org/infix/latest/networking/#wifi
322322
[10]: https://www.raspberrypi.com/products/raspberry-pi-touch-display/
323323
[11]: https://www.raspberrypi.com/documentation/
324-
[12]: https://kernelkit.org/infix/latest/hardware/#banana-pi-bpi-r3
324+
[12]: https://www.kernelkit.org/infix/latest/hardware/#banana-pi-bpi-r3

board/arm/microchip-sama7g54-ek/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,5 @@ Connect a USB-to-serial adapter to the board's debug UART header.
112112
> [!WARNING]
113113
> Use only 3.3V serial adapters.
114114
115-
[0]: https://kernelkit.org/posts/flashing-sdcard/
115+
[0]: https://www.kernelkit.org/posts/flashing-sdcard/
116116
[1]: https://www.microchip.com/en-us/development-tool/EV21H18A

board/arm/raspberrypi-rpi2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,5 @@ Serial settings: 115200 8N1
9191
> [!WARNING]
9292
> Use only 3.3V serial adapters. 5V adapters will damage your Raspberry Pi!
9393
94-
[0]: https://kernelkit.org/posts/flashing-sdcard/
94+
[0]: https://www.kernelkit.org/posts/flashing-sdcard/
9595
[1]: https://www.raspberrypi.com/products/raspberry-pi-2-model-b/

board/common/image/image-itb-gns3a/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cat <<EOF >"${gns3a}"
1212
"category": "router",
1313
"description": "${ARTIFACT} development appliance",
1414
"vendor_name": "Kernelkit",
15-
"vendor_url": "https://kernelkit.org",
15+
"vendor_url": "https://www.kernelkit.org",
1616
"product_name": "${ARTIFACT} devel",
1717
"registry_version": 6,
1818
"status": "experimental",

board/common/image/image-readme/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The default credentials for the demo builds is
5050
Password:
5151
.-------.
5252
| . . | Infix OS — Immutable.Friendly.Secure
53-
|-. v .-| https://kernelkit.org
53+
|-. v .-| https://www.kernelkit.org
5454
'-'---'-'
5555

5656
Run the command 'cli' for interactive OAM

board/common/rootfs/etc/motd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
.-------.
22
| . . | Infix OS — Immutable.Friendly.Secure
3-
|-. v .-| https://kernelkit.org
3+
|-. v .-| https://www.kernelkit.org
44
'-'---'-'

board/common/rootfs/usr/sbin/container

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ dir=""
2323
all=""
2424
env=""
2525
port=""
26-
force=
26+
force=${force:-}
27+
reset_volumes=
2728

2829
# Variable shared across subshells
2930
export meta_sha=""
@@ -227,7 +228,7 @@ fetch()
227228

228229
if out=$(eval "$cmd" 2>&1); then
229230
log "$file downloaded successfully."
230-
if check "$file"; then
231+
if [ -n "$force" ] || check "$file"; then
231232
echo "$dst"
232233
return 0
233234
fi
@@ -897,6 +898,9 @@ while [ "$1" != "" ]; do
897898
shift
898899
restart=$1
899900
;;
901+
-R | --reset-volumes)
902+
reset_volumes=true
903+
;;
900904
-s | --simple)
901905
simple=true
902906
;;
@@ -1108,7 +1112,8 @@ case $cmd in
11081112
# Remove the old image if it's not used by any other containers
11091113
if [ -n "$old_image_id" ]; then
11101114
# Check if the old image is still in use by any containers
1111-
if ! podman ps -a --format '{{.ImageID}}' | grep -q "^${old_image_id}$"; then
1115+
old_image_id=${old_image_id:0:12}
1116+
if ! podman ps -a --format '{{.ImageID}}' | grep -q "^${old_image_id}"; then
11121117
log "Removing old image $old_image_id"
11131118
podman rmi "$old_image_id" 2>/dev/null || true
11141119
else
@@ -1250,8 +1255,22 @@ case $cmd in
12501255
container stop "$name"
12511256
echo "done"
12521257

1258+
# If --reset-volumes requested, delete named volumes so they re-initialize from new image
1259+
if [ -n "$reset_volumes" ]; then
1260+
printf ">> Resetting named volumes (all configuration will be lost): "
1261+
grep -oE -- '-v [^ ]+' "$script" | awk '{print $2}' | cut -d: -f1 | \
1262+
while read -r vol_name; do
1263+
if podman volume exists "$vol_name" 2>/dev/null; then
1264+
printf "%s " "$vol_name"
1265+
log "Removing volume $vol_name"
1266+
podman volume rm -f "$vol_name" >/dev/null || true
1267+
fi
1268+
done
1269+
echo "done"
1270+
fi
1271+
12531272
# Set force flag to ensure fresh pull/fetch of image
1254-
force="-f"
1273+
export force="-f"
12551274

12561275
# For remote images, force re-pull
12571276
case "$img" in
@@ -1273,14 +1292,17 @@ case $cmd in
12731292
# Recreate container by running the script
12741293
echo ">> Recreating container ..."
12751294
if ! "$script"; then
1295+
force=
12761296
echo ">> Failed recreating container $name"
12771297
exit 1
12781298
fi
1299+
force=
12791300

12801301
# Remove the old image if it's not used by any other containers
12811302
if [ -n "$old_image_id" ]; then
12821303
# Check if the old image is still in use by any containers
1283-
if ! podman ps -a --format '{{.ImageID}}' | grep -q "^${old_image_id}$"; then
1304+
old_image_id=${old_image_id:0:12}
1305+
if ! podman ps -a --format '{{.ImageID}}' | grep -q "^${old_image_id}"; then
12841306
log "Removing old image $old_image_id"
12851307
podman rmi "$old_image_id" 2>/dev/null || true
12861308
else

configs/aarch64_defconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ BR2_PACKAGE_MARVELL_CN9130_CRB=y
143143
BR2_PACKAGE_MARVELL_ESPRESSOBIN=y
144144
BR2_PACKAGE_RASPBERRYPI_RPI64=y
145145
BR2_PACKAGE_STYX_DCP_SC_28P=y
146-
INFIX_VENDOR_HOME="https://kernelkit.org"
146+
INFIX_VENDOR_HOME="https://www.kernelkit.org"
147147
INFIX_DESC="Infix is an immutable, friendly, and secure operating system that turns any ARM or x86 device into a powerful, manageable network appliance. Deploy on anything from $35 Raspberry Pi boards to enterprise switches as routers, IoT gateways, or edge devices. Infix models Linux networking features using YANG so you can manage your devices using NETCONF/RESTCONF APIs and focus on your business logic running in isolated containers."
148148
INFIX_HOME="https://github.com/kernelkit/infix/"
149-
INFIX_DOC="https://kernelkit.org/infix/"
149+
INFIX_DOC="https://www.kernelkit.org/infix/"
150150
INFIX_SUPPORT="mailto:kernelkit@googlegroups.com"
151151
BR2_PACKAGE_FEATURE_GPS=y
152152
BR2_PACKAGE_FEATURE_WIFI_MEDIATEK=y

0 commit comments

Comments
 (0)