Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
{solved} (cryptsetup-luks) Initramfs help
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
jpc22
Apprentice
Apprentice


Joined: 29 Jan 2012
Posts: 186

PostPosted: Mon Dec 30, 2013 12:49 am    Post subject: {solved} (cryptsetup-luks) Initramfs help Reply with quote

Im am getting back to gentoo after a year of win7 frustration.(not having time to install gentoo during college and needing word)

I remember how to set up everything but since mkinitcpio is out of the portage tree i have not suceeded in making an intramfs that boots.
I am currently rereading all encryption/initramfs tutorial i can find , but i would like some reminders or pointers.

I did compile better-initramfs and install it but i dont understand how i am supposed to pass boot parameters and configure grub2 to use it.

I have a jfs partition for boot on a usb key labeled boot_stick and my whole hdd (dev/sda) is encrypted dev/mapper/rot is also partitioned as jfs.


Last edited by jpc22 on Wed Jan 08, 2014 9:10 pm; edited 4 times in total
Back to top
View user's profile Send private message
haVok
n00b
n00b


Joined: 21 May 2013
Posts: 37

PostPosted: Mon Dec 30, 2013 1:20 am    Post subject: Reply with quote

You can also just use genkernel to build the initramfs, make sure cryptsetup and genkernel are installed, not sure if u want lam or not but the hand book has info on genkernel
genkernel --luks --install initramfs, and sorry I don't know much about better initramfs
Back to top
View user's profile Send private message
jpc22
Apprentice
Apprentice


Joined: 29 Jan 2012
Posts: 186

PostPosted: Mon Dec 30, 2013 4:16 am    Post subject: Reply with quote

i am not familiar with genkernel and i guess its initramfs would not work with a kernel not produced by it, but i will probably try it anyway tomorrow.
Back to top
View user's profile Send private message
haVok
n00b
n00b


Joined: 21 May 2013
Posts: 37

PostPosted: Mon Dec 30, 2013 4:27 am    Post subject: Reply with quote

No u can build you own custom kernel and use genkernel just to build the initramfs
https://wiki.gentoo.org/wiki/Initramfs/HOWTO
example for luks: genkernel --luks --install intramfs
and it will copy it to your /boot
Back to top
View user's profile Send private message
jpc22
Apprentice
Apprentice


Joined: 29 Jan 2012
Posts: 186

PostPosted: Mon Dec 30, 2013 4:35 am    Post subject: Reply with quote

thanks buddy , but i need to backup your .config in case genkernel messes with it? will try tomorrow its almost midnight.

Last edited by jpc22 on Wed Jan 01, 2014 9:01 pm; edited 2 times in total
Back to top
View user's profile Send private message
tuxtor
n00b
n00b


Joined: 22 Apr 2007
Posts: 39
Location: Guatemala

PostPosted: Mon Dec 30, 2013 4:45 am    Post subject: Reply with quote

If you still are with better-initramfs you should only specify an initrd line like this

Code:

menuentry "Gentoo Linux Geek - geek-linux-3.12.4" {
  insmod part_msdos
  insmod ext2
  set root=(hd1,msdos1)
  search --no-floppy --fs-uuid --set c4eda537-7a61-4911-bade-d3bbf6e3f2c7
  linux /geek-linux-3.12.4 enc_root=/dev/sdb2 lvm luks root=/dev/mapper/vg-root rootfstype=ext4 splash=verbose,theme:livedvd-12.0 quiet video=uvesafb:1280x800-32,mtrr:3,ywrap root=/dev/mapper/vg-root rootfstype=ext4
  initrd /fbramfs.cpio.gz
  set gfxpayload=text
}



The fbramfs.cpio.gz is the file generated by initramfs, all other options go in kernel parameters.
Back to top
View user's profile Send private message
jpc22
Apprentice
Apprentice


Joined: 29 Jan 2012
Posts: 186

PostPosted: Tue Dec 31, 2013 3:27 am    Post subject: Reply with quote

