9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] unofficial sdcard image for raspberry pi 4 testing
Date: Sat, 16 Nov 2019 17:48:06 +0100	[thread overview]
Message-ID: <EF4A0EFED3711AB74D242189BDBCB71D@felloff.net> (raw)
In-Reply-To: 3B74ECDF1DF49C8F0E834D8CEF34216C@hera.eonet.ne.jp

> we see two lines of waserror(), and trysdiocmd() calls sdiocmd()
> which also includes waserror() line.  In this case which of the waserror()
> will be called when error() occurs somewhere?

the top one of the stack. the jump-back locations are managed by a "stack".
waserror() pushes on that stack, and poperror(), nexterror(), and error()
pops it from the stack. that way you can nest waserror() handlers.

in this case, you have 2 levels. the inner waserror() handler in sdiocmd()
handles the cleanup of the lock, making sure in error case, the lock is
released.

and the outer waserror() handler in trysdiocmd() just makes the function
return 0 in the error case, so that trysdiocmd() itself never raises an
error up.

> By the way, aux/wpa demands the factotum preset the wpapsk, essid and password.
> It is possible to setup wifi after the system booted-up.

...
> However, to get the / filesystem from a file server to boot the system,
> which is in my case, how I can preset the factotum for wpapsk before the root filesystem
> mounted?   To mount the root I need to connect to the file sever, but I have no wifi setup yet.

absolutely, yes.

if you do *NOT* pass -p flag to aux/wpa, it will not prompt. it can sit in the
background and wait for any access point starting the 4-way handshake.

factotum is used for the keys. the keys in factotum are tagged with the essid=
attribute. that means you can have multiple wifi keys in factotum, and depending
on which network you select by writing "essid ...." > /net/etherX/clone you
can switch the networks.

so one running aux/wpa instance is really per wifi interface. but can authenticate
you to multiple networks without needing a restart.

on booting a terminal, aux/wpa is started in bootrc automatically
*IFF* you select the wifi interface for netbooting (bootargs).
/net/ether0 is the default.

/sys/src/9/boot/net.rc

fn confignet{
	# get primary default interface if not specified
	if(~ $#* 0){
		e=/net/ether*
		if(! ~ $e '/net/ether*')
			*=(ether $e(1))
	}

	# setup wifi encryption if any
	if(~ $1 ether && ~ $service terminal && test -x /bin/aux/wpa){
		if(grep -s '^status: need authentication' $2/ifstats >[2]/dev/null){
			aux/wpa -p $2
		}
	}
...

this is not done for cpu servers as we cannot prompt... and before we get
networking up, we cannot fetch keys from secstore... it could be handled
probably with plan9.ini boot parameters but has not been done so far.

--
cinap


             reply	other threads:[~2019-11-16 16:48 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-16 16:48 cinap_lenrek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-01-27  2:18 kokamoto
2019-12-05  5:19 kokamoto
2019-11-21  1:14 kokamoto
2020-05-31  8:51 ` Iruatã Souza
2020-06-01 23:07   ` kokamoto
2019-11-20  0:20 kokamoto
2019-11-21  0:23 ` hiro
2019-11-20  0:09 kokamoto
2019-11-18  9:45 umbraticus
2019-11-17 23:34 kokamoto
2019-11-17 23:37 ` Kurt H Maier
2019-11-17 18:33 cinap_lenrek
2020-06-20 11:39 ` Iruatã Souza
2019-11-17  6:23 kokamoto
2019-11-17  0:04 kokamoto
2019-11-17  0:02 kokamoto
2019-11-16 10:04 rgl
2019-11-16  9:29 kokamoto
2019-11-16  1:08 cinap_lenrek
2019-11-15  9:13 kokamoto
2019-11-15  6:58 rgl
2019-11-15  2:27 ori
2019-11-15  2:18 kokamoto
2019-11-15  0:21 kokamoto
2019-11-04  0:55 kokamoto
2019-10-21  4:19 kokamoto
2019-10-20  7:38 ori
2019-10-20  6:15 kokamoto
2019-10-20  0:37 cinap_lenrek
2019-10-20  9:13 ` Steve Simon
2019-10-20 13:48   ` hiro
2019-10-19 23:07 kokamoto
2019-10-19  0:13 kokamoto
2019-10-17 10:15 kokamoto
2019-10-16 23:29 kokamoto
2019-10-15  3:53 kokamoto
2019-09-30  0:31 kokamoto
2019-09-29  1:17 kokamoto
2019-09-29  4:27 ` Sean Hinchee
2019-09-29 20:43   ` hiro
2019-09-28  0:54 kokamoto
2019-09-28 18:48 ` Ethan Gardener
2019-09-28 19:43 ` Julius Schmidt
2019-09-28 23:35   ` hiro
2019-09-28  0:10 kokamoto
2019-09-28  1:24 ` Julius Schmidt
2019-09-28  7:43   ` hiro
2019-09-27  1:51 cinap_lenrek
2019-09-27  4:58 ` Roman Shaposhnik
2019-09-27  1:28 cinap_lenrek
2019-09-27  1:48 ` Roman Shaposhnik
2019-09-27  1:06 kokamoto
2019-09-27 10:22 ` Julius Schmidt
2019-09-26 14:35 cinap_lenrek
2019-09-26  9:58 kokamoto
2019-09-26 12:12 ` hiro
2019-09-26  3:50 kokamoto
2019-09-26  6:44 ` hiro
2019-09-26  0:04 kokamoto
2019-09-24 23:19 kokamoto
2019-09-24 22:45 cinap_lenrek
2019-09-24 21:51 kokamoto
2019-09-24 21:30 kokamoto
2019-09-24 21:22 kokamoto
2019-09-24 11:13 cinap_lenrek
2019-09-24  5:24 kokamoto
2019-09-23 17:24 cinap_lenrek
2019-09-23  1:44 cinap_lenrek
2019-09-23  2:00 ` Kenji Okamoto
2019-09-23  1:41 kokamoto
2019-08-23 20:16 cinap_lenrek
2019-08-21 14:35 cinap_lenrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EF4A0EFED3711AB74D242189BDBCB71D@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).