From 77e8c07dc0307cfca9f0987cd982419ed5b7a2a6 Mon Sep 17 00:00:00 2001 From: RouxAntoine Date: Sat, 6 Jan 2024 19:22:16 +0100 Subject: [PATCH] I know what I am doing. Trust me. Signed-off-by: RouxAntoine --- rootfs-kernel/Makefile | 6 +++--- rootfs-kernel/kernel.sh | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/rootfs-kernel/Makefile b/rootfs-kernel/Makefile index ee731bb..65ce6f5 100644 --- a/rootfs-kernel/Makefile +++ b/rootfs-kernel/Makefile @@ -13,15 +13,15 @@ use-ubuntu: ../out/ubuntu-22.04.ext4 ../out/ubuntu-22.04.id_rsa use-kernel: ../out/vmlinux-5.10.204 ln -fs $< ../out/vmlinux -use-kernel-custom: ../out/vmvmlinux-custom +use-kernel-custom: ../out/vmlinux-5.11 ln -fs $< ../out/vmlinux ../out/vmlinux-5.10.204: wget -O $@ https://s3.amazonaws.com/spec.ccfc.min/firecracker-ci/v1.7/$(ARCH)/vmlinux-5.10.204 CONFIG_FILE=$(wildcard ./kernel-config/*.config) -../out/vmvmlinux-custom: ./kernel.sh $(CONFIG_FILE) - bash ./kernel.sh +../out/vmlinux-5.11: ./kernel.sh $(CONFIG_FILE) + bash ./kernel.sh 5.11 ../out/arch-rootfs.ext4: ./arch-rootfs.sh bash ./arch-rootfs.sh diff --git a/rootfs-kernel/kernel.sh b/rootfs-kernel/kernel.sh index bc6ea87..2e30f5d 100755 --- a/rootfs-kernel/kernel.sh +++ b/rootfs-kernel/kernel.sh @@ -4,18 +4,20 @@ set -ex -KERNEL_VERSION=v5.11 +KERNEL_VERSION=$1 WD=../out +NPROC=4 ## Install build tools # pacman -Syu base-devel bc pahole --ignore linux-firmware +# disabling CONFIG_DEBUG_INFO_BTF so no pahole required sudo rm -rf "$WD"/linux ## Get kernel source -git clone --depth 1 --branch $KERNEL_VERSION https://github.com/torvalds/linux.git "$WD"/linux +git clone --depth 1 --branch v$KERNEL_VERSION https://github.com/torvalds/linux.git "$WD"/linux ## Get Archlinux kernel config -curl -o "$WD"/linux/.config https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/raw/2db49d4fbcda88d76a4c236ccb5a7986715d70ba/config +curl -o "$WD"/linux/.config https://gitlab.archlinux.org/archlinux/packaging/packages/linux/-/raw/5.11.16.arch1-1/config?ref_type=tags CONFIG_PATH="$WD"/linux/.config @@ -34,6 +36,7 @@ sed 's/\(.*\)VIDEO\(.*\)=y/\1VIDEO\2=n/g' -i "$CONFIG_PATH" # sed 's/\(.*\)PCI\(.*\)=y/\1PCI\2=n/g' -i "$CONFIG_PATH" sed 's/\(.*\)WLAN\(.*\)=y/\1WLAN\2=n/g' -i "$CONFIG_PATH" sed 's/\(.*\)DRM\(.*\)=y/\1DRM\2=n/g' -i "$CONFIG_PATH" +sed 's/\(.*\)BTF\(.*\)=y/\1BTF\2=n/g' -i "$CONFIG_PATH" cat kernel-config/virtio.config >> "$CONFIG_PATH" cat kernel-config/fs.config >> "$CONFIG_PATH" @@ -42,6 +45,9 @@ cat kernel-config/net.config >> "$CONFIG_PATH" ## Add KVM guest support make -C "$WD"/linux/ kvm_guest.config -#make -j$(nproc) -# -#./scripts/extract-vmlinux ./arch/x86_64/boot/bzImage > "$WD"/vmlinux-$KERNEL_VERSION.bin +make -j$NPROC EXTRA_CFLAGS=-Wno-error=use-after-free +#make -j$NPROC WERROR=0 + +cp ./vmlinux "$WD"/vmlinux-$KERNEL_VERSION + +sudo rm -rf "$WD"/linux