(EDIT)
When i try to boot grub it fist says the following but still proceeds to the menu.
error: file '/grub/fonts/unicode.pf2' not found
error: no suitable video mode found.

Both genkernel and better-initramfs are automatically configured by grub using the arguments i provide in /etc/default/grub
But they never ask me my password to decrypt /dev/sda and they try to mount /dev/mapper/root which utterly fails.
Even if i use their rescue shells to unlock /dev/sda and let them resume their booting ,they still cant find /dev/mapper/root

better-initramfs says could not find the root device in .
genkernel says something like it cant find /dev/mapper/root in fstab

/etc/default/grub
http://bpaste.net/show/sGUHc7i3yjYmXyI2M7d6/
genkernel conf.
http://bpaste.net/show/YCSfW8LmiWBAn61nu7wk/
/etc/fstab
http://bpaste.net/show/kUfSn4e7iDsA65geqjYT/

(EDIT) Tried all those to influence the linux_10 grub2 script output whit no sucessful boot

GRUB_CMDLINE_LINUX_DEFAULT="acpi_osi=Linux acpi=on cryptdevice=/dev/sda:root panic=10 ro"
GRUB_CMDLINE_LINUX_DEFAULT="acpi_osi=Linux acpi=on crypt_root=/dev/sda:root Real_root=/dev/mapper/root panic=10 ro"
GRUB_CMDLINE_LINUX_DEFAULT="acpi_osi=Linux acpi=on enc_root=/dev/sda luks root=/dev/mapper/root rootfstype=jfs splash=verbose,theme:livedvd-12.0 quiet root=/dev/mapper/root panic=10 ro "

GRUB_DISABLE_LINUX_UUID=true

Noticed this in grub2-mkconfig: it points my boot partition as the root device how do i fix that (will try writing a custom one)?

search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1 156ecc58-262c-435b-97f7-67565919ff59
else
search --no-floppy --fs-uuid --set=root 156ecc58-262c-435b-97f7-67565919ff59
blkid
/dev/sdb1: LABEL="boot_stick" UUID="156ecc58-262c-435b-97f7-67565919ff59" TYPE="jfs"
/dev/loop0: TYPE="squashfs"
/dev/sr0: UUID="2012-12-20-21-49-47-00" LABEL=""Gentoo Linux 20121221"" TYPE="iso9660" PTTYPE="dos"
/dev/sda: UUID="87094233-7c3f-4be9-aa3c-b550e5a24540" TYPE="crypto_LUKS"
/dev/mapper/root: UUID="d159d45f-dabb-4ccd-a61b-2ccf781a4e34" TYPE="jfs"

(edit) tried substituing the uuid with those of /dev/sda and /dev/mapper/root with all the variables above.


Last edited by jpc22 on Wed Jan 01, 2014 8:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
jpc22
Apprentice
Apprentice


Joined: 29 Jan 2012
Posts: 186

PostPosted: Wed Jan 01, 2014 9:26 pm    Post subject: Reply with quote

Can someone explain me how i am supposed to tell grub that /dev/sda is the encrypted root partition and dev/sdb1 the boot, when grub is on the /dev/sdb mbr and which damn boot arguments i need to pass(been trying adapting tuxtor config to my system and tried merging with lots of other things all day long.


Is there anyway i could somehow ressurect mkinitcpio with this https://bitbucket.org/braindamaged/mkinitcpio-gentoo/
since mkinitcpio worked just fine and used to produce in 5 minutes what i was unable to do in countless hours : an initramfs that worked with jfs on dev/sda:root and boot on usb stick

(EDIT)
Gonna try rolling my own initrd again
Back to top
View user's profile Send private message
jpc22
Apprentice
Apprentice


Joined: 29 Jan 2012
Posts: 186

PostPosted: Wed Jan 08, 2014 9:09 pm    Post subject: Reply with quote

Used extlinux from syslinux and now it boots but i have a small issue that will be for another thread.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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