You are not logged in.

#1 2012-11-05 17:03:04

doupod
Member
Registered: 2012-09-06
Posts: 73

Stop the boot in hook ?

Hi,

I'm running Arch on LVM on LUKS on my laptop. I use a keyfile to unlock the LUKS partitions. So, I'd like to modify the encrypt hook to not ask for a passphrase if it doesn't find any key file.

But my problem is : how can I stop the boot sequence in a hook ? I'd like to prevent it from booting up further if there's no keyfile and display an error message. I played with exit command... without success. I only manage to get a kernel panic error because the system can't go on without rootfs partition.

Thanks.

Offline

#2 2012-11-05 17:37:57

Awebb
Member
Registered: 2010-05-06
Posts: 4,640

Re: Stop the boot in hook ?

While this does not answer your question, asking for a password is pretty much what I'd call a stopped boot process. You can then ctrl+alt+del and fix the problem.

Offline

#3 2012-11-05 18:49:01

doupod
Member
Registered: 2012-09-06
Posts: 73

Re: Stop the boot in hook ?

Yes, I agree with you. Asking for a password is a way to stop the boot process.

But :
- First, I don't use passphrases. So I'd prefer to directly jump to a rescue shell or stop the boot process in this case.
- Second, if I can stop the boot process, I can return an error message which won't reveal at first sight that my hard drive is encrypted. This can be important for people searching for a "plausible deniability" thing.

The only thing I managed to do now is using some sleep, pause and while to stop the boot process. Just as it does while asking for a passphrase, but without prompting for it.

Offline

#4 2012-11-05 20:45:56

jjacky
Member
Registered: 2011-11-09
Posts: 322
Website

Re: Stop the boot in hook ?

If you want to start a shell, just do that:

exec sh -i

Offline

#5 2012-11-09 23:45:33

oeufcoque
Member
Registered: 2012-11-09
Posts: 19
Website

Re: Stop the boot in hook ?

doupod wrote:

Yes, I agree with you. Asking for a password is a way to stop the boot process.

But :
- First, I don't use passphrases. So I'd prefer to directly jump to a rescue shell or stop the boot process in this case.
- Second, if I can stop the boot process, I can return an error message which won't reveal at first sight that my hard drive is encrypted. This can be important for people searching for a "plausible deniability" thing.

The only thing I managed to do now is using some sleep, pause and while to stop the boot process. Just as it does while asking for a passphrase, but without prompting for it.

Instead of calling the function named "launch_interactive_shell", or just launching a shell like jjakcy suggested, I would simply comment out lines in /usr/lib/initcpio/hooks/encrypt which are responsible for asking for a passphrase.

That way you'll automatically drop to the interactive shell the intended way.

edit: ... and to stop the boot completely you could perhaps add a "halt --halt --force" to make it appear like everything just froze. While you're at it you could also add this classic error message:

clear
while read ; do
  echo "DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER."
  sleep 1
done

Last edited by oeufcoque (2012-11-09 23:52:30)

Offline

Board footer

Powered by FluxBB