Skip to content
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

Updated rocm-sources ebuilds that ensures kernel files with executabl… #198

Merged

Conversation

preney
Copy link
Contributor

@preney preney commented Sep 12, 2021

This pull request addresses justxi/rocm Issue #186 with ebuilds that will install rocm-sources kernel source code preserving all files' executable attributes (e.g., .sh and .py files) so the kernel can be built.

Each ebuild is in its own SLOT so as to not interfere with other kernels. Additionally when the ebuild is removed, the files in /usr/src are left as-is. The features of the kernel-2 eclass were exploited to allow for the ROCm designation to be part of the EXTRAVERSION part of the installed name with the kernel version itself being part of the base name. For example, if one runs emerge -av rocm-sources:4.3.1 then it will be installed in /usr/src/linux-5.11.0-rocm-4.3.1 and will retain the 5.11.0-rocm-4.3.1 part of the name for built kernel files written to /boot.

To make releases for other kernels do the following:

  • copy one of the ebuild files to a new file name changing the version number appropriately, and,
  • within the new ebuild file set CKV to be the version of the kernel the ROCm kernel code is based on, i.e., see the ROCK repository's top Makefile at the top, remembering to use Gentoo conventions for the version, e.g., CKV="5.9.0_rc2". (This will cause the emitted name to have the Linux kernel version in it as well as the ebuild version information.)

I was able to build kernels for v4.3.0 and v4.3.1 and all appears to be good --except on my system there are no audio devices. (After some web searching, this may well kernel 5.11 issue.) I suspect since I run Gentoo testing ~amd64, I am unable to build the kernels before v4.3.0 due to arch/x86/entry/thunk_64.o: warning: objtool: missing symbol table and similar errors even using GCC v8. (That said, some time ago I was able to build v4.1.0 --so an update to a tool, e.g., binutils might be triggering this issue. Others may well be able to build these kernels.)

…e attributes

remain (e.g., so "make menuconfig" etc. will work). (These ebuilds make use of the
kernel-2 eclass.) Each ebuild exists in its own slot and when the ebuild is
removed no files are deleted from /usr/src (i.e., which is the same behaviour
of gentoo-sources).

To use with other kernels, simply copy the ebuild renaming the file's
version and set CKV in the ebuild file to be the actual kernel release
of the repository. The latter can be found at the top of the repository's
root Makefile. Use Gentoo conventions for formatting such, e.g., 5.9.0_rc2.
@preney
Copy link
Contributor Author

preney commented Sep 12, 2021

Hmmm I missed adding # Copyright 2021 Gentoo Authors for the copyright at the top of each ebuild.

@justxi justxi merged commit 1a064e5 into justxi:master Sep 12, 2021
@justxi
Copy link
Owner

justxi commented Sep 12, 2021

Ok, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants