Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to make boot image of custom kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Fri Nov 11, 2022 7:11 pm    Post subject: How to make boot image of custom kernel Reply with quote

Hello, so here I am again.
How to make working image of compiled kernel ?
I made my changes to kernel.

Quote:
genkernel --install --kernel-config=/usr/src/linux/linux-6.0.8-gentoo/.config initramfs
ERROR: Kernel Makefile (/usr/src/linux/Makefile) missing. Maybe re-install the kernel sources.


Can't change default folder of /usr/src/linux.
Kernel folder is linux-6.0.8-gentoo.

Thank you.
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1438
Location: Earth

PostPosted: Fri Nov 11, 2022 8:21 pm    Post subject: Reply with quote

hello,

https://wiki.gentoo.org/wiki/Kernel/Configuration

Code:
eselect kernel list
Available kernel symlink targets:
  [1]   linux-6.0.7-gentoo
  [2]   linux-6.0.8-gentoo *

Code:
eselect kernel set 1

to, e.g. change to linux-6.0.7-gentoo

it seems that linux is a folder on your system - it should be a symlink wich points to the linux-6.0.8-gentoo folder :!:

Code:
ls -la /usr/src/linux
lrwxrwxrwx 1 root root 20 Nov 11 18:19 /usr/src/linux -> linux-6.0.8-gentoo


8)
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "


Last edited by CooSee on Fri Nov 11, 2022 10:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Fri Nov 11, 2022 8:52 pm    Post subject: Reply with quote

Quote:
>> Pre-generating initramfs' /etc/ld.so.cache ...
* ERROR: None of the initramfs compression methods we tried are supported by your kernel (config file "/usr/src/linux/linux-6.0.8-gentoo/.config"), strange!?
* Please consult '/var/log/genkernel.log' for more information and any
* errors that were reported above.
*

Changed compression methods many times. Allways the same message. Thank you.
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Fri Nov 11, 2022 9:03 pm    Post subject: Reply with quote

http://dpaste.com/5MLC7JQZ8


genkernel.log
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1438
Location: Earth

PostPosted: Fri Nov 11, 2022 9:21 pm    Post subject: Reply with quote

Code:
* Determining 'BEST' compression method for initramfs using kernel config '/usr/src/linux/linux-6.0.8-gentoo/.config' ...
* Checking if we can use 'XZ' compression ...
* Cannot use 'XZ' compression, kernel option 'CONFIG_RD_XZ' is not set!
* Checking if we can use 'LZMA' compression ...
* Cannot use 'LZMA' compression, kernel option 'CONFIG_RD_LZMA' is not set!
* Checking if we can use 'ZSTD' compression ...
* Cannot use 'ZSTD' compression, kernel option 'CONFIG_RD_ZSTD' is not set!
* Checking if we can use 'GZIP' compression ...
* Cannot use 'GZIP' compression, kernel option 'CONFIG_RD_GZIP' is not set!
* Checking if we can use 'BZIP2' compression ...
* Cannot use 'BZIP2' compression, kernel option 'CONFIG_RD_BZIP2' is not set!
* Checking if we can use 'LZO' compression ...
* Cannot use 'LZO' compression, the tool 'lzop' to compress initramfs was not found. Is app-arch/lzop installed?
* Checking if we can use 'LZ4' compression ...
* Cannot use 'LZ4' compression, the tool 'lz4' to compress initramfs was not found. Is app-arch/lz4 installed?


you didn't set any of those above - set one or all if you want - for LZO and LZ4 you've install above mentioned ebuilds.

and look in /etc/genkernel.conf and set an option if you want and gekernel will choose accordingly.

Code:
# Compress generated initramfs
COMPRESS_INITRD="yes"

# Types of compression: best, xz, lzma, bzip2, gzip, lzop, lz4, zstd, fastest
# "best" selects the best available compression method
# "fastest" selects the fastest available compression method
COMPRESS_INITRD_TYPE="best"


when you're within menuconfig, type the slash / symbol key and search for CONFIG_RD_XZ and it'll show you the option and a number, e.g. 1 - after typing the number you go directly to this option and can activate whatever you need or want :!:

https://wiki.gentoo.org/wiki/Kernel/Configuration#Search_modules

8)
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Fri Nov 11, 2022 10:17 pm    Post subject: Reply with quote

CooSee wrote:
Code:
* Determining 'BEST' compression method for initramfs using kernel config '/usr/src/linux/linux-6.0.8-gentoo/.config' ...
* Checking if we can use 'XZ' compression ...
* Cannot use 'XZ' compression, kernel option 'CONFIG_RD_XZ' is not set!
* Checking if we can use 'LZMA' compression ...
* Cannot use 'LZMA' compression, kernel option 'CONFIG_RD_LZMA' is not set!
* Checking if we can use 'ZSTD' compression ...
* Cannot use 'ZSTD' compression, kernel option 'CONFIG_RD_ZSTD' is not set!
* Checking if we can use 'GZIP' compression ...
* Cannot use 'GZIP' compression, kernel option 'CONFIG_RD_GZIP' is not set!
* Checking if we can use 'BZIP2' compression ...
* Cannot use 'BZIP2' compression, kernel option 'CONFIG_RD_BZIP2' is not set!
* Checking if we can use 'LZO' compression ...
* Cannot use 'LZO' compression, the tool 'lzop' to compress initramfs was not found. Is app-arch/lzop installed?
* Checking if we can use 'LZ4' compression ...
* Cannot use 'LZ4' compression, the tool 'lz4' to compress initramfs was not found. Is app-arch/lz4 installed?


