General question about handling manually compiled packages

Hi all!

I am willing to learn compiling kernel and also some packages on my own. I have learnt somewhat about PKGBUILD, so that's not what I want to ask now.

The question is, if I compile and install packages manually, how can I manage their updates?

To make my question more clear, mainly I want to understand what hardware needs what and debloat unnecessary things (for example, there are so many iwlwifi drivers in the kernel, but I want to get rid of every unwanted ones). But if I get an update, they add again those junk, and if I add them to ignored packages I would lose the updates. Is there a way to have a patch on what changes should be on every update (like if I can have a patch to PKGBUILD and that patch would remain on every update)?

Since there are some people here who compile kernels on their own, I would like to know how they handle it.

Thanks. :slight_smile:

1 Like

I just follow this to compile my kernel. I like have the latest from kernel.org, not waiting for an Arch update.
Kernel/Traditional compilation - ArchWiki

For example, I use right now the latest bleeding edge 5.14.rc3, instead of 5.13.5.

2 Likes

Even if you manually build packages, I would recommend creating a PKGBUILD and building them that way. That way you can handle dependencies properly and the system knows they are installed.

3 Likes

For compiling kernels the Gentoo wiki is also a great ressource:
https://wiki.gentoo.org/wiki/Kernel/Configuration

As for updates, GitHub notifications for new software updates has proven to be a good way to get notified about updates - once a PKGBUILD has been written properly its only a matter of changing the version and updating checksums to get going :slight_smile:

3 Likes

So having newer version than Arch is what the trick I was looking for. Thanks for your replies.

I will follow the links and try to create my own PKGBUILDs :slight_smile:

If you have your own version of package that is in the Arch repos and want to maintain it yourself longterm I wouldn't recommend fighting a version battle.

Instead, use provides and conflicts in your PKGBUILD. In other words, if you want to build your own version of gcc, you can call your package gcc-se and have it provide gcc and conflict with gcc. The fact that it provides gcc means it will satisfy other packages dependent on gcc. Having it conflict means it won't allow gcc-se and gcc to be installed at the same time which will avoid conflicts in the filesystem.

3 Likes

OK. Thanks :smiley: I read about provides in Archwiki but that didn't come to my mind for this.

1 Like

I don't know about or build my own kernels, but maybe what you are looking for is not exactly "building your own kernel".
AFAIK when installing a kernel, it is installed in the filesystem as a package with all provided modules/drivers. Then there is a pacman hook that builds the actual/local kernel image which is then installed and used at /boot/.
Depending on the order of mkinitcpio.conf HOOKS and the placement of autodetect in this array, the final/working kernel image is filled with the required modules to boot your specific/own HW. Not everything is installed in the final image. (Edit: all the rest of the skipped modules are added in the fallback kernel image). Also, IIRC some modules from firmware package are added (which are not in the kernel package, but I am not sure about that.

If it's about saving disk space is different from learning how to compile a kernel.
So it's about doing what you want/need :wink:

I hope others correct my mistaken perceptions, so I keep learning :grinning_face_with_smiling_eyes:

3 Likes

Actually I got this idea by looking in my PinePhone. There there is nothing related to Intel, NVIDIA, AMD, etc. (AFAIK, at least no such files). So I thought that it's possible. I also want to learn how compiling works in Arch so that I can understand much about hardware, I'll maybe find out if it serves this purpose also or not :slightly_smiling_face:

3 Likes

I suppose the kernels used on Pinephone are not the same we use from arch repos. They are arm-aimed and probably the developers have already filtered the contents to the arm-specific HW. :man_shrugging:

This sounds like a good plan/target!!

4 Likes

Exactly. That's what I want, a kernel not from Arch repo but compiled on my own.

And

This is I am interested in learning. I think it's a long run, but I'm happy to start learning :grin:
To get started, I'll pick a PKGBUILD from AUR (maybe cacule) and try to tweak. Maybe not get very deep in source code now (I don't know all the programming languages, just try setting/unsetting variables in PKGBUILDs and looking for files and removing, etc.)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.