10609da61614adc47594dd24ff472887b6b12a69
[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 # For Debian:
27 excludes="$excludes --exclude ^file-rc"
28
29 # Run febootstrap on the package list.
30 if [ "x@FEBOOTSTRAP_YUM_CONFIG@" != "xno" ]; then
31     extra="--yum-config @FEBOOTSTRAP_YUM_CONFIG@"
32 fi
33
34 echo @FEBOOTSTRAP@ -v -o supermin.d --names $(< packagelist ) $excludes $extra
35 @FEBOOTSTRAP@ -v -o supermin.d --names $(< packagelist ) $excludes $extra
36
37 # Remove some things that we don't want in the appliance.  This is
38 # copied from the old febootstrap-minimize.  However minimization is
39 # not so important now that we are caching the appliance.
40 < supermin.d/hostfiles \
41 grep -v '^/usr/lib/locale' |
42 grep -v '^/usr/share/locale' |
43 grep -v '^/usr/lib/gconv' |
44 grep -v '^/usr/lib64/gconv' |
45 grep -v '^/usr/bin/localedef' |
46 grep -v '^/usr/sbin/build-locale-archive' |
47 grep -v '^/usr/share/man/' |
48 grep -v '^/usr/share/doc/' |
49 grep -v '^/usr/share/info/' |
50 grep -v '^/usr/share/gnome/help/' |
51 grep -v '^/usr/share/cracklib/' |
52 grep -v '^/usr/share/i18n/' > supermin.d/hostfiles-t
53
54 # XXX resolv.conf?  The old script had:
55 # echo nameserver 169.254.2.3 > resolv.conf
56 if ! grep -q /etc/resolv.conf supermin.d/hostfiles-t; then
57     echo /etc/resolv.conf >> supermin.d/hostfiles-t
58 fi
59
60 # Include any Augeas lenses from the host.
61 if grep -q /usr/share/augeas/lenses supermin.d/hostfiles-t; then
62     echo "/usr/share/augeas/lenses/*.aug" >> supermin.d/hostfiles-t
63 fi
64
65 mv supermin.d/hostfiles-t supermin.d/hostfiles