From bfe65e0dc5cc53830c046342c22b09b160459b9f Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Tue, 10 Dec 2019 17:55:44 +0000 Subject: [PATCH 1/2] kernel: make get_config_version quiet `get_config_version` should not log anything because it's used by functions that print a string as return value, hence its return value can be tainted, i.e `get_config_version`. fixes #867 Signed-off-by: Julio Montes --- kernel/build-kernel.sh | 7 +++---- kernel/kata_config_version | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/kernel/build-kernel.sh b/kernel/build-kernel.sh index 9e0aa83bd3..634f6a711a 100755 --- a/kernel/build-kernel.sh +++ b/kernel/build-kernel.sh @@ -124,7 +124,7 @@ get_kernel() { major_version=$(echo "${version}" | cut -d. -f1) kernel_tarball="linux-${version}.tar.xz" - + if [ ! -f sha256sums.asc ] || ! grep -q "${kernel_tarball}" sha256sums.asc; then info "Download kernel checksum file: sha256sums.asc" curl --fail -OL "https://cdn.kernel.org/pub/linux/kernel/v${major_version}.x/sha256sums.asc" @@ -269,15 +269,14 @@ get_default_kernel_config() { get_config_and_patches() { if [ -z "${patches_path}" ]; then - info "Clone config and patches" patches_path="${default_patches_dir}" if [ ! -d "${patches_path}" ]; then tag="${kata_version}" - git clone "https://${patches_repo}.git" "${patches_repo_dir}" + git clone -q "https://${patches_repo}.git" "${patches_repo_dir}" pushd "${patches_repo_dir}" >> /dev/null if [ -n $tag ] ; then info "checking out $tag" - git checkout $tag + git checkout -q $tag fi popd >> /dev/null fi diff --git a/kernel/kata_config_version b/kernel/kata_config_version index 04f9fe4606..abdfb053e4 100644 --- a/kernel/kata_config_version +++ b/kernel/kata_config_version @@ -1 +1 @@ -59 +60 From 43a6e67e70da4343f7646a106a371cf8b4e651a9 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Tue, 10 Dec 2019 20:06:31 +0000 Subject: [PATCH 2/2] snap: overwrite Makefile variables Overwrite Makefile variable `DISTRO` in order to build rootfs and initrd images with the right distro. fixes #868 Signed-off-by: Julio Montes --- snap/snapcraft.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 7bb83987f8..d5fb2903ed 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -228,11 +228,11 @@ parts: export DEBUG=1 case "$(uname -m)" in aarch64|ppc64le|s390x) - sudo -E PATH=$PATH DISTRO=alpine make initrd + sudo -E PATH=$PATH make initrd DISTRO=alpine ;; x86_64) # In some build systems it's impossible to build a rootfs image, try with the initrd image - sudo -E PATH=$PATH DISTRO=clearlinux make image || sudo -E PATH=$PATH DISTRO=alpine make initrd + sudo -E PATH=$PATH make image DISTRO=clearlinux || sudo -E PATH=$PATH make initrd DISTRO=alpine ;; *) echo "unsupported architecture: $(uname -m)"; exit 1;; esac