Making an Intergalactic Libre-Kernel For Trisquel 12
- Inicie sesión o regístrese para enviar comentarios
Making an Intergalactic Libre-Kernel For Trisquel 12
Good for space travellers...
https://linux-libre.fsfla.org/pub/linux-libre/releases/
sudo apt install build-essential libncurses-dev bison libssl-dev libelf-dev fakeroot dwarves flex -y
tar -xf linux-libre-5.15.175-gnu.tar.xz
cd linux-5.15/
cp -v /boot/config-$(uname -r) .config
make olddefconfig
make localmodconfig
scripts/config --disable SYSTEM_TRUSTED_KEYS
scripts/config --disable SYSTEM_REVOCATION_KEYS
scripts/config --set-str CONFIG_SYSTEM_TRUSTED_KEYS ""
scripts/config --set-str CONFIG_SYSTEM_REVOCATION_KEYS ""
make MENUCONFIG_COLOR=blackbg menuconfig
make -j$(nproc) && make modules && make modules_install && make headers_install && make install && sync && sudo shutdown now
(kernel actually broke, because I was running the screen recorder and a video at the same time I was using all my cpu cores to compile and build the libre-linux kernel, but the configuration should actually be fine...I made it specifically for an intel processor, so if you have amd you will have to tick the amd options, and otherwise the configuration should work for anybody)
video link: https://rumble.com/v6xhgu4-making-an-intergalactic-libre-kernel-for-trisquel-12.html
you can download it like this...
sudo apt install yt-dlp && yt-dlp https://rumble.com/v6xhgu4-making-an-intergalactic-libre-kernel-for-trisquel-12.html
(needs some work arounds to make it more libre friendly, the standard commands for building the kernel like olddefconfig localmodconfig make it a really fast and trivial process to build the kernel trimmed down, for like a gaming or high performance system, but definitely alter the default trisquel config, away from it's libre-kernel roots, similarly to a default linux kernel)
edit... update
So apprently this kernel configuration I demonstrate in the video actually totally breaks the kernel, and after a couple hours of playing around with it, I have no idea what it is that broken it. I build the kernel all the time for fun, and to learn more about everything, so as far as I know, from experience, it should be fine, but I unchecked some option that actually broke it in the end, and rebuilt it with an older Libre_6.12 config I made, and the intergalactic kernel is working fine... anyways, maybe I rushed to make the video, but I was just having fun.
If I ever manage to figure out how to make it libre-friendly I'll make another guide, a quick fix to do so, if anyone is interested is, I think, to simply avoid using the make olddefconfig, make localmodconfig, or any of the make *config* type commands, and stick with the libre-config that comes standard with trisquel, and let it configure hardware, then you can simply tweak the other areas for fun : D
edit... last update
possibly just avoid using make olddefconfig, and stick with make localmodconfig, and use a libre-kernel tarball that matches the version trisquel ships, and you should be good to go... (to use localmodconfig, attach, load, all the hardware you intend to use with the kernel in the future, so the kernel loads any modules that might otherwise be missing, before running make localmodconfig)
You need not build Linux-libre yourself. Jason Self kindly does it for us. He indeed administrates an APT repository with the latest LTS and STS Linux-libre kernels: https://www.fsfla.org/ikiwiki/selibre/linux-libre/freesh
Ok, thanks for the info, I haven't tried that yet.
Now I think the proper way to do this, and keep the libre-kernel, libre
is to use trisquels Kconfig (config-6.8.0-71-generic) and to download the corresponding
tarball from fsfla, for trisquel 12, it comes with 6.8, so in order to keep the same config,
we can use only make localmodconfig. Otherwise you will start turning on support for all sorts
of wild stuff... so the commands look like this. These are the basic commands for building a custom kernel on an Ubuntu type OS... slightly modified to keep things libre : D
https://linux-libre.fsfla.org/pub/linux-libre/releases/
sudo apt install build-essential libncurses-dev bison libssl-dev libelf-dev fakeroot dwarves flex -y
tar -xf linux-libre-6.8-gnu.tar.xz
cd linux-6.8/
cp -v /boot/config-$(uname -r) .config
make localmodconfig
scripts/config --disable SYSTEM_TRUSTED_KEYS
scripts/config --disable SYSTEM_REVOCATION_KEYS
scripts/config --set-str CONFIG_SYSTEM_TRUSTED_KEYS ""
scripts/config --set-str CONFIG_SYSTEM_REVOCATION_KEYS ""
make MENUCONFIG_COLOR=blackbg menuconfig
make -j$(nproc) && make modules && make modules_install && make headers_install && make install && sync && sudo shutdown now
we can use only make localmodconfig. Otherwise you will start turning on support for all sorts of wild stuff.
make localmodconfig is a great starting point to configure a kernel. It sets the support for everything currently connected to your computer. Nevertheless, unless your objective is to learn, you probably want jxself's packaged kernels, which are easily installed using significantly less time and energy (does it still take hours to build a kernel nowadays?) and that APT will update whenever new versions are released.
Precompiled kernels such as jxself's are usually configured so that they support as much hardware as possible (that is welcome when you plug a new device) and so that the support for unused hardware does not require more main memory or entail longer boot times. Indeed that support is not compiled in the kernel image but in modules that the kernel only loads when the related hardware is connected. For instance, Trisquel 11's default kernel comes along 6008 modules taking ~450 MB of disk space:
$ find /lib/modules/5.15.0-151-generic/ -type f -iname '*.o' -or -iname '*.ko' | wc -l
6008
$ du -hs /lib/modules/5.15.0-151-generic/
449M /lib/modules/5.15.0-151-generic/
Unless we are talking about an embedded system with little disk space, saving a few hundreds of hundreds of MB on the disk is usually not worth the time and energy to manually configure and build a kernel.
Yes I am trying to learn more about it, and I think building our own custom kernel is essential activity...
I'm in the power user category of Trisquel GnuLinux users, so I'm interested in learning about, playing around with, everything there is...
The guide here uses make oldconfig...
https://trisquel.info/en/wiki/compiling-gnu-linux-libre-kernel
My problem is now, that typically on other distributions, it's very simple, to use the built-in facilities to quickly configure/build a custom kernel. Using make locamodconfig reduces the time to build the kernel to only 10-15 minutes, plus, the libre-kernel, is already trimmed down like 30% compared to the vanilla kernel. So by default it already takes 30% less time to configure/build.
So now I want to know, how to preserve the libre-linux alterations, without activating any non-free bits, using the typical facillities (make) for configuring/building the kernel.
user@pc:~$ find /lib/modules/6.8.0-59-generic/ -type f -iname '*.o' -or -iname '*.ko' | wc -l
6468
user@pc:~$ du -hs /lib/modules/6.8.0-59-generic/
578M /lib/modules/6.8.0-59-generic/
user@pc:~$ find /lib/modules/6.12.0-gnu.Intergalactic/ -type f -iname '*.o' -or -iname '*.ko' | wc -l
178
user@pc:~$ du -hs /lib/modules/6.12.0-gnu.Intergalactic/
18M /lib/modules/6.12.0-gnu.Intergalactic/
So now, the kernel I built with make olddefconfig (to update values from trisquels default config to support the changes between 6.8-6.12) and make localmodconfig reduced the size
of the modules directory from 578Mb to 18MB, but when you use make olddefconfig it's like running a non-free program and starts activating all sorts of wild stuff, modifying the configuration like a vanilla kernel...
Anyways so I'm trying to figure this out, how to alter the standard build process just to keep things libre.
I want to know, how to preserve the libre-linux alterations, without activating any non-free bits, using the typical facillities (make) for configuring/building the kernel.
As https://www.fsfla.org/ikiwiki/selibre/linux-libre/ explains:
GNU Linux-libre is a project to maintain and publish 100% Free distributions of Linux, suitable for use in Free System Distributions, removing software that is included without source code, with obfuscated or obscured source code, under non-Free Software licenses, that do not permit you to change the software so that it does what you wish, and that induces or requires you to install additional pieces of non-Free Software.
From the sources the Linux-libre project releases, you only build kernels with no non-free bit.
Okay So I figured out what went wrong, for some strange reason when I was using make localmodconfig the support for my harddrive (nvme - under block devices) was being turned from a module(default) to completely off.
So in order to keep things libre I think the instructions still stand, but in that specific case, of having an nvme type drive at least, there is a bug. And simply turning that on after make localmodconfig turns it off, fixes the problem...
edit.
So I've tried building it now, using the trisquel default config, a similar libre-linux kernel, (6.8 for trisquel 12) and just make localmodconfig a few times, and it's just totally broken.. typically I build it all the time like in the first posts instructions-> make olddefconfig make localmodconfig make menuconfig, and it works every time without issues. The kernel I built in the video was made like that too, so I dont know what's happening, but apparently running make localmodconfig is making weird dramatic changes that break everything... I literally just went through this same process with trisquel 12 weeks ago, and everything was working great, then after the latest updates, I can't get it working anymore
another edit...
(might be relevant, there appears to be some major issue in Ubuntu Noble related to the kernel(called linux))
https://discourse.ubuntu.com/t/hard-drive-not-available-when-newly-installed-kernels-boot/65943/10
(I'm only loosely following this issue atm because I'm busy doing other things right now)
(...I've also upgraded to trisquel 11(jammy) now https://trisquel.info/en/forum/making-intergalactic-libre-kernel-trisquel-11)(dont have a testing station for 12(noble) set up atm)
make localmodconfig a few times, and it's just totally broken.
Do you actually have an existing .config file in the working directory? make localmodconfig uses that file and the currently loaded modules to generate a configuration.
Hi magic, so I spent the last two days, trying to get a working libre-kernel on trisquel 12, so now I've moved on to effectively upgrading to trisquel 11...
Can you see my videos? I recorded myself building the libre-kernel from start to finish on both trisquel 11/12
https://rumble.com/v6xjkb2-making-an-intergalactic-libre-kernel-for-trisquel-11.html
https://rumble.com/v6xhgu4-making-an-intergalactic-libre-kernel-for-trisquel-12.html
It appears to me, that recent updates to trisquel 12, have broken this standard procedure, for me, because using the exact same procedure prior to the latest updates, maybe only a week or two ago, I had no issues.
(the videos are uploaded with a free license (called "personal" license on rumble)(so im not actually sure if people can see them, it says, theyre not searchable, but I assume I can give links to people)
if you dont like proprietary websites, you can download the video's like this...
sudo apt install yt-dlp && yt-dlp https://rumble.com/v6xjkb2-making-an-intergalactic-libre-kernel-for-trisquel-11.html && yt-dlp https://rumble.com/v6xhgu4-making-an-intergalactic-libre-kernel-for-trisquel-12.html
Basically I had no problems building on 11, and had no problems on 12, until only very recently, around the time I wanted to make a video for it.
I can see you did copy the configuration file to the working directory.
Looks like theyre making changes to the kernel in the upstream, but I haven't been able to figure out all the changes yet...
https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890
Now we've had 3 point releases already, and presumeably anyone that auto-updates ubuntu packages, has gotten all of those updates.