Discussion:
postinstall reference files without /usr/src
J. Lewis Muir
2014-09-25 22:28:46 UTC
Permalink
Hello, NetBSD Users.

I built the netbsd-6 CVS branch from source using BUILD-NetBSD from
(pkgsrc) sysutils/etcmanage (0.8.2). This creates a directory named
releasedir which contains the binary sets and kernel. I then copy these
binary set and kernel files to a target machine where I install them
using INSTALL-NetBSD. Doing this enables me to not keep a source tree
on the target machine nor build from source on the target machine.

After running INSTALL-NetBSD on the target machine, I want to run
"postinstall check". Unfortunately, this does not work because
"/usr/src" does not exist. Looking at the postinstall(8) man page shows
me that there's a '-s' option to specify reference files. So, I can
do "postinstall -s [RELEASEDIR]/amd64/binary/sets/etc.tgz check" where
[RELEASEDIR] is the path to the releasedir directory I copied over. For
this form of the '-s' option, it says the etc.tgz file must be specified
and the xetc.tgz file is optional. My question is, are all the other
set files optional too? Or put another way, is the '-s' option only for
specifying etc.tgz and xetc.tgz, or is it also intended to be used for
base.tgz, comp.tgz, and so on, and by not specifying those, some checks
will be skipped?

Thank you!

Lewis
Greg Troxel
2014-09-26 00:42:36 UTC
Permalink
Post by J. Lewis Muir
I built the netbsd-6 CVS branch from source using BUILD-NetBSD from
(pkgsrc) sysutils/etcmanage (0.8.2). This creates a directory named
releasedir which contains the binary sets and kernel. I then copy these
binary set and kernel files to a target machine where I install them
using INSTALL-NetBSD. Doing this enables me to not keep a source tree
on the target machine nor build from source on the target machine.
Indeed, this is part of the point of the scripts.
Post by J. Lewis Muir
After running INSTALL-NetBSD on the target machine, I want to run
"postinstall check". Unfortunately, this does not work because
"/usr/src" does not exist. Looking at the postinstall(8) man page shows
me that there's a '-s' option to specify reference files. So, I can
do "postinstall -s [RELEASEDIR]/amd64/binary/sets/etc.tgz check" where
[RELEASEDIR] is the path to the releasedir directory I copied over. For
this form of the '-s' option, it says the etc.tgz file must be specified
and the xetc.tgz file is optional. My question is, are all the other
set files optional too? Or put another way, is the '-s' option only for
specifying etc.tgz and xetc.tgz, or is it also intended to be used for
base.tgz, comp.tgz, and so on, and by not specifying those, some checks
will be skipped?
I am 99% sure that postinstall really just wants an unpacked etc.tgz and
xetc.tgz somehow.

You'll find that INSTALL-NetBSD leaves the etc.tgz and xetc.tgz sets
unpacked in /usr/netbsd-etc, so you should be able to do:

postinstall -s /usr/netbsd-etc check

which is working for me.
Martin Husemann
2014-09-26 08:26:33 UTC
Permalink
Post by Greg Troxel
I am 99% sure that postinstall really just wants an unpacked etc.tgz and
xetc.tgz somehow.
There are two ways to use it. Assuming you have transfered all your sets
to /tmp on the target machine:

postinstall -s /tmp/etc.tgz -s /tmp/xetc.tgz -d / check

or (which is very usefull on machines where unpacking takes serious time):

mkdir /tmp/etc && cd /tmp/etc
tar xpzf ../etc.tgz
tar xpzf ../xetc.tgz
postinstall -s /tmp/etc -d / check

I usually do the latter, but split into two phases: extract etc/xetc, delete
those two sets, then extract all the others onto the target root, then
run postinstall with -s pointing to the previously extracted etc dir.

Martin

Loading...