Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GRUB2 + cryptomount + grub2 scripting
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
agentsmith83
n00b
n00b


Joined: 15 Sep 2011
Posts: 12
Location: RU,Moscow

PostPosted: Thu Aug 01, 2013 12:53 pm    Post subject: GRUB2 + cryptomount + grub2 scripting Reply with quote

Hello.
I use a system with a whole hdd encrypted.
Here is my disk configuration

1) MBR
2) gpt1 - EF02 code partition. Here will be grub2 core image.
3) gpt2 - 8E00 code partition. LVM over LUKS
3.1) lvm/boot - grub2 files, kernel and initrd image
3.2) lvm/root, lvm/var, lvm/usr, lvm/home, lvm/swap

I have been successful to make all these stuff work properly.

So, when I start this system the first screen I see is the a cryptomount message.
Everything is ok if I have entered a passphrase correctly.
If I have been mistaken then grub rescue CLI apperas on the screen.
And my next step is to manually enter cryptomount command via CLI.
This is annoying :evil:
I discovered that grub2 supports bash-like command for scripting purpose.
I added normal (needed for bash-like command) echo and help modules into grub2 core.img. So I tried to use this in grub2 embedded config file
Code:
while ! cryptomount -u MY_UID;do echo Try again; done

And this doesn't work :(((. Grub2 simply switches in normal mode and nothing happens.

Here are some interesting things:
1) In grub2 CLI (normal mode) the code works properly
2) In grub2 CLI (normal mode)
Code:
cryptomount -u MY_UID; echo $?

returns error code
3) In grub2 (embedded config with nomal module)
Code:
cryptomount -u MY_UID; echo $?

returns empty string.

It seems than 3 point is the problem.

Do you have any ideas?
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