diff --git a/_data/kernels.json b/_data/kernels.json index 1dbcf054..6fc2eb04 100644 --- a/_data/kernels.json +++ b/_data/kernels.json @@ -27,6 +27,16 @@ { "name": "4.19", "url": "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git?depth=1#linux-4.19.y" + }, + { + "name": "rhel8", + "opts": [ + [ "--enable", "CONFIG_EXT4_FS"], + [ "--disable", "CONFIG_SECURITY_APPARMOR"], + [ "--disable", "CONFIG_NF_CONNTRACK"], + [ "--disable", "CONFIG_MODULE_SIG"], + [ "--disable", "CONFIG_MODULE_SIG_ALL"] + ] } ], "common_opts": [ diff --git a/dockerfiles/kernel-images-rhel8 b/dockerfiles/kernel-images-rhel8 new file mode 100644 index 00000000..5b828b1c --- /dev/null +++ b/dockerfiles/kernel-images-rhel8 @@ -0,0 +1,49 @@ +# syntax=docker/dockerfile:1.3-labs +# vim: set ft=dockerfile: + +FROM quay.io/lvh-images/lvh:latest AS lvh + +FROM rockylinux:8 AS builder + +COPY --from=lvh /usr/bin/lvh /usr/bin/lvh + +RUN dnf install -y 'dnf-command(builddep)' 'dnf-command(config-manager)' +RUN dnf config-manager --set-enabled powertools +RUN dnf builddep -y kernel + +FROM builder AS prepare + +WORKDIR /tmp +RUN dnf download --source kernel && rpm -ivh kernel*.src.rpm + +WORKDIR /root/rpmbuild/SPECS +RUN rpmbuild -bp kernel.spec --with baseonly + +RUN ln -s /root/rpmbuild/BUILD/kernel-*/linux-* /tmp/build +WORKDIR /tmp/build + +RUN mkdir patches +COPY patches/rhel8/*.patch patches/ +RUN for p in patches/*.patch; do echo "Applying $p"; patch -p1 < "$p" || exit 1; done + +# Emulate InitBuildVars() from kernel.spec +RUN make -s mrproper +RUN cp configs/kernel-*-$(uname -m)-debug.config .config + +# Remove all RHEL modules +RUN sed --in-place -E -e 's/^(CONFIG_[^=]+)=m/# \1 is not set/' .config + +COPY _data /data + +RUN lvh kernels --dir /data raw_configure . rhel8 2>&1 + +FROM prepare AS build + +RUN make -j $(nproc) +RUN make tar-pkg + +COPY scripts/generate-btf.sh /tmp/ +RUN /tmp/generate-btf.sh /tmp/build/tar-install + +FROM busybox as kernel +COPY --from=build /tmp/build/tar-install /data/kernels/rhel8 diff --git a/patches/rhel8/0001-fs-9p-vfs_file.c-use-new-return-type-vm_fault_t.patch b/patches/rhel8/0001-fs-9p-vfs_file.c-use-new-return-type-vm_fault_t.patch new file mode 100644 index 00000000..946f09f3 --- /dev/null +++ b/patches/rhel8/0001-fs-9p-vfs_file.c-use-new-return-type-vm_fault_t.patch @@ -0,0 +1,38 @@ +From fe6340e2d1f5ef9ebb9a82665b053c362837cbd6 Mon Sep 17 00:00:00 2001 +From: Souptick Joarder +Date: Tue, 17 Jul 2018 19:14:35 -0700 +Subject: [PATCH] fs/9p/vfs_file.c: use new return type vm_fault_t + +Use new return type vm_fault_t for page_mkwrite handler. + +See 1c8f422059ae ("mm: change return type to vm_fault_t") for reference. + +Link: http://lkml.kernel.org/r/20180702154928.GA3964@jordon-HP-15-Notebook-PC +Signed-off-by: Souptick Joarder +Reviewed-by: Matthew Wilcox +Acked-by: Jun Piao +Cc: Eric Van Hensbergen +Cc: Ron Minnich +Cc: Latchesar Ionkov +Signed-off-by: Andrew Morton +Signed-off-by: Dominique Martinet +--- + fs/9p/vfs_file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c +index 03c9e325bfbc..5f2e48d41d72 100644 +--- a/fs/9p/vfs_file.c ++++ b/fs/9p/vfs_file.c +@@ -533,7 +533,7 @@ v9fs_mmap_file_mmap(struct file *filp, struct vm_area_struct *vma) + return retval; + } + +-static int ++static vm_fault_t + v9fs_vm_page_mkwrite(struct vm_fault *vmf) + { + struct v9fs_inode *v9inode; +-- +2.43.0 +