Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 783069 - =sys-kernel/gentoo-kernel-9999: new package version request
Summary: =sys-kernel/gentoo-kernel-9999: new package version request
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Default Assignee for New Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-16 03:06 UTC by Kenneth G. Strawn
Modified: 2021-04-24 17:30 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Shell script to work around this bug (distupgrade,674 bytes, application/x-shellscript)
2021-04-16 03:06 UTC, Kenneth G. Strawn
Details
Shell script to work around this bug (distupgrade.sh,672 bytes, text/plain)
2021-04-16 03:24 UTC, Kenneth G. Strawn
Details
Systemd service to delete old kernels on boot (eclean-kernel.service,250 bytes, text/plain)
2021-04-16 03:26 UTC, Kenneth G. Strawn
Details
My kernel configuration (kernel.config,230.55 KB, text/plain)
2021-04-19 19:27 UTC, Kenneth G. Strawn
Details
Ebuild that gives users this option (auto-git-sources-5.12_rc8.ebuild,1.40 KB, text/plain)
2021-04-19 19:59 UTC, Kenneth G. Strawn
Details
Add separate sys-kernel/auto-git-sources package (auto-git-sources-5.12_rc8.ebuild,1.88 KB, text/plain)
2021-04-19 20:41 UTC, Kenneth G. Strawn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth G. Strawn 2021-04-16 03:06:44 UTC
Created attachment 700035 [details]
Shell script to work around this bug

Unlike on other distributions with binary kernel packages that update the kernel automatically, running `emerge -uDNU @world` doesn't automatically trigger genkernel when a new kernel sources package is installed. I added a shell script as a temporary workaround, but adding post-installation triggers to all sys-kernel/<X>-sources packages to automatically set the new kernel sources and run genkernel post-merge would be a better move going forward.

The attached shell script, for the record, also runs dracut as a callback instead of applying the 'all' option to genkernel because unlike genkernel's built-in initramfs generator, dracut supports Plymouth. Adding a configuration option to genkernel.conf to automatically run such a callback by default would also be a good idea, but that's something for another bug report entirely.
Comment 1 Kenneth G. Strawn 2021-04-16 03:24:13 UTC
Created attachment 700044 [details]
Shell script to work around this bug

Updating the script to make the intention even clearer re: what I eventually want Portage to do by default whenever new kernel sources are installed.
Comment 2 Kenneth G. Strawn 2021-04-16 03:26:25 UTC
Created attachment 700047 [details]
Systemd service to delete old kernels on boot

One of the downsides to automatic kernel updates is that it clutters /boot with a lot of old kernels; this solves that problem.
Comment 3 Thomas Deutschmann (RETIRED) gentoo-dev 2021-04-16 09:07:32 UTC
I leave this for bug wranglers to figure out what to do with this bug but just a few comments:

Your proposed solution/idea will fit your specific use case but doesn't fit a general use case. For example, not everyone wants to upgrade immediately, not everyone wants to cleanup previous kernel immediately. Also, why are you using genkernel *and* dracut?

