Skip to content

Use kernel 5.10 for minikube.iso. #12707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ KUBERNETES_VERSION ?= $(shell egrep "DefaultKubernetesVersion =" pkg/minikube/co
KIC_VERSION ?= $(shell egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f2)

# Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions
ISO_VERSION ?= v1.26.0-1653677468-13807
ISO_VERSION ?= v1.26.0-1654280115-12707
# Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta
DEB_VERSION ?= $(subst -,~,$(RAW_VERSION))
DEB_REVISION ?= 0
Expand Down Expand Up @@ -73,7 +73,7 @@ MINIKUBE_BUCKET ?= minikube/releases
MINIKUBE_UPLOAD_LOCATION := gs://${MINIKUBE_BUCKET}
MINIKUBE_RELEASES_URL=https://github.com/kubernetes/minikube/releases/download

KERNEL_VERSION ?= 4.19.235
KERNEL_VERSION ?= 5.10.57
# latest from https://github.com/golangci/golangci-lint/releases
# update this only by running `make update-golint-version`
GOLINT_VERSION ?= v1.46.2
Expand Down Expand Up @@ -287,11 +287,12 @@ minikube-iso-arm64: minikube-iso-aarch64

minikube-iso-%: deploy/iso/minikube-iso/board/minikube/%/rootfs-overlay/usr/bin/auto-pause # build minikube iso
echo $(ISO_VERSION) > deploy/iso/minikube-iso/board/minikube/$*/rootfs-overlay/etc/VERSION
cp deploy/iso/minikube-iso/CHANGELOG deploy/iso/minikube-iso/board/minikube/$*/rootfs-overlay/etc/CHANGELOG
cp deploy/iso/minikube-iso/arch/$*/Config.in.tmpl deploy/iso/minikube-iso/Config.in
if [ ! -d $(BUILD_DIR)/buildroot ]; then \
mkdir -p $(BUILD_DIR); \
git clone --depth=1 --branch=$(BUILDROOT_BRANCH) https://github.com/buildroot/buildroot $(BUILD_DIR)/buildroot; \
perl -pi -e 's@\s+source "package/sysdig/Config\.in"\n@@;' $(BUILD_DIR)/buildroot/package/Config.in; \
rm -r $(BUILD_DIR)/buildroot/package/sysdig; \
cp deploy/iso/minikube-iso/go.hash $(BUILD_DIR)/buildroot/package/go/go.hash; \
fi;
$(MAKE) -C $(BUILD_DIR)/buildroot $(BUILDROOT_OPTIONS) O=$(BUILD_DIR)/buildroot/output-$* minikube_$*_defconfig
Expand All @@ -312,17 +313,17 @@ iso-menuconfig: ## Configure buildroot configuration

# Change the kernel configuration for the minikube ISO
linux-menuconfig-%: ## Configure Linux kernel configuration
$(MAKE) -C $(BUILD_DIR)/buildroot/output/build/linux-$(KERNEL_VERSION)/ menuconfig
$(MAKE) -C $(BUILD_DIR)/buildroot/output/build/linux-$(KERNEL_VERSION)/ savedefconfig
cp $(BUILD_DIR)/buildroot/output/build/linux-$(KERNEL_VERSION)/defconfig deploy/iso/minikube-iso/board/minikube/$*/linux_$*_defconfig
$(MAKE) -C $(BUILD_DIR)/buildroot/output-$*/build/linux-$(KERNEL_VERSION)/ menuconfig
$(MAKE) -C $(BUILD_DIR)/buildroot/output-$*/build/linux-$(KERNEL_VERSION)/ savedefconfig
cp $(BUILD_DIR)/buildroot/output-$*/build/linux-$(KERNEL_VERSION)/defconfig deploy/iso/minikube-iso/board/minikube/$*/linux_$*_defconfig

out/minikube-%.iso: $(shell find "deploy/iso/minikube-iso" -type f)
ifeq ($(IN_DOCKER),1)
$(MAKE) minikube-iso-$*
else
docker run --rm --workdir /mnt --volume $(CURDIR):/mnt $(ISO_DOCKER_EXTRA_ARGS) \
--user $(shell id -u):$(shell id -g) --env HOME=/tmp --env IN_DOCKER=1 \
$(ISO_BUILD_IMAGE) /bin/bash -lc '/usr/bin/make out/minikube.iso'
$(ISO_BUILD_IMAGE) /bin/bash -lc '/usr/bin/make minikube-iso-$*'
endif

