Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ dist/
.env
!/hook-bootkit/
!/hook-docker/
!/hook-mdev/
hook*.*.yaml
!linuxkit-templates
out/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ The most important environment variables are:

- There's a distributed GitHub Actions build workflow `"matrix"`.
- The bash build system produces JSON objects that drive the matrix stages:
- One matrix is per-arch, and builds all the containers whose source is hosted in this repo (bootkit, docker, mdev)
- One matrix is per-arch, and builds all the containers whose source is hosted in this repo (bootkit, docker, udev)
- Second matrix is per-flavor(/kernel), and builds the kernel
- Third matrix, depending on the other two, is per-flavor(/kernel), and builds Hook itself (via LinuxKit) and prepares a .tar.gz into GH artifacts

Expand Down
2 changes: 1 addition & 1 deletion bash/hook-lk-containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function build_all_hook_linuxkit_containers() {
# # NOTE: linuxkit containers must be in the images/ directory
build_hook_linuxkit_container hook-bootkit "HOOK_CONTAINER_BOOTKIT_IMAGE"
build_hook_linuxkit_container hook-docker "HOOK_CONTAINER_DOCKER_IMAGE"
build_hook_linuxkit_container hook-mdev "HOOK_CONTAINER_MDEV_IMAGE"
build_hook_linuxkit_container hook-udev "HOOK_CONTAINER_UDEV_IMAGE"
build_hook_linuxkit_container hook-containerd "HOOK_CONTAINER_CONTAINERD_IMAGE"
build_hook_linuxkit_container hook-runc "HOOK_CONTAINER_RUNC_IMAGE"
build_hook_linuxkit_container hook-embedded "HOOK_CONTAINER_EMBEDDED_IMAGE"
Expand Down
2 changes: 1 addition & 1 deletion bash/json-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# - CI_RUNNER_LK is the runner to use for all linuxkit builds
# - CI_RUNNER_AMD64 is the runner to use for all AMD64 things
# - CI_RUNNER is the runner to use for everything
## LK containers (hook-bootkit, hook-docker, hook-mdev): (3):
## LK containers (hook-bootkit, hook-docker, hook-udev): (3):
# - CI_RUNNER_LK_CONTAINERS_AMD64 is the runner to use for amd64 linuxkit containers builds
# - CI_RUNNER_LK_CONTAINERS is the runner to use for all linuxkit containers builds
# - CI_RUNNER_AMD64 is the runner to use for all AMD64 things
Expand Down
4 changes: 2 additions & 2 deletions files/dhcp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ set -x

run_dhcp_client() {
one_shot="$1"
al="eth*"
al="en*"

vlan_id=$(sed -n 's/.* vlan_id=\([0-9]*\).*/\1/p' /proc/cmdline)
if [ -n "$vlan_id" ]; then
al="eth*.*"
al="en*.*"
fi

if [ "$one_shot" = "true" ]; then
Expand Down
2 changes: 1 addition & 1 deletion files/dhcpcd.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Default values for dhcpcd from linuxkit/dhcpcd:v0.8 with `allowinterfaces eth*` removed
# Default values for dhcpcd from linuxkit/dhcpcd:v0.8 with `allowinterfaces en*` removed
# This allows the `--allowinterfaces` flag of dhcpcd to specify the allowinterfaces.
hostname
clientid
Expand Down
4 changes: 2 additions & 2 deletions files/vlan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ function add_vlan_interface() {
ifname="$(get_interface_name ${hw_addr})"
echo "VLAN handling - vlan_id: '${vlan_id}', hw_addr: '${hw_addr}', found interface: '${ifname}'" >&2
else
echo "VLAN handling - vlan_id: '${vlan_id}', hw_addr: '${hw_addr}', no hw_addr found in kernel commandline; default ifname to eth0." >&2
ifname="eth0"
echo "VLAN handling - vlan_id: '${vlan_id}', hw_addr: '${hw_addr}', no hw_addr found in kernel commandline; cannot set vlan interface." >&2
ifname=""
fi

if [ -n "$ifname" ]; then
Expand Down
17 changes: 0 additions & 17 deletions images/hook-mdev/Dockerfile

This file was deleted.

231 changes: 0 additions & 231 deletions images/hook-mdev/persistent-storage.sh

This file was deleted.

9 changes: 9 additions & 0 deletions images/hook-udev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM debian:12-slim AS base

RUN DEBIAN_FRONTEND=noninteractive apt update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends udev && \
apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rf /var/lib/apt /var/lib/dpkg /var/lib/cache /var/lib/log /var/cache/* /usr/lib/apt/* /usr/share/*

CMD ["/etc/init.d/udev", "start"]
28 changes: 14 additions & 14 deletions linuxkit-templates/hook.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# - HOOK_KERNEL_VERSION: ${HOOK_KERNEL_VERSION}
# - HOOK_CONTAINER_BOOTKIT_IMAGE: ${HOOK_CONTAINER_BOOTKIT_IMAGE}
# - HOOK_CONTAINER_DOCKER_IMAGE: ${HOOK_CONTAINER_DOCKER_IMAGE}
# - HOOK_CONTAINER_MDEV_IMAGE: ${HOOK_CONTAINER_MDEV_IMAGE}
# - HOOK_CONTAINER_UDEV_IMAGE: ${HOOK_CONTAINER_UDEV_IMAGE}
# - HOOK_CONTAINER_CONTAINERD_IMAGE: ${HOOK_CONTAINER_CONTAINERD_IMAGE}
# - HOOK_CONTAINER_RUNC_IMAGE: ${HOOK_CONTAINER_RUNC_IMAGE}
# - HOOK_CONTAINER_EMBEDDED_IMAGE: ${HOOK_CONTAINER_EMBEDDED_IMAGE}
Expand Down Expand Up @@ -41,6 +41,19 @@ onboot:
image: linuxkit/modprobe:v1.0.0
command: [ "modprobe", "cdc_ncm" ] # for usb ethernet dongles

- name: udev
image: "${HOOK_CONTAINER_UDEV_IMAGE}"
capabilities:
- all
binds:
- /dev:/dev
- /sys:/sys
- /lib/modules:/lib/modules
rootfsPropagation: shared
devices:
- path: all
type: b

- name: dhcpcd-once
image: linuxkit/dhcpcd:v1.0.0
command: [ "/etc/ip/dhcp.sh", "true" ] # 2nd paramter is one-shot true/false: true for onboot, false for services
Expand All @@ -64,19 +77,6 @@ services:
- name: ntpd
image: linuxkit/openntpd:v1.0.0

- name: mdev
image: "${HOOK_CONTAINER_MDEV_IMAGE}"
command: [ "mdev", "-v", "-S", "-df" ]
capabilities:
- all
binds:
- /dev/:/dev/
- /lib/modules:lib/modules
rootfsPropagation: shared
devices:
- path: all
type: b

- name: getty
image: linuxkit/getty:v1.0.0
capabilities:
Expand Down
Loading