Skip to content

Commit

Permalink
sys-kernel/cross-kernel-bin: this is basically a placeholder
Browse files Browse the repository at this point in the history
* at least until some GH automation is in place
* for now use locally and copy to your own version string

Signed-off-by: Stephen L Arnold <[email protected]>
  • Loading branch information
sarnold committed Jan 6, 2024
1 parent b68fac3 commit 941af2f
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Interesting/useful items:
* net-proxy/pyforwarder - Python raw socket proxy with optional SSL/TLS termination
* sci-electronics/pyVHDLModel - An abstract VHDL language model written in Python
* sci-electronics/ghdl - The GHDL VHDL simulator
* sys-kernel/cross-kernel-bin - simple (cross)hand-built kernel installer (wip)

plus lots of other python and networking goodies (see below for full listing).

Expand Down Expand Up @@ -60,6 +61,45 @@ Run the following command to sync the repo::

# emaint sync --repo embedded-overlay

WIP embedded kernel-bin ebuild
==============================

This is currently a WIP convenience ebuild for installing a generic kernel
binary on something small/embedded that can't run the full distro-kernel bin
package.

In this context, "generic kernel" is built using something like the RCN
`build scripts`_ (forked) or one of the many upstream `kernel builders`_.


.. _build scripts: https://github.com/sarnold/arm64-mainline-linux
.. _kernel builders: https://github.com/RobertCNelson/

To use the cross-kernel-bin ebuild still involves manual work, but at least
the install/removal is managed. Using the above method produces a set of build
artifacts in a deploy directory named by KVER. For an arm64 target, the result
should look something like this::

$ ls -1 deploy/*6.5.8-arm64-r1*
deploy/6.5.8-arm64-r1-dtbs.tar.gz
deploy/6.5.8-arm64-r1-modules.tar.gz
deploy/6.5.8-arm64-r1.Image
deploy/config-6.5.8-arm64-r1

To use the ebuild on an arm64 host with the above build output, the steps
are essentially:

* drop the artifacts in your local distfiles
* (re)generate the ``cross-kernel-bin`` Manifest file
* emerge ``cross-kernel-bin`` as you normally would
* if needed, generate your initramfs (eg, dracut)
* run ``grub-mkconfig`` --or-- update extlinux.conf

.. note:: The grub ebuild in this overlay has the required devicetree patches
until they make it into the portage tree. Otherwise edit the resulting
grub.cfg file and manually add a ``devicetree`` entry for each kernel
with the full path to the ``.dtb`` file for your device.

Dev tools
=========

Expand Down
4 changes: 4 additions & 0 deletions sys-kernel/cross-kernel-bin/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DIST 6.5.8-arm64-r1-dtbs.tar.gz 8266371 BLAKE2B 1457e7a342e96158f9ca4d38f47063aaa42db173a3d0202db290d3b2b4f465e1ae0ad8df5757ef012cfdc2c8ff0f2bf7e1a762bad1c4c7d88a77dc44b402765c SHA512 ac416fabfa630e671d48e632c21670b9cf82b6c986d81c7dbde2ece46c10725b8d1259cc58b5da747a029349503b2148c681ed14fd964707c6cad4123f032cd1
DIST 6.5.8-arm64-r1-modules.tar.gz 16350599 BLAKE2B 61619fe58aeb447a52ef1545bf49fa022044099dbbeb4a3856bdda729cdf75f700944000ff2a6c9c7737df560a2a8f2adaf090519f1896d6d9891d34555b5a8b SHA512 f6ae43e41bdf2077bf67feb3aeed8b34169963954976ecf447aab94c6e289b5e889aa8a1cd7aae97cea4d6a05a4349be6d75b67cbb0b220bc8ff66c1184a3158
DIST 6.5.8-arm64-r1.Image 41345536 BLAKE2B 03c666bb4c223cf54b7d16e4087f3433e28972d61d7e56fdcd763208222af304e0caddaba446ee27749ac30b063ccf76cf2de1ceb474a2c8216d493de4474459 SHA512 9df87f8a2f71d30998ae62431265f1fd2ef5ee8c0188ef2a6417e0789ec1addaf7938fc122af29357debd3da421e6ddf48fbccf7abc002155ea9a0928f742340
DIST config-6.5.8-arm64-r1 284498 BLAKE2B 98f1347897eaffb109842ce8270051c31a428be0f8d2acea0af9d6305e74f3c96a6cc5bfe0a328438e8efabf20ed6e09a694606546596c1a5d7ccaf4408c259f SHA512 1ebb2b2de4833de7e8100859810273fde05a10a8e57d630c7c5e771cd438f5f5fd0b115356f99af33de961ce946f81903ae5511d0116f1054a57ba92f58fd787
41 changes: 41 additions & 0 deletions sys-kernel/cross-kernel-bin/cross-kernel-bin-6.5.8-r1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

KVER_ARM64="${PV}-arm64-${PR}"

DESCRIPTION="Simple kernel bin install of image, modules, and dtbs"
HOMEPAGE="https://github.com/sarnold/arm64-mainline-linux"

BASE_URI="https://github.com/sarnold/arm64-mainline-linux/releases/download"
SRC_URI="
arm64? (
"${BASE_URI}/${KVER_ARM64}/${KVER_ARM64}.Image"
"${BASE_URI}/${KVER_ARM64}/config-${KVER_ARM64}"
"${BASE_URI}/${KVER_ARM64}/${KVER_ARM64}-modules.tar.gz"
"${BASE_URI}/${KVER_ARM64}/${KVER_ARM64}-dtbs.tar.gz"
)
"
LICENSE="GPL-2"
RESTRICT="bindist mirror test strip"
SLOT="0"
KEYWORDS="-* ~arm64"

S="${WORKDIR}"

RDEPEND="
sys-libs/zlib:0/1
"

QA_PREBUILT="*"

src_install() {
rm "${S}"/lib/modules/"${KVER_ARM64}"/{build,source}
mv "${S}"/lib "${ED}"/ || die
dodir /boot/dtbs/"${KVER_ARM64}"
mv "${S}"/* "${ED}/boot/dtbs/${KVER_ARM64}/"
cp "${DISTDIR}/${KVER_ARM64}.Image" "${ED}/boot/vmlinuz-${KVER_ARM64}"
cp "${DISTDIR}/config-${KVER_ARM64}" "${ED}/boot/"
elog "Do not forget to run dracut and/or grub-mkconfig !!"
}

0 comments on commit 941af2f

Please sign in to comment.