Re: Building FreeBSD to install or update in two DESTDIRs

2012-05-17 Thread Thomas Mueller
from Polytropon:

 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 don't want more than one additional installation, and might do that one only 
once.

But if I wanted to create many bootable systems from scratch, I could create an 
installation image, ISO or memstick.

  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. :-)

I think only one build machine is used to create FreeBSD snapshots?  You can 
'make universe'?

I guess the fun more than doubles when I try to create a NetBSD installation 
cross-building from FreeBSD, or a Cross-Linux-from-Scratch.

Consider that NetBSD has been unstable on my new computer even with a binary 
installation.

  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.

I think freebsd-update is for a binary upgrade from the freebsd.org servers?

Tom
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Building FreeBSD to install or update in two DESTDIRs

2012-05-16 Thread Thomas Mueller
  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.

  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?

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?

I think the second mergemaster was supposed to be done before make 
delete-old, or maybe that doesn't really matter either?

  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.

Tom
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Building FreeBSD to install or update in two DESTDIRs

2012-05-16 Thread Polytropon
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
 either?

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.




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Building FreeBSD to install or update in two DESTDIRs

2012-05-16 Thread Thomas Mueller
  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.

 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?

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

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

For i386, I would follow advice on http://wiki.freebsd.org/Wine 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.

Tom
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Building FreeBSD to install or update in two DESTDIRs

2012-05-16 Thread Polytropon
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 http://wiki.freebsd.org/Wine
 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. :-)





-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Building FreeBSD to install or update in two DESTDIRs

2012-05-15 Thread Polytropon
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. :-)




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Building FreeBSD to install or update in two DESTDIRs

2012-05-14 Thread Matthew Seaman
On 14/05/2012 00:10, Thomas Mueller wrote:
 I tried make installkernel and make installworld, but those didn't
 fully work right the second time, with DESTDIR=/mnt (USB stick main
 partition).

What exactly went wrong?  Setting DESTDIR is the correct way to do this
sort of thing.  You only need to set it when running the installworld or
installkernel steps though -- there's nothing that gets compiled into
/usr/obj which prevents you from installing into a different than normal
tree.

I use this sort of construct frequently for updating jails, or when
managing boot environments.

 /usr/src/UPDATING doesn't say how to update for two DESTDIRs on the
 same build.

For each different DESTDIR, just repeat the installworld, installkernel,
check-old, delete-old* steps setting DESTDIR=/some/where
on the make command line.

The equivalent for mergemaster is to add '-D /some/where' to the
commandline.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey




signature.asc
Description: OpenPGP digital signature


Re: Building FreeBSD to install or update in two DESTDIRs

2012-05-14 Thread Wojciech Puchar

I would like to build FreeBSD to install in two places: regular hard drive and 
also on a USB stick, probably 8 GB.

USB stick install would be for backup, in case something goes awry with a later 
update, then I have something to fall back on; could also install tools such as 
gdisk to use on hard drive.

I tried make installkernel and make installworld, but those didn't fully work 
right the second time, with DESTDIR=/mnt (USB stick main partition).

REALLY can't help you without any info attached.

As from your description it just have to work and you did all fine.

anyway i usually just do installs to DESTDIR=/something, then tar.gz it 
up, and untar whenever i need (but separately tar.gz for /boot/kernel 
subdir)


use --unlink option when untarring on live system.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Building FreeBSD to install or update in two DESTDIRs

2012-05-14 Thread Thomas Mueller
 What exactly went wrong?  Setting DESTDIR is the correct way to do this
 sort of thing.  You only need to set it when running the installworld or
 installkernel steps though -- there's nothing that gets compiled into
 /usr/obj which prevents you from installing into a different than normal
 tree.

 I use this sort of construct frequently for updating jails, or when
 managing boot environments.

  /usr/src/UPDATING doesn't say how to update for two DESTDIRs on the
  same build.

 For each different DESTDIR, just repeat the installworld, installkernel,
 check-old, delete-old* steps setting DESTDIR=/some/where
 on the make command line.

 The equivalent for mergemaster is to add '-D /some/where' to the
 commandline.

 Cheers,

 Matthew

 --
 Dr Matthew J Seaman MA, D.Phil.

I guess after the first installkernel, to default location, I should 
immediately make installkernel again, this time with DESTDIR=/mnt?

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

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

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? 

Would I need to do make distribution?

First time, make installkernel DESTDIR=/mnt only installed part.  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 some of the files were cleaned out?

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

Tom
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Building FreeBSD to install or update in two DESTDIRs

2012-05-13 Thread Thomas Mueller
I would like to build FreeBSD to install in two places: regular hard drive and 
also on a USB stick, probably 8 GB.

USB stick install would be for backup, in case something goes awry with a later 
update, then I have something to fall back on; could also install tools such as 
gdisk to use on hard drive.

I tried make installkernel and make installworld, but those didn't fully work 
right the second time, with DESTDIR=/mnt (USB stick main partition).

/usr/src/UPDATING doesn't say how to update for two DESTDIRs on the same build.

Update (from 9.0_RELEASE amd64 to STABLE) was successful on main, hard-drive 
installation.  I had spontaneous reboots at times of inactivity, without 
cleanly umounting file systems, under the release, but upgrading to STABLE 
fixed that.

I also want to build the same 9.0_STABLE to install on a 16 GB USB stick, which 
could be used on my older computer, but this would be i386 version; I could 
also use it on new computer for 32-bit compatibility needed for emulators/wine 
(but not doscmd, I tried that and didn't like it.). I can't do this on old 
computer from FreeBSD 8.2 because of shortage of disk space and only 256 MB RAM.

I could do that either concurrently (how?) or after the amd64 update.

Tom
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org