CLIP: Add bootstrap support for 32-bit archs

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: Fix Pungi patches.

The patch was reversed, and the .patched was a dupe file.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: Fix live cd target names.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: Add our custom livecd-tools for build host.

livecd-tools contains a bug:
https://bugzilla.redhat.com/show_bug.cgi?id=766955

So carry our own, apply our patch, add support to our bootstrap
script that installs ours and removes bad versions when necessary.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: Kill tail process in %post to fix live media.

Live media builds fail to umount critical devices if files are in use
(understanably).  Our tail process needs to be terminated at the end of
%post as a result.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: Switch to host's patched livecd-creator.

We are now carrying our own livecd-creator due to the need to patch some
components and the expectation we will need to do more patching moving
forward.  Drop the calls to the one we carried in support/.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: add sudo to installed package list

For some reason it is not getting pulled into live media builds through
deps.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: Drop unused cruft from ks Makefile

We are no longer using mayflower and the commented out livecd args can
be dropped.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: Drop mayflower from support/ - not needed for RHEL 6

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: Add support for easily expanding SRPMS for patching.

New target called "patchy" expands an existing srpm, runs rpmbuild build
prep (-bp) which expands the sources and applies all exisint patches,
then creates you and a/ and b/.  Then you go and modify b/ and make your
new additive patch :)

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: Add patches to fix livecd-creator for RHEL6.

- Trim the boot menu a bit.  More trimming will be done later.
- Force all SELinux bits to be updated when relabeling the fs images.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: Add custom dracut module to fix livecd booting w/ SELinux.

The SELinux bits in dracut weren't written for RAM-backed stateless
environments like those found in LiveCDs.  Specifically, if a relabel is
required, it was performed in dracut, but the autorelabel file was never
removed in the system was never put back into enforcing (if necessary).
This is a problem because if autorelabel is present when rc.sysinit runs
the system relabels (again) and reboots.  Since this is stateless all
changes are lost, and the entire thing starts over again, and again, and
again.  Additionally, it wasn't putting the system back into enforcing
mode after a relabel.

This module runs after the default selinux module, removes the
autorelabel file, and sets the enforcing mode appropriately (permissive
or enforcing depending on config).

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: policy fixes for kernel_t in livecd environments.

In LiveCD environments, where dracut is still running as kernel_t, some
operations are happening and they are failing as the kernel doesn't have
appropriate perms.  Two things, the kernel is trusted, dracut is highly
trusted as it loads the policy itself and could pretty much do whatever
it wants.  While not ideal, until dracut is fixed and either re-execs
itself, or the load_policy occurs after pivot_root, we are stuck with
dracut running in kernel_t.

So, give it permission to read things and relabel things.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: More livecd fixes for dracut and labeling.

Dracut has problems with stateless RAM-backed environments and we now
have a CLIP-specific dracut module to fix those problems. Additionally,
imgcreate has an interesting problem.  The SELinux python module's
__init__ is called outside of the chroot when the app is first run, that
means it initializes SELinux info based on the host, not the chroot.
This meant all of the file_contexts paths passed to setfiles were wrong.

Enabled the clip-dracut-module to fix labeling and reboot issues in
dracut's default SELinux support that only really pop up in LiveCD
RAM-backed stateless environments.

Fix setfiles calls to use a hard-coded file_contexts path for CLIP

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: add CLIP dracut module to ks.

We have our own pretty little dracut module.  Install it in the ks.
This fixes the livecd, ram-backed file system issues.

Also add it to the CONFIG_BUILD so we can actually build the package.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: add script to automated mounting of LiveCD ext3.img

Debugging live media requires mounting images within images within
images.  This script automates that process.  Your on your own for
unmounting though.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: Use system's livecd-iso-to-disk.

In RHEL 5 we had to modify livecd-iso-to-disk but in RHEL 6 we can use
the system's (plus ours no longer worked).

Switch to the system's livecd-iso-to-disk and drop the old one in our
tree.

THis commit also drops livecd-creator from our support dir which we are no longer using.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: drop bad req from livecd spec.

I added a bad req to livecd's spec.  The host doesn't need clip-dracut,
only the generated image.

CXS-15

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: add checks for our livecd-tools version.

The default version of livecd-tools doesn't work so put in some help
info and do some checks at build time for the correct version.

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation
CLIP: add script that can mount a ext3 image from live image.

Development sometime necessitates poking around in the ext3 image in
live media.  You have to mount images in images in images so this makes
that easier.

CXS-16

The modifications in this commit are copyrighted works of the Cubic Corporation.
(C) 2013 Cubic Corporation