Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 189901

Summary: sys-fs/cryptsetup - Ability to find the key device [PATCH] in dm-crypt-start.sh
Product: Gentoo Linux Reporter: Nelson <nelson.batalha>
Component: New packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: CONFIRMED ---    
Severity: enhancement CC: base-system, thomas.bettler
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: dm-crypt-start.sh-keyfind.patch
new patch w/ problem solved
same as before but for latest dm-crypt

Description Nelson 2007-08-23 07:04:52 UTC
Summary says it. If remdev isn't defined, it'll look for it. Same if something goes wrong and the user requests a find.
Comment 1 Nelson 2007-08-23 07:05:30 UTC
Created attachment 128926 [details, diff]
dm-crypt-start.sh-keyfind.patch
Comment 2 Benjamin Smee (strerror) (RETIRED) gentoo-dev 2007-09-28 14:03:31 UTC
I don't understand what you mean by if remdev isn't defined it'll look for it, the  'if [ -n "$remdev" ];' clearly only executes if it IS defined. I'm also uncertain what you mean by if the user requests a find. Can you explain what you mean here please.
Comment 3 Nelson 2007-09-28 17:56:42 UTC
(In reply to comment #2)
(I'm away from a linux box and will be for some time,but I'm quite sure:)

it's simple: if you don't define "remdev" in your config file, but if you define "key", it'll try to guess the remdev by looking to the "usual" devices.

With the patch you get a 'elif [ -z "$remdev" ];' test for that. 
Comment 4 Nelson 2007-09-28 18:02:45 UTC
Oh I fo(In reply to comment #2)
> I'm also
> uncertain what you mean by if the user requests a find. 

I forgot to explain this. If it happens during boot that the user isn't able to boot with a certain $remdev, the message displayed now gives the option to the user to change to auto find (temporary, it doesn't change the configuration).
Comment 5 Benjamin Smee (strerror) (RETIRED) gentoo-dev 2007-10-02 14:43:30 UTC
(In reply to comment #4)
> I forgot to explain this. If it happens during boot that the user isn't able to
> boot with a certain $remdev, the message displayed now gives the option to the
> user to change to auto find (temporary, it doesn't change the configuration).

This patch doesn't work for me as it is (haven't got the time to debug it). I like the idea of what you are doing but the current implementation doesn't work if for example you define a key on a USB stick and boot without that usb key in, it will prompt for auto scan or for you to specify. If you ask it to auto detect it doesn't work, if you specify the device, eg /dev/sda1, then it finds it but doesn't break out of the loop correctly not allowing you to mount that mountpoint. Submit a new patch against the new dm-crypt-start.sh I'm about to put in cvs.
Comment 6 Nelson 2007-10-02 21:35:03 UTC
(In reply to comment #5)
> Submit a new patch against the new dm-crypt-start.sh I'm about to
> put in cvs.

I can't, I'm away from home for a semester and don't have a gentoo laptop. I noticed that behaviour, but I thought it was some kernel problem. Either way the autodetection works in the normal case, it should be easy to correct no?

Comment 7 Ɓukasz Damentko (RETIRED) gentoo-dev 2008-08-11 01:17:28 UTC
Reassigning back to herd since Benjamin has retired as a Gentoo developer (#89719).
Comment 8 Nelson 2008-08-23 00:16:09 UTC
Created attachment 163583 [details, diff]
new patch w/ problem solved

So I returned a few months ago to my desktop and I solved the problem, it was the removal of the mount dir of the key that was causing it.

Unfortunately I see you updated the file. This is for the old version. Made a new patch considering most updates, but (see new attach comment):
Comment 9 Nelson 2008-08-23 00:19:03 UTC
Created attachment 163585 [details, diff]
same as before but for latest dm-crypt

There are some lines here I didn't update since it would require a complete rewrite. I don't see these changes as important, it does remove the new timer feature. Since these were changes of the maintainer, could you merge them? 

If I get the time I'll finish, but not soon.
Comment 10 Nelson 2008-09-02 01:41:43 UTC
I just tested the currently available script. This new timeout feature can be ignored, 99% of the times the script doesn't find the key it's because it's in a new address, and this solves it.

So please patch current 1.0.6-dm-crypt as it is.