Write more configuration files so that less modification is required in
the final image.  Some changes to Rune's work for consistency.

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #10
Merge branch 'configfiles'
Fix double-fault attempting to raise errors

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #16
The default behavior of unsetting the root password previously failed,
due to a temporary workaround for an old plumbum bug.  Remove the
workaround and fail when unsetting the root password with older
plumbum.

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #13
post scripts should be able to override automatic config files (issues/10)
Use markdown syntax for links

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>
show all command progress

Instead of hiding commands with no output, show all commands run
for improved transparency.

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #18
handle unreliable kpartx -d

The kpartx -d command does not reliably remove mappings.  If
it fails, fall back to dmsetup and losetup to remove the
mappings.

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #19
optionally support GPT partitions

The --gpt option creates a GPT partition table instead of a DOS
partition table.

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #12
losetup -d only if the loop device is still set up

Commit 2d0e9fcecd3e57215d42a5c128654c48de787aba introduced a workaround
for kpartx -d failing to correctly remove partition mappings.  However,
when kpartx -d functions correctly, losetup -d fails.

Now, calls losetup -d only if the backing_file map exists.

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #21
add missing trailing newline to /etc/bootloader.d/root.conf

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #22
enable mounted image inspection

By default, if an image build fails, attempt to start an interactive
shell session in the image, in order to investigate the problem.

Optionally, after an image build succeeds, attempt to start an
interactive shell seession in the image.

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #23
kill processes left running by tag/trove scripts

When tag or trove scripts leave running processes, they previously
prevented unmounting the filesystems, breaking builds.  Now they
are run in a new pid namespace and are terminated after the tag
and trove scripts have returned.

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #5
add Makefile

Add a Makefile with clean and install targets.  Honors DESTDIR.

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #25
there is currently no API

At least until such time as an API could be kept stable, there is
no stable API for flimage.  Document this fact in README.md

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>
build images when tag scripts clean up properly (regression fix)

The recent fix to kill processes left over by tag/trove scripts
unintentionally broke builds when tag/trove scripts did not leave
processes running.  This is now resolved.

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #26
make install no longer creates "755" directory in source code

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #29
system call numbers chosen correctly for cross-build

Previously, if a build was being done under a 32-bit personality
with a 64-bit python, it would try to use the 32-bit syscall
numbers for clone and getpid, and thus fail.  Now it determines
whether the python interpreter in use is 32-bit or 64-bit as
well as using the personality to choose the system call numbers
to use.  This enables 32-bit builds on 64-bit systems using
the "setarch i686" command to choose the i686 personality.

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #28
print error log file name on error

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #27
build 32-bit images on 64-bit systems

Document how to build 32-bit images on 64-bit systems, and enhance
the model cache cache to take architecture into account so that a
single model cache file is not shared between 32-bit and 64-bit
builds if a flavorless system model is used.

Signed-off-by: Michael K Johnson <johnsonm@foresightlinux.org>

Fixes #1