Wait with starting the mk.service until the network is up
Comprehensive network interface support: DHCP on all the things!

This implements DHCP configuration for all network interfaces.  Literally all
of them, in fact: anything other than the loopback interface should
automatically be:

A) added to `/etc/sysconfig/network-scripts/ifcfg-*`.
B) configured for DHCP.
C) configured not to fail if a DHCP offer is not received, but to
   keep trying until one finally arrives on that interface.
D) brought up with the `network.service` systemd unit.

This is fully automatic -- no user configuration is supported, and it is
fully driven out of udev device discovery.

This also means that it should work with, eg, hotplug network interfaces, USB
devices that show up late, layered or lazy network interfaces (if anyone *ever*
implements one of them, though VPN seems ... possible, if crazy), etc.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Migrate to a systemd timer rather than a Ruby loop

This migrates the Microkernel binary away from a Ruby "daemon" and back to a
model where an external process supervisor triggers each run.  This, in turn,
resolves the robustness problem where network issues can cause it to fail out
and ultimately never restart.

In this model a systemd `mk.timer` unit replaces the Ruby daemon code, and the
`mk.service` unit is a one-shot trigger that runs the script and exits -- good
or bad -- before waiting on being triggered again.

The one feature this lacks is adjusting the timer interval dynamically; it is
technically possible (by editing the timer unit and reloading it), but not
implemented and possibly not entirely desirable.

This should, at least, make the registration (and, presently, command
execution) process as robust as systemd itself, which should be approximately
as robust as the entire Linux stack.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Use sysfs directly to obtain hardware ID MAC address data

This replaces the use of Facter, and regular expressions, in determining the
set of MAC addresses to use for the hardware ID.  Now, instead, we use a
Linux-specific method to get the data -- trolling directly through sysfs and
reading the attributes directly.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Remove MK code gem after installing it

When building the Microkernel image, we copy the gem into the target
filesystem, then install it.  Previously we left the gem archive sitting on
disk; now it is deleted.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Use UTC timezone for the Microkernel

The Microkernel was previously configured in the US/Eastern timezone -- which
is not the most helpful source of timestamps on the west coast, let alone
elsewhere in the world.

This updates the image to use UTC, which is probably the least worst portable
timestamp / system clock timezone option available to us.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Don't preserve the one unpacked en_US locale file

The previous code carefully went through and preserved the en_US locale
message files, etc, that were not packed into the base archive.  This was a
grand total of one (unimportant) message collection -- which roughly
duplicated the `C` locale built into the application.

This just deletes the whole lot.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Cut ~ 98MB out of the pregenerated locale archive

Instead of unpacked locale data, Fedora 19 uses a binary archive that is
memory mapped into every running process.  Conveniently, this avoids a lot of
the overheads of the older, separate files.

Inconveniently for us, they build it with all the locales in, and that weighs
in at about 100MB of data.  Now, we purge everything but en_US locale data,
giving us a resultant image of 2.1MB.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Yum can clean up temporary data on it's own

Instead of manually emulating `yum clean all`, we just invoke it.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Remove more packages, more cleanly

A number of packages are only needed during the build process; this removes a
much broader set and shaves some more MB out of the final image.

It also moves the package removal *before* we destroy their unpacked locale
data, removing a stream of complaints from the packaging tools -- and making
it possible to see if something actually went wrong!

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Truncate logfiles before building the image

A number of logfiles have data -- a piddly amount -- from during the build
process, not the current run of the Microkernel.

While the data savings are trivial, this ensures that what you get in the logs
reflects what *actually* happened on this machine, without polluting it based
on whatever random system the Microkernel ISO was built on.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Remove /boot from inside the Microkernel images

The build process for the microkernel extracts the kernel and other components
out of the target image, and writes them to the ISO9660 filesystem.

Once booted, the running in-memory system contained another copy of the same
kernel and support code -- useful for installing to disk, but absolutely
worthless for anything at runtime.

This commit deletes those files before the final archive is built; they are
already copied into the "outside" ISO9660 filesystem by this point.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Disquiet the microkernel boot process

This turns off graphical, and quiet, booting of the Microkernel image.
Hopefully that makes it a bit easier to debug problems that crop up along the
way, rather than obscuring them more.  (In testing, it certainly did.)

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Ensure we don't share `random-seed` in all MK boots

While the risks are probably low, having a single, fixed and easily discovered
random seed on all Microkernel images is probably not a good strategy.

This destroys the file containing the data, if present, which will simply
cause the Microkernel to skip seeding the PRNG on boot.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Disable SSH daemon by default

This disables starting the SSH daemon in the Microkernel instance by default,
which seems like the best security strategy.  We can enable a Microkernel
command in future to start it for us, or perhaps offer some kernel
command-line feature to enable it.

This also destroys -- if present -- any SSH host keys in the final image.
The startup process for sshd will generate new, unique microkernel keys.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Compress the cracklib dictionary

This reduces the memory footprint of the cracklib dictionary in the final
image, which should help (a touch) on low memory systems.  It is unlikely that
the content will ever be used, but better safe than sorry.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Exclude some additional packages from the image

These packages are not needed during build, or at runtime.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Fix the Microkernel release at Fedora 19

Rather than defaulting to whatever release of Fedora we are building on, this
fixes our mirror to an F19 mirror.  That should produce a more predictable
result for users building on platforms other than the version we happen to be
running on presently.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Fix a bug in b852f52 causing a reboot during builds

Apparently I included an *execution* of `reboot(1)` in the build-livecd script
when I migrated from a Ruby daemon to systemd.  This went unnoticed until
current testing came around; this commit fixes that.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Use puppetlabs yum repos

We want to pull int he latest released version of facter, not the slightly
outdated one from the Fedora repos.

Fixes https://github.com/puppetlabs/razor-el-mk/issues/12