From 28583eb747073ca585fdb6d957b9b307d21f1a22 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 13 Oct 2017 10:10:34 +0100 Subject: [PATCH 1/4] Reenable content-trust for linuxkit/test-ltp Signed-off-by: Ian Campbell --- test/pkg/ltp/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/test/pkg/ltp/build.yml b/test/pkg/ltp/build.yml index 142370356..26459fd15 100644 --- a/test/pkg/ltp/build.yml +++ b/test/pkg/ltp/build.yml @@ -1,5 +1,4 @@ image: test-ltp network: true -disable-content-trust: true arches: - amd64 From d606c88e80e1eace599f2e43892079c6be667012 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 13 Oct 2017 10:15:57 +0100 Subject: [PATCH 2/4] Bump linuxkit/test-ltp hash Signed-off-by: Ian Campbell --- test/hack/test-ltp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hack/test-ltp.yml b/test/hack/test-ltp.yml index 0c14eee5d..2ef939eab 100644 --- a/test/hack/test-ltp.yml +++ b/test/hack/test-ltp.yml @@ -7,7 +7,7 @@ init: - linuxkit/containerd:ed8e8f92e24dd4b94260cf147594ae3fd13a2182 onboot: - name: ltp - image: linuxkit/test-ltp:96c9845f8bca2cfb2d3c5e6ca53d82f77b2fddd0 + image: linuxkit/test-ltp:0967388fb338867dddd3c1a72470a1a7cec5a0dd binds: - /etc/ltp/baseline:/etc/ltp/baseline - name: poweroff From a87a07c8e97d6b99bd073b2ce07daaca328130cb Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 13 Oct 2017 10:21:17 +0100 Subject: [PATCH 3/4] tools: enable content trust for mkimage-* A few of these already had content-trust, enable for the remaineder. Signed-off-by: Ian Campbell --- tools/mkimage-dynamic-vhd/build.yml | 1 - tools/mkimage-gcp/build.yml | 1 - tools/mkimage-iso-bios/build.yml | 1 - tools/mkimage-iso-efi/build.yml | 1 - tools/mkimage-vhd/build.yml | 1 - tools/mkimage-vmdk/build.yml | 1 - 6 files changed, 6 deletions(-) diff --git a/tools/mkimage-dynamic-vhd/build.yml b/tools/mkimage-dynamic-vhd/build.yml index 1d8c28f28..5fef466bf 100644 --- a/tools/mkimage-dynamic-vhd/build.yml +++ b/tools/mkimage-dynamic-vhd/build.yml @@ -1,2 +1 @@ image: mkimage-dynamic-vhd -disable-content-trust: true diff --git a/tools/mkimage-gcp/build.yml b/tools/mkimage-gcp/build.yml index 89fef6c63..29e878945 100644 --- a/tools/mkimage-gcp/build.yml +++ b/tools/mkimage-gcp/build.yml @@ -1,2 +1 @@ image: mkimage-gcp -disable-content-trust: true diff --git a/tools/mkimage-iso-bios/build.yml b/tools/mkimage-iso-bios/build.yml index 2910b2172..4dd32749e 100644 --- a/tools/mkimage-iso-bios/build.yml +++ b/tools/mkimage-iso-bios/build.yml @@ -1,4 +1,3 @@ image: mkimage-iso-bios -disable-content-trust: true arches: - amd64 diff --git a/tools/mkimage-iso-efi/build.yml b/tools/mkimage-iso-efi/build.yml index 3151301d1..1ea72881e 100644 --- a/tools/mkimage-iso-efi/build.yml +++ b/tools/mkimage-iso-efi/build.yml @@ -1,3 +1,2 @@ image: mkimage-iso-efi -disable-content-trust: true network: true diff --git a/tools/mkimage-vhd/build.yml b/tools/mkimage-vhd/build.yml index dde28fc5d..8b00b4fda 100644 --- a/tools/mkimage-vhd/build.yml +++ b/tools/mkimage-vhd/build.yml @@ -1,2 +1 @@ image: mkimage-vhd -disable-content-trust: true diff --git a/tools/mkimage-vmdk/build.yml b/tools/mkimage-vmdk/build.yml index 97ef2c7ea..cfad11d0b 100644 --- a/tools/mkimage-vmdk/build.yml +++ b/tools/mkimage-vmdk/build.yml @@ -1,2 +1 @@ image: mkimage-vmdk -disable-content-trust: true From 5380c7a18d7140fd7c2d8e51d430aa95994b58ab Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 13 Oct 2017 10:34:02 +0100 Subject: [PATCH 4/4] update-component-sha: Accept easier to cut-n-paste --image arguments. Signed-off-by: Ian Campbell --- scripts/update-component-sha.sh | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/scripts/update-component-sha.sh b/scripts/update-component-sha.sh index 2eeda3f49..704ab0a34 100755 --- a/scripts/update-component-sha.sh +++ b/scripts/update-component-sha.sh @@ -23,6 +23,9 @@ Replace by image: $0 --image Example: $0 --image linuxkit/foo abcdef567899 Will tag all instances of linuxkit/foo with abcdef567899 + $0 --image : is accepted as a convenient shortcut for cutting + and pasting e.g.the output of linuxkit pkg show-tag + By default, for convenience, if no mode is given (--image or --hash), the first method (--hash) is assumed. Thus the following are equivalent: $0 @@ -33,28 +36,39 @@ EOF # backwards compatibility -if [ $# -eq 2 ]; then +if [ $# -eq 2 -a -n "${1%--*}" ]; then set -- "--hash" "$1" "$2" fi # sufficient arguments -if [ $# -ne 3 ] ; then +if [ $# -lt 2 -o $# -gt 3 ] ; then usage exit 1 fi - # which mode? case "$1" in --hash) + if [ $# -ne 3 ] ; then + usage + exit 1 + fi old=$2 new=$3 git grep -w -l "\b$old\b" | xargs sed -i.bak -e "s,$old,$new,g" ;; --image) - image=$2 - hash=$3 + case $# in + 2) + image=${2%:*} + hash=${2#*:} + ;; + 3) + image=$2 + hash=$3 + ;; + esac git grep -E -l "\b$image:" | xargs sed -i.bak -e "s,$image:[[:xdigit:]]"'\{40\}'",$image:$hash,g" ;; *)