How to compile latest, stable Linux Kernel for Remastered FatDog?

versatile 64-bit multi-user Linux distribution

Moderators: kirk, jamesbond, p310don, JakeSFR, step, Forum moderators

Post Reply
Neo_78
Posts: 368
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 200 times
Been thanked: 9 times

How to compile latest, stable Linux Kernel for Remastered FatDog?

Post by Neo_78 »

I would like to use the latest, stable Linux kernel 6.0.3 with a remastered FatDog64:

https://kernel.org/

Regarding the use of a different kernel, the documentation states the following:

https://distro.ibiblio.org/fatdog/web/faqs/kernel.html

"This instruction is for using one of the pre-packaged Fatdog kernels, replacing the current one that comes with your version of Fatdog. If instead, you just want to add some additional kernel modules you've built yourself; or if you compile a totally new kernel, please follow the instructions in here to rebuild and replace the kernel-modules.sfs in initrd."

If I see this correctly, the latest pre-compiled kernel that is aivailable for FatFog is vmlinuz-5.19.14, right?

https://distro.ibiblio.org/fatdog/kernels/810/

This means that I would have to compile 6.0.3 myself, correct?

So the guide mentioned in the docs is the following one:

https://distro.ibiblio.org/fatdog/web/faqs/initrd.html

Correct me if I am wrong, but this only explains kernel module replacement but does not seem to describe the complete kernel compilation process on its own.

Could you guide me how to approach this?

Thank you! :thumbup:

jamesbond
Posts: 577
Joined: Tue Aug 11, 2020 3:02 pm
Location: The Pale Blue Dot
Has thanked: 86 times
Been thanked: 307 times

Re: How to compile latest, stable Linux Kernel for Remastered FatDog?

Post by jamesbond »

There is nothing special about Fatdog kernel build process. It's just standard kernel compilation process, of which there are many guides on the Net. Basically, get the kernel tarball, unpack it, patch it with aufs, and apply the kernel config.

Fatdog's running kernel config file is always available in /proc/config.gz and you can use this as a starting point for your own build. We tweak the config file when we upgrade to a major kernel release (5.4.xx, 5.10.xx, etc) but usually keep it as is for minor releases unless there is a need to do it otherwise.

The difference about our kernel build compared to others is the packaging: what we do after the kernel is finished. The kernel itself has no need for packaging (just rename from bzImage to vmlinuz), it's only the modules and the firmware that needs to be packaged into an SFS file.

If you really want to have a taste of how to build kernels for Fatdog, my best advice is to download one of the many Fatdog kernel source SFS-es (aptly named as kernel-source-xxx.sfs). Get it, load the SFS, go to /usr/src/linux-XXX and then try to compile it. You don't even have to worry about patching aufs, as it is already patched in. Try to build it and see if you can finish the process.
(If you do finish it, don't follow the guide to "install" it, as Fatdog operates differently and you can't install it the way other guides tell you to do).

Neo_78
Posts: 368
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 200 times
Been thanked: 9 times

Re: How to compile latest, stable Linux Kernel for Remastered FatDog?

Post by Neo_78 »

Thanks @jamesbond.

I have a couple of questions if you don't mind.

For instance having a look at the first kernel compilation tutorial search result that you shared:

https://phoenixnap.com/kb/build-linux-kernel

Are the required packages already present in FatDog (sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison)?

Can you compile a kernel if you run FatDog in RAM-only mode and you don't have it installed on a hard drive?

Regarding your recommendation, just to clarify: do you suggest to compile a pre-built source file, e.g. kernel-source-5.19.14.sfs, as a test run?

Thanks for your feedback! :thumbup2:

jamesbond
Posts: 577
Joined: Tue Aug 11, 2020 3:02 pm
Location: The Pale Blue Dot
Has thanked: 86 times
Been thanked: 307 times

Re: How to compile latest, stable Linux Kernel for Remastered FatDog?

Post by jamesbond »

Neo_78 wrote: Thu Oct 27, 2022 9:10 pm

Are the required packages already present in FatDog (sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison)?

They're all in devx. If you load the devx SFS then you'll have all of them.

Follow step 1, 2, 4, 5.1
Don't run step 5.2 (make modules_install) etc onwards - that's the installation process.
We only want to try to build it at this time; we can cover the installation process later.

Can you compile a kernel if you run FatDog in RAM-only mode and you don't have it installed on a hard drive?

If you have enough RAM.

Regarding your recommendation, just to clarify: do you suggest to compile a pre-built source file, e.g. kernel-source-5.19.14.sfs, as a test run?

Yes, pick up any version you want to use (even older ones are okay - because you're only practising).
In comparison with the guide you linked, by using those prepackaged SFS, you skip Step 1 and 2 (and the step they don't include there - aufs patching), so you can go straight to Step 4 and 5.1.
Once you are confident enough, you can do Step 1 and 2 on your own, downloading from kernel.org as you wish.

Neo_78
Posts: 368
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 200 times
Been thanked: 9 times

Re: How to compile latest, stable Linux Kernel for Remastered FatDog?

Post by Neo_78 »

Thanks a lot for your detailed guidance @jamesbond. Let me try that and I'll get back... :thumbup2:

Neo_78
Posts: 368
Joined: Wed Dec 29, 2021 10:45 pm
Has thanked: 200 times
Been thanked: 9 times

Re: How to compile latest, stable Linux Kernel for Remastered FatDog?

Post by Neo_78 »

Another question if you don't mind @jamesbond:

From your experience, how much space is required to compile the Linux kernel for FatFog?

Some users report temporary file sizes of 22GB (depending on the distribution):

https://superuser.com/questions/130381/ ... -is-needed

That would clearly exceed my available RAM size to compile it in memory only.

As I do not have a hard drive and I boot FatDog from DVD into RAM, would it be possible to simply connect a sufficiently large USB pendrive and compile it on that pendrive? Could I simply let the USB drive auto-mount or would it have to be mounted and formatted in a specific way?

Thanks for your advice! :thumbup2:

User avatar
Duprate
Posts: 298
Joined: Sat Aug 22, 2020 8:14 pm
Location: Southern Brazil
Has thanked: 147 times
Been thanked: 102 times

Re: How to compile latest, stable Linux Kernel for Remastered FatDog?

Post by Duprate »

Good morning, Neo_78! You can use Ozsul's kernels, which also does a great job! https://forum.puppylinux.com/viewtopic. ... 0e424190cb
Try it you will like it! :thumbup:
I previously, in the past years, really wanted to compile my own kernel, but the application of the AUFS package was something "obscure" that nobody taught. I was also in a bad mood to learn.... :mrgreen:
So I started to think "outside the box" and migrated all my systems to Overlayfs! When you have the necessary conditions (hardware), you can also compile the kernel. You don't need to be a master programmer. in a next post, I'll give you the basic commands that I've been using for a while and that works for me! Now if you need AUFS, you'll need to talk to someone who understands.....
Good luck! :thumbup2:

jamesbond
Posts: 577
Joined: Tue Aug 11, 2020 3:02 pm
Location: The Pale Blue Dot
Has thanked: 86 times
Been thanked: 307 times

Re: How to compile latest, stable Linux Kernel for Remastered FatDog?

Post by jamesbond »

@Neo_78

Code: Select all

# du -sh linux-5.19.17
3.7G	linux-5.19.17

@Duprate
It's not a secret. Here is the instructions for 6.0.x kernel, straight from the author of aufs.

Post Reply

Return to “FatDog64”