Permalink
Browse files

appliance: Use supermin >= 5.

This requires the new version of supermin (5.1.0).
  • Loading branch information...
rwmjones committed Feb 25, 2014
1 parent d353b4a commit b13c22668d956df4cb8e82aaf1d0d3941581b715
View
@@ -37,14 +37,18 @@ Makefile.in
/align/stamp-virt-alignment-scan.pod
/align/virt-alignment-scan
/align/virt-alignment-scan.1
-/appliance/excludelist
+/appliance/daemon.tar.gz
+/appliance/excludefiles
+/appliance/hostfiles
+/appliance/init.tar.gz
/appliance/libguestfs-make-fixed-appliance
/appliance/libguestfs-make-fixed-appliance.1
/appliance/make.sh
/appliance/packagelist
/appliance/stamp-libguestfs-make-fixed-appliance.pod
/appliance/stamp-supermin
/appliance/supermin.d
+/appliance/udev-rules.tar.gz
/autom4te.cache
/bash/virt-builder
/bash/virt-cat
View
5 README
@@ -61,12 +61,11 @@ The full requirements are described below.
| | | | - virtio-block |
| | | | - virtio-net |
+--------------+-------------+---+-----------------------------------------+
-| supermin | 4.1.0 | R | This is required on all distros. |
-| febootstrap | 3.20 | | 'supermin' is the new name for |
+| supermin | 5.1.0 | R | This is required on all distros. |
+| | | | 'supermin' is the new name for |
| | | | 'febootstrap'. |
| | | | For alternatives, see: |
| | | | libguestfs.org/download/binaries/appliance/
-| | | | febootstrap 2.x WILL NOT WORK |
+--------------+-------------+---+-----------------------------------------+
| glibc | | R | We use various glibc-isms. |
| | | | Also glibc provides XDR, rpcgen. |
View
@@ -1,5 +1,5 @@
# libguestfs
-# Copyright (C) 2009 Red Hat Inc.
+# Copyright (C) 2009-2014 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,8 +19,9 @@ include $(top_srcdir)/subdir-rules.mk
EXTRA_DIST = \
99-guestfs-serial.rules \
- excludelist.in \
+ excludefiles.in \
guestfsd.suppressions \
+ hostfiles.in \
init \
libguestfs-make-fixed-appliance.in \
libguestfs-make-fixed-appliance.pod \
@@ -32,24 +33,42 @@ superminfsdir = $(libdir)/guestfs/supermin.d
fs_DATA =
superminfs_DATA = \
- supermin.d/init.img \
- supermin.d/udev-rules.img
-
-if SUPERMIN_HELPER_COMPRESSED_CPIO
-GZ = .gz
-endif
+ supermin.d/init.tar.gz \
+ supermin.d/udev-rules.tar.gz
if ENABLE_DAEMON
superminfs_DATA += \
- supermin.d/daemon.img$(GZ)
+ supermin.d/daemon.tar.gz
endif
if ENABLE_APPLIANCE
superminfs_DATA += \
- supermin.d/base.img$(GZ) \
+ supermin.d/base.tar.gz \
+ supermin.d/packages \
+ supermin.d/excludefiles \
supermin.d/hostfiles
endif
+supermin.d/base.tar.gz \
+supermin.d/daemon.tar.gz \
+supermin.d/excludefiles \
+supermin.d/hostfiles \
+supermin.d/init.tar.gz \
+supermin.d/packages \
+supermin.d/udev-rules.tar.gz: stamp-supermin
+stamp-supermin: make.sh \
+ packagelist \
+ hostfiles \
+ excludefiles \
+ daemon.tar.gz \
+ init.tar.gz \
+ udev-rules.tar.gz
+ rm -f $@ supermin.d/base.tar.gz supermin.d/packages
+ ./make.sh
+ cp -t supermin.d \
+ daemon.tar.gz excludefiles hostfiles init.tar.gz udev-rules.tar.gz
+ touch $@
+
# This used to be a configure-generated file. However config.status
# always touches the destination file, which means the appliance got
# rebuilt too often.
@@ -65,57 +84,47 @@ if VALGRIND_DAEMON
PACKAGELIST_CPP_FLAGS += -DVALGRIND_DAEMON=1
endif
-packagelist: packagelist.in Makefile
- cpp -undef $(PACKAGELIST_CPP_FLAGS) < $< | \
+excludefiles: excludefiles.in Makefile
+ m4 $(PACKAGELIST_CPP_FLAGS) $< | \
grep -v '^[[:space:]]*$$' | grep -v '^#' > $@-t
cmp -s $@ $@-t || mv $@-t $@
rm -f $@-t
-excludelist: excludelist.in Makefile
- cpp -undef $(PACKAGELIST_CPP_FLAGS) < $< | \
+hostfiles: hostfiles.in Makefile
+ m4 $(PACKAGELIST_CPP_FLAGS) $< | \
grep -v '^[[:space:]]*$$' | grep -v '^#' > $@-t
cmp -s $@ $@-t || mv $@-t $@
rm -f $@-t
-supermin.d/base.img$(GZ) supermin.d/hostfiles: stamp-supermin
-stamp-supermin: make.sh packagelist excludelist
- rm -f $@ supermin.d/base.img$(GZ) supermin.d/hostfiles
- ./make.sh
-if SUPERMIN_HELPER_COMPRESSED_CPIO
- gzip -9 supermin.d/base.img
-endif
- touch $@
+packagelist: packagelist.in Makefile
+ m4 $(PACKAGELIST_CPP_FLAGS) $< | \
+ grep -v '^[[:space:]]*$$' | grep -v '^#' > $@-t
+ cmp -s $@ $@-t || mv $@-t $@
+ rm -f $@-t
-supermin.d/daemon.img$(GZ): ../daemon/guestfsd guestfsd.suppressions
- rm -f $@ $@-t $@-tt
+daemon.tar.gz: ../daemon/guestfsd guestfsd.suppressions
+ rm -f $@ $@-t
rm -rf tmp-d
mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc
ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd
ln $(srcdir)/guestfsd.suppressions tmp-d/etc/guestfsd.suppressions
- ( cd tmp-d && find | cpio --quiet -o -H newc ) > $@-t
+ ( cd tmp-d && tar zcf - * ) > $@-t
rm -r tmp-d
-if SUPERMIN_HELPER_COMPRESSED_CPIO
- gzip -9 -c $@-t > $@-tt
- mv $@-tt $@-t
-endif
mv $@-t $@
-supermin.d/init.img: init
- rm -rf init.tmp $@ $@-t
- mkdir init.tmp
- cp $< init.tmp
- (cd init.tmp; echo "init" | cpio --quiet -o -H newc) > $@-t
- rm -r init.tmp
+init.tar.gz: init
+ rm -f $@ $@-t
+ tar zcf $@-t init
mv $@-t $@
# We should put this file in /lib/udev/rules.d, but put it in /etc so
# we don't have to deal with all the UsrMove crap in Fedora.
-supermin.d/udev-rules.img: 99-guestfs-serial.rules
+udev-rules.tar.gz: 99-guestfs-serial.rules
rm -f $@ $@-t
rm -rf tmp-u
mkdir -p tmp-u/etc/udev/rules.d
for f in $^; do ln $$f tmp-u/etc/udev/rules.d/$$(basename $$f); done
- ( cd tmp-u && find | cpio --quiet -o -H newc ) > $@-t
+ ( cd tmp-u && tar zcf - etc ) > $@-t
rm -r tmp-u
mv $@-t $@
@@ -144,7 +153,14 @@ stamp-libguestfs-make-fixed-appliance.pod: libguestfs-make-fixed-appliance.pod
# Make clean.
-CLEANFILES = packagelist excludelist \
+CLEANFILES = \
+ *~ \
+ daemon.tar.gz \
+ excludefiles \
+ hostfiles \
+ init.tar.gz \
libguestfs-make-fixed-appliance.1 \
+ packagelist \
stamp-libguestfs-make-fixed-appliance.pod \
- supermin.d/*
+ supermin.d/* \
+ udev-rules.tar.gz
View
@@ -0,0 +1,29 @@
+dnl This is the list of files excluded from the appliance, even if
+dnl they appear in packagelist.in (or more likely, as dependencies of
+dnl packages in packagelist.in).
+dnl
+dnl List is a list of wildcards, one per line, prefixed by a '-' character.
+dnl
+dnl This file is processed by m4 with one of the
+dnl following symbols defined (depending on the distro):
+dnl
+dnl REDHAT=1 For Fedora, RHEL, EPEL and workalikes.
+dnl DEBIAN=1 For Debian.
+dnl UBUNTU=1 For Ubuntu.
+dnl ARCHLINUX=1 For Archlinux.
+dnl
+dnl Note that any matching file will be dropped from the appliance.
+dnl Of course, this may break the appliance, so be careful.
+
+dnl The right kernel modules are added back by supermin.
+-/boot/*
+-/lib/modules/*
+
+-/usr/lib/locale/*
+-/usr/share/locale/*
+-/usr/share/man/*
+-/usr/share/doc/*
+-/usr/share/info/*
+-/usr/share/gnome/help/*
+-/usr/share/cracklib/*
+-/usr/share/i18n/*
View
@@ -1,57 +0,0 @@
-/* This is the list of distro packages which are
- * excluded from the appliance, even if they appear in
- * packagelist.in (or more likely, as dependencies of
- * packages in packagelist.in).
- *
- * List is a list of basic regular expressions, one per line.
- *
- * This file is processed by cpp with one of the
- * following symbols defined (depending on the distro):
- *
- * REDHAT=1 For Fedora, RHEL, EPEL and workalikes.
- * DEBIAN=1 For Debian.
- * UBUNTU=1 For Ubuntu.
- * ARCHLINUX=1 For Archlinux.
- *
- * Note that any file provided by one of these packages will
- * be dropped from the appliance. Of course, this may break
- * the appliance, so be careful. Other files are also dropped
- * from the appliance such as docs and man pages: see 'make.sh.in'
- * for the full details.
- */
-
-/* Basically the same with a few minor tweaks. */
-#ifdef UBUNTU
-#define DEBIAN 1
-#endif
-
-/* Don't need any Perl or Python appearing in the appliance. */
-^perl
-^python
-
-/* Plymouth is a graphical boot thing - not needed. */
-^plymouth
-
-/* Linux firmware. */
-^linux-firmware
-
-/* Keyboard maps - appliance is not interactive. */
-^kbd-misc
-
-#ifdef REDHAT
-
-/* Linux kernel. febootstrap <= 3.18 used to exclude the kernel
- * package (only) by default, but since 3.19 it doesn't do this any
- * longer.
- */
-^kernel
-
-^fedora-logos
-^redhat-logos
-^dracut
-
-#endif
-
-#ifdef DEBIAN
-^file-rc
-#endif
View
@@ -0,0 +1,13 @@
+dnl This is the list of extra files added to appliance.
+dnl
+dnl List is a list of wildcards, one per line.
+dnl
+dnl This file is processed by m4 with one of the
+dnl following symbols defined (depending on the distro):
+dnl
+dnl REDHAT=1 For Fedora, RHEL, EPEL and workalikes.
+dnl DEBIAN=1 For Debian.
+dnl UBUNTU=1 For Ubuntu.
+dnl ARCHLINUX=1 For Archlinux.
+
+/usr/share/augeas/lenses/*.aug
@@ -105,7 +105,7 @@ guestfish -a /dev/null run
# Find the location of the appliance.
cachedir="$(guestfish get-cachedir)"
euid="$(id -u)"
-appliancedir="$cachedir/.guestfs-$euid"
+appliancedir="$cachedir/.guestfs-$euid/appliance.d"
cp "$appliancedir/kernel" "$outputdir/kernel"
cp "$appliancedir/initrd" "$outputdir/initrd"
@@ -130,7 +130,7 @@ be set using the C<LIBGUESTFS_PATH> environment variable.
Normally a supermin appliance is located on this path (see
L<supermin(1)/SUPERMIN APPLIANCE>). libguestfs reconstructs this
-into a full appliance by running L<supermin-helper(1)>.
+into a full appliance by running C<supermin --build>.
However, a simpler "fixed appliance" can also be used. libguestfs
detects this by looking for a directory on the path containing four
@@ -167,7 +167,6 @@ libguestfs, please see the L<guestfs(3)> manual page.
L<guestfs(3)>,
L<supermin(1)>,
-L<supermin-helper(1)>,
L<xz(1)>,
L<http://libguestfs.org/>,
L<http://qemu.org/>.
View
@@ -20,42 +20,14 @@ unset CDPATH
set -e
-# Turn excludelist file into command line arguments.
-exec 5<excludelist
-while read regexp <&5; do
- excludes="$excludes --exclude $regexp"
-done
-exec 5<&-
+# Run supermin.
-# Run supermin on the package list.
-# NB: Keep using --yum-config (deprecated alias) here since both old
-# and new supermin still support it.
if [ "x@SUPERMIN_PACKAGER_CONFIG@" != "xno" ]; then
- extra="--yum-config @SUPERMIN_PACKAGER_CONFIG@"
+ extra="--packager-config @SUPERMIN_PACKAGER_CONFIG@"
fi
if [ "x@SUPERMIN_EXTRA_OPTIONS@" != "xno" ]; then
extra="$extra @SUPERMIN_EXTRA_OPTIONS@"
fi
-echo @SUPERMIN@ -v -o supermin.d --names $(< packagelist ) $excludes $extra
-@SUPERMIN@ -v -o supermin.d --names $(< packagelist ) $excludes $extra
-
-# Remove some things that we don't want in the appliance. This is
-# copied from the old febootstrap-minimize. However minimization is
-# not so important now that we are caching the appliance.
-< supermin.d/hostfiles \
-grep -v '^/usr/lib/locale' |
-grep -v '^/usr/share/locale' |
-grep -v '^/usr/share/man/' |
-grep -v '^/usr/share/doc/' |
-grep -v '^/usr/share/info/' |
-grep -v '^/usr/share/gnome/help/' |
-grep -v '^/usr/share/cracklib/' |
-grep -v '^/usr/share/i18n/' > supermin.d/hostfiles-t
-
-# Include any Augeas lenses from the host.
-if grep -q /usr/share/augeas/lenses supermin.d/hostfiles-t; then
- echo "/usr/share/augeas/lenses/*.aug" >> supermin.d/hostfiles-t
-fi
-
-mv supermin.d/hostfiles-t supermin.d/hostfiles
+echo @SUPERMIN@ --prepare -v -o supermin.d $(< packagelist ) $extra
+@SUPERMIN@ --prepare -v -o supermin.d $(< packagelist ) $extra
Oops, something went wrong.

0 comments on commit b13c226

Please sign in to comment.