+ fix some dialog entries to correctly modify variables instead of working
in a subshell
+ add a logverbose function for debugging purposes
+ force 512/4096 blocks on filesystems
+ use 'auto' for disklabel so it works irrespective of the floppy size.
This is useful for larger images than 1720k
of the default ones (which could be incorrect when doing cross builds).
Also, try to be backward compatible when compiling wmk (the goal being
able to use the most recent "picobsd" script on a wide range of
source trees).
in crunch.conf -- the previous choice, CWD, was too subject to false
matches (this string will be replaced by the absolute pathname
during the build process).
From the user's perspective:
* everything is now built outside the source tree (more precisely,
in `pwd`/builddir-${name}/ ) except for the kernel config file(s)
which still need to be copied into src/sys/i386/conf because of
"config" limitations. I am not sure if there is an easy way
to get away from this without changing "config" or replicating
some part of the source tree.
This is really the only change that most users should worry about,
but it is a good one.
* if you do cross-compiles (using "picobsd --src somedir/src [--init] ... ")
then the libraries and include directories etc. are searched/created
in "somedir/usr" ;
* you can do most things (basically build the kernel and the crunched
binary and the filesystem trees) without root privileges. You need
privileges to use mdconfig/vnconfig to create the actual MFS and
floppy image, unfortunately.
* the -v option now prints some diagnostic but does not stop for
user input at each step. You need to specify -v -v to have the
old behaviour.
Internally, the script has been reshuffled quite a bit to support
the above features. Many shell variables have been renamed or
made local in an effort to avoid undesired side effects. There is
a somewhat better error handling in case something goes wrong.
tree. Unfortunately the latter cannot be completely readonly, because
"config" still depends on the kernel config file being in sys/${ARCH}/conf
(it seems to derive other pathnames from that one).
before parsing the command line.
Move code to build include and libraries in a separate function,
so we can use the verbose flag for that.
Chang ownership of some directories so more of the build process
(namely, builds of include and libs) can be run without root
permission (we still depend on root permission to mount a memory
filesystem).
as well. This works by selecting "md" or "vn" depending on "uname -r"
output, so we can use the same script on -CURRENT and -STABLE.
Also included minor bugfixes and code cleanup.
Testers welcome, as this code has only been tested on -STABLE
(and for this reason I am doing an immediate MFC).
so as to make the "picobsd" script less version-specific.
Improve handling of cross-builds (which requires creation of
includes and libraries for the new source tree).
The "picobsd" script will not probably work on -current because it still
uses 'vn' instead of 'md', but i am commiting it anyways to keep it
in sync with the version in -stable.
better place to handle dependencies.
Make another step at helping cross-compiling: when the user specifies
an alternate source tree, the script takes care of creating include
files and libraries for the new tree.
Furthermore, build and use a version of the "config" program which
matches the new sources.
It takes a long time to create libraries, and it might even not do
the right thing at once, there might be some dependencies that i
have forgotten. At any rate, with this code i have been able to
build a working picobsd image using -CURRENT sources on -STABLE
MFC after: 3 days
With these scripts i was able to build a _working_ image of a
bridge-like floppy image with a reasonable set of utilities
in it, despite the code size increase we have in 5.0
The scripts are slightly different from the previous ones especially
on the place where the kernel and binaries are built. Hopefully
this will not cause too much trouble to people (is there any???)
using the old scripts.
Deprecate the "global" crunch.inc file and the CRUNCHFLAGS global build
options. Tools not policy. Move these global settings out into each
picobsd distribution.
a per program basis allowing a greater control on what is built.
The buildopts file contains Makefile lines of form:
# Anything added to OPTS is added to every build rule.
OPTS= -DNOPAM
# These should only be added to the build of user-ppp.
ppp_OPTS= -DNOKLDLOAD -DNOINET6 -DNONAT -DNOATM -DNOSUID \
-DHAVE_DES -DNORADIUS -DNOI4B -DNONETGRAPH
Really these should be added to crunch.inc, but that file is currently
optional, and if defined masks the global one. Next step will be to move
these global settings back out into the individual builds as OPTS, and
then migrate OPTS and prog_OPTS back into the local crunch.inc file.
Peter's new format, and I'd added hints files for each.
The build process uses the PICOBSD.hints file as well as the config,
and additionally builds with -DNO_MODULES. The build process
probably needs to be converted to use the 'buildkernel' method
instead of running config itself.
The kernels now compile. I've not been able to test the crunch
process however because it used the vn driver and there are no
/dev/vn device nodes under devfs yet. Maybe someone else could
give it a go.
build process in too many cases. Adding mtree to bootstrap-tools
to solve this breaks the upgrade path because mtree needs a
libc that has strtofflags and fflagstostr.