LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-04-2012, 06:38 AM   #1
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 530

Rep: Reputation: Disabled
Custom Kernel requirements for LVM+LUKS?


Sorry to bother everybody's day again, but I had a question that again...I cannot answer myself.

I'm about to go about recompiling a kernel, but this time I've decided to take a default kernel config from the ones on www.kernel.org instead of using the generic kernel as the backbone this time.

I've done this successfully before for LVM-only (with the root partition NOT as a part of the Volume Group), but I know that LUKS+LVM has some specific requirements, specifically cryptography requirements.

From lots of reading I've found that I need these for sure:

1. Device mapper support (built-in, done by default by both vanilla kernel and the generic one)
aka CONFIG_BLK_DEV_DM
2. Crypt target support (also built-in, also done by both vanilla kernel and generic one)
aka CONFIG_DM_CRYPT
3. SHA256 Encryption
4. AES Encryption
5. CBC Encryption
6. Root partition filesystem built as a module (in my situation it will be ext4)

I'm wondering two things:

First, am I missing anything specifically from the kernel for LVM+LUKS and what has to (or can) be a module while what has to (or can) be built-in?

Secondly, grepping the .config file for the generic kernel shows me a few things I don't quite understand:
Code:
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_AES_X86_64=y
CONFIG_CRYPTO_AES_NI_INTEL=y
CONFIG_CRYPTO_DEV_PADLOCK_AES=m
I realize I stated I know I needed AES cryptography, but I'm not entirely sure which one of these is what I need for sure. Although some kernel documentation reading shows that CONFIG_CRYPTO_DEV_PADLOCK_AES seems to be for hardware encryption so I'm assuming that's the one (but again, I'm asking because I'm unsure).

Same goes for CBC:
Code:
CONFIG_CRYPTO_CBC=y
CONFIG_CRYPTO_PCBC=y
CONFIG_CRYPTO_XCBC=m
There was only one when I looked for SHA256 and that was built-in, so I'll leave that alone.

In case anybody's wondering, I've already been to Google quite a lot and looked at the cryptsetup code.google.com documentation but I was unable to find anything that specifically states what modules I need from the kernel and if they can even be built-in or must be a module.

On a secondary note, I'll be using the /usr/share/mkinitrd/mkinitrd_generator_script.sh to aid me in this.

The system is currently setup as README_CRYPT.TXT guided me at the very bottom (on the LVM+LUKS combination part with different VG names) and my initrd.gz is working successfully with the generic kernel and I am able to hibernate. I'd like to just have the same function on my newer kernel. ^.^
 
Old 06-04-2012, 09:18 AM   #2
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,259

Rep: Reputation: 231Reputation: 231Reputation: 231
If you copy the config file from either smp or non-smp, and run make oldconfig, that should work. When I build my kernels, I always use one of the vanilla config provided by Slackware. Running the mkinitrd_generator_script.sh will do a good job about telling you which modules to compile.
 
Old 06-04-2012, 05:16 PM   #3
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 530

Original Poster
Rep: Reputation: Disabled
The mkinitrd_generator_script.sh gives me the ext4 modules, usb modules and the likes, but it doesn't seem to contain the information I need for the cryptography modules which is what my main concern is.
 
Old 06-05-2012, 10:19 AM   #4
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,259

Rep: Reputation: 231Reputation: 231Reputation: 231
It won't give you a module, but I believe the "-C" argument handles the decryption.
 
Old 06-05-2012, 11:54 AM   #5
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 530

Original Poster
Rep: Reputation: Disabled
Well, in the end I did try this by myself, and even with -C it appears I may have missed something. After digging deeper it turns out it was basically like not having cryptsetup installed (which is obviously not going to work). rworkman looked over the mkinitrd command I used and we both determined it was on the kernel that I made the mistake. I wasn't entirely sure what, but the generic kernel was working fine so I just used the same configuration file and started trimming things myself (e.g. most of the modules) and it still worked fine. I'll marked this thread solved.

Thanks again, rworkman.
 
Old 06-05-2012, 12:42 PM   #6
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,259

Rep: Reputation: 231Reputation: 231Reputation: 231
Good to hear that you got it working! I hear that fellow rworkman is really good. ;-)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Gentoo, LUKS, LVM - kernel panic - not syncing /init not found mechman422 Linux - Kernel 1 10-23-2010 01:15 AM
[SOLVED] Kernel update on LUKS and LVM encrypted Slackware, mount fails KMBS Slackware 15 02-08-2010 01:23 PM
slackware64 lvm/luks and mkinitrd for custom kernel chopp Slackware 19 08-25-2009 02:33 PM
New kernel and existing Luks/Lvm ? brodo Slackware 3 09-14-2008 09:44 AM
LVM + Encryption + Custom Kernel sparker Slackware 2 08-05-2008 04:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration