Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 May 2012 00:57:21 +0200
From:      Polytropon <>
To:        "Thomas Mueller" <>
Subject:   Re: Building FreeBSD to install or update in two DESTDIRs
Message-ID:  <>
In-Reply-To: <>
References:  <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Wed, 16 May 2012 18:46:28 -0400, Thomas Mueller wrote:
> > > The idea was to "make buildkernel" once and "make buildworld" once
> > > and install to two different DESTDIRs.
> > I'm not sure I understand: The two install* targets ("make installkernel"
> > and "make installworld") are only able to install to _one_ location,
> > which is the _default_ location *or* the location pointed to by
> > DESTDIR. It is not possible to perform _one_ install step which
> > will cause results in _two_ locations (without any means of
> > "hidden duplication", e. g. by using a mirroring technique).
> The idea was to "make buildkernel" once and "make buildworld" once,
> but "make installkernel" and "make installworld" would each have
> to be done once for each DESTDIR, meaning twice each.  Building
> takes much more computer resources than installing, so I try to
> avoid building the same thing twice.

Yes, _that_ is the correct approach.

In case you need to do more than one additional installation,
you should consider creating a tar archive of the fully installed
system and then use tar --unlink to the mounted target. If you
need to create many bootable systems from scratch, a script
performing the disklabel, newfs, mount and tar steps should
be easy to write.

> > I'm refering to the instructions presented in /usr/src/Makefile:
> > # For individuals wanting to upgrade their sources (even if only a
> > # delta of a few days):
> > #
> > #  1.  `cd /usr/src'       (or to the directory containing your source tree).
> > #  2.  `make buildworld'
> > #  3.  `make buildkernel KERNCONF=YOUR_KERNEL_HERE'     (default is GENERIC).
> > #  4.  `make installkernel KERNCONF=YOUR_KERNEL_HERE'   (default is GENERIC).
> > #       [steps 3. & 4. can be combined by using the "kernel" target]
> > #  5.  `reboot'        (in single user mode: boot -s from the loader prompt).
> > #  6.  `mergemaster -p'
> > #  7.  `make installworld'
> > #  8.  `make delete-old'
> > #  9.  `mergemaster'            (you may wish to use -i, along with -U or -F).
> > # 10.  `reboot'
> > # 11.  `make delete-old-libs' (in case no 3rd party program uses them anymore)
> I checked /usr/src/UPDATING, and the sequence was
> ...
> <reboot in single user mode>
> mergemaster -p 
> make installworld
> mergemaster -i  (one may wish also -U)
> make delete-old
> <reboot>
> I checked /usr/src/Makefile , and found you quoted correctly,
> see 'make delete-old' and the second 'mergemaster' are transposed
> relative to what I saw in /usr/src/UPDATING 
> Sort of confusing; make either way works?

It should not be much difference if you consider what the
"steps in permutation" do: mergemaster modifies files,
make delete-old removes stuff that isn't needed anymore.
Both steps don't seem to affect each other. a + b = b + a. :-)

> Subsequently I would also want to build for i386, but this
> would be after the amd64 build and installation/update.

In case you're creating different TARGET= architectures,
the fun doubles. :-)

> It would be nice if bsdinstall had an option for update as
> well as fresh install.

This step can easily be performed manually using freebsd-update
right after installation.

If you understand update == overwrite, just don't format the
partitions that are already present on the target media.

> For i386, I would follow advice on
> but would want a full installation capable of running
> independently of amd64, would need the kernel, would install
> on 16 GB USB stick which could be mounted on /compat/i386. 
> I would want to use hard-drive PORTSDIR, would need to so
> adjust /etc/make.conf .  I don't really want to think of
> building big ports on a USB stick, especially on the older
> computer with 256 MB RAM and USB 1.1 on motherboard.

Also note that USB sticks are "not real R/W media", they
suffer more from using than hard disks do, and they're
slower of course. :-)

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

Want to link to this message? Use this URL: <>