-
Notifications
You must be signed in to change notification settings - Fork 55
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
[WIP] Enable Rockchip arch in kernel #2556
Draft
sambonbonne
wants to merge
27
commits into
flatcar:main
Choose a base branch
from
sambonbonne:feature/enable-rockchip-in-kernel
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+369
−173
Draft
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
ccfe3ea
kernel: upgrade from 6.6 to 6.10
ader1990 4563b0e
kernel: add corect checksums
ader1990 3edf8fe
linux: add coreos-modules for 6.10.9
ader1990 b01e779
linux: pahole flags moved to scripts/Makefile.btf
ader1990 8c91f0d
linux: remove CONFIG_AMD_IOMMU_V2
ader1990 1d972a9
linux: remove CONFIG_MD_LINEAR
ader1990 1632cd1
linux: remove CONFIG_NET_ACT_IPT
ader1990 103ce4d
pahole: added a revamped patch to remove the parallel implementation
ader1990 912e96d
zfs: unmask 2.2.6 version compatible with linux kernel 6.10
ader1990 388b190
linux: remove CONFIG_FB_ARMCLCD
ader1990 a429bc2
To be fixed: build_image: do not fail on cpio end of file
ader1990 068aabf
build: force max load
ader1990 162bf91
kernel: remove rebased files
ader1990 317604d
hv_daemons: update the hv_fcopy to hv_fcopy_uio
ader1990 b2f98bf
kernel: use pahole 1.27 feature of reproducible builds
ader1990 9225cb0
Add the required patches
ader1990 9c0114e
kernel: update patch for secureboot
ader1990 2be94c2
cpio: show all the rootfs found
ader1990 47b9495
kernel: fix hv tools build for arm64
ader1990 ca8a7da
app-emulation/hv-daemons: add hv_fcopy_uio_daemon
ader1990 218f211
kernel: upgrade from 6.10 to 6.11
ader1990 b1578e9
kernel: use kernel 6.12
ader1990 354489d
kernel: use new patches for secure boot
ader1990 c9f9794
kernel: add required CONFIG_MODULE_COMPRESS=y
ader1990 582883a
sys-fs/zfs: add and enable 2.2.7 which is compatible with kernel 6.12
ader1990 87bc1d5
kernel: set CONFIG_ARCH_ROCKCHIP
sambonbonne 3d0e057
Merge branch 'main' into feature/enable-rockchip-in-kernel
ader1990 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...src/third_party/coreos-overlay/app-emulation/hv-daemons/files/hv_fcopy_uio_daemon.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=Hyper-V FCOPY UIO daemon | ||
ConditionPathExists=/sys/bus/vmbus/devices/eb765408-105f-49b6-b4aa-c123b64d17d4/uio | ||
|
||
[Service] | ||
ExecStart=/usr/bin/hv_fcopy_uio_daemon --no-daemon | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
1 change: 1 addition & 0 deletions
1
...ontainer/src/third_party/coreos-overlay/app-emulation/hv-daemons/hv-daemons-6.12.0.ebuild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hv-daemons-9999.ebuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
...ainer/src/third_party/coreos-overlay/sys-kernel/coreos-kernel/coreos-kernel-6.12.0.ebuild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# Copyright 2014-2016 CoreOS, Inc. | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=7 | ||
COREOS_SOURCE_REVISION="" | ||
inherit coreos-kernel | ||
|
||
DESCRIPTION="CoreOS Linux kernel" | ||
KEYWORDS="amd64 arm64" | ||
|
||
RDEPEND="=sys-kernel/coreos-modules-${PVR}" | ||
DEPEND="${RDEPEND} | ||
app-arch/gzip | ||
app-arch/zstd | ||
app-crypt/clevis | ||
app-shells/bash | ||
coreos-base/coreos-init:= | ||
sys-apps/coreutils | ||
sys-apps/findutils | ||
sys-apps/grep | ||
sys-apps/ignition:= | ||
sys-apps/less | ||
sys-apps/nvme-cli | ||
sys-apps/sed | ||
sys-apps/shadow | ||
sys-apps/systemd[cryptsetup] | ||
sys-apps/seismograph | ||
sys-apps/util-linux | ||
sys-fs/btrfs-progs | ||
sys-fs/e2fsprogs | ||
sys-fs/mdadm | ||
sys-fs/xfsprogs | ||
>=sys-kernel/coreos-firmware-20180103-r1:= | ||
>=sys-kernel/bootengine-0.0.4:= | ||
sys-kernel/dracut | ||
virtual/udev | ||
amd64? ( sys-firmware/intel-microcode:= )" | ||
|
||
# We are bad, we want to get around the sandbox. So do the creation of the | ||
# cpio image in pkg_setup() where we are free to mount filesystems, chroot, | ||
# and other fun stuff. | ||
pkg_setup() { | ||
coreos-kernel_pkg_setup | ||
|
||
[[ "${MERGE_TYPE}" == binary ]] && return | ||
|
||
# Fail early if we didn't detect the build installed by coreos-modules | ||
[[ -n "${KV_OUT_DIR}" ]] || die "Failed to detect modules build tree" | ||
|
||
if [[ "${ROOT:-/}" != / ]]; then | ||
# TMPDIR needs to be corrected for chroot | ||
TMPDIR=${TMPDIR#${ROOT}} ${ROOT}/usr/sbin/update-bootengine -m -c ${ROOT} -k "${KV_FULL}" || die | ||
else | ||
update-bootengine -k "${KV_FULL}" || die | ||
fi | ||
} | ||
|
||
src_prepare() { | ||
default | ||
# KV_OUT_DIR points to the minimal build tree installed by coreos-modules | ||
# Pull in the config and public module signing key | ||
KV_OUT_DIR="${SYSROOT%/}/lib/modules/${COREOS_SOURCE_NAME#linux-}/build" | ||
cp -v "${KV_OUT_DIR}/.config" build/ || die | ||
local sig_key="$(getconfig MODULE_SIG_KEY)" | ||
mkdir -p "build/${sig_key%/*}" || die | ||
cp -v "${KV_OUT_DIR}/${sig_key}" "build/${sig_key}" || die | ||
|
||
# Symlink to bootengine.cpio so we can stick with relative paths in .config | ||
ln -sv "${SYSROOT%/}"/usr/share/bootengine/bootengine.cpio build/ || die | ||
config_update 'CONFIG_INITRAMFS_SOURCE="bootengine.cpio"' | ||
|
||
# include all intel and amd microcode files, avoiding the signatures | ||
local fw_dir="${SYSROOT%/}/lib/firmware" | ||
use amd64 && config_update "CONFIG_EXTRA_FIRMWARE=\"$(find ${fw_dir} -type f \ | ||
\( -path ${fw_dir}'/intel-ucode/*' -o -path ${fw_dir}'/amd-ucode/*' \) -printf '%P ')\"" | ||
use amd64 && config_update "CONFIG_EXTRA_FIRMWARE_DIR=\"${fw_dir}\"" | ||
} | ||
|
||
src_compile() { | ||
kmake "$(kernel_target)" | ||
|
||
# sanity check :) | ||
[[ -e build/certs/signing_key.pem ]] && die "created a new key!" | ||
} | ||
|
||
src_install() { | ||
# coreos-postinst expects to find the kernel in /usr/boot | ||
insinto "/usr/boot" | ||
newins "$(kernel_path)" "vmlinuz-${KV_FULL}" | ||
dosym "vmlinuz-${KV_FULL}" "/usr/boot/vmlinuz" | ||
|
||
insinto "/usr/lib/modules/${KV_FULL}/build" | ||
doins build/System.map | ||
|
||
insinto "/usr/lib/debug/usr/boot" | ||
newins build/vmlinux "vmlinux-${KV_FULL}" | ||
dosym "../../../boot/vmlinux-${KV_FULL}" "/usr/lib/debug/usr/lib/modules/${KV_FULL}/vmlinux" | ||
|
||
# For easy access to vdso debug symbols in gdb: | ||
# set debug-file-directory /usr/lib/debug/usr/lib/modules/${KV_FULL}/vdso/ | ||
kmake INSTALL_MOD_PATH="${D}/usr/lib/debug/usr" vdso_install | ||
} |
68 changes: 68 additions & 0 deletions
68
...ner/src/third_party/coreos-overlay/sys-kernel/coreos-modules/coreos-modules-6.12.0.ebuild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Copyright 2014-2016 CoreOS, Inc. | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=7 | ||
COREOS_SOURCE_REVISION="" | ||
inherit coreos-kernel savedconfig | ||
|
||
DESCRIPTION="CoreOS Linux kernel modules" | ||
KEYWORDS="amd64 arm64" | ||
RDEPEND="!<sys-kernel/coreos-kernel-4.6.3-r1" | ||
|
||
src_prepare() { | ||
default | ||
restore_config build/.config | ||
if [[ ! -f build/.config ]]; then | ||
local archconfig="$(find_archconfig)" | ||
local commonconfig="$(find_commonconfig)" | ||
elog "Building using config ${archconfig} and ${commonconfig}" | ||
cat "${archconfig}" "${commonconfig}" >> build/.config || die | ||
fi | ||
cpio -ov </dev/null >build/bootengine.cpio | ||
|
||
# Check that an old pre-ebuild-split config didn't leak in. | ||
grep -q "^CONFIG_INITRAMFS_SOURCE=" build/.config && \ | ||
die "CONFIG_INITRAMFS_SOURCE must be removed from kernel config" | ||
config_update 'CONFIG_INITRAMFS_SOURCE="bootengine.cpio"' | ||
} | ||
|
||
src_compile() { | ||
# Generate module signing key | ||
setup_keys | ||
|
||
# Build both vmlinux and modules (moddep checks symbols in vmlinux) | ||
kmake vmlinux modules | ||
} | ||
|
||
src_install() { | ||
# Install modules to /usr. | ||
# Install firmware to a temporary (bogus) location. | ||
# The linux-firmware package will be used instead. | ||
# Stripping must be done here, not portage, to preserve sigs. | ||
kmake INSTALL_MOD_PATH="${D}/usr" \ | ||
INSTALL_MOD_STRIP="--strip-debug" \ | ||
INSTALL_FW_PATH="${T}/fw" \ | ||
modules_install | ||
|
||
# Install to /usr/lib/debug with debug symbols intact | ||
kmake INSTALL_MOD_PATH="${D}/usr/lib/debug/usr" \ | ||
INSTALL_FW_PATH="${T}/fw" \ | ||
modules_install | ||
rm "${D}/usr/lib/debug/usr/lib/modules/${KV_FULL}/"modules.* || die | ||
rm "${D}/usr/lib/debug/usr/lib/modules/${KV_FULL}/build" || die | ||
|
||
# Clean up the build tree | ||
shred_keys | ||
kmake clean | ||
find "build/" -type d -empty -delete || die | ||
rm "build/.config.old" || die | ||
|
||
# Install /lib/modules/${KV_FULL}/{build,source} | ||
install_build_source | ||
|
||
# Not strictly required but this is where we used to install the config. | ||
dodir "/usr/boot" | ||
local build="lib/modules/${KV_FULL}/build" | ||
dosym "../${build}/.config" "/usr/boot/config-${KV_FULL}" | ||
dosym "../${build}/.config" "/usr/boot/config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-sources/Manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
DIST linux-6.6.tar.xz 140064536 BLAKE2B 5f02fd8696d42f7ec8c5fbadec8e7270bdcfcb1f9844a6c4db3e1fd461c93ce1ccda650ca72dceb4890ebcbbf768ba8fba0bce91efc49fbd2c307b04e95665f2 SHA512 458b2c34d46206f9b4ccbac54cc57aeca1eaecaf831bc441e59701bac6eadffc17f6ce24af6eadd0454964e843186539ac0d63295ad2cc32d112b60360c39a35 | ||
DIST patch-6.6.75.xz 3746436 BLAKE2B 341eef5843e45bde810560b3a6e9c0460decc553aba28b5a1fa65c90130703fd2299aeaf2cc850948301e8869774920cbb05eeebc6bfb3098f4601b07da4a583 SHA512 f2a2faf11ec041b21fa9ea1033046c631d6e7e49d75842cad1d6ec282bf4e57107035c38e165a3ba91c1e6b0fe494cc1e1117be60be1943fd2e039c3e6faa305 | ||
DIST linux-6.12.tar.xz 147906904 BLAKE2B b2ec2fc69218cacabbbe49f78384a5d259ca581b717617c12b000b16f4a4c59ee348ea886b37147f5f70fb9a7a01c1e2c8f19021078f6b23f5bc62d1c48d5e5e SHA512 a37b1823df7b4f72542f689b65882634740ba0401a42fdcf6601d9efd2e132e5a7650e70450ba76f6cd1f13ca31180f2ccee9d54fe4df89bc0000ade4380a548 |
46 changes: 46 additions & 0 deletions
46
...ner/src/third_party/coreos-overlay/sys-kernel/coreos-sources/coreos-sources-6.12.0.ebuild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright 2014 CoreOS, Inc. | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=7 | ||
ETYPE="sources" | ||
|
||
# -rc releases should be versioned L.M_rcN | ||
# Final releases should be versioned L.M.N, even for N == 0 | ||
|
||
# Only needed for RCs | ||
K_BASE_VER="5.15" | ||
|
||
inherit kernel-2 | ||
EXTRAVERSION="-flatcar" | ||
detect_version | ||
|
||
DESCRIPTION="Full sources for the CoreOS Linux kernel" | ||
HOMEPAGE="http://www.kernel.org" | ||
if [[ "${PV%%_rc*}" != "${PV}" ]]; then | ||
SRC_URI="https://git.kernel.org/torvalds/p/v${KV%-coreos}/v${OKV} -> patch-${KV%-coreos}.patch ${KERNEL_BASE_URI}/linux-${OKV}.tar.xz" | ||
PATCH_DIR="${FILESDIR}/${KV_MAJOR}.${KV_PATCH}" | ||
else | ||
SRC_URI="${KERNEL_URI}" | ||
PATCH_DIR="${FILESDIR}/${KV_MAJOR}.${KV_MINOR}" | ||
fi | ||
|
||
# make modules_prepare depends on pahole | ||
RDEPEND="dev-util/pahole" | ||
|
||
KEYWORDS="amd64 arm64" | ||
IUSE="" | ||
|
||
# XXX: Note we must prefix the patch filenames with "z" to ensure they are | ||
# applied _after_ a potential patch-${KV}.patch file, present when building a | ||
# patchlevel revision. We mustn't apply our patches first, it fails when the | ||
# local patches overlap with the upstream patch. | ||
UNIPATCH_LIST=" | ||
${PATCH_DIR}/z0001-kbuild-derive-relative-path-for-srctree-from-CURDIR.patch \ | ||
${PATCH_DIR}/z0002-pahole-support-reproducible-builds.patch \ | ||
${PATCH_DIR}/z0003-Revert-x86-boot-Remove-the-bugger-off-message.patch \ | ||
${PATCH_DIR}/z0004-efi-add-an-efi_secure_boot-flag-to-indicate-secure-b.patch \ | ||
${PATCH_DIR}/z0005-efi-lock-down-the-kernel-if-booted-in-secure-boot-mo.patch \ | ||
${PATCH_DIR}/z0006-mtd-disable-slram-and-phram-when-locked-down.patch \ | ||
${PATCH_DIR}/z0007-arm64-add-kernel-config-option-to-lock-down-when.patch \ | ||
${PATCH_DIR}/z0008-tools-hv-fix-cross-compilation-for-ARM64.patch \ | ||
" |
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
...erlay/sys-kernel/coreos-sources/files/6.12/z0002-pahole-support-reproducible-builds.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
From 9faff3734e6456e7927c0914829a4764ec9f1b44 Mon Sep 17 00:00:00 2001 | ||
From: Adrian Vladu <avladu@cloudbasesolutions.com> | ||
Date: Tue, 17 Sep 2024 13:44:14 +0000 | ||
Subject: [PATCH] pahole: support reproducible builds | ||
|
||
--- | ||
scripts/Makefile.btf | 3 +++ | ||
1 file changed, 3 insertions(+) | ||
|
||
diff --git a/scripts/Makefile.btf b/scripts/Makefile.btf | ||
index 2d6e5ed9081e..b2f88b0fcf37 100644 | ||
--- a/scripts/Makefile.btf | ||
+++ b/scripts/Makefile.btf | ||
@@ -23,6 +23,9 @@ else | ||
# Switch to using --btf_features for v1.26 and later. | ||
pahole-flags-$(call test-ge, $(pahole-ver), 126) = -j --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func | ||
|
||
+# Support reproducible builds. | ||
+pahole-flags-$(call test-ge, $(pahole-ver), 127) = -j --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func,reproducible_build | ||
+ | ||
endif | ||
|
||
pahole-flags-$(CONFIG_PAHOLE_HAS_LANG_EXCLUDE) += --lang_exclude=rust | ||
-- | ||
2.34.1 | ||
|
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CONFIG_ARCH_MULTI_V7 might be required too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RK3566 is ARMv8-A (it has only 4 Cortex A-55, which are ARMv8.2-A) and
CONFIG_ARCH_MULTI_V7
is for ARMv7 (if I understand correctly). So at first sight, it should not be required but if my real test fails, I'll try to add it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://cateee.net/lkddb/web-lkddb/ARCH_ROCKCHIP.html: depends on: CONFIG_ARCH_MULTI_V7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is weird because it says it's for Rockchip Cortex-A9 so I'll try without it and if it doesn't work, I'll try to add it.
If I add it, I'll try to use the SDK container to build locally and make the change if it helps.