appliance: Change to using febootstrap 3.x supermin appliance.
[libguestfs.git] / appliance / make.sh.in
1 #!/bin/bash -
2 # @configure_input@
3 # Copyright (C) 2009-2010 Red Hat Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 unset CDPATH
20
21 set -e
22
23 # XXX Distro-dependent in future.
24 excludes="--exclude '^perl' --exclude '^python' --exclude '^fedora-logos' --exclude '^redhat-logos' --exclude '^dracut' --exclude '^upstart' --exclude '^plymouth' --exclude '^systemd' --exclude '^linux-firmware' --exclude '^kbd-misc'"
25
26 # Run febootstrap on the package list.
27 if [ -z "@PACKAGE_DIRECTORY@" ]; then
28     @FEBOOTSTRAP@ -v -o supermin.d $excludes --names $(< packagelist )
29 else
30     @FEBOOTSTRAP@ -v -o supermin.d $excludes @PACKAGE_DIRECTORY@/*
31 fi
32
33 # Remove some things that we don't want in the appliance.  This is
34 # copied from the old febootstrap-minimize.  However minimization is
35 # not so important now that we are caching the appliance.
36 < supermin.d/hostfiles \
37 grep -v '^/usr/lib/locale' |
38 grep -v '^/usr/share/locale' |
39 grep -v '^/usr/lib/gconv' |
40 grep -v '^/usr/lib64/gconv' |
41 grep -v '^/usr/bin/localedef' |
42 grep -v '^/usr/sbin/build-locale-archive' |
43 grep -v '^/usr/share/man/' |
44 grep -v '^/usr/share/doc/' |
45 grep -v '^/usr/share/info/' |
46 grep -v '^/usr/share/gnome/help/' |
47 grep -v '^/usr/share/cracklib/' |
48 grep -v '^/usr/share/i18n/' > supermin.d/hostfiles-t
49
50 # XXX resolv.conf?  The old script had:
51 # echo nameserver 169.254.2.3 > resolv.conf
52 if ! grep -q /etc/resolv.conf supermin.d/hostfiles-t; then
53     echo /etc/resolv.conf >> supermin.d/hostfiles-t
54 fi
55
56 # Include any Augeas lenses from the host.
57 if grep -q /usr/share/augeas/lenses supermin.d/hostfiles-t; then
58     echo "/usr/share/augeas/lenses/*.aug" >> supermin.d/hostfiles-t
59 fi
60
61 mv supermin.d/hostfiles-t supermin.d/hostfiles