For your use case you better try something like sys-kernel/gentoo-kernel which should do already what you proposed.
Comment 4 Kenneth G. Strawn 2021-04-17 16:55:34 UTC
(In reply to Thomas Deutschmann from comment #3)
> Also, why are you using genkernel *and* dracut?

Because genkernel builds kernel images and dracut doesn't while dracut supports Plymouth and genkernel doesn't.
Comment 5 Mike Gilbert gentoo-dev 2021-04-19 18:27:27 UTC
I doubt this is something we would actually want to implement in pkg_postinst.

I am assigning this to the kernel team since they maintain the kernel source packages and this request specifically says "after kernel sources upgrade".

Also copying dist-kernel since this overlaps with their work.
Comment 6 Thomas Deutschmann (RETIRED) gentoo-dev 2021-04-19 19:11:02 UTC
(In reply to Kenneth G. Strawn from comment #4)
> Because genkernel builds kernel images 

This is what sys-kernel/gentoo-kernel is about.
Comment 7 Kenneth G. Strawn 2021-04-19 19:14:35 UTC
(In reply to Thomas Deutschmann from comment #6)
> (In reply to Kenneth G. Strawn from comment #4)
> > Because genkernel builds kernel images 
> 
> This is what sys-kernel/gentoo-kernel is about.

It's an older version than that produced by compiling from git-sources. Running dracut as a callback to genkernel and using "kernel" instead of "all" (i.e. tell genkernel to build the kernel but NOT the initrd) allows both newer kernels AND Plymouth support.
Comment 8 Thomas Deutschmann (RETIRED) gentoo-dev 2021-04-19 19:27:30 UTC
You have a specific request which you have to address on your own. I see nothing Gentoo can do for you. Well, actually we have solved your problem already:

Like said, gentoo-kernel package is doing what you want. If you want to use different sources, either try to use user patch feature to patch sources the way you want it or get familiar with kernel-build eclass to write an own ebuild for your custom sources.

And you could even write an ebuild utilizing genkernel and dracut.
Comment 9 Kenneth G. Strawn 2021-04-19 19:27:45 UTC
Created attachment 700899 [details]
My kernel configuration

Another potential problem with sys-kernel/gentoo-kernel: if it's the same kernel as what's on the LiveCD, that means it's configured to support a *much* smaller range of hardware and features than mine.
Comment 10 Kenneth G. Strawn 2021-04-19 19:33:59 UTC
(In reply to Thomas Deutschmann from comment #8)
> 
> And you could even write an ebuild utilizing genkernel and dracut.

I've already written a Catalyst .spec file doing just that which is attached to bug 784218. The use of dracut however is something another dev brought up which is completely beside the point of this bug ― the point of this bug is to patch the sources ebuilds so that they automatically build the kernel on kernel upgrade in other areas. Since that would interfere with my use-case, however, marking this invalid because it could break a lot of things including Catalyst.
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-04-19 19:40:32 UTC
(In reply to Kenneth G. Strawn from comment #9)
> Another potential problem with sys-kernel/gentoo-kernel: if it's the same
> kernel as what's on the LiveCD, that means it's configured to support a
> *much* smaller range of hardware and features than mine.

It's not.  It's based mostly on the configs Fedora is using, and I haven't had any reports of hardware support missing in it.
Comment 12 Thomas Deutschmann (RETIRED) gentoo-dev 2021-04-19 19:56:19 UTC
Keep in mind that you can pass your custom kernel.config to any ebuild using kernel-build eclass via savedconfig feature (see USE=savedconfig).
Comment 13 Kenneth G. Strawn 2021-04-19 19:59:45 UTC
Created attachment 700905 [details]
Ebuild that gives users this option

Reopening now that I found a solution
Comment 14 Kenneth G. Strawn 2021-04-19 20:02:42 UTC
(In reply to Michał Górny from comment #11)
> (In reply to Kenneth G. Strawn from comment #9)
> > Another potential problem with sys-kernel/gentoo-kernel: if it's the same
> > kernel as what's on the LiveCD, that means it's configured to support a
> > *much* smaller range of hardware and features than mine.
> 
> It's not.  It's based mostly on the configs Fedora is using, and I haven't
> had any reports of hardware support missing in it.

Good to know. My config is based on Arch's which also supports a lot more hardware than the Gentoo live media default ― *and* also supports /proc/config.gz on top of that.
Comment 15 Thomas Deutschmann (RETIRED) gentoo-dev 2021-04-19 20:17:38 UTC
(In reply to Kenneth G. Strawn from comment #13)
> Created attachment 700905 [details]
> Ebuild that gives users this option
> 
> Reopening now that I found a solution

Please read genkernel man page. --kernel-config can read from /proc/config.gz already out-of-the-box. Your proposed solution has also disadvantages regarding current Gentoo solutions: For example, user will be unable to make kernel.config changes because you are always reading from current running kernel.

Anyway, last comment before I will leave this bug: You want to read about https://wiki.gentoo.org/wiki/Handbook:X86/Portage/Advanced#Hooking_in_the_emerge_process
Comment 16 Kenneth G. Strawn 2021-04-19 20:36:34 UTC
(In reply to Thomas Deutschmann from comment #15)
> Your proposed solution has also
> disadvantages regarding current Gentoo solutions: For example, user will be
> unable to make kernel.config changes because you are always reading from
> current running kernel.

That's exactly why I created a new ebuild instead of patching an already-existing one. If merged into the tree correctly, users would be able to choose between auto-git-sources which automatically builds using src_postinst and plain git-sources which doesn't. Going to attach a tree patch that makes this ebuild its own separate package to make this choice clear
Comment 17 Kenneth G. Strawn 2021-04-19 20:41:48 UTC
Created attachment 700929 [details]
Add separate sys-kernel/auto-git-sources package

Fixing some ebuild issues, including pulling in Arch's default kernel configuration when auto-building for the first time instead of using the already-running kernel's configuration.
Comment 18 Thomas Deutschmann (RETIRED) gentoo-dev 2021-04-19 20:49:13 UTC
The current ebuild draft violates Gentoo's package standards (QA).

Personally I believe this is a specific solution for a specific problem and doesn't belong into Gentoo repository.

But maybe you will find a developer who will proxy you...

Kernel project is not interested in your proposed solution, sorry. Kernel project out.
Comment 19 Kenneth G. Strawn 2021-04-23 17:06:35 UTC
I wonder if a 9999 version of sys-kernel/gentoo-kernel would be possible. That would definitely solve this problem.
Comment 20 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2021-04-24 17:30:43 UTC
gentoo-kernel is maintained by the dist-kernel team, we are not interested in the 9999 version. I am sorry.