I've been building and installing the kernel (via a script) from sys-kernel/gentoo-sources thus far for a somewhat odd embedded powerpc architecture. Installing isn't so bad, but it requires somewhat manual cleanup of /boot and /lib/modules from time to time. I would also like to be able to utilize the binpkg facilities of sys-kernel/gentoo-kernel, if possible. I've attached a few diffs in order to treat ppc like arm for easy kernel building on embedded ppc platforms. It would be great if this can be included going forward. I'm currently on kernel 5.10 as 5.11 introduced some issues with wifi card region issues on atheros cards in ap mode. I haven't re-tested since early 5.11 builds. I currently build a uImage from sys-kernel/gentoo-sources, but I may be able to boot a self-extracting vmlinux directly (not yet tested). Otherwise, I'll need to devise a yet to be written post-install ebuild command to convert a vmlinux to a uImage... If this already exists somewhere, please let me know! Reproducible: Always --- /mnt/btrfs-root/@repos/gentoo/sys-kernel/gentoo-kernel/gentoo-kernel-5.10.39.ebuild 2021-05-22 15:39:35.000000000 -0400 +++ /mnt/btrfs-root/@repos/e500v2/sys-kernel/gentoo-kernel/gentoo-kernel-5.10.39.ebuild 2021-05-25 16:58:38.871958940 -0400 @@ -38,9 +38,11 @@ S=${WORKDIR}/${MY_P} LICENSE="GPL-2" -KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" IUSE="debug" -REQUIRED_USE="arm? ( savedconfig )" +REQUIRED_USE=" + arm? ( savedconfig ) + ppc? ( savedconfig )" RDEPEND=" !sys-kernel/gentoo-kernel-bin:${SLOT}" @@ -53,6 +55,7 @@ local PATCHES=( # meh, genpatches have no directory "${WORKDIR}"/*.patch + "${FILESDIR}"/*.patch ) default @@ -67,6 +70,9 @@ arm64) cp "${DISTDIR}/kernel-aarch64-fedora.config.${CONFIG_VER}" .config || die ;; + ppc) + return + ;; ppc64) cp "${DISTDIR}/kernel-ppc64le-fedora.config.${CONFIG_VER}" .config || die ;; --- /mnt/btrfs-root/@repos/gentoo/virtual/dist-kernel/dist-kernel-5.10.39.ebuil2021-05-22 15:39:35.000000000 -0400 +++ /mnt/btrfs-root/@repos/e500v2/virtual/dist-kernel/dist-kernel-5.10.39.ebuil2021-06-07 11:39:42.342841875 -0400 @@ -9,7 +9,7 @@ LICENSE="" SLOT="0/${PV}" -KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" RDEPEND=" || (
Didn't realize this line was still in until posting. Feel free to omit as I can overlay specific powerpc-spe patches through other supported portage mechanisms. local PATCHES=( # meh, genpatches have no directory "${WORKDIR}"/*.patch + "${FILESDIR}"/*.patch ) default
Package list is empty or all packages have requested keywords.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87154942884b817ccb5062be7185b1058411c755 commit 87154942884b817ccb5062be7185b1058411c755 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2021-12-16 20:56:28 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2021-12-16 21:45:34 +0000 virtual/dist-kernel: keyword 5.15.8 for ~ppc Bug: https://bugs.gentoo.org/794799 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> virtual/dist-kernel/dist-kernel-5.15.8.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d6986205d23d8af32850b82b99a4c8bd62630776 commit d6986205d23d8af32850b82b99a4c8bd62630776 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2021-12-16 20:55:59 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2021-12-16 21:45:33 +0000 sys-kernel/gentoo-kernel: keyword 5.15.8 for ~ppc Bug: https://bugs.gentoo.org/794799 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> sys-kernel/gentoo-kernel/gentoo-kernel-5.15.8.ebuild | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1b02758164baf3f42801d29c4ae5de47efe32b0 commit e1b02758164baf3f42801d29c4ae5de47efe32b0 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2021-12-16 20:54:56 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2021-12-16 21:45:33 +0000 kernel-install.eclass: add ppc(32) support Bug: https://bugs.gentoo.org/794799 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> eclass/kernel-install.eclass | 9 +++++++++ 1 file changed, 9 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a632e2f5848755b7eb7b394d4dc760207a43fe3b commit a632e2f5848755b7eb7b394d4dc760207a43fe3b Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2021-12-16 21:02:48 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2021-12-16 21:45:32 +0000 dist-kernel-utils.eclass: add ppc(32) support Bug: https://bugs.gentoo.org/794799 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> eclass/dist-kernel-utils.eclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f22e54f0601c3b6b58cfb286c3875a57c74c1320 commit f22e54f0601c3b6b58cfb286c3875a57c74c1320 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2021-12-16 20:54:24 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2021-12-16 21:45:31 +0000 dev-util/pahole: keyword 1.22 for ~ppc Bug: https://bugs.gentoo.org/794799 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> dev-util/pahole/pahole-1.22.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sorry for taking so long. added, USE=savedconfig is not in required use, but is forced via profiles. default config is for powermac from kernel itself and works on qemu mac99,via=pmu machine just fine. it will save it as savedconfig first time you use it, but ofc you can pre-populate it.
Thanks for your effort! gentoo-kernel is building without issue. It is certainly nice to be able to leverage binpkg! As discussed on IRC, gentoo-kernel populates an uncompressed vmlinux in /boot that needs to be wrapped as a uimage for uboot platforms. As suggested, I've been iterating on a trivial uimage kernel wrapping script in /etc/kernel/postinst.d. Feel free to peek at the current postinst.d script here: https://github.com/lmchale/uImage-eselect/blob/main/90-uImage.install The kernel source provides a reliable ppc uimage wrapping script in: arch/powerpc/boot/wrapper (https://elixir.bootlin.com/linux/v5.10.88/source/arch/powerpc/boot/wrapper). However, this does not exist in the /usr/src/<kver> directory deployed by gentoo-kernel, but does exist in gentoo-sources. Depending on the platform, this script also may rely on object files generated in arch/powerpc/boot. Is it possible to preserve the arch/powerpc/boot directory? If not, the above postinst.d script is a workable solution. Followed up just in-case there is interest in generalizing the postinst.d uboot script.
Thanks, will check out. Yes we can preserve more files if there’s real value ofc, I’ll look at it too, thanks for suggestion.