Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 May 2012 10:28:38 +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 Mon, 14 May 2012 20:45:51 -0400, Thomas Mueller wrote:
> I guess after the first installkernel, to default location,
> I should immediately make installkernel again, this time with
> DESTDIR=/mnt?

That should be possible, you only have to make sure that both
"install targets" are fine with the kernel you just built (e. g.
both i386 _or_ amd64).

> Better to "make buildkernel" and "make installkernel" as two
> separate steps, rather than "make kernel"?

Yes. You only need to "make buildkernel" once, then "make installkernel"
for both $DESTDIRs.

> After rebooting single-user, do "mergemaster -p",
> then "mergemaster -p -D /mnt", and then "make installworld" and
> immediately following that, "make installworld DESTDIR=/mnt" ?

Refer to the commend header in /usr/src/Makefile for the
correct procedure. Without having it tested, the following
commands in SUM (after you have successfully installed the
new kernels) should work as intended:

	# merpemaster -p
	# make installworld
	# make delete-old
	# mergemaster

	# merpemaster -p -D /mnt
	# make installworld DESTDIR=/mnt
	# make delete-old DESTDIR=/mnt
	# mergemaster -D /mnt

	# reboot

Also see the comment regarding "make delete-old-libs" to be
applied after reboot correspondingly.

> After that, I would do "mergemaster -i" followed by
> "mergemaster -i -D /mnt"?  And then make delete-old followed
> by "DESTDIR=/mnt make delete-old"? 

It should be possible to pass DESTDIR= to make instead of "prefixing"
make with it. The parameter seems to be applied for _any_ of the
targets (as long as it would affect that target). You can add
additional parameters to the mergemaster examples above (such
as -i).

> Would I need to do "make distribution"?

I don't think so, unless you want to create a distribution media.

> First time, "make installkernel DESTDIR=/mnt" only installed part. 

What parts (of the kernel set) have been installed? To observe
differences, it might be helpful to save a `ls` or `ls -lR`
output before and after the installation and compare them.

> I installed to USB stick only after fully upgrading on main
> installation, finally copied /boot/kernel directory, and that
> USB stick is now bootable.  So now I know how to make a USB
> stick bootable with GPT.

Maybe kernel modules for GPT have been missing? Check /etc/src.conf
for any strange settings, see "man 3 src.conf" for details. You
can use this file to customize and "tweak" your builds.

> Maybe some of the files were cleaned out?

I'm not sure in how far the install* targets to remove files.
I suppose they will overwrite files if required...

> It is surely useful to have a rescue backup, considering the
> possibility of an update going awry on the main installation.

That's right. :-)

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

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