iso_in_docker:
Expand Down
1 change: 0 additions & 1 deletion deploy/iso/minikube-iso/arch/x86_64/package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ menu "System tools x86_64"
source "$BR2_EXTERNAL_MINIKUBE_PATH/arch/x86_64/package/cni-plugins/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/arch/x86_64/package/containerd-bin/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/arch/x86_64/package/podman/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/arch/x86_64/package/vbox-guest/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/arch/x86_64/package/hyperv-daemons/Config.in"
endmenu
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
################################################################################

HYPERV_DAEMONS_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION))
HYPERV_DAEMONS_SITE = https://www.kernel.org/pub/linux/kernel/v4.x
HYPERV_DAEMONS_SITE = https://www.kernel.org/pub/linux/kernel/v5.x
HYPERV_DAEMONS_SOURCE = linux-$(HYPERV_DAEMONS_VERSION).tar.xz

define HYPERV_DAEMONS_BUILD_CMDS
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
CONFIG_FTRACE_SYSCALLS=y
CONFIG_FTRACE=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_BRIDGE_NETFILTER=y
CONFIG_PCI=y
CONFIG_TMPFS=y
CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y
CONFIG_AUDIT=y
Expand Down Expand Up @@ -1213,5 +1219,4 @@ CONFIG_DEBUG_FS=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_SCHED_DEBUG is not set
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_FTRACE is not set
CONFIG_MEMTEST=y
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
CONFIG_VBOXGUEST=m
CONFIG_VBOXSF_FS=m
CONFIG_DRM_VBOXVIDEO=m
CONFIG_BRIDGE_NETFILTER=y
CONFIG_PCI=y
CONFIG_TMPFS=y
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_KERNEL_LZ4=y
CONFIG_SYSVIPC=y
Expand Down
6 changes: 3 additions & 3 deletions deploy/iso/minikube-iso/configs/minikube_aarch64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/minikube/aarch
BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/minikube/aarch64/genimage.cfg"


# Linux headers same as kernel, a 4.19 series
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
# Linux headers same as kernel, a 5.10 series
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y

# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.235"
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.57"
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_LINUX_KERNEL_INSTALL_TARGET=y
Expand Down
6 changes: 3 additions & 3 deletions deploy/iso/minikube-iso/configs/minikube_x86_64_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ BR2_TARGET_SYSLINUX=y
BR2_TARGET_ROOTFS_CPIO=y
BR2_TARGET_ROOTFS_CPIO_GZIP=y

# Linux headers same as kernel, a 4.19 series
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
# Linux headers same as kernel, a 5.10 series
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y

# Kernel
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.235"
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.57"
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_LINUX_KERNEL_INSTALL_TARGET=y
Expand Down
2 changes: 2 additions & 0 deletions deploy/iso/minikube-iso/package/Config.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
menu "System tools"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/tbb/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/sysdig/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/crun/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/automount/Config.in"
source "$BR2_EXTERNAL_MINIKUBE_PATH/package/gluster/Config.in"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
From cc8bccc3ebb90103900a7f0f2b085ddb723b8792 Mon Sep 17 00:00:00 2001
From: Francis Laniel <[email protected]>
Date: Wed, 6 Apr 2022 16:54:37 +0100
Subject: [PATCH] libsinsp: Apply PATCH_COMMAND to fix lua types and function.

Buildroot luajit 5.1 seems to not have compatibility between luaL_reg and
luaL_Reg.
So, we apply sysdig CMakeLists.txt PATCH_COMMAND to fix this and lua function
call as well.
Note that, this PATCH_COMMAND was added in sysdig in:
a064440394c9 ("Adding power support to Travis builds (#1566)")

This patch is also present in kubernetes/minikube in:
f036c279bc59 ("Add patch for compiling sysdig with system luajit")

Signed-off-by: Francis Laniel <[email protected]>
---
userspace/libsinsp/chisel.cpp | 6 +++---
userspace/libsinsp/lua_parser.cpp | 2 +-
userspace/libsinsp/lua_parser_api.cpp | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/userspace/libsinsp/chisel.cpp b/userspace/libsinsp/chisel.cpp
index 0a6e3cf8..0c2e255a 100644
--- a/userspace/libsinsp/chisel.cpp
+++ b/userspace/libsinsp/chisel.cpp
@@ -98,7 +98,7 @@ void lua_stackdump(lua_State *L)
// Lua callbacks
///////////////////////////////////////////////////////////////////////////////
#ifdef HAS_LUA_CHISELS
-const static struct luaL_reg ll_sysdig [] =
+const static struct luaL_Reg ll_sysdig [] =
{
{"set_filter", &lua_cbacks::set_global_filter},
{"set_snaplen", &lua_cbacks::set_snaplen},
@@ -134,7 +134,7 @@ const static struct luaL_reg ll_sysdig [] =
{NULL,NULL}
};