you didn't set any of those above - set one or all if you want - for LZO and LZ4 you've install above mentioned ebuilds.


Problem is that I selected.
[img]https://i.ibb.co/C1kZWLG/Screenshot-2022-11-12-04-11-26.png[/img]
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1438
Location: Earth

PostPosted: Fri Nov 11, 2022 10:32 pm    Post subject: Reply with quote

do you have app-arch/gzip emerged ?

emerge app-text/wgetpaste if not already emerged and

wgetpaste /usr/src/linux/.config and provide the given link here.

edit:

there's no need to use genkernel for kernel build - i use it only for building initramfs.

after .config file is configured via menuconfig or copying old .config to new sources directory and excuting make oldconfig & make clean.

Code:
time make -j8 && make -j8 modules_install && make install && cp .config /etc/kernels/kernel-config-6.0.8-gentoo-x86_64

and
Code:
genkernel --luks --lvm --btrfs --xfsprogs --kernel-config=/usr/src/linux/.config initramfs

finally
Code:
grub-mkconfig -o /boot/grub/grub.cfg

here's my .config for comparison only https://dpaste.com/CA5SF5X3E - please ignore the additional -1 in kernel name.

that's all 8)
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Sat Nov 12, 2022 9:57 am    Post subject: Reply with quote

Hello, I have the same problem.
Quote:
mfs: >> Initializing ...
* >> Appending devices cpio data ...
* >> Appending base_layout cpio data ...
* >> Appending util-linux cpio data ...
* >> Appending eudev cpio data ...
* >> Appending devicemanager cpio data ...
* >> Appending auxiliary cpio data ...
* >> Appending busybox cpio data ...
* >> Appending btrfs cpio data ...
* >> Appending luks cpio data ...
* >> Appending lvm cpio data ...
* >> Appending modprobed cpio data ...
* >> Appending xfsprogs cpio data ...
* >> Appending modules cpio data ...
* modules: 0 modules copied. Is that correct?
* >> Deduping cpio ...
* >> Pre-generating initramfs' /etc/ld.so.cache ..


None of the initramfs compression methods we tried are supported by your kernel (config file "/usr/src/linux/linux-6.0.8-gentoo/.config"), strange!?

I have installed gzip, I got the same message.
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1438
Location: Earth

PostPosted: Sat Nov 12, 2022 5:39 pm    Post subject: Reply with quote

Quote:
* modules: 0 modules copied. Is that correct?

something's odd with your config (no offence).

please upload your .config via https://wiki.gentoo.org/wiki/Wgetpaste.

e.g.
Code:
wgetpaste /usr/src/linux/.config

and provide the given link in you answer.

have you ever used an editor to change some settings in your .config? - never ever edit this file by hand !

8)
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Sat Nov 12, 2022 6:24 pm    Post subject: Reply with quote

RIA77,

There are two different things here and they both need to be right at the same time.

First the kernel must be able to decompress the compressed initramfs.
That's the kerne CONFIG_RD_XZ', CONFIG_RD_LZMA and so on.
The one or ones you want to use must be built into the kernel.
That's just for decompression.

For compression, when the initrd is made, you need a user space tool that supports the compression system you want to use.

For a good experience, you need to use the same compression and decompression methods.

Code:
* Checking if we can use 'LZO' compression ...
* Cannot use 'LZO' compression, the tool 'lzop' to compress initramfs was not found. Is app-arch/lzop installed?
* Checking if we can use 'LZ4' compression ...
* Cannot use 'LZ4' compression, the tool 'lz4' to compress initramfs was not found. Is app-arch/lz4 installed?


Even if those packages were installed, without kernel support, it won't work end to end.

genkernel is being nice to you. It won't let you make a compressed initramfs that the kernel cannot decompress when the time comes.
If you do it yourself, there is no such check.

Do you need to rebuild your kernel with the correct decompression support?
Do you need to add user space compression tool support?
Maybe both?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Mon Nov 14, 2022 6:23 pm    Post subject: Reply with quote

CooSee wrote:
Quote:
* modules: 0 modules copied. Is that correct?

something's odd with your config (no offence).

please upload your .config via https://wiki.gentoo.org/wiki/Wgetpaste.

e.g.
Code:
wgetpaste /usr/src/linux/.config

and provide the given link in you answer.

have you ever used an editor to change some settings in your .config? - never ever edit this file by hand !

8)


No offence here, everyone here are very nice.

http://dpaste.com/FDJ3QDTMU
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 342

PostPosted: Tue Nov 15, 2022 10:41 pm    Post subject: Reply with quote

Quote:
ORTANT: config file '/etc/genkernel.conf' needs updating.
* See the CONFIGURATION FILES and CONFIGURATION FILES UPDATE TOOLS

Quote:
YOU ARE ABOUT TO UPDATE A MODIFIED FILE WHICH PROBABLY CONTAINS
* CUSTOM SETTINGS. YOU ARE FORCED TO UPDATE MANUALLY!

What should I choose ?

Just updated genkernel and if there is a need to update genkernel.conf or not ?
Thank you.
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1438
Location: Earth

PostPosted: Thu Dec 01, 2022 3:02 pm    Post subject: Reply with quote

my apologies for the loong delay - to much work at the end of this year.
Quote:
Just updated genkernel and if there is a need to update genkernel.conf or not ?

the config file of genkernel was modified and portage asking if you want to replace with the config file from your emerge or ignore and keep the current one.

use etc-update or dispatch.conf.

look here https://wiki.gentoo.org/wiki/Handbook:X86/Portage/Tools

8)
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum