Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!hoey@nrl-aic.arpa From: hoey@nrl-aic.arpa (Dan Hoey) Newsgroups: comp.unix.wizards Subject: Building a 4.3BSD kernel under 4.2 Message-ID: <8943@brl-adm.ARPA> Date: Fri, 21-Aug-87 17:57:07 EDT Article-I.D.: brl-adm.8943 Posted: Fri Aug 21 17:57:07 1987 Date-Received: Sun, 23-Aug-87 03:24:42 EDT Sender: news@brl-adm.ARPA Lines: 74 Our upgrade path to 4.3 is to build the kernel under 4.2, then slide it in. But we have a few jimmies sprinkled on our vanilla sources, so I have to patch them. Last thing before patching, I decided to make sure I could correctly use the 4.3 cc, ld, /usr/include, etc. to build a 4.3 kernel. The test I decided on was to try to build an exact copy of the distributed 4.3 GENERIC kernel. So I mv'ed /4.3/GENERIC to /4.3/origGENERIC, and started building, using ``cmp -l'' and ``nm -n'' to check for differences between /4.3/{orig,}GENERIC/vmunix. I had to edit my /4.3/GENERIC/version so that /4.3/{orig,}GENERIC/vers.c would have the same length. (I changed it to "2 \n" though your mileage may differ). The hardest part was figuring out that I needed the 4.3 version of /usr/ucb/symorder. Why is some random ucb binary needed to make the kernel? RTFM. But why did they change it for 4.3? I couldn't tell you, but it definitely makes a difference in the order of symbol table entries. I'm not sure I needed to link all the other files, but they seemed likely. Anyway, I succeeded in building a kernel for which the only differences were in the version strings. Here is a shell script I use to install the 4.3 tools needed to compile the kernel, and it may be useful to you if you want to build a 4.3 kernel under 4.2. The only tailoring you will need is to change the definition of NEW to the place you put the 4.3 tools. Oh, and you might want to warn your users that for the duration of the tests they shouldn't trust the C compiler, due to possible version skew between /usr/include and /usr/lib and your running system. Dan Hoey HOEY@NRL-AIC.ARPA #! /bin/sh # # 4.3mode: Install enough tools to build 4.3 kernel on 4.2 system. # Do "init" before anything else, "undo" before redoing "init". # Make changes in FILES only with "4.3mode undo"ne # # 4.3mode init -- sets up symbolic links # 4.3mode on -- switches links to 4.3 copies # 4.3mode off -- switches links back to 4.2 copies # 4.3mode undo -- undoes the symbolic links # # Set NEW to where you have put part of your 4.3 directory tree, # including all files in FILES. # NEW="/aic3/4.3utils/" FILES=" lib usr/include sys usr/sys bin/as bin/cc bin/ld \ etc/config usr/lib/gcrt0.o usr/ucb/symorder" NEEDBACK="! -r";RM="rm"; MV="mv" LN="ln -s"; LNP="/"; LNS=".4.2" case "$1" in init) NEEDBACK="-r"; RM="false"; MVT=".4.2";; undo) LN="false"; MVF=".4.2";; on) MV="false"; LNP="${NEW}"; LNS="";; off) MV="false";; *) echo "Usage: $0 init|on|off|undo"; exit 1;; esac for F in ${FILES} do if [ '(' ! -r /${F} ')' -o '(' ! -r ${NEW}${F} ')' -o \ '(' ${NEEDBACK} /${F}.4.2 ')' ] then echo "Problem with /${F}, /${F}.4.2, or ${NEW}${F}" ABORT="exit 1" fi done ${ABORT} for F in ${FILES} do ${RM} /${F} ${MV} /${F}${MVF} /${F}${MVT} ${LN} ${LNP}${F}${LNS} /${F} done