Commit Graph

99 Commits

Author SHA1 Message Date
Luigi Rizzo
fbcd78c3cb Misc fixes to the build script:
+ 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
2002-03-08 02:24:21 +00:00
Luigi Rizzo
99d1dbfdb0 Use { } instead of ( ) for grouping shell commands so that
variable assignments are retained ( () creates a subshell)

Reported-by: Michael Bretterklieber <mbretter@inode.at>
2002-02-14 19:21:50 +00:00
Luigi Rizzo
e96781579c Whoops... left some junk in previous commit. 2001-11-24 20:24:36 +00:00
Luigi Rizzo
11bc3e5610 Let "make" use the .mk files from the correct source tree instead
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).
2001-11-24 20:22:20 +00:00
Josef Karthauser
0dec49d17a Use a local write_mfs_in_kernel.c instead of the one in ncvs/src/release
which is likely to be removed shortly, after repo-copying it from
there.
2001-11-20 01:00:52 +00:00
Luigi Rizzo
3c560efb1a Provide a new picobsd option, "--modules", to also build modules
(modload and friends are sufficiently small to consider their inclusion
in PicoBSD images).
2001-11-01 16:17:37 +00:00
Luigi Rizzo
9bbeaf002b Use host keys from the config directory if they exist, instead of
regenerating them.

Make the script handle relative paths for the source directory.
2001-10-07 17:22:46 +00:00
Luigi Rizzo
56d75155a6 Fix a typo and sync a comment with the version in RELENG_4 2001-10-07 00:21:13 +00:00
Luigi Rizzo
c1a4244819 Use @__CWD__@ as the magic string meaning "this directory"
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).
2001-10-04 00:42:20 +00:00
Luigi Rizzo
4cd80eaaaf A somewhat large change of this script.
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.
2001-10-02 17:06:51 +00:00
Luigi Rizzo
d8e39ff94b Compile the kernel under ${BUILDDIR} instead of polluting the source
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).
2001-10-02 16:53:50 +00:00
Luigi Rizzo
d38e229ac3 Move a bunch of initialization into a function which must be run
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).
2001-09-28 21:02:15 +00:00
Josef Karthauser
8b7c2294ba On -current with devfs there is no MAKEDEV in /dev anymore, so use
it from ${SRC}/etc/MAKEDEV instead.

We may want to do this on -stable as well, but for now -stable still
uses /dev/MAKEDEV.
2001-09-20 13:34:16 +00:00
Josef Karthauser
1a77e80042 Relocate the memory disk selection code to the same place the other
variables are set.
2001-09-20 13:09:01 +00:00
Luigi Rizzo
a2f6c865cd Make the script aware of mdconfig, so it can hopefully run on -CURRENT
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).
2001-09-20 02:52:02 +00:00
Luigi Rizzo
1d199fd358 Move commands to create stripped kernel into Makefile.conf,
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.
2001-09-04 02:01:52 +00:00
Luigi Rizzo
93c013c83e use correct "compile" directory, which is ../../compile/<filename>
This does not apply to RELENG_4 for which the compile directory is
../compile/<filename>
2001-09-01 21:19:15 +00:00
Luigi Rizzo
7f61417f8e Supply a default value for the kernel config binary. 2001-09-01 19:16:00 +00:00
Luigi Rizzo
e619430f32 Bugfix: Use the correct variable for picobsd type (same bug is
present in STABLE).  Also add a bit more logging (when enabled).
2001-09-01 18:27:39 +00:00
Luigi Rizzo
5d97a228a8 add a missing -o.
There might be some other bug related to OBJDIR handling, once
fixed these changes can be MFC immediately.
2001-08-30 21:39:14 +00:00
Luigi Rizzo
a39c93813c Move handling of crunch* files into Makefile.conf, which is a
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
2001-06-21 08:49:46 +00:00
Luigi Rizzo
da485c53a9 Move variable assignement after argument parsing, to improve handling
of alternate source trees.

Also improve verbose behaviour.
2001-06-20 14:16:48 +00:00
Luigi Rizzo
630802eb2a Sync picobsd script with the one in -stable, and also
patch boot2 so it goes to load /kernel right away

Perl code from Josef Karthauser
2001-05-11 07:39:40 +00:00
Luigi Rizzo
f07e0883ca remove a reference to a nonexisting script, "clean", when
building all images. Also, build "bridge" image as well.

