9front - general discussion about 9front
 help / color / mirror / Atom feed
* Re: [9front] Booting with encrypted partitions
@ 2019-11-13  5:07 ori
  2019-11-13 11:45 ` hiro
  2019-11-20 12:58 ` petter9
  0 siblings, 2 replies; 6+ messages in thread
From: ori @ 2019-11-13  5:07 UTC (permalink / raw)
  To: cinap_lenrek, 9front

> any suggestions for a good name? $start? $setup?
> $autoexec? $DEVICEHIGH?

startcmd is the best I can think of.



^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [9front] Booting with encrypted partitions
@ 2019-11-12 21:54 cinap_lenrek
  2019-11-12 23:51 ` petter9
  0 siblings, 1 reply; 6+ messages in thread
From: cinap_lenrek @ 2019-11-12 21:54 UTC (permalink / raw)
  To: 9front

notice that this mechanism has nothing specitic to
disk/cryptsetup and is just a hook to get arbitrary
code run.

which is *FINE*. just in the wrong place for something
like cryptsetup and has the wrong name.

you see the main function in bootrc can get run multiple
times. which is not what you'd want i think.

... also what Ori said, the empty test is wrong.

but otherwise i'm not against such a hook, which could
be usefull for other things as well.

probably do it right after the configlocal line in boorc.
(and dont forget the </dev/cons redirection to make
prompts work).

any suggestions for a good name? $start? $setup?
$autoexec? $DEVICEHIGH?

the name probably depends on what OTHER hooks we'r going
to add in some strategic places. any suggestions?

--
cinap


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [9front] Booting with encrypted partitions
@ 2019-11-12 20:57 ori
  0 siblings, 0 replies; 6+ messages in thread
From: ori @ 2019-11-12 20:57 UTC (permalink / raw)
  To: petter9, 9front

> Hi,
> 
> Got a bit tired of dropping to the shell and punching in the disk 
> decryption command on every boot.  This one:
>  > disk/cryptsetup -i /dev/sdE0/fsworm /dev/sdE0/fscache /dev/sdE0/other
> Also, one typo and the entire command must be retyped :/

If you attach patches inline, it's easier to review, and they'll still
be viewable years from now.

> So i made a change to the boot process to do that for me. Don't know if 
> something like this exist but it was anyway educational for me doing 
> this (noob) and i just thought i would share in case anyone is interested.
> 
> The change to the boot script,
> http://okturing.com/src/7221/body

>  diff -r 8f9f3ee2eacf sys/src/9/boot/bootrc
>  --- a/sys/src/9/boot/bootrc     Mon Nov 11 13:35:47 2019 -0800
>  +++ b/sys/src/9/boot/bootrc     Tue Nov 12 13:10:09 2019 +0100
>  @@ -65,6 +65,11 @@
>   mt=()
>   
>   fn main{
>  +       if(! ~ $decryptfs 0) {

This line isn't quite right -- you're checking if the content of '$decryptfs'
is 0, rather than whether the list has 0 elements. You need the '#' operator:

	if(! ~ $#decryptfs 0)

Other than that, it like it will work to me.

I'll let someone else more familiar with the boot process (cinap,
probably?) comment if there's a cleaner solution that doesn't add a
new knob. Ideally, I think we'd want:

	nobootprompt=crypt!local!/dev/sdE0/fscache

but I don't see a great way to get the args for disk/cryptsetup
out of that spec.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-11-20 12:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13  5:07 [9front] Booting with encrypted partitions ori
2019-11-13 11:45 ` hiro
2019-11-20 12:58 ` petter9
  -- strict thread matches above, loose matches on Subject: below --
2019-11-12 21:54 cinap_lenrek
2019-11-12 23:51 ` petter9
2019-11-12 20:57 ori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).