* Re: [9fans] simple question: I want boot to bring up an rc prompt in boot()
@ 2006-04-07 20:09 jmk
0 siblings, 0 replies; 4+ messages in thread
From: jmk @ 2006-04-07 20:09 UTC (permalink / raw)
To: 9fans
You can replace the binary produced by boot.c by a shell script as follows:
in your kernel config file, change the 'bootdir' section to
include all the programmes you will use in the shell script, e.g.
bootdir
/386/bin/rc
/rc/lib/rcmain
/386/bin/bind
/386/bin/sed
/386/bin/srv
/386/bin/cat
/386/bin/cp
/386/bin/rm
/386/bin/echo
/386/bin/mount
/386/bin/sleep
/386/bin/ip/ipconfig
/386/bin/auth/factotum
/386/bin/ls
/386/bin/ps
/386/bin/auth/wrkey
boot.rc boot
and in the appropriate kernel architecture subdirectory (in this
case '386') create the shell script you want to run as /boot in
boot.rc, e.g.
#!/boot/rc -m /boot/rcmain
cpuserver=yes
cd /boot
echo boot...
bind -a '#I' /net
bind -a '#l0' /net
bind -a '#S' /dev
bind '#p' /proc
bind '#d' /fd
bind -a /boot /
ipconfig -D
authaddr=`{sed -n 's/ auth=(.*)/\1/p' /net/ndb|sed 1q}
if(~ $authaddr '')
authaddr=xxx.xxx.xxx.xxx
fsaddr=`{sed -n 's/ fs=(.*)/\1/p' /net/ndb|sed 1q}
if(~ $fsaddr '')
fsaddr=xxx.xxx.xxx.xxx
factotum -sfactotum -S -a $authaddr
if(! srv tcp!$fsaddr!564 boot)
exec ./rc -m/boot/rcmain -i
if(! mount -c /srv/boot /root)
exec ./rc -m/boot/rcmain -i
bind -ac /root /
rootdir=/root
rootspec=''
/$cputype/init -c
exec ./rc -m/boot/rcmain -i
where xxx.xxx.xxx.xxx is replaced by local default ip addresses
for the auth and file servers.
--jim
^ permalink raw reply [flat|nested] 4+ messages in thread
* [9fans] simple question: I want boot to bring up an rc prompt in boot()
@ 2006-04-07 18:20 Ronald G Minnich
2006-04-07 19:42 ` Russ Cox
2006-04-07 19:54 ` Steve Simon
0 siblings, 2 replies; 4+ messages in thread
From: Ronald G Minnich @ 2006-04-07 18:20 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
Is there some simple way to set up an (e.g.) pccpu such that when boot()
runs, after it sets up the basic namespace, it drops me into an rc
prompt? This would help me with debugging.
In the past I've done this by hacking on boot.c; I'm wondering if I'm
missing something.
thanks
ron
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-04-07 20:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-07 20:09 [9fans] simple question: I want boot to bring up an rc prompt in boot() jmk
-- strict thread matches above, loose matches on Subject: below --
2006-04-07 18:20 Ronald G Minnich
2006-04-07 19:42 ` Russ Cox
2006-04-07 19:54 ` Steve Simon
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).