Reported-by: Bruce Montague
2001-05-08 20:44:37 +00:00
Josef Karthauser
18668d0278 MF4S: Sync with the developments that Luigi's been doing in -stable. 2001-04-23 19:55:03 +00:00
Josef Karthauser
7bba070f1c MF4S: Remove some unused error messages. (revision 1.1.2.5) 2001-04-23 19:52:13 +00:00
Josef Karthauser
b8ff2fec46 MFS4: Do not terminate if it fails to clean something. (rev 1.12.2.5) 2001-04-22 23:58:46 +00:00
Luigi Rizzo
25801a0e8b Bring the new script into -current. Still untested here, but there
is a high chance that they work modulo minor things.
2001-02-20 17:09:40 +00:00
Luigi Rizzo
b8c84b6286 Make correct entries for atapi disks 2001-02-18 06:50:40 +00:00
Luigi Rizzo
a0ab7f4419 Put picobsd build scripts in sync with the ones in -STABLE.
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.
2001-01-29 22:47:46 +00:00
Josef Karthauser
e1f903baf7 MF4: Allow the build process to continue even if crunchgen returns an error.
Most crunchgen errors are non-fatal.
2001-01-11 22:35:57 +00:00
Josef Karthauser
1826f66757 Remove floppy.tree from the build directory. 2000-12-23 19:33:13 +00:00
Josef Karthauser
04dbe0f9b9 Determine the names of the picobsd releases automatically.
Use the 'realclean' target in the crunch.mk file for cleaning the object
build tree.
2000-12-23 16:53:35 +00:00
Josef Karthauser
5e75ac9fe2 Utilise the -p file to crunchgen to specify where the objects should
be built and remove the previous glue that did the same thing.
2000-12-18 16:28:03 +00:00
Josef Karthauser
d08c457148 Fixup the /tmp directory permissions to 01777.
PR:     misc/15875
2000-11-07 20:40:21 +00:00
Josef Karthauser
57b8982cca Load the kernel and root file systems from floppy:/. 2000-11-07 12:33:46 +00:00
Josef Karthauser
c6e77fea54 Crunchgen now has the necessary magic to include the make hooks that
munge_crunchmk was adding for us.
2000-11-03 15:50:04 +00:00
Josef Karthauser
095aac1a86 Fold the buildopts into the existing crunch.inc file.
Deprecate the "global" crunch.inc file and the CRUNCHFLAGS global build
options.  Tools not policy.  Move these global settings out into each
picobsd distribution.
2000-11-03 01:33:03 +00:00
Josef Karthauser
be0d2a8f18 Build picobsd object files in /usr/obj/picobsd/${TYPE}. 2000-11-02 13:38:10 +00:00
Josef Karthauser
a5e7d98e8a Post process the crunch1.mk file to allow make arguments to passed on
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.
2000-11-02 13:16:43 +00:00
Josef Karthauser
c7afc3e07c Remove an unneeded declaration for OBJ. 2000-11-02 12:46:02 +00:00
Josef Karthauser
0a007e03a9 Copy the built kernel from the right place. (Forgotten in the last
commit.)
2000-11-02 01:57:23 +00:00
Josef Karthauser
72d93b8e80 Build the PICOBSD kernels using the 'make buildkernel' method. 2000-10-16 08:08:31 +00:00
Josef Karthauser
1e2b0ddcfa Fix the PICOBSD kernel configs. They're now converted to use
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.
2000-10-15 20:42:22 +00:00
Marcel Moolenaar
11017a687b Backout addition of -L switch to mtree. Using -L breaks the
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.
2000-07-23 16:33:00 +00:00
Andrey A. Chernov
8b873d926b Add -L to mtree.
Not shure ever it needed for MFS, but just to keep old behaviour exact, can be
removed later
2000-07-16 08:44:40 +00:00
Roger Hardiman
7bae8dfb17 Add .image.list to the list of temporary files which can be deleted 2000-07-01 13:51:22 +00:00
Roger Hardiman
5bbd55b415 Add 'bridge' so we can clean up the bridge files too 2000-07-01 04:40:01 +00:00
Doug White
223b633217 Commit PicoBSD mega-patch:
. Bring PicoBSD up to date with -CURRENT reality.
. Make PicoBSD smart and not spam /dev/vn0 and /mnt.  Now it uses the first
  unused vn device and creates a temporary mountpoint in /tmp.
. Miscellaneous build cleanups and optimizations.

Unfortunately the bridge, isp, and router floppies are too big and need
the axe treatment.  The install floppy needs updating to -CURRENT. Dial and
net build and (appear to) run OK.  I will be adressing these in the
near future (unless someone beats me to it :-) ).

PR:		misc/17737
Submitted by:	Omachonu Ogali <oogali@intranova.net>
2000-04-25 19:00:08 +00:00
Luigi Rizzo
c97822e186 Add global version of mfs.mtree -- this is common to most floppy types
Approved-by: jordan
2000-02-08 11:39:28 +00:00