-const static struct luaL_reg ll_chisel [] =
+const static struct luaL_Reg ll_chisel [] =
{
{"request_field", &lua_cbacks::request_field},
{"set_filter", &lua_cbacks::set_filter},
@@ -146,7 +146,7 @@ const static struct luaL_reg ll_chisel [] =
{NULL,NULL}
};

-const static struct luaL_reg ll_evt [] =
+const static struct luaL_Reg ll_evt [] =
{
{"field", &lua_cbacks::field},
{"get_num", &lua_cbacks::get_num},
diff --git a/userspace/libsinsp/lua_parser.cpp b/userspace/libsinsp/lua_parser.cpp
index 0e26617d..78810d96 100644
--- a/userspace/libsinsp/lua_parser.cpp
+++ b/userspace/libsinsp/lua_parser.cpp
@@ -32,7 +32,7 @@ extern "C" {
#include "lauxlib.h"
}

-const static struct luaL_reg ll_filter [] =
+const static struct luaL_Reg ll_filter [] =
{
{"rel_expr", &lua_parser_cbacks::rel_expr},
{"bool_op", &lua_parser_cbacks::bool_op},
diff --git a/userspace/libsinsp/lua_parser_api.cpp b/userspace/libsinsp/lua_parser_api.cpp
index c89e9126..c3d8008a 100644
--- a/userspace/libsinsp/lua_parser_api.cpp
+++ b/userspace/libsinsp/lua_parser_api.cpp
@@ -266,7 +266,7 @@ int lua_parser_cbacks::rel_expr(lua_State *ls)
string err = "Got non-table as in-expression operand\n";
throw sinsp_exception("parser API error");
}
- int n = luaL_getn(ls, 4); /* get size of table */
+ int n = lua_objlen (ls, 4); /* get size of table */
for (i=1; i<=n; i++)
{
lua_rawgeti(ls, 4, i);
--
2.25.1

38 changes: 38 additions & 0 deletions deploy/iso/minikube-iso/package/sysdig/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
config BR2_PACKAGE_SYSDIG
bool "sysdig"
depends on BR2_LINUX_KERNEL
depends on BR2_INSTALL_LIBSTDCPP # jsoncpp
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
depends on BR2_TOOLCHAIN_HAS_THREADS # elfutils, jq
depends on !BR2_STATIC_LIBS # elfutils
depends on BR2_USE_WCHAR # elfutils
depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils
depends on BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION_5_1
select BR2_PACKAGE_C_ARES
select BR2_PACKAGE_ELFUTILS
select BR2_PACKAGE_GRPC
select BR2_PACKAGE_GTEST
select BR2_PACKAGE_JQ
select BR2_PACKAGE_JSONCPP
select BR2_PACKAGE_LIBB64
select BR2_PACKAGE_LIBCURL
select BR2_PACKAGE_NCURSES
select BR2_PACKAGE_OPENSSL
select BR2_PACKAGE_PROTOBUF
select BR2_PACKAGE_TBB
select BR2_PACKAGE_ZLIB
help
Sysdig is open source, system-level exploration:
capture system state and activity from a running Linux
instance, then save, filter and analyze.
Think of it as strace + tcpdump + lsof + awesome sauce.
With a little Lua cherry on top.

https://github.com/draios/sysdig/wiki

comment "sysdig needs a glibc or uclibc toolchain w/ C++, threads, gcc >= 4.8, dynamic library, a Linux kernel, and luajit or lua 5.1 to be built"
depends on !BR2_LINUX_KERNEL || !BR2_INSTALL_LIBSTDCPP \
|| !BR2_TOOLCHAIN_HAS_THREADS \
|| !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || BR2_STATIC_LIBS \
|| !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC) \
|| !BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION_5_1
4 changes: 4 additions & 0 deletions deploy/iso/minikube-iso/package/sysdig/sysdig.hash
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# sha256 locally computed
sha256 b9d05854493d245a7a7e75f77fc654508f720aab5e5e8a3a932bd8eb54e49bda sysdig-0.27.1.tar.gz
sha256 57d5b713b875eba35546a1408bf3f20c2703904a17d956be115ee55272db4cfa sysdig-0.23.1.tar.gz
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
Loading