2 # virt-efivars build script
4 # (C) Copyright 2014-2015 Red Hat Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 # Written by Richard W.M. Jones <rjones@redhat.com>
29 if [ -z "$output" ]; then
30 echo "$0: do not run this script directly, use 'make'"
34 # Get the list of package names that are added to the appliance.
35 # Dependencies are resolved automatically by supermin. This is
37 if [[ "$distro" =~ ^fedora- ]]; then
46 echo "$0: $distro not known."
47 echo "You need to edit '$0.in' to add support for this distro."
51 # Run the prepare step.
52 echo "Preparing the supermin appliance containing:" $packages
53 "$supermin" --prepare $packages -o tmp-supermin.d
55 # Add the init script and editor binary.
56 tar cf tmp-supermin.d/init.tar init editor
59 echo "Building the full appliance ..."
60 echo "If you see 'Permission denied' errors here, you can probably ignore"
61 echo "them, but encourage your distro to stop using security-through-obscurity."
62 "$supermin" --build --format ext2 tmp-supermin.d -o tmp-appliance.d
64 # Copy out the kernel, initrd and disk image.
65 mv tmp-appliance.d/kernel .
66 mv tmp-appliance.d/initrd .
67 qemu-img convert -f raw tmp-appliance.d/root -O qcow2 "$output"
69 rm -rf tmp-supermin.d tmp-appliance.d