Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jan 1998 16:48:09 +1100 (EST)
From:      John Birrell <jb@freebsd1.cimlogic.com.au>
To:        alpha@FreeBSD.ORG
Subject:   Bootstrapping FreeBSD/Alpha
Message-ID:  <199801110548.QAA24424@freebsd1.cimlogic.com.au>

next in thread | raw e-mail | index | archive | help
G'day,

I've committed a bunch of changes that allow FreeBSD/Alpha to be
bootstrapped from an installed NetBSD/Alpha 1.3 system. The bootstrap
is not complete (after 2.5 days), but it is in a state where people
who want to play can do so using source that they are familiar with.

The bootstrap is not intended to clobber anything on the system you
are using. It uses a modified makefile based on the -current make
world, but unlike that makefile, there is no final install (yet).
The bootstrap will abort long before that. 8-).

The philosophy behind this bootstrap is that you start with a stock
NetBSD/Alpha installation and using the FreeBSD bootstrap procedure
you evolve into FreeBSD/Alpha. The system will remain a hybrid for
some time due to the differences in the kernel interface. The goal
is to be able to run as much of the FreeBSD user-space code as
possible and then (hopefully) people will step up to the plate to
take the system the extra mile.

Here's a summary of what the bootstrap does:

1.  Deletes a previous build if one exists. You always bootstrap
    from scratch.

2.  Installs FreeBSD's mkdep in the temporary build tree because
    the one in NetBSD isn't good enough.

3.  Runs NetBSD's make using FreeBSD's .mk and makefiles to build
    a new version of make from FreeBSD sources using NetBSD headers,
    installed libraries and tools.

4.  Builds a FreeBSD version of find which has the -L argument that
    NetBSD doesn't have. This version of find doesn't support the
    -fstype argument because NetBSD's libc doesn't support getvfsbyname().

5.  Runs mtree like a normal build does. At this point you'll find
    that you need to add a few users and groups because NetBSD doesn't
    support as many as FreeBSD does.

6.  Builds the obj tree like a normal build does.

7.  Re-makes make, this time using makefiles parsed by the FreeBSD
    make (just in case the NetBSD one came up with a different set
    of build commands).

8.  Builds install from the FreeBSD source because the NetBSD one
    doesn't know -C.

9.  Builds lex like the normal build does.

10. Creates links to the GNU programs that haven't been ported.

11. Builds gperf, tsort, bison, gcc, cpp, g++ etc which are
    needed to build the libraries.

12. Installs the FreeBSD header files in the temporary build tree.

Up to this point, all the builds have used the NetBSD make until the
FreeBSD one was built. The FreeBSD source files have been pre-processed
against NetBSD header files and the programs linked against NetBSD
libraries. From here on, the build continues to use FreeBSD programs
if they have been built and NetBSD ones otherwise. The build will
only look at FreeBSD header files from this point.

13. Builds a number of the most important libraries that are needed
    to link the remainder of the build tools. [You can expect the
    bootstrap build to come to a grinding halt somewhere in here
    when it tries to link against NetBSD's libc and finds that the
    locale functions referenced by ctype.h are not there. I've
    started porting libc to resolve this.]

14. Builds the rest of the build tools.

15. Makes dependencies on everything.

16. Builds everythings.

[And then you'd install to clobber the existing system if you got that far].

Before you use the bootstrap build, just give a thought to what you'd
do if it clobbers something it shouldn't. As always, you do this at
your own risk. 8-)

Here's what I do:

1.  Mount /usr/src from another (FreeBSD) machine.
2.  Create /usr/obj with enough disk space to build.
3.  cd /usr/src
    make -m /usr/src/share/mk buildworld
4.  Sit back and wait for it to crash. If it stops before you get to
    the libs, I've probably missed committing something.
5.  When it does stop, all of the things you've built will be in
    the /usr/obj/usr/src/tmp tree. They should run!

Let me (and this list) know how you get on. And if anyone else wants
to do part of this work, please do.

Regards,

-- 
John Birrell - jb@cimlogic.com.au; jb@netbsd.org; jb@freebsd.org
CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801110548.QAA24424>