Skip to content

Commit 62730e3

Browse files
Replace mdev with udev: (#263)
## Description <!--- Please describe what this PR is going to change --> This gets us persistent network interface naming. @rpardini , you did a bunch of work creating `images/hook-mdev/persistent-storage.sh`, when/if you have some cycles, would you mind checking this out and verifying if you see the same functionality? ## Why is this needed <!--- Link to issue you have raised --> Fixes: # ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## How are existing users impacted? What migration steps/scripts do we need? <!--- Fixes a bug, unblocks installation, removes a component of the stack etc --> <!--- Requires a DB migration script, etc. --> ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
2 parents 5737a48 + 865b7dd commit 62730e3

File tree

11 files changed

+31
-271
lines changed

11 files changed

+31
-271
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ dist/
44
.env
55
!/hook-bootkit/
66
!/hook-docker/
7-
!/hook-mdev/
87
hook*.*.yaml
98
!linuxkit-templates
109
out/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ The most important environment variables are:
150150

151151
- There's a distributed GitHub Actions build workflow `"matrix"`.
152152
- The bash build system produces JSON objects that drive the matrix stages:
153-
- One matrix is per-arch, and builds all the containers whose source is hosted in this repo (bootkit, docker, mdev)
153+
- One matrix is per-arch, and builds all the containers whose source is hosted in this repo (bootkit, docker, udev)
154154
- Second matrix is per-flavor(/kernel), and builds the kernel
155155
- 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
156156

bash/hook-lk-containers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function build_all_hook_linuxkit_containers() {
99
# # NOTE: linuxkit containers must be in the images/ directory
1010
build_hook_linuxkit_container hook-bootkit "HOOK_CONTAINER_BOOTKIT_IMAGE"
1111
build_hook_linuxkit_container hook-docker "HOOK_CONTAINER_DOCKER_IMAGE"
12-
build_hook_linuxkit_container hook-mdev "HOOK_CONTAINER_MDEV_IMAGE"
12+
build_hook_linuxkit_container hook-udev "HOOK_CONTAINER_UDEV_IMAGE"
1313
build_hook_linuxkit_container hook-containerd "HOOK_CONTAINER_CONTAINERD_IMAGE"
1414
build_hook_linuxkit_container hook-runc "HOOK_CONTAINER_RUNC_IMAGE"
1515
build_hook_linuxkit_container hook-embedded "HOOK_CONTAINER_EMBEDDED_IMAGE"

bash/json-matrix.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# - CI_RUNNER_LK is the runner to use for all linuxkit builds
2222
# - CI_RUNNER_AMD64 is the runner to use for all AMD64 things
2323
# - CI_RUNNER is the runner to use for everything
24-
## LK containers (hook-bootkit, hook-docker, hook-mdev): (3):
24+
## LK containers (hook-bootkit, hook-docker, hook-udev): (3):
2525
# - CI_RUNNER_LK_CONTAINERS_AMD64 is the runner to use for amd64 linuxkit containers builds
2626
# - CI_RUNNER_LK_CONTAINERS is the runner to use for all linuxkit containers builds
2727
# - CI_RUNNER_AMD64 is the runner to use for all AMD64 things

files/dhcp.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ set -x
99

1010
run_dhcp_client() {
1111
one_shot="$1"
12-
al="eth*"
12+
al="en*"
1313

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

1919
if [ "$one_shot" = "true" ]; then

files/dhcpcd.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Default values for dhcpcd from linuxkit/dhcpcd:v0.8 with `allowinterfaces eth*` removed
1+
# Default values for dhcpcd from linuxkit/dhcpcd:v0.8 with `allowinterfaces en*` removed
22
# This allows the `--allowinterfaces` flag of dhcpcd to specify the allowinterfaces.
33
hostname
44
clientid

files/vlan.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ function add_vlan_interface() {
7171
ifname="$(get_interface_name ${hw_addr})"
7272
echo "VLAN handling - vlan_id: '${vlan_id}', hw_addr: '${hw_addr}', found interface: '${ifname}'" >&2
7373
else
74-
echo "VLAN handling - vlan_id: '${vlan_id}', hw_addr: '${hw_addr}', no hw_addr found in kernel commandline; default ifname to eth0." >&2
75-
ifname="eth0"
74+
echo "VLAN handling - vlan_id: '${vlan_id}', hw_addr: '${hw_addr}', no hw_addr found in kernel commandline; cannot set vlan interface." >&2
75+
ifname=""
7676
fi
7777

7878
if [ -n "$ifname" ]; then

images/hook-mdev/Dockerfile

Lines changed: 0 additions & 17 deletions
This file was deleted.

images/hook-mdev/persistent-storage.sh

Lines changed: 0 additions & 231 deletions
This file was deleted.

images/hook-udev/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM debian:12-slim AS base
2+
3+
RUN DEBIAN_FRONTEND=noninteractive apt update && \
4+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends udev && \
5+
apt-get clean autoclean && \
6+
apt-get autoremove --yes && \
7+
rm -rf /var/lib/apt /var/lib/dpkg /var/lib/cache /var/lib/log /var/cache/* /usr/lib/apt/* /usr/share/*
8+
9+
CMD ["/etc/init.d/udev", "start"]

0 commit comments

Comments
 (0)