Building FreeBSD to install or update in two DESTDIRs
freebsd at edvax.de
Wed May 16 14:17:03 UTC 2012
On Wed, 16 May 2012 03:13:10 -0400, Thomas Mueller wrote:
> > > 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.
> 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).
> > > 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.
> I assume your "merpemaster" is a typo for "mergemaster"?
Ah yes, the well-known "P next to G typing error", procreated
by copy & paste. :-)
> I would have done each step for main installation and then for
> USB stick (DESTDIR=/mnt) before going to the next step, or
> maybe that doesn't really matter?
The order of targets does not matter. However, the order of
steps _per_ target does matter (e. g. "make installkernel"
first, _then_ "installworld" - it matters as soon as you boot).
> I think the second "mergemaster" was supposed to be done
> before "make delete-old", or maybe that doesn't really matter
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)
That means: "mergemaster -p" before installing world, "mergemaster"
(maybe with additional options) after installing world. I think
the delete-old and delete-old-libs steps can also be performed at
the end of the whole process. But doing what the instructions say
has always been the most comfortable way of avoiding trouble. :-)
> > > 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.
> I think I must have all GPT modules there; I have no trouble
> accessing hard-disk partitions, and USB stick when partitioned GPT.
> I might want to prevent building ulpt module because of hplip
> and HP 1212nf MFP printer idiosyncrasies, though that may or
> may not make any difference.
> I could also prevent building other modules that would not be used.
There are several means you can use for this: a custom kernel
configuration, settings in /etc/src.conf, settings in /boot/loader.conf.
It should not _require_ you to deal with a custom kernel if you want
to avoid that.
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions