Friday, February 26, 2021

Finding my way

 My last entry was a bunch of compile times with no context.

This post will give the context -hopefully!

First, I want to show why I think I may be on the right track:

iso-image ===> etc
make iso-image started at:  Fri Feb 26 12:57:59 AKST 2021
make iso-image finished at: Fri Feb 26 12:58:01 AKST 2021
===> Successful make iso-image
===> build.sh ended:      Fri Feb 26 12:58:01 AKST 2021
===> Summary of results:
         build.sh command:    ./build.sh -X /home/random/netbsd9/usr/xsrc -x -m sparc -j 5 -U -u -O /home/random/netbsd9/usr/obj -R /home/random/netbsd9/rel/rel-sparc -T /home/random/netbsd9/tooldir/tooldir-sparc release iso-image
         build.sh started:    Fri Feb 26 12:35:41 AKST 2021
         NetBSD version:      9.1_STABLE
         MACHINE:             sparc
         MACHINE_ARCH:        sparc
         Build platform:      Linux 4.19.0-14-amd64 x86_64
         HOST_SH:             /usr/bin/sh
         MAKECONF file:       /etc/mk.conf (File not found)
         TOOLDIR path:        /home/random/netbsd9/tooldir/tooldir-sparc
         DESTDIR path:        /home/random/netbsd9/usr/obj/destdir.sparc
         RELEASEDIR path:     /home/random/netbsd9/rel/rel-sparc
         Updated makewrapper: /home/random/netbsd9/tooldir/tooldir-sparc/bin/nbmake-sparc
         Successful make release
         Successful make iso-image
         build.sh ended:      Fri Feb 26 12:58:01 AKST 2021
===> . 

At this point, it seems as if I'm able to compile sparc/32 ...including X...in 23 minutes. That started at 12:35 and ended at 12:58. 

I haven't tested the iso to confirm that there's X on it, however. 

Even if that has messed up (and I've no reason to think it has) I'm still in the right direction. What I'm referring to is using some of the more advanced(ish) features of buildsh. I have set up a per-arch tools dir and built the tools for several architectures. The quick compile time of sparc32 shows that it's paying off. 

I have a shell script that still has some flaws, but will show you the general idea of what I'm trying to do:

$ cat ../makeit.sh
#!/bin/bash
export TTDR=$HOME/netbsd9/tooldir/tooldir-
export RREL=$HOME/netbsd9/rel/rel-
export OOBJ=$HOME/netbsd9/usr/obj
 for x in i386 sparc64
do
mkdir $RREL$x
./build.sh -X ~/netbsd9/usr/xsrc/ -x -m $x -j 5 -U -u -O $OOBJ -R $RREL$x -T $TTDR$x release iso-image

done

I'm setting up the directories, then the enviromental variables and having mixed results. As I was typing this up, my i386 compile crashed -and now I'm trying with arch-specific obj dirs -a change not reflected in the snippet above.

I also need to research how/what buildsh does with DESTDIR and how to set it, too.

No comments:

automating zfs mounts -a quick and very dirty script

 #!/bin/sh for x in obj xsrc src pkgsrc pkgsrc/distfiles pkgsrc/packages pkg         do zfs create ext/$x zfs set mountpoint=/usr/$x ext/$x ...