You are not logged in.

#51 2018-10-17 22:08:03

sleekmason
Member
Registered: 2018-05-22
Posts: 189

Re: How To - Kernel Compile With Custom Options

Linux Kernel version 4.19 should go stable at the beginning of next week. Find it Here:

https://www.kernel.org/

Here are a couple links for further information on new features and such:

https://www.phoronix.com/scan.php?page= … ures&num=1
https://www.phoronix.com/scan.php?page= … Linux+4.19

Offline

#52 2018-12-21 18:26:21

sleekmason
Member
Registered: 2018-05-22
Posts: 189

Re: How To - Kernel Compile With Custom Options

Linux Kernel 4.20 should be released on Sunday.   https://www.kernel.org/

More information about the latest 4.20 kernel here: https://phoronix.com/scan.php?page=news … t-Features
and:
https://www.phoronix.com/scan.php?page= … ures&num=1

Offline

#53 2018-12-22 01:27:18

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 7,303
Website

Re: How To - Kernel Compile With Custom Options

Thanks for the update!


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#54 2019-03-03 21:50:42

sleekmason
Member
Registered: 2018-05-22
Posts: 189

Re: How To - Kernel Compile With Custom Options

Linux Kernel version 5.0 should be out today. Get it Here: https://www.kernel.org/

Here is a list of interesting features: https://www.phoronix.com/scan.php?page= … ghts-Recap

It looks like 5.1 will have a few new features as well:  https://phoronix.com/scan.php?page=news … Kernel-Day

Last edited by sleekmason (2019-03-03 21:52:02)

Offline

#55 2019-05-03 12:39:33

sleekmason
Member
Registered: 2018-05-22
Posts: 189

Re: How To - Kernel Compile With Custom Options

Linux Kernel 5.1 will be released on Sunday, May 5th.  Get it here: https://www.kernel.org/

For a bit more info on 5.1: https://www.phoronix.com/scan.php?page= … ures&num=1

Offline

#56 2019-05-04 02:15:21

DeepDayze
Like sands through an hourglass...
From: In Linux Land
Registered: 2017-05-28
Posts: 992

Re: How To - Kernel Compile With Custom Options

sleekmason wrote:

Linux Kernel 5.1 will be released on Sunday, May 5th.  Get it here: https://www.kernel.org/

For a bit more info on 5.1: https://www.phoronix.com/scan.php?page= … ures&num=1

Should be able to build 5.1 on Stretch.


Real Men Use Linux

Offline

#57 2020-08-13 17:04:16

sleekmason
Member
Registered: 2018-05-22
Posts: 189

Re: How To - Kernel Compile With Custom Options

I am trying to use gcc 10.1 compiled from source to compile the 5.8 kernel. (this will allow for some patches I am interested in.:)

Looks like everything went well, and a folder was created in home for my new version:

~/GCC-10.1.0

I have tried to direct the new path from the kernel directory by:

sleekmason@ai:~/kernels/linux-5.8.1$ export PATH=$PATH:~/GCC-10.1.0/bin

but this doesn't seem to work when checked:

sleekmason@ai:~/kernels/linux-5.8.1$ gcc --version
gcc (Debian 8.3.0-6) 8.3.0

Any advice here would be appreciated.

The other method is to use gcc from unstable (haven't checked version), and use: update-alternatives --config gcc , to change when needed.  This way seems a bit unnecessary if I can get this to work properly.

Offline

#58 2020-08-13 19:14:44

DeepDayze
Like sands through an hourglass...
From: In Linux Land
Registered: 2017-05-28
Posts: 992

Re: How To - Kernel Compile With Custom Options

Be warned: if you compile a kernel with a newer compiler than on Stable it most likely won't run on Stable.


Real Men Use Linux

Offline

#59 2020-08-13 19:28:35

sleekmason
Member
Registered: 2018-05-22
Posts: 189

Re: How To - Kernel Compile With Custom Options

DeepDayze wrote:

Be warned: if you compile a kernel with a newer compiler than on Stable it most likely won't run on Stable.

Why would it matter which version of GCC it was compiled with?  .config doesn't change.

Edit*  I have built a bunch of kernels for android on this computer.  Seems like that change would be even bigger:)  My understanding is that the GCC code gets optimized, in turn making for a better optimized kernel.  I don't understand how it could affect the actual setting of the kernel, as those are dictated by computer hardware, system calls, bios, etc . . .

Last edited by sleekmason (2020-08-13 20:01:46)

Offline

#60 2020-08-14 00:47:36

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 7,303
Website

Re: How To - Kernel Compile With Custom Options

sleekmason wrote:

I have tried to direct the new path from the kernel directory by:

sleekmason@ai:~/kernels/linux-5.8.1$ export PATH=$PATH:~/GCC-10.1.0/bin

but this doesn't seem to work when checked:

sleekmason@ai:~/kernels/linux-5.8.1$ gcc --version
gcc (Debian 8.3.0-6) 8.3.0

