the author obviously meant a void since he doesn't return any values.
One caveat, http_request has three return()'s, but doesn't do anything
with it. Either the code needs to be rewritten to take care of proper
error handling on that point, or the returns ripped out. I made it void
for now.
We had to give up DDB and grep this time...
Add a hint in "config" on how to increase the image size so
we can stuff more things in the image (mostly for use on a CDROM).
directories when writing to disk.
Use the (yet to be committed) sysctl variable kern.bootdevname
to derive the device name, fallback to /dev/fd0 if kern.bootdevname
is unset or not available.
closer to doing "the right thing".
The structure is now the following:
* /etc/rc (from MFS) loads the rest of /etc and /root from
/fd and then from floppy (if present), then transfers control
to /etc/rc1
* /etc/rc1 loads defaults from /etc/rc.conf.defaults, tries to
set the hostname basing on the MAC address of the first ethernet
interface, and then sources /etc/rc.conf and /etc/rc.conf.local
for local configurations
* The rest of the startup process is then performed (rc.network and so on).
Everything except the initial /etc/rc (from MFS) can be overridden with
a local version loaded from floppy. But in most cases, you should only need
to customize the following files in /etc:
rc.conf rc.firewall hosts
Previously there were a number of inconsistencies in the calling
between files, and also a lot of clutter in rc.conf and rc.firewall.
Also, "rc1" was called "rc" and would overwrite the initial /etc/rc
from MFS, making it really hard to figure out what was going on in
case of bugs.
+ 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
and disable telnet and friends in favour of ssh/sshd/scp.
Pull out a few NIC drivers from the config file to make the
image fit into a 1.44 image again. I have left "lnc" in as that is
emulated by vmware so this can be booted there.
"top" does (thinking of it, i could have as well used the same format line!)
This only makes sense when "-w" option is also specified, because the
load is computed as the difference between subsequent samples.
I think this (and the "-d" feature which shows differences in the
network statistics counts) would also make sense in the standard
vmstat and netstat.
only once into an array of shell variables, and then scan the array
to find entries matching the MAC address.
Associative arrays would really be handy here...
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).
refuses to start if it does not find a matching entry for the terminal
type.
My impression is that this is a problem in the shell, because
at least on PicoBSD images, the shell itself coredumps.
Anyways, this is the quickest fix i can come up with.
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.
I get a link error on in6addr_<something> and i cannot find the
symbol in any of the libraries. It might be my mistake, but in any
case the crunched binary would overflow the floppy, so...
This applies to -current only.
Make sure hints are statically compiled into the kernel,
because the bootloader is not available in picobsd and so the
hints file cannot be found at run time.
(This is kind of inconvenient if you have to handle non PnP devices,
but fortunately these days non-PnP ISA cards are disappearing...)
This must have to do with the use of devfs in -CURRENT, but i
have no idea when the devfs is actually mounted (is it a
side effect of mount -t nonfs or what ?) and when /dev/fd0c becomes
available.
For the time being, let's use this hack. Once I understand how devfs
works, this can be reverted back to the previous value, and also the
part of the build script which creates device entries can be nuked.
This is for -current only.
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