From: Richard W.M. Jones Date: Mon, 31 Mar 2014 19:31:00 +0000 (+0100) Subject: Require supermin >= 5.1.6. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=7f2ff37315d0ac107d8a750a326794fa3a2bbc77;p=a-fedora-appliance.git Require supermin >= 5.1.6. --- diff --git a/.gitignore b/.gitignore index 548becf..8ca796d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ Makefile.in /a-fedora-appliance-*.src.rpm /a-fedora-appliance.spec /aclocal.m4 +/appliance.d/ /autom4te.cache/ /boot-a-fedora-appliance /build-a-fedora-appliance diff --git a/Makefile.am b/Makefile.am index eb43bf6..ced1c9b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # a-fedora-appliance -# Copyright (C) 2011 Red Hat Inc. +# Copyright (C) 2011-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 @@ -18,7 +18,6 @@ EXTRA_DIST = \ .gitignore \ a-fedora-appliance.spec \ - extra-find-requires.sh \ firstboot \ init \ make.sh.in \ @@ -27,7 +26,7 @@ EXTRA_DIST = \ CLEANFILES = *~ make.sh stamp-supermin clean-local: - rm -rf supermin.d + rm -rf supermin.d appliance.d bin_SCRIPTS = boot-a-fedora-appliance @@ -35,22 +34,20 @@ libexec_SCRIPTS = build-a-fedora-appliance fsdir = $(libdir)/a-fedora-appliance/supermin.d fs_DATA = \ - supermin.d/base.img \ - supermin.d/init.img \ - supermin.d/hostfiles + supermin.d/base.tar.gz \ + supermin.d/init.tar.gz \ + supermin.d/packages -supermin.d/base.img supermin.d/hostfiles: stamp-supermin +supermin.d/base.tar.gz supermin.d/packages: stamp-supermin stamp-supermin: make.sh mkdir -p supermin.d - rm -f $@ supermin.d/base.img supermin.d/hostfiles + rm -f $@ supermin.d/base.tar.gz supermin.d/packages ./make.sh touch $@ -supermin.d/init.img: init firstboot +supermin.d/init.tar.gz: init firstboot mkdir -p supermin.d - rm -f $@ $@-t - echo -e "init\nfirstboot" | cpio --quiet -o -H newc > $@-t - mv $@-t $@ + tar zcf $@ $^ # This used to be a configure-generated file. However config.status # always touches the destination file, which means the appliance got @@ -63,7 +60,7 @@ make.sh: make.sh.in # For local build/testing. local-build: - ./build-a-fedora-appliance supermin.d kernel initrd root + ./build-a-fedora-appliance supermin.d appliance.d local-boot: ./boot-a-fedora-appliance --local diff --git a/README b/README index 3cea48d..ff72fe6 100644 --- a/README +++ b/README @@ -23,7 +23,7 @@ it for your own purposes. (2) If you are building from the source tarball ---------------------------------------------------------------------- -'supermin' version 4 or above is required: +'supermin' version 5 or above is required: http://people.redhat.com/~rjones/supermin/ Do: @@ -35,7 +35,7 @@ To run locally without installing: make local-build -This creates 3 files (kernel, initrd, root) in the local directory. +This creates 3 files (kernel, initrd, root) under appliance.d/ You can test-boot this appliance by doing: diff --git a/a-fedora-appliance.spec.in b/a-fedora-appliance.spec.in index f03c1c1..e2b589c 100644 --- a/a-fedora-appliance.spec.in +++ b/a-fedora-appliance.spec.in @@ -29,17 +29,10 @@ Requires: @PACKAGELIST@ BuildRequires: createrepo -BuildRequires: supermin >= 4.1.1 -Requires(post): supermin-helper >= 4.1.1 +BuildRequires: supermin >= 5.1.6 Requires: qemu-kvm >= 0.12 -# Provide our own custom requires for the supermin appliance. -Source1: extra-find-requires.sh -%global _use_internal_dependency_generator 0 -%global __find_provides %{_rpmconfigdir}/find-provides -%global __find_requires %{SOURCE1} %{_rpmconfigdir}/find-requires - %description This is a package that contains a Fedora appliance, otherwise known as @@ -86,7 +79,7 @@ failovermethod=priority enabled=1 gpgcheck=0 EOF -%define extra --with-yum-config=$(pwd)/yum.conf +%define extra --with-packager-config=$(pwd)/yum.conf %endif %configure %{extra} @@ -104,8 +97,7 @@ mkdir -p $RPM_BUILD_ROOT%{appliancedir} # XXX We should add an RPM trigger so that this gets rebuilt after any # dependent package install (recursively). -%{_libexecdir}/build-a-fedora-appliance "%{supermindir}" \ - "%{appliancedir}/kernel" "%{appliancedir}/initrd" "%{appliancedir}/root" && \ +%{_libexecdir}/build-a-fedora-appliance "%{supermindir}" "%{appliancedir}" && \ echo "Fedora %{fedora} appliance built in %{appliancedir}" diff --git a/boot-a-fedora-appliance.in b/boot-a-fedora-appliance.in index 6847b2d..a6111af 100644 --- a/boot-a-fedora-appliance.in +++ b/boot-a-fedora-appliance.in @@ -1,7 +1,7 @@ #!/bin/bash - # @configure_input@ # boot-a-fedora-appliance -# Copyright (C) 2011 Red Hat Inc. +# Copyright (C) 2011-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 @@ -21,7 +21,7 @@ if [ "$1" != "--local" ]; then prefix="@prefix@" d="@localstatedir@/lib/a-fedora-appliance" else - d=. + d=appliance.d fi exec qemu-kvm \ diff --git a/build-a-fedora-appliance.in b/build-a-fedora-appliance.in index d065f9d..163221e 100644 --- a/build-a-fedora-appliance.in +++ b/build-a-fedora-appliance.in @@ -1,7 +1,7 @@ #!/bin/bash - # @configure_input@ # build-a-fedora-appliance -# Copyright (C) 2011 Red Hat Inc. +# Copyright (C) 2011-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 @@ -17,14 +17,20 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -if [ $# -ne 4 ]; then - echo "$0 supermin.d kernel initrd root" +if [ $# -ne 2 ]; then + echo "$0 supermin.d appliance.d" echo "Note: you normally should not run this command directly." exit 1 fi supermindir="$1" -shift +appliancedir="$2" -arch="$(uname -m)" -exec supermin-helper -f ext2 "$supermindir" "$arch" "$@" +if [ "$(id -u)" -ne 0 ]; then + echo + echo "Ignore any 'permission denied' errors below, or even better" + echo "get Fedora to stop doing security-by-obscurity." + echo +fi + +exec @SUPERMIN@ --build -f ext2 "$supermindir" -o "$appliancedir" diff --git a/configure.ac b/configure.ac index 0fc20e7..e09e817 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # a-fedora-appliance -# Copyright (C) 2011 Red Hat Inc. +# Copyright (C) 2011-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,11 +19,14 @@ AC_INIT([a-fedora-appliance],[1.0]) AM_INIT_AUTOMAKE([foreign]) dnl RPM release. -RELEASE=6 +RELEASE=7 AC_SUBST([RELEASE]) dnl The list of packages included in the appliance. -dnl NOTE: After changing this: touch make.sh.in; make +dnl NOTES: +dnl (1) These packages have to be installed on the host. +dnl (2) After changing this do: +dnl touch make.sh.in; make PACKAGELIST="\ bash \ binutils \ @@ -47,21 +50,21 @@ udev \ " AC_SUBST([PACKAGELIST]) -dnl Check for supermin >= 4. +dnl Check for supermin >= 5. AC_CHECK_PROG([SUPERMIN], [supermin],[supermin],[no]) test "x$SUPERMIN" = "xno" && - AC_MSG_ERROR([supermin >= 4 must be installed]) + AC_MSG_ERROR([supermin >= 5 must be installed]) -dnl Pass a supermin --yum-config option. -AC_MSG_CHECKING([if user requested supermin --yum-config option]) -AC_ARG_WITH([yum-config], - [AS_HELP_STRING([--with-yum-config=FILE], - [pass supermin --yum-config option @<:@default=no@:>@])], - [YUM_CONFIG="$withval"], - [YUM_CONFIG=no]) -AC_MSG_RESULT([$YUM_CONFIG]) -AC_SUBST([YUM_CONFIG]) +dnl Pass a supermin --packager-config option. +AC_MSG_CHECKING([if user requested supermin --packager-config option]) +AC_ARG_WITH([packager-config], + [AS_HELP_STRING([--with-packager-config=FILE], + [pass supermin --packager-config option @<:@default=no@:>@])], + [PACKAGER_CONFIG="$withval"], + [PACKAGER_CONFIG=no]) +AC_MSG_RESULT([$PACKAGER_CONFIG]) +AC_SUBST([PACKAGER_CONFIG]) dnl Produce output files. AC_CONFIG_FILES([Makefile diff --git a/extra-find-requires.sh b/extra-find-requires.sh deleted file mode 100755 index a7c5a0c..0000000 --- a/extra-find-requires.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -# a-fedora-appliance -# Copyright (C) 2011 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -# Additional custom requires for the package. - -original_find_requires="$1" -shift - -# Get the list of files. -files=`sed "s/['\"]/\\\&/g"` - -# Use ordinary find-requires first. -echo $files | tr [:blank:] '\n' | $original_find_requires - -# Is supermin.d/hostfiles included in the list of files? -hostfiles=`echo $files | tr [:blank:] '\n' | grep 'supermin\.d/hostfiles$'` - -if [ -z "$hostfiles" ]; then - exit 0 -fi - -# Generate extra requires for libraries listed in hostfiles. -sofiles=`grep 'lib.*\.so\.' $hostfiles | fgrep -v '*' | sed 's|^\.||'` -for f in $sofiles; do - if [ -f "$f" ]; then - echo "$f" - fi -done diff --git a/firstboot b/firstboot index c888bc6..3ba3523 100755 --- a/firstboot +++ b/firstboot @@ -1,6 +1,6 @@ #!/bin/bash - # a-fedora-appliance -# Copyright (C) 2011 Red Hat Inc. +# Copyright (C) 2011-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 diff --git a/init b/init index 370d7e5..11e9d31 100755 --- a/init +++ b/init @@ -1,6 +1,6 @@ #!/bin/bash # a-fedora-appliance -# Copyright (C) 2011 Red Hat Inc. +# Copyright (C) 2011-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 diff --git a/make.sh.in b/make.sh.in index 928c620..b1ef2dd 100644 --- a/make.sh.in +++ b/make.sh.in @@ -1,6 +1,6 @@ #!/bin/bash - # a-fedora-appliance -# Copyright (C) 2011 Red Hat Inc. +# Copyright (C) 2011-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 @@ -16,9 +16,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -if [ "x@YUM_CONFIG@" != "xno" ]; then - extra="--yum-config @YUM_CONFIG@" +if [ "x@PACKAGER_CONFIG@" != "xno" ]; then + extra="--packager-config @PACKAGER_CONFIG@" fi -echo @SUPERMIN@ -v -o supermin.d --names @PACKAGELIST@ $extra -@SUPERMIN@ -v -o supermin.d --names @PACKAGELIST@ $extra +echo @SUPERMIN@ -v --prepare -o supermin.d @PACKAGELIST@ $extra +@SUPERMIN@ -v --prepare -o supermin.d @PACKAGELIST@ $extra