Any advice here would be appreciated.

This is because you're appending the path to gcc to PATH. The system uses the first instance of a command that it finds, which will be the regular gcc in this case. Check with

which gcc

To give your custom path precedence it needs to come first in PATH, thus:

export PATH=~/GCC-10.1.0/bin:$PATH

...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#61 2020-08-14 01:26:44

sleekmason
Member
Registered: 2018-05-22
Posts: 189

Re: How To - Kernel Compile With Custom Options

Thank you johnraff. Unfortunately, that doesn't do the trick either.

sleekmason@ai:~/kernels/linux-5.8.1$ export PATH=~/GCC-10.1.0/bin:$PATH
sleekmason@ai:~/kernels/linux-5.8.1$ gcc --version
gcc (Debian 8.3.0-6) 8.3.0
sleekmason@ai:~/kernels/linux-5.8.1$ which gcc
/usr/bin/gcc
sleekmason@ai:~$ ls GCC-10.1.0
bin  include  lib  libexec  share

Offline

#62 2020-08-14 02:25:44

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 7,303
Website

Re: How To - Kernel Compile With Custom Options

Is ~/GCC-10.1.0/bin/gcc executable?
And, try

hash gcc

after the export command, to make sure the new path has been picked up.

Test it with some other random executable, in some arbitary path.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#63 2020-08-14 03:22:24

sleekmason
Member
Registered: 2018-05-22
Posts: 189

Re: How To - Kernel Compile With Custom Options

All items in the folder are executable.No gcc, but gccgo. Tried linking directly to that as well. hash gcc showed nothing.  Maybe I didn't build in the right items?

sleekmason@ai:~/GCC-10.1.0$ ls bin
c++    gfortran                 x86_64-pc-linux-gnu-g++
g++    lto-dump                 x86_64-pc-linux-gnu-gccgo
gccgo  x86_64-pc-linux-gnu-c++  x86_64-pc-linux-gnu-gfortran

Test it with some other random executable, in some arbitary path.

I have executables in ~/bin I can move around, but don't understand how to test the path? will gladly do so if you tell me how sir:)

Offline

#64 2020-08-14 04:29:36

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 7,303
Website

Re: How To - Kernel Compile With Custom Options

sleekmason wrote:

All items in the folder are executable. No gcc, but gccgo.

No gcc, then 'which gcc' will of course show the one in /usr/bin. What executable are you trying to override here?

'hash <executable>' shows nothing if the executable exists (else an error message) - it just caches the path. Sometimes I've found it necessary when adding a new executable to PATH, to prevent the stale cached path being used.

don't understand how to test the path?

I just meant to put an executable file in some non-standard location, add that path to PATH and see if the system can find it. Or make some executable testfile in ~/GCC-10.1.0/bin, run your export command again and see what 'which testfile' returns.

But I think the issue is that you haven't got anything called gcc in ~/GCC-10.1.0/bin.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#65 2020-08-14 12:30:33

sleekmason
Member
Registered: 2018-05-22
Posts: 189

Re: How To - Kernel Compile With Custom Options

johnraff wrote:

But I think the issue is that you haven't got anything called gcc in ~/GCC-10.1.0/bin.

Looks like I may have some further exploring to do:) Thank you for your suggestions. Hopefully I can get it figured out.

Offline

#66 2020-08-20 19:25:14

sleekmason
Member
Registered: 2018-05-22
Posts: 189

Re: How To - Kernel Compile With Custom Options

Guide updated.

As a side note, linux-image-4.19.0-10-amd64 (currently installed with bl-welcome), has the BFQ scheduler enabled as a module.  This can be checked with:

sudo cat /sys/block/sda/queue/scheduler

You can try it for the existing session with:

sudo echo bfq > /sys/block/sda/queue/scheduler

Run cat again to check.

If you want to make BFQ default, look in the guide for instructions.  Just need to change a file, and add a file:)

Offline

#67 2020-08-30 19:24:46

sleekmason
Member
Registered: 2018-05-22
Posts: 189

Re: How To - Kernel Compile With Custom Options

Thought I would share the difference in times between the kernel as is, and one that has been optimized to get rid of some of the debugging, and a few other easy optimizations.
The native configuration needs some tweaking.

Just after install:

sleekmason@ai:~$ systemd-analyze
Startup finished in 7.524s (kernel) + 49.303s (userspace) = 56.828s 
graphical.target reached after 49.282s in userspace

After customization:
sleekmason@ai:~$ systemd-analyze

Startup finished in 4.259s (kernel) + 28.872s (userspace) = 33.132s 
graphical.target reached after 28.847s in userspace

This translates to opening of apps, taskes, etc.

My computer is a 2009 Dell dual-core with 2 gigs ram.  Probably doesn't matter with a newer system, but sure makes these old boxes fly!

Offline

Board footer

Powered by FluxBB