Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]kernel -> error: out of memory with dm-crypt enabled
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
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 185
Location: Lake Macha, Czech republic

PostPosted: Thu Oct 04, 2018 6:32 am    Post subject: [SOLVED]kernel -> error: out of memory with dm-crypt enab Reply with quote

Hi guys,

I went trough https://wiki.gentoo.org/wiki/Full_Disk_Encryption_From_Scratch_Simplified tutorial about how to enable encryption on root partition.
I have initramfs built-in within kernel image (not 2 separate files).

After enabling all required configuration when I try to boot from grub I get error:
Code:
Loading kernel 4.18.10
error: out of memory


after this it returns me to grub2 menu. I wasn't able to find such error anywhere over internet (via google). Any idea whats wrong here?
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force


Last edited by archenroot on Sun Oct 14, 2018 10:56 am; edited 1 time in total
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6229
Location: Room 101

PostPosted: Thu Oct 04, 2018 10:31 am    Post subject: Reply with quote

archenroot ...

how are you supplying the INITRAMFS_SOURCE? Sounds as though you may be providing a compressed cpio image (which I think is what genkernel outputs by default), when it should either be an uncompressed cpio or a directory tree.

best ... khay
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 185
Location: Lake Macha, Czech republic

PostPosted: Thu Oct 04, 2018 12:53 pm    Post subject: Reply with quote

Ok, nice catch, make sense to me.

When I check content of /usr/src/linux/.config file I get:
Code:
CONFIG_INITRAMFS_SOURCE="/var/tmp/genkernel/initramfs-4.18.11-gentoo.cpio"


Additionally there is config regarding compression:
Code:
CONFIG_INITRAMFS_COMPRESSION_NONE=y


Strange I use genkernel for ages already...

But you are right, at genkernel level there is compression enabled:
Code:
COMPRESS_INITRD="yes"
COMPRESS_INITRD_TYPE="best"


I changed it to:
Code:
COMPRESS_INITRD="no"
#COMPRESS_INITRD_TYPE="best"


And compiling now... will update later.
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6229
Location: Room 101

PostPosted: Thu Oct 04, 2018 1:24 pm    Post subject: Reply with quote

archenroot wrote:
Additionally there is config regarding compression:
Code:
CONFIG_INITRAMFS_COMPRESSION_NONE=y

archenroot ... that should be =y (and an INITRAMFS_COMPRESSION selected) as it will then compress your cpio/directory, and more importantly be able to decompress.

best ... khay
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 185
Location: Lake Macha, Czech republic

PostPosted: Fri Oct 05, 2018 7:39 am    Post subject: Reply with quote

Thanks for hints, but I think you interpret COMPRESSION_NONE wrong or I don't understand your statement. NONE means no compression will be used, so I cannot sellect any compression method.

Additionally I just compared my 2 machines. I have workstation with 64GB ram and this Dell XPS 15 laptop 32GB ram which I am now installing, but that one with encrypted ROOT partition.

Workstation is configured as:
1. genkernel.conf
Code:
# Build the generated initramfs into the kernel instead of
# keeping it as a separate file
INTEGRATED_INITRAMFS="1"


# Compress generated initramfs
COMPRESS_INITRD="yes"
# Types of compression: best, xz, lzma, bzip2, gzip, lzop, fastest
# "best" selects the best available compression method
# "fastest" selects the fastest available compression method
COMPRESS_INITRD_TYPE="best"


And kernel config:
Code:
zangetsu@andromeda /usr/src/linux $ cat .config |grep COMPRESSION
CONFIG_INITRAMFS_COMPRESSION_NONE=y
# CONFIG_INITRAMFS_COMPRESSION_XZ is not set
CONFIG_INITRAMFS_COMPRESSION=""


On this machine (without compression) all works just fine. I don't think separating the init and kernel will make any big difference, but will try as well. It is just something with this compression, etc.
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 185
Location: Lake Macha, Czech republic

PostPosted: Fri Oct 05, 2018 8:27 am    Post subject: Reply with quote

Not sure if that is the case, but I found following issue on other cpu platform:
https://bugzilla.redhat.com/show_bug.cgi?id=1615969

Also noticed my kernel on laptop is quite big, about 200MB vs about 60MB on workstation.
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6229
Location: Room 101

PostPosted: Fri Oct 05, 2018 9:01 am    Post subject: Reply with quote

archenroot wrote:
Also noticed my kernel on laptop is quite big, about 200MB vs about 60MB on workstation.

archenroot ... both of those are unusually large, what are you including in your initramfs?

Code:
# mount /boot
# ls -lh /boot/efi/linux/vmlinuz.efi
-rwxr-xr-x 1 root root 4.5M 2018-04-28 19:46 /boot/efi/linux/vmlinuz.efi
# du -hs /usr/src/initramfs/sourceroot
2.9M    /usr/src/initramfs/sourceroot

vmlinuz.efi (3.12.x) includes initramfs, and 'sourceroot' is the (uncompressed) tree provided as INITRAMFS_SOURCE.

I'm fairly certain that will be the cause of your "out of memory" error.

best ... khay
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 185
Location: Lake Macha, Czech republic

PostPosted: Tue Oct 09, 2018 11:02 am    Post subject: Reply with quote

I was busy by joining new job onboard, but, the size of kernel was so big because:
1. I have lot of things enabled as running on laptop and need simply lot of drivers
2. I had an option to all modules in ram disk

As I had issues with my own kernel config which was 2 years old. I simply did excersize to use Live DVD config and just cut off as much as possible, this resulted in following sizes:
5.1M Oct 8 23:51 kernel-genkernel-x86_64-4.14.65-gentoo
75M Oct 8 23:55 initramfs-genkernel-x86_64-4.14.65-gentoo

So it is much better I think, lol.

I will now try to integrate initramfs into kernel to build stub, so in the end I don't need grub and can boot directly via UEFI motherboard loader. Still initramfs are quite big against yours :-), I build those via:
Code:
genkernel --install --no-ramdisk-modules initramfs
genkernel --install --no-ramdisk-modules kernel


Code:
genkernel --kernel-config=/usr/src/linux/.config --no-clean --luks --lvm --no-zfs all

NOTE: I have lvm and luks and clean configured via genkernel.conf, but was just playing so enforced via command line as override to prevent config file mistake.
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 185
Location: Lake Macha, Czech republic

PostPosted: Tue Oct 09, 2018 11:03 am    Post subject: Reply with quote

Anyway thx for your helping hints about how to get out!
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6229
Location: Room 101

PostPosted: Tue Oct 09, 2018 1:50 pm    Post subject: Reply with quote

archenroot ...

my initramfs is built with better-initramfs ... and so cryptsetup, lvm2, etc, are built, and statically linked to, musl. Your genkernel built initramfs will use the host libc, and so linked against glibc. Some of the size difference is due to this, the rest is due to better-initramfs not including kernel modules, everything needed to boot is builtin to the kernel.

You could give the pre-built initramfs a shot ... but you would need to make sure that your kernel has =y for those drivers needed to access AHCI, and mount your filesystem.

You're welcom & best ... khay
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 185
Location: Lake Macha, Czech republic

PostPosted: Thu Oct 11, 2018 9:21 am    Post subject: Reply with quote

So here we are, thx for detailed explanation, I learned something new and thx for tip with better-initramfs links, etc.

Have a good day!

Ladislav
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
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