From owner-freebsd-arch Fri Jun 22 7:14:20 2001 Delivered-To: freebsd-arch@freebsd.org Received: from sdmail0.sd.bmarts.com (sdmail0.sd.bmarts.com [209.247.77.155]) by hub.freebsd.org (Postfix) with ESMTP id 13D6237B401; Fri, 22 Jun 2001 07:14:12 -0700 (PDT) (envelope-from gordont@bluemtn.net) Received: from localhost (gordont@localhost) by sdmail0.sd.bmarts.com (8.11.3/8.11.2/BMA1.1) with ESMTP id f5MEDuc82007; Fri, 22 Jun 2001 07:13:57 -0700 (PDT) Date: Fri, 22 Jun 2001 07:13:56 -0700 (PDT) From: Gordon Tetlow X-X-Sender: To: "David O'Brien" Cc: Subject: Re: (FWD) Re: import NetBSD rc system In-Reply-To: <20010620182320.D99923@dragon.nuxi.com> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-2121145011-993219236=:25983" Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-2121145011-993219236=:25983 Content-Type: TEXT/PLAIN; charset=US-ASCII I've been staring at this patch some more and it occurs to me that it breaks rc.diskless1 in all cases. I've attached a new patch that moves rc.diskless1 to before the sourcing of /etc/defaults/rc.conf. It also changes the rc.conf variable to rc_ng. -gordon On Wed, 20 Jun 2001, David O'Brien wrote: > Does anyone have any problems with this patch? > If not I'd like to commit it. (I might make "rc_new" rc_ng" since > everything else we have seems to be named that way) > > > > ----- Forwarded message from Gordon Tetlow ----- > > From: Gordon Tetlow > Subject: Re: import NetBSD rc system > Date: Sun, 17 Jun 2001 21:28:02 -0700 (PDT) > To: "David O'Brien" > Cc: "David O'Brien -Hackers" > X-X-Sender: > List-ID: > List-Archive: (Web Archive) > > On Sat, 16 Jun 2001, David O'Brien wrote: > > > On Sat, Jun 16, 2001 at 07:58:06AM -0700, Gordon Tetlow wrote: > > > I like Matt's idea (I think it was Matt) to have a new_rc switch. I'll > > > look at adding the code for it and submitting a patch, > > > > You are going off on a tangent. You are worried about the flag day > > before we even have a flag to run up the poll. > > Actually, this makes the import of the new rc system much easier. I've > attached the patch against an older (may 11th) world. It should make it > pretty clear. After this, all you need to do is import the rc.subr and the > rc.d directory from the NetBSD project. Then to test the new boot system, > all you need is rcorder and new_rc switched on in /etc/rc.conf. If you > need to get back to the old boot system, just change the new_rc knob to > off and you can boot normally. > > > > > > /etc/rc.subr ported > > > > > > > > What changes were needed here? > > > > > > I basically added a function called checkwildno() that is similar to > > > checkyesno that returns 1 for NO (plus variants) or '' and returns 0 for > > > anything else. This gets rid of alot of case statements in the modules, > > > making them simple if's. > > > > Again, why don't we just concentrate on porting the NetBSD scripts and > > not the second system enhancements? > > I agree. I'm a little further ahead on my local box than where we are on > the repo. My big question is, do we want to keep the current boot > order/logic or are we going with NetBSDs? Either way is fine by me, > although I've tried to keep FreeBSDs system more than NetBSDs. > > -gordon > > diff -ur /usr/src/etc/defaults/rc.conf etc/defaults/rc.conf > --- /usr/src/etc/defaults/rc.conf Wed May 9 22:30:33 2001 > +++ etc/defaults/rc.conf Sat Jun 16 08:39:43 2001 > @@ -19,6 +19,7 @@ > ### Important initial Boot-time options #################### > ############################################################## > > +new_rc="NO" # Set to YES to enable new-style rc. Experimental. > swapfile="NO" # Set to name of swapfile if aux swapfile desired. > apm_enable="NO" # Set to YES to enable APM BIOS functions (or NO). > apmd_enable="NO" # Run apmd to handle APM event from userland. > diff -ur /usr/src/etc/rc etc/rc > --- /usr/src/etc/rc Fri May 11 12:06:55 2001 > +++ etc/rc Sat Jun 16 15:46:27 2001 > @@ -52,6 +52,39 @@ > PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin > export HOME PATH > > +# If there is a global system configuration file, suck it in. > +# > +if [ -r /etc/defaults/rc.conf ]; then > + . /etc/defaults/rc.conf > + source_rc_confs > +elif [ -r /etc/rc.conf ]; then > + . /etc/rc.conf > +fi > + > +case ${new_rc} in > +[Yy][Ee][Ss]) > + . /etc/rc.subr > + > + _rc_conf_loaded=YES > + > + if [ "$1" = autoboot ]; then > + autoboot=yes > + _rc_fast_run=yes # run_rc_command(): do fast booting > + fi > + > + files=`rcorder -s nostart /etc/rc.d/*` > + > + for _rc_elem in $files; do > + run_rc_script $_rc_elem start > + done > + > + exit 0 > + ;; > +*) > + # fall-through to the old rc scripts > + ;; > +esac > + > # BOOTP diskless boot. We have to run the rc file early in order to > # retarget various config files. > # > @@ -60,15 +93,6 @@ > if [ ${dlv:=0} != 0 ]; then > . /etc/rc.diskless1 > fi > -fi > - > -# If there is a global system configuration file, suck it in. > -# > -if [ -r /etc/defaults/rc.conf ]; then > - . /etc/defaults/rc.conf > - source_rc_confs > -elif [ -r /etc/rc.conf ]; then > - . /etc/rc.conf > fi > > feed_dev_random() { > diff -ur /usr/src/etc/rc.shutdown etc/rc.shutdown > --- /usr/src/etc/rc.shutdown Sun Dec 17 00:15:57 2000 > +++ etc/rc.shutdown Sat Jun 16 15:46:32 2001 > @@ -52,6 +52,26 @@ > . /etc/rc.conf > fi > > +case ${new_rc} in > +[Yy][Ee][Ss]) > + . /etc/rc.subr > + > + files=`rcorder -k shutdown /etc/rc.d/*` > + for i in $files; do # reverse order of files > + nfiles="$i $nfiles" > + done > + files=$nfiles > + > + for i in $files; do > + run_rc_script $i stop > + done > + > + exit 0 > + ;; > +*) > + ;; > +esac > + > # Write some entropy so the rebooting /dev/random can reseed > # > case ${entropy_file} in > > > ----- End forwarded message ----- > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message > --0-2121145011-993219236=:25983 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="rc.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="rc.diff" ZGlmZiAtdXIgL3Vzci9zcmMvZXRjL2RlZmF1bHRzL3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XMNCisJCW5maWxlcz0iJGkgJG5maWxlcyINCisJZG9u ZQ0KKwlmaWxlcz0kbmZpbGVzDQorDQorCWZvciBpIGluICRmaWxlczsgZG8N CisJCXJ1bl9yY19zY3JpcHQgJGkgc3RvcA0KKwlkb25lDQorDQorCWV4aXQg MA0KKwk7Ow0KKyopDQorCTs7DQorZXNhYw0KKw0KICMgV3JpdGUgc29tZSBl bnRyb3B5IHNvIHRoZSByZWJvb3RpbmcgL2Rldi9yYW5kb20gY2FuIHJlc2Vl ZA0KICMNCiBjYXNlICR7ZW50cm9weV9maWxlfSBpbg0K --0-2121145011-993219236=:25983-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message