plan9fox/rc/bin/inst/nvramsetup

52 lines
1 KiB
Plaintext
Raw Normal View History

#!/bin/rc
# desc: invalidate nvram
# prereq: systype copydist
2011-06-09 20:43:04 +00:00
files=()
for(i in /dev/sd*/nvram){
if(test -f $i)
files=($files $i)
}
2011-06-09 05:26:17 +00:00
switch($1){
2011-06-09 20:31:04 +00:00
case checkdone checkready
if(~ $#files 0 && ! ~ $syst cpu)
nvramsetup=done
if not {
if(~ $#nvram 1 && grep -s trust $nvram)
nvramsetup=done
if not
nvramsetup=ready
}
export nvramsetup
case go
2011-06-09 20:31:04 +00:00
echo
echo 'Setup Plan 9 NVRAM configuration partition (nvram)'
echo
if(~ $#files 1)
default=(-d $files)
if not
default=()
prompt $default 'Nvram partition' $files
nvram=$rd
export nvram
echo 'trust, but verify' >$nvram
2011-06-09 20:31:04 +00:00
if(! ~ $syst cpu)
exit
echo
echo 'You will be asked to enter an authid, authdom, secstore key,'
echo 'and password upon next boot. The authid is the hostowner.'
echo 'The authdom is the domain from your network configuration.'
echo 'The secstore key and password should be a secret password'
echo 'of eight characters or greater in length. On an auth server,'
echo 'the password will be used to encrypt the user database'
echo '/adm/keys'
echo
}