From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from duke.felloff.net ([216.126.196.34]) by ewsd; Sat Nov 16 11:48:16 EST 2019 Message-ID: Date: Sat, 16 Nov 2019 17:48:06 +0100 From: cinap_lenrek@felloff.net To: 9front@9front.org Subject: Re: [9front] unofficial sdcard image for raspberry pi 4 testing In-Reply-To: 3B74ECDF1DF49C8F0E834D8CEF34216C@hera.eonet.ne.jp MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: patented self-signing method-oriented CSS grid-scale core realtime-java frontend > 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