From 3d0cd9d5da8e23075c930fae1c5e47b398b0707f Mon Sep 17 00:00:00 2001 From: Avi Deitcher Date: Mon, 4 Mar 2024 20:54:50 +0200 Subject: [PATCH 1/2] properly handle sed for update-component-sha.sh Signed-off-by: Avi Deitcher --- kernel/Makefile | 6 +++--- scripts/update-component-sha.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 685f322b1..276907dfd 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -69,8 +69,8 @@ SPACE := $(eval) $(eval) PERIOD := . # series - convert a version to a series, e.g. 6.6.13 -> 6.6.x series = $(word 1,$(subst ., ,$(1))).$(word 2,$(subst ., ,$(1))).x -# serieswildcard - convert a version with or without a hash to a wildcard, e.g. 6.6.13-anbcd -> 6.6.-* -serieswildcard = $(word 1,$(subst ., ,$(1))).$(word 2,$(subst ., ,$(1))).[0-9]+-[0-9a-f]+.* +# serieswithhash - convert a version with or without a hash to a series with a hash, e.g. 6.6.13-anbcd -> 6.6.x-[0-9a-f]+ +serieswithhash = $(word 1,$(subst ., ,$(1))).$(word 2,$(subst ., ,$(1))).[0-9]+-[0-9a-f]+ # word 1 is the release, word 2 is the tool RELEASESEP := PART @@ -195,7 +195,7 @@ tag-debugkernel-%: # will update hash for same semver and/or patch version update-kernel-hash-yaml-%: $(eval NEWTAG=$(shell $(MAKE) tag-plainkernel-$*)) - $(eval OLDTAG=$(call serieswildcard,$(NEWTAG))) + $(eval OLDTAG=$(call serieswithhash,$(NEWTAG))) @cd $(REPO_ROOT) && ./scripts/update-component-sha.sh --hash "$(OLDTAG)" "$(NEWTAG)" # find and replace any usage of the normal kernel with semver for most recent series diff --git a/scripts/update-component-sha.sh b/scripts/update-component-sha.sh index a65c62e52..0ac21b351 100755 --- a/scripts/update-component-sha.sh +++ b/scripts/update-component-sha.sh @@ -69,7 +69,7 @@ case "${mode}" in fi old=$1 new=$2 - git grep -E -l "\b($old)([[:space:]].*)?$" -- '*.yml' '*.yaml' '*.yml.in' '*.yaml.in' '*/Dockerfile' '*/Makefile' | grep -v /vendor/ | while read -r file; do sed -ri.bak -e "s,$old,$new,g" "$file"; done + git grep -E -l "\b($old)([[:space:]]|$)?" -- '*.yml' '*.yaml' '*.yml.in' '*.yaml.in' '*/Dockerfile' '*/Makefile' | grep -v /vendor/ | while read -r file; do sed -ri.bak -e "s,($old)([[:space:]]|$)?,$new\2,g" "$file"; done ;; --image) if [ $# -lt 1 ] ; then From 533d582bada20c4b0e424ec371b6a87136a3c13f Mon Sep 17 00:00:00 2001 From: Avi Deitcher Date: Mon, 4 Mar 2024 21:33:23 +0200 Subject: [PATCH 2/2] update 6.6.x test hash versions Signed-off-by: Avi Deitcher --- test/cases/020_kernel/019_config_6.6.x/test.yml | 2 +- test/cases/020_kernel/119_kmod_6.6.x/Dockerfile | 2 +- test/cases/020_kernel/119_kmod_6.6.x/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cases/020_kernel/019_config_6.6.x/test.yml b/test/cases/020_kernel/019_config_6.6.x/test.yml index 0dcbb4531..df9a7ba47 100644 --- a/test/cases/020_kernel/019_config_6.6.x/test.yml +++ b/test/cases/020_kernel/019_config_6.6.x/test.yml @@ -1,5 +1,5 @@ kernel: - image: linuxkit/kernel:6.6.13-93250a118b43a85609ca27778784c161977024e6 + image: linuxkit/kernel:6.6.13-ad4d0da9e582d714cf61c8d99468cc7c1109bce5 cmdline: "console=ttyS0 console=ttyAMA0" init: - linuxkit/init:07d37c3ae7fad5ddcb54c8dc65774ae050851f04 diff --git a/test/cases/020_kernel/119_kmod_6.6.x/Dockerfile b/test/cases/020_kernel/119_kmod_6.6.x/Dockerfile index 89b312fa1..bc1cc6982 100644 --- a/test/cases/020_kernel/119_kmod_6.6.x/Dockerfile +++ b/test/cases/020_kernel/119_kmod_6.6.x/Dockerfile @@ -3,7 +3,7 @@ # In the last stage, it creates a package, which can be used for # testing. -FROM linuxkit/kernel:6.6.13-93250a118b43a85609ca27778784c161977024e6 AS ksrc +FROM linuxkit/kernel:6.6.13-ad4d0da9e582d714cf61c8d99468cc7c1109bce5 AS ksrc # Extract headers and compile module FROM linuxkit/kernel:6.6.13-builder AS build diff --git a/test/cases/020_kernel/119_kmod_6.6.x/test.yml b/test/cases/020_kernel/119_kmod_6.6.x/test.yml index ab00caa3c..8616dfffa 100644 --- a/test/cases/020_kernel/119_kmod_6.6.x/test.yml +++ b/test/cases/020_kernel/119_kmod_6.6.x/test.yml @@ -1,5 +1,5 @@ kernel: - image: linuxkit/kernel:6.6.13-93250a118b43a85609ca27778784c161977024e6 + image: linuxkit/kernel:6.6.13-ad4d0da9e582d714cf61c8d99468cc7c1109bce5 cmdline: "console=ttyS0 console=ttyAMA0" init: - linuxkit/init:07d37c3ae7fad5ddcb54c8dc65774ae050851f04