Hello community, here is the log from the commit of package build for openSUSE:Factory checked in at 2015-06-23 11:54:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/build (Old) and /work/SRC/openSUSE:Factory/.build.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "build" Changes: -------- --- /work/SRC/openSUSE:Factory/build/build.changes 2015-03-23 12:12:03.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.build.new/build.changes 2015-06-23 11:54:44.000000000 +0200 @@ -1,0 +2,20 @@ +Wed Jun 17 15:01:43 UTC 2015 - [email protected] + +- fixing test suite call + +------------------------------------------------------------------- +Mon Jun 15 11:41:12 UTC 2015 - [email protected] + +- support build time source services +- docker VM support +- Simple image creation support +- vc: create changelog file only in case of a change +- get hostarch based on preinstalled kernel image +- architecture CanDo updates +- avoid endless loops during in binfmt misc registration +- debian debootstrap fixes +- added support of debbuild build engine +- optional support of network inside of KVM +- allow lintian to break the build + +------------------------------------------------------------------- Old: ---- baselibs.conf obs-build-20150317.tar.gz New: ---- obs-build-20150615.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ build.spec ++++++ --- /var/tmp/diff_new_pack.KZlC24/_old 2015-06-23 11:54:45.000000000 +0200 +++ /var/tmp/diff_new_pack.KZlC24/_new 2015-06-23 11:54:45.000000000 +0200 @@ -22,11 +22,9 @@ Summary: A Script to Build SUSE Linux RPMs License: GPL-2.0+ and GPL-2.0 Group: Development/Tools/Building -Version: 20150317 +Version: 20150615 Release: 0 Source: obs-build-%{version}.tar.gz -#!BuildIgnore: build-mkbaselibs -Source1: baselibs.conf BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch # Manual requires to avoid hard require to bash-static @@ -153,6 +151,15 @@ echo "WARNING: Not building as root, tests did not run!" exit 0 fi +if [ ! -e $RPM_BUILD_ROOT/usr/lib/build/configs/default.conf ]; then +%if 0%{?suse_version} + echo "ERROR: No default build conf, tests did not run!" + exit 1 +%else + echo "WARNING: No default build conf, tests did not run!" + exit 0 +%endif +fi # get back the default.conf link cp -av $RPM_BUILD_ROOT/usr/lib/build/configs/default.conf configs/ # do not get confused when building this already with build: ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.KZlC24/_old 2015-06-23 11:54:45.000000000 +0200 +++ /var/tmp/diff_new_pack.KZlC24/_new 2015-06-23 11:54:45.000000000 +0200 @@ -1,5 +1,5 @@ pkgname=build -pkgver=20150317 +pkgver=20150615 pkgrel=0 pkgdesc="Build packages in sandbox" arch=('i686' 'x86_64') @@ -8,7 +8,7 @@ groups=('base-devel') depends=('perl') source=(obs-build-${pkgver}.tar.gz) -md5sums=('deaeff7a854cb1668560813f55980587') +md5sums=('fa2ad796c1407587342ac2a6339a1659') package() { msg "Installing build ..." ++++++ build.dsc ++++++ --- /var/tmp/diff_new_pack.KZlC24/_old 2015-06-23 11:54:45.000000000 +0200 +++ /var/tmp/diff_new_pack.KZlC24/_new 2015-06-23 11:54:45.000000000 +0200 @@ -1,6 +1,6 @@ Format: 1.0 Source: build -Version: 20150317 +Version: 20150615 Binary: build Maintainer: Adrian Schroeter <[email protected]> Architecture: all ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.KZlC24/_old 2015-06-23 11:54:45.000000000 +0200 +++ /var/tmp/diff_new_pack.KZlC24/_new 2015-06-23 11:54:45.000000000 +0200 @@ -1,4 +1,4 @@ -build (20150317) unstable; urgency=low +build (20150615) unstable; urgency=low * Update to current git trunk - add sles11sp2 build config and adapt autodetection ++++++ obs-build-20150317.tar.gz -> obs-build-20150615.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/Build/Kiwi.pm new/obs-build-20150615/Build/Kiwi.pm --- old/obs-build-20150317/Build/Kiwi.pm 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/Build/Kiwi.pm 2015-06-15 13:40:56.000000000 +0200 @@ -21,87 +21,10 @@ package Build::Kiwi; use strict; +use Build::SimpleXML; our $bootcallback; -# worst xml parser ever, just good enough to parse those kiwi files... -# can't use standard XML parsers, unfortunatelly, as the build script -# must not rely on external libraries -# -sub parsexml { - my ($xml) = @_; - - my @nodestack; - my $node = {}; - my $c = ''; - $xml =~ s/^\s*\<\?.*?\?\>//s; - while ($xml =~ /^(.*?)\</s) { - if ($1 ne '') { - $c .= $1; - $xml = substr($xml, length($1)); - } - if (substr($xml, 0, 4) eq '<!--') { - $xml =~ s/.*?-->//s; - next; - } - die("bad xml\n") unless $xml =~ /(.*?\>)/s; - my $tag = $1; - $xml = substr($xml, length($tag)); - my $mode = 0; - if ($tag =~ s/^\<\///s) { - chop $tag; - $mode = 1; # end - } elsif ($tag =~ s/\/\>$//s) { - $mode = 2; # start & end - $tag = substr($tag, 1); - } else { - $tag = substr($tag, 1); - chop $tag; - } - my @tag = split(/(=(?:\"[^\"]*\"|\'[^\']*\'|[^\"\s]*))?\s+/, "$tag "); - $tag = shift @tag; - shift @tag; - push @tag, undef if @tag & 1; - my %atts = @tag; - for (values %atts) { - next unless defined $_; - s/^=\"([^\"]*)\"$/=$1/s or s/^=\'([^\']*)\'$/=$1/s; - s/^=//s; - s/</</g; - s/>/>/g; - s/&/&/g; - s/'/\'/g; - s/"/\"/g; - } - if ($mode == 0 || $mode == 2) { - my $n = {}; - push @{$node->{$tag}}, $n; - for (sort keys %atts) { - $n->{$_} = $atts{$_}; - } - if ($mode == 0) { - push @nodestack, [ $tag, $node, $c ]; - $c = ''; - $node = $n; - } - } else { - die("element '$tag' closes without open\n") unless @nodestack; - die("element '$tag' closes, but I expected '$nodestack[-1]->[0]'\n") unless $nodestack[-1]->[0] eq $tag; - $c =~ s/^\s*//s; - $c =~ s/\s*$//s; - $node->{'_content'} = $c if $c ne ''; - $node = $nodestack[-1]->[1]; - $c = $nodestack[-1]->[2]; - pop @nodestack; - } - } - $c .= $xml; - $c =~ s/^\s*//s; - $c =~ s/\s*$//s; - $node->{'_content'} = $c if $c ne ''; - return $node; -} - sub unify { my %h = map {$_ => 1} @_; return grep(delete($h{$_}), @_); @@ -147,7 +70,7 @@ my @requiredarch; my $schemaversion = 0; my $schemaversion56 = versionstring("5.6"); - my $kiwi = parsexml($xml); + my $kiwi = Build::SimpleXML::parse($xml); die("not a kiwi config\n") unless $kiwi && $kiwi->{'image'}; $kiwi = $kiwi->{'image'}->[0]; $schemaversion = versionstring($kiwi->{'schemaversion'}) if $kiwi->{'schemaversion'}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/Build/SimpleXML.pm new/obs-build-20150615/Build/SimpleXML.pm --- old/obs-build-20150317/Build/SimpleXML.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-build-20150615/Build/SimpleXML.pm 2015-06-15 13:40:56.000000000 +0200 @@ -0,0 +1,83 @@ +package Build::SimpleXML; + +use strict; + +# very simple xml parser, just good enough to parse kiwi and _service files... +# can't use standard XML parsers, unfortunatelly, as the build script +# must not rely on external libraries +# +sub parse { + my ($xml) = @_; + + my @nodestack; + my $node = {}; + my $c = ''; + $xml =~ s/^\s*\<\?.*?\?\>//s; + while ($xml =~ /^(.*?)\</s) { + if ($1 ne '') { + $c .= $1; + $xml = substr($xml, length($1)); + } + if (substr($xml, 0, 4) eq '<!--') { + $xml =~ s/.*?-->//s; + next; + } + die("bad xml\n") unless $xml =~ /(.*?\>)/s; + my $tag = $1; + $xml = substr($xml, length($tag)); + my $mode = 0; + if ($tag =~ s/^\<\///s) { + chop $tag; + $mode = 1; # end + } elsif ($tag =~ s/\/\>$//s) { + $mode = 2; # start & end + $tag = substr($tag, 1); + } else { + $tag = substr($tag, 1); + chop $tag; + } + my @tag = split(/(=(?:\"[^\"]*\"|\'[^\']*\'|[^\"\s]*))?\s+/, "$tag "); + $tag = shift @tag; + shift @tag; + push @tag, undef if @tag & 1; + my %atts = @tag; + for (values %atts) { + next unless defined $_; + s/^=\"([^\"]*)\"$/=$1/s or s/^=\'([^\']*)\'$/=$1/s; + s/^=//s; + s/</</g; + s/>/>/g; + s/&/&/g; + s/'/\'/g; + s/"/\"/g; + } + if ($mode == 0 || $mode == 2) { + my $n = {}; + push @{$node->{$tag}}, $n; + for (sort keys %atts) { + $n->{$_} = $atts{$_}; + } + if ($mode == 0) { + push @nodestack, [ $tag, $node, $c ]; + $c = ''; + $node = $n; + } + } else { + die("element '$tag' closes without open\n") unless @nodestack; + die("element '$tag' closes, but I expected '$nodestack[-1]->[0]'\n") unless $nodestack[-1]->[0] eq $tag; + $c =~ s/^\s*//s; + $c =~ s/\s*$//s; + $node->{'_content'} = $c if $c ne ''; + $node = $nodestack[-1]->[1]; + $c = $nodestack[-1]->[2]; + pop @nodestack; + } + } + $c .= $xml; + $c =~ s/^\s*//s; + $c =~ s/\s*$//s; + $node->{'_content'} = $c if $c ne ''; + return $node; +} + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/Build.pm new/obs-build-20150615/Build.pm --- old/obs-build-20150317/Build.pm 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/Build.pm 2015-06-15 13:40:56.000000000 +0200 @@ -24,6 +24,7 @@ use Digest::MD5; use Build::Rpm; use Data::Dumper; +use POSIX qw(strftime); our $expand_dbg; @@ -1174,6 +1175,7 @@ $recipe =~ s/^_service:.*://; return 'arch' if $recipe eq 'PKGBUILD'; return 'preinstallimage' if $recipe eq '_preinstallimage'; + return 'simpleimage' if $recipe eq 'simpleimage'; return undef; } @@ -1196,6 +1198,17 @@ return $d; } +sub parse_simpleimage { + return undef unless $do_rpm; + my $d = Build::Rpm::parse(@_); + $d->{'name'} ||= 'simpleimage'; + if (!defined($d->{'version'})) { + my @s = stat($_[1]); + $d->{'version'} = strftime "%Y.%m.%d-%H.%M.%S", gmtime($s[9] || time); + } + return $d; +} + sub parse { my ($cf, $fn, @args) = @_; return Build::Rpm::parse($cf, $fn, @args) if $do_rpm && $fn =~ /\.spec$/; @@ -1203,6 +1216,7 @@ return Build::Kiwi::parse($cf, $fn, @args) if $do_kiwi && $fn =~ /config\.xml$/; return Build::Kiwi::parse($cf, $fn, @args) if $do_kiwi && $fn =~ /\.kiwi$/; return Build::LiveBuild::parse($cf, $fn, @args) if $do_livebuild && $fn =~ /\.livebuild$/; + return parse_simpleimage($cf, $fn, @args) if $fn eq 'simpleimage'; my $fnx = $fn; $fnx =~ s/.*\///; $fnx =~ s/^[0-9a-f]{32,}-//; # hack for OBS srcrep implementation @@ -1219,6 +1233,7 @@ return Build::Deb::parse($cf, $fn, @args) if $do_deb && $buildtype eq 'dsc'; return Build::Kiwi::parse($cf, $fn, @args) if $do_kiwi && $buildtype eq 'kiwi'; return Build::LiveBuild::parse($cf, $fn, @args) if $do_livebuild && $buildtype eq 'livebuild'; + return parse_simpleimage($cf, $fn, @args) if $buildtype eq 'simpleimage'; return Build::Arch::parse($cf, $fn, @args) if $do_arch && $buildtype eq 'arch'; return parse_preinstallimage($cf, $fn, @args) if $buildtype eq 'preinstallimage'; return undef; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/Makefile new/obs-build-20150615/Makefile --- old/obs-build-20150317/Makefile 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/Makefile 2015-06-15 13:40:56.000000000 +0200 @@ -56,6 +56,7 @@ changelog2spec \ spec2changelog \ download \ + runservices \ spec_add_patch \ spectool \ signdummy \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build new/obs-build-20150615/build --- old/obs-build-20150317/build 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/build 2015-06-15 13:40:56.000000000 +0200 @@ -60,6 +60,7 @@ ABUILD_GID=399 DO_INIT=true +DO_INIT_TOPDIR=true DO_LINT= DO_CHECKS=true CLEAN_BUILD= @@ -283,7 +284,7 @@ --vm-type TYPE Use virtual machine instead of chroot - TYPE is one of xen|kvm|uml|qemu|lxc|zvm|openstack|ec2 + TYPE is one of xen|kvm|uml|qemu|lxc|zvm|openstack|ec2|docker --vm-worker GUEST GUEST is a z/VM build worker controlled by the controlling @@ -323,6 +324,12 @@ --vm-initrd FILE Kernel and initrd to use for VM (kvm and qemu only) + --vm-net OPTION + --vm-netdev OPTION + --vm-device OPTION + KVM only: Attach kvm option + Available options are -net, -netdev, -device + (This options in kvm can not guarantee reproducible builds) --debug Enable creation of a debuginfo package @@ -695,6 +702,7 @@ cleanup_and_exit ;; -noinit|-no-init) + test "$DO_INIT" = false && DO_INIT_TOPDIR=false DO_INIT=false ;; -nochecks|-no-checks) @@ -925,6 +933,7 @@ if test -n "$CLEAN_BUILD" ; then DO_INIT=true + DO_INIT_TOPDIR=true fi if test -n "$VM_TYPE" -a -z "$RUNNING_IN_VM" ; then @@ -980,9 +989,17 @@ fi if test -z "$VM_IMAGE" -a -z "$LOGFILE" ; then - # lxc is special case: virtual machine shares logfile with host - if test -z "$RUNNING_IN_VM" -o "$VM_TYPE" != lxc; then + if test -z "$RUNNING_IN_VM"; then LOGFILE="$BUILD_ROOT/.build.log" + else + # lxc and docker are special cases: vm shares logfile with host + case "$VM_TYPE" in + lxc|docker) + ;; + *) + LOGFILE="$BUILD_ROOT/.build.log" + ;; + esac fi fi @@ -1255,6 +1272,11 @@ cd $BUILD_ROOT$TOPDIR/SOURCES || cleanup_and_exit 1 + if test -e _service; then + echo "Running build time source services..." + $BUILD_DIR/runservices || cleanup_and_exit 1 + fi + echo ----------------------------------------------------------------- if test "$BUILD_USER" = root ; then echo ----- building $RECIPEFILE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build-recipe new/obs-build-20150615/build-recipe --- old/obs-build-20150317/build-recipe 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/build-recipe 2015-06-15 13:40:56.000000000 +0200 @@ -24,7 +24,7 @@ KIWI_PARAMETERS= -for i in spec dsc kiwi arch preinstallimage mock livebuild debootstrap; do +for i in spec dsc kiwi arch preinstallimage simpleimage mock livebuild debootstrap debbuild; do . "$BUILD_DIR/build-recipe-$i" done @@ -73,6 +73,7 @@ *.kiwi) BUILDTYPE=kiwi ;; PKGBUILD) BUILDTYPE=arch ;; _preinstallimage) BUILDTYPE=preinstallimage ;; + simpleimage) BUILDTYPE=simpleimage ;; *.livebuild) BUILDTYPE=livebuild ;; esac if test -z "$BUILDTYPE" ; then @@ -93,6 +94,9 @@ if test "$BUILDENGINE" = debootstrap -a "$BUILDTYPE" = dsc ; then BUILDTYPE=debootstrap fi + if test "$BUILDENGINE" = debbuild -a "$BUILDTYPE" = spec ; then + BUILDTYPE=debbuild + fi } # expands all directories into files @@ -118,7 +122,7 @@ livebuild) types=".livebuild" ;; esac fi - types="$types .spec .dsc PKGBUILD .kiwi .src.rpm .nosrc.rpm" + types="$types .spec .dsc PKGBUILD .kiwi .src.rpm .nosrc.rpm simpleimage" fi for t in $types ; do found= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build-recipe-arch new/obs-build-20150615/build-recipe-arch --- old/obs-build-20150317/build-recipe-arch 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/build-recipe-arch 2015-06-15 13:40:56.000000000 +0200 @@ -23,7 +23,7 @@ recipe_setup_arch() { TOPDIR=/usr/src/packages - rm -rf "$BUILD_ROOT$TOPDIR" + test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR" mkdir -p "$BUILD_ROOT$TOPDIR" mkdir -p "$BUILD_ROOT$TOPDIR/OTHER" mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build-recipe-debbuild new/obs-build-20150615/build-recipe-debbuild --- old/obs-build-20150317/build-recipe-debbuild 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-build-20150615/build-recipe-debbuild 2015-06-15 13:40:56.000000000 +0200 @@ -0,0 +1,49 @@ +# +# debbuild specific functions. +# +################################################################ +# +# Copyright (c) 2015 SUSE Linux GmbH +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or 3 as +# published by the Free Software Foundation. +# +# 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 (see the file COPYING); if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# +################################################################ + +recipe_setup_debbuild() { + TOPDIR=/usr/src/debian + test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR" + mkdir -p "$BUILD_ROOT$TOPDIR" + mkdir -p "$BUILD_ROOT$TOPDIR/OTHER" + mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES" + mkdir -p "$BUILD_ROOT$TOPDIR/DEBS" + mkdir -p "$BUILD_ROOT$TOPDIR/SDEBS" + mkdir -p "$BUILD_ROOT$TOPDIR/BUILD" + test -e "$BUILD_ROOT$TOPDIR/SPECS" || ln -s SOURCES "$BUILD_ROOT$TOPDIR/SPECS" + chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR" + cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/ +} + +recipe_prepare_debbuild() { + recipe_prepare_spec "$@" +} + +recipe_build_debbuild() { + recipe_build_spec "$@" +} + +recipe_resultdirs_debbuild() { + echo DEBS SDEBS +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build-recipe-debootstrap new/obs-build-20150615/build-recipe-debootstrap --- old/obs-build-20150317/build-recipe-debootstrap 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/build-recipe-debootstrap 2015-06-15 13:40:56.000000000 +0200 @@ -45,9 +45,13 @@ done FULL_PKG_LIST="${FULL_PKG_LIST#,}" rm -rf "$BUILD_ROOT/$myroot" - set -- chroot $BUILD_ROOT debootstrap --no-check-gpg --variant=buildd --arch="${arch}" --include="$FULL_PKG_LIST" "$dist" "$myroot" file:///.build.binaries + set -- chroot $BUILD_ROOT debootstrap --keep-debootstrap-dir --no-check-gpg --variant=buildd --arch="${arch}" --include="$FULL_PKG_LIST" "$dist" "$myroot" file:///.build.binaries echo "running debootstrap..." - "$@" + if ! "$@" || ! chroot $BUILD_ROOT dpkg --configure -a; then + cat $BUILD_ROOT/debootstrap/debootstrap.log + echo "Failed to setup debootstrap chroot" + cleanup_and_exit 1 + fi # adapt passwd if test $BUILD_USER = abuild ; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build-recipe-dsc new/obs-build-20150615/build-recipe-dsc --- old/obs-build-20150317/build-recipe-dsc 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/build-recipe-dsc 2015-06-15 13:40:56.000000000 +0200 @@ -23,7 +23,7 @@ recipe_setup_dsc() { TOPDIR=/usr/src/packages - rm -rf "$BUILD_ROOT$TOPDIR" + test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR" mkdir -p "$BUILD_ROOT$TOPDIR" mkdir -p "$BUILD_ROOT$TOPDIR/OTHER" mkdir -p "$BUILD_ROOT$TOPDIR/SOURCES" @@ -91,9 +91,9 @@ chroot $buildroot su - else chroot $buildroot su -c "export DEB_BUILD_OPTIONS=${DSC_BUILD_OPTIONS} ; cd $TOPDIR/BUILD && $DSC_BUILD_CMD" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true - if test "$BUILD_SUCCEEDED" = true -a "$DO_CHECKS" != "false"; then + if test "$BUILD_SUCCEEDED" = true -a "$DO_CHECKS" != "false" && ( chroot $buildroot su -c "which lintian > /dev/null" - $BUILD_USER < /dev/null ); then DEB_CHANGESFILE=${RECIPEFILE%.dsc}_"$(chroot $buildroot su -c 'dpkg-architecture -qDEB_BUILD_ARCH')".changes - chroot $buildroot su -c "which lintian > /dev/null && cd $TOPDIR && echo Running lintian && (set -x && lintian -i $DEB_SOURCEDIR/$DEB_DSCFILE)" - $BUILD_USER < /dev/null + chroot $buildroot su -c "cd $TOPDIR && echo Running lintian && (set -x && lintian -i $DEB_SOURCEDIR/$DEB_DSCFILE)" - $BUILD_USER < /dev/null || BUILD_SUCCEEDED=false fi fi } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build-recipe-kiwi new/obs-build-20150615/build-recipe-kiwi --- old/obs-build-20150317/build-recipe-kiwi 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/build-recipe-kiwi 2015-06-15 13:40:56.000000000 +0200 @@ -415,18 +415,18 @@ # prepare rpms as source and createrepo on the repositories ln -sf $TOPDIR/SOURCES/repos $BUILD_ROOT/repos cd $BUILD_ROOT/$TOPDIR/SOURCES/repos - for r in */* ; do + for r in *[^:]/* ; do test -L $r && continue test -d $r || continue repo="$TOPDIR/SOURCES/repos/$r/" # create compatibility link for old kiwi versions rc="${r//:/:/}" if test "$rc" != "$r" ; then - rl="${rc//[^\/]}" - rl="${rl//?/../}" - mkdir -p "${rc%/*}" - ln -s $rl$r "${rc%/*}/${rc##*/}" - repo="$TOPDIR/SOURCES/repos/${rc%/*}/${rc##*/}/" + rl="${rc//[^\/]}" + rl="${rl//?/../}" + mkdir -p "${rc%/*}" + ln -s $rl$r "${rc%/*}/${rc##*/}" + repo="$TOPDIR/SOURCES/repos/${rc%/*}/${rc##*/}/" fi if test "$imagetype" != product -a "$DO_INIT" != "false" ; then echo "creating repodata for $repo" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build-recipe-livebuild new/obs-build-20150615/build-recipe-livebuild --- old/obs-build-20150317/build-recipe-livebuild 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/build-recipe-livebuild 2015-06-15 13:40:56.000000000 +0200 @@ -23,9 +23,8 @@ ################################################################# recipe_setup_livebuild() { - TOPDIR=/usr/src/packages - rm -rf "$BUILD_ROOT$TOPDIR" + test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR" for i in OTHER SOURCES LIVEBUILD_ROOT ; do mkdir -p "$BUILD_ROOT$TOPDIR/$i" done @@ -149,6 +148,7 @@ LB_MIRROR_BINARY_SECURITY="file:/.build.binaries/" LB_MIRROR_DEBIAN_INSTALLER="file:/.build.binaries/" LB_APT_SECURE="false" + LIVE_IMAGE_NAME="${RECIPEFILE%.livebuild}" EOF # Expand live-build configuration to $TOPDIR/$LIVEBUILD_ROOT @@ -194,25 +194,46 @@ chroot $BUILD_ROOT su -c "cd $TOPDIR/$LIVEBUILD_ROOT && lb build" - root \ < /dev/null || cleanup_and_exit 1 - # Move created product to destination + # extract build result basenames + local build_results="" for i in $BUILD_ROOT/$TOPDIR/$LIVEBUILD_ROOT/* ; do test -f "$i" || continue case "${i##*/}" in + *.hybrid.iso) + build_results="${build_results}\n${i%%.hybrid.iso}" + ;; *.iso) - # all created files share the same name without suffix - mv ${i%%.iso}.* $BUILD_ROOT/$TOPDIR/OTHER/. - BUILD_SUCCEEDED=true + build_results="${build_results}\n${i%%.iso}" + ;; + *.img) + build_results="${build_results}\n${i%%.img}" + ;; + *.netboot.tar*) + build_results="${build_results}\n${i%%.netboot.tar*}" + ;; + *.tar*) + build_results="${build_results}\n${i%%.tar*}" ;; *) ;; esac done - # Fail the build if no ISO was created - if [ -z "$(ls $BUILD_ROOT/$TOPDIR/OTHER/*.iso)" ] ; then - echo "No ISO image found" + # Fail the build if no build results are found + if [ -z "${build_results}" ] ; then + echo "No live-build result found" cleanup_and_exit 1 fi + + # move created products (and their metadata files) to destination + local buildnum="${RELEASE:+-Build${RELEASE}}" + for prefix in $(echo -e ${build_results} | sort | uniq) ; do + for f in ${prefix}.* ; do + mv ${f} \ + $BUILD_ROOT/$TOPDIR/OTHER/${prefix##*/}${buildnum}${f#${prefix}} + BUILD_SUCCEEDED=true + done + done } recipe_resultdirs_livebuild() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build-recipe-simpleimage new/obs-build-20150615/build-recipe-simpleimage --- old/obs-build-20150317/build-recipe-simpleimage 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-build-20150615/build-recipe-simpleimage 2015-06-15 13:40:56.000000000 +0200 @@ -0,0 +1,88 @@ +recipe_setup_simpleimage() { + TOPDIR=/usr/src/packages + rm -rf "$BUILD_ROOT$TOPDIR" + for i in OTHER SOURCES LIVEBUILD_ROOT ; do + mkdir -p "$BUILD_ROOT$TOPDIR/$i" + done + chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR" + if test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then + mv "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/ + else + cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/ + fi +} + +recipe_prepare_simpleimage() { + BUILD_USER="root" +} + +recipe_build_simpleimage() { + TOPDIR=/usr/src/packages + + echo "creating simple image..." + cd $BUILD_ROOT || cleanup_and_exit 1 + export SRCDIR="$TOPDIR/SOURCES" + + NAME="`sed -n 's|Name:[[:blank:]]*||p' $BUILD_ROOT$TOPDIR/SOURCES/simpleimage`" + [ -n "$NAME" ] || NAME="simpleimage" + VERSION="`sed -n 's|Version:[[:blank:]]*||p' $BUILD_ROOT$TOPDIR/SOURCES/simpleimage`" + [ -n "$VERSION" ] || VERSION="`date -u +%y.%m.%d-%H.%M.%S`" + + SHELL="/bin/sh" + [ -x $BUILD_ROOT/bin/bash ] && SHELL="/bin/bash" + if [ "`grep '^%build$' $BUILD_ROOT$TOPDIR/SOURCES/simpleimage`" ]; then + echo "Running integration script..." + sed -n '/%build/,$ p' $BUILD_ROOT$TOPDIR/SOURCES/simpleimage | tail -n +2 | chroot $BUILD_ROOT $SHELL -x + echo "Integration script finished." + fi + + echo "Compresing the final image, this can take a while..." + echo + TAR="tar" + if test -x /usr/bin/bsdtar; then + TAR="/usr/bin/bsdtar --format gnutar --chroot" + fi + TOPDIRS= + for DIR in .* * ; do + case "$DIR" in + .|..) continue ;; + .build*) continue ;; + .simpleimage*) continue ;; + .srcfiles*) continue ;; + .pkgs) continue ;; + .rpm-cache) continue ;; + .tmp) continue ;; + installed-pkg) continue ;; + proc|sys) continue ;; + esac + TOPDIRS="$TOPDIRS $DIR" + done + rm -rf "$BUILD_ROOT$TOPDIR" + mkdir -p .tmp/{proc,sys} + if ! $TAR -cvzf .simpleimage.tar.gz --one-file-system $TOPDIRS -C .tmp proc sys; then + cleanup_and_exit 1 + fi + if [ -x "`which mksquashfs 2> /dev/null`" ]; then + echo + echo "Tarball done, creating squashfs image as well" + echo + mksquashfs $TOPDIRS .tmp/proc .tmp/sys .simpleimage.squashfs -info -keep-as-directory -no-progress || cleanup_and_exit 1 + fi + echo "simple image created." + + DEST="$BUILD_ROOT$TOPDIR/OTHER" + mkdir -p "$DEST" + mv $BUILD_ROOT/.simpleimage.tar.gz $DEST/$NAME-${VERSION}_${BUILD_ARCH%%:*}.tar.gz + if [ -r .simpleimage.squashfs ]; then + mv $BUILD_ROOT/.simpleimage.squashfs $DEST/$NAME-${VERSION}_${BUILD_ARCH%%:*}.squashfs + fi + rm -f $BUILD_ROOT/.build.packages + ln -s ${TOPDIR#/} $BUILD_ROOT/.build.packages + test -d "$SRCDIR" && cd "$SRCDIR" + cleanup_and_exit 0 +} + +recipe_resultdirs_simpleimage() { + : +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build-recipe-spec new/obs-build-20150615/build-recipe-spec --- old/obs-build-20150317/build-recipe-spec 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/build-recipe-spec 2015-06-15 13:40:56.000000000 +0200 @@ -27,7 +27,7 @@ echo "Error: TOPDIR empty" cleanup_and_exit 1 fi - rm -rf "$BUILD_ROOT$TOPDIR" + test "$DO_INIT_TOPDIR" = false || rm -rf "$BUILD_ROOT$TOPDIR" for i in BUILD RPMS/`uname -m` RPMS/i386 RPMS/noarch SOURCES SPECS SRPMS BUILDROOT OTHER ; do mkdir -p $BUILD_ROOT$TOPDIR/$i done @@ -106,6 +106,7 @@ rpmbuild=rpmbuild test -x $BUILD_ROOT/usr/bin/rpmbuild || rpmbuild=rpm + test "$BUILDTYPE" = debbuild && rpmbuild=debbuild # XXX: move _srcdefattr to macro file? rpmbopts=("$BUILD_RPM_BUILD_STAGE" "--define" "_srcdefattr (-,root,root)") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build-vm new/obs-build-20150615/build-vm --- old/obs-build-20150317/build-vm 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/build-vm 2015-06-15 13:40:56.000000000 +0200 @@ -45,6 +45,9 @@ VM_WORKER= VM_SERVER= VM_MEMSIZE= +VM_NETOPT=() +VM_NETDEVOPT=() +VM_DEVICEOPT=() VMDISK_ROOTSIZE=4096 VMDISK_SWAPSIZE=1024 VMDISK_FILESYSTEM= @@ -60,7 +63,7 @@ # emulator specific? EMULATOR_SCRIPT= -for i in ec2 emulator kvm lxc openstack qemu uml xen zvm ; do +for i in ec2 emulator kvm lxc openstack qemu uml xen zvm docker ; do . "$BUILD_DIR/build-vm-$i" done @@ -132,7 +135,7 @@ needarg VM_TYPE="$ARG" case "$VM_TYPE" in - lxc) ;; + lxc|docker) ;; ec2|xen|kvm|uml|qemu|emulator|openstack|zvm) test -z "$VM_IMAGE" && VM_IMAGE=1 ;; @@ -227,6 +230,21 @@ -vm-watchdog) VM_WATCHDOG=true ;; + -vm-net) + needarg + VM_NETOPT+=("$ARG") + shift + ;; + -vm-netdev) + needarg + VM_NETDEVOPT+=("$ARG") + shift + ;; + -vm-device) + needarg + VM_DEVICEOPT+=("$ARG") + shift + ;; -*) return 1 ;; @@ -249,7 +267,7 @@ fi exec >&0 2>&0 # so that the logging tee finishes sleep 1 # wait till tee terminates - test "$VM_TYPE" = lxc && exit $1 + test "$VM_TYPE" = lxc -o "$VM_TYPE" = docker && exit $1 kill -9 -1 # goodbye cruel world if ! test -x /sbin/halt ; then test -e /proc/sysrq-trigger || mount -n -tproc none /proc @@ -432,14 +450,17 @@ fi RUNNING_IN_VM=true test -e /proc/version || mount -orw -n -tproc none /proc - if test "$VM_TYPE" != lxc ; then + if test "$VM_TYPE" != lxc -a "$VM_TYPE" != docker ; then mount -n ${VMDISK_MOUNT_OPTIONS},remount,rw / fi umount /run >/dev/null 2>&1 # mount /sys if ! test -e /sys/block; then - mkdir -p /sys - mount -orw -n -tsysfs sysfs /sys + mkdir -p /sys + mount -orw -n -tsysfs sysfs /sys + # Docker already has sysfs mounted ro elsewhere, + # need to remount rw explicitly. + mount -o remount,rw sysfs /sys fi # qemu inside of xen does not work, check again with kvm later before enabling this # if test -e /dev/kqemu ; then @@ -469,6 +490,10 @@ fi HOST="$MYHOSTNAME" + # repair dracut damage, see bsc#922676 + test -L /var/run -a ! -e /var/run && rm -f /var/run + test -L /var/lock -a ! -e /var/lock && rm -f /var/lock + # fork a process monitoring max filesystem usage during build if test "$DO_STATISTICS" = 1 ; then rm -f /.build/_statistics.exit @@ -587,6 +612,30 @@ fi } +vm_update_hostarch() { + local kernel="$vm_kernel" + local hostarchfile + local newhostarch + if test -z "$VM_KERNEL" -a -e "$BUILD_ROOT/.build.kernel.$VM_TYPE" ; then + kernel="$BUILD_ROOT/.build.kernel.$VM_TYPE" + hostarchfile="$BUILD_ROOT/.build.hostarch.$VM_TYPE" + fi + if test -n "$hostarchfile" -a -e "$hostarchfile"; then + newhostarch=`cat "$hostarchfile"` + elif test -n "$kernel" -a -e "$kernel" ; then + case `objdump -f "$kernel" | sed -ne 's/.*file format //p'` in + elf64-powerpcle) newhostarch=ppc64le ;; + elf64-powerpc) newhostarch=ppc64 ;; + esac + fi + if test -n "$newhostarch" -a "$newhostarch" != "$BUILD_HOST_ARCH" ; then + echo "setting hostarch to $newhostarch" + BUILD_HOST_ARCH="$newhostarch" + # update BUILD_INITVM_ARCH + build_host_arch + fi +} + # # prepare for vm startup # @@ -632,6 +681,11 @@ # do vm specific fixups vm_fixup + # update the hostarch + if test -n "$VM_IMAGE" ; then + vm_update_hostarch + fi + # the watchdog needs a log file test -n "$LOGFILE" || VM_WATCHDOG= # put our config into .build/build.data @@ -659,6 +713,7 @@ echo "INCARNATION='${INCARNATION//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data echo "DISTURL='${DISTURL//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data echo "DO_INIT='${DO_INIT//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data + echo "DO_INIT_TOPDIR='${DO_INIT_TOPDIR//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data echo "KIWI_PARAMETERS='${KIWI_PARAMETERS//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data test -n "$VM_SWAP" && echo "VM_SWAP='${VM_SWAPDEV//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data test -n "$VMDISK_MOUNT_OPTIONS" && echo "VMDISK_MOUNT_OPTIONS='${VMDISK_MOUNT_OPTIONS//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data @@ -669,7 +724,7 @@ ppc|ppcle|s390) PERSONALITY=8 ;; # ppc/s390 kernel never tells us if a 32bit personality is active, assume we run on 64bit aarch64) test "$BUILD_ARCH" != "${BUILD_ARCH#armv}" && PERSONALITY=8 ;; # workaround, to be removed esac - test "$VM_TYPE" = lxc && PERSONALITY=0 + test "$VM_TYPE" = lxc -o "$VM_TYPE" = docker && PERSONALITY=0 echo "PERSONALITY='$PERSONALITY'" >> $BUILD_ROOT/.build/build.data echo "MYHOSTNAME='`hostname`'" >> $BUILD_ROOT/.build/build.data echo -n "definesnstuff=(" >> $BUILD_ROOT/.build/build.data diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build-vm-docker new/obs-build-20150615/build-vm-docker --- old/obs-build-20150317/build-vm-docker 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-build-20150615/build-vm-docker 2015-06-15 13:40:56.000000000 +0200 @@ -0,0 +1,69 @@ +# +# Docker specific functions +# +################################################################ +# +# Copyright (c) 2015 Oleg Girko +# Copyright (c) 2015 SUSE Linux Products GmbH +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 or 3 as +# published by the Free Software Foundation. +# +# 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 (see the file COPYING); if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# +################################################################ + +vm_verify_options_docker() { + VM_IMAGE= + VM_SWAP= +} + +vm_startup_docker() { + local name="obsbuild.${BUILD_ROOT##*/}" + docker rm "$name" >/dev/null 2>&1 || true + docker run \ + --rm --name "$name" --cap-add=sys_admin --net=none \ + -v "$BUILD_ROOT:/mnt" busybox /usr/sbin/chroot /mnt "$vm_init_script" + BUILDSTATUS="$?" + test "$BUILDSTATUS" != 255 || BUILDSTATUS=3 + cleanup_and_exit "$BUILDSTATUS" +} + +vm_kill_docker() { + local name="obsbuild.${BUILD_ROOT##*/}" + docker stop -t 2 "$name" || true +} + +vm_fixup_docker() { + : +} + +vm_attach_root_docker() { + : +} + +vm_attach_swap_docker() { + : +} + +vm_detach_root_docker() { + : +} + +vm_detach_swap_docker() { + : +} + +vm_cleanup_docker() { + : +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/build-vm-kvm new/obs-build-20150615/build-vm-kvm --- old/obs-build-20150317/build-vm-kvm 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/build-vm-kvm 2015-06-15 13:40:56.000000000 +0200 @@ -26,6 +26,7 @@ # assume virtio support by default kvm_device=virtio-blk-pci +kvm_serial_device= kvm_options= kvm_check_ppc970() { @@ -104,6 +105,7 @@ vm_kernel=/boot/image vm_initrd=/boot/initrd kvm_device=virtio-blk-ccw + kvm_serial_device=virtio-serial-ccw ;; esac @@ -152,13 +154,39 @@ VM_SWAPDEV=/dev/sdb ;; esac + + if test -n "$VM_NETOPT" -o -n "$VM_NETDEVOPT" ; then + if test -n "$VM_NETOPT" ; then + for item in "${VM_NETOPT[@]}" ; do + kvm_options="$kvm_options -net $item" + done + fi + if test -n "$VM_NETDEVOPT" ; then + for item in "${VM_NETDEVOPT[@]}" ; do + kvm_options="$kvm_options -netdev $item" + done + fi + fi + + if test -n "$VM_DEVICEOPT" ; then + for item in "${VM_DEVICEOPT[@]}" ; do + kvm_options="$kvm_options -device $item" + done + fi } vm_startup_kvm() { qemu_bin="$kvm_bin" - qemu_args=(-drive file="$VM_IMAGE",if=none,id=disk,serial=0,cache=unsafe -device "$kvm_device",drive=disk) + qemu_args=(-drive file="$VM_IMAGE",format=raw,if=none,id=disk,serial=0,cache=unsafe -device "$kvm_device",drive=disk) if test -n "$VM_SWAP" ; then - qemu_args=("${qemu_args[@]}" -drive file="$VM_SWAP",if=none,id=swap,serial=1,cache=unsafe -device "$kvm_device",drive=swap) + qemu_args=("${qemu_args[@]}" -drive file="$VM_SWAP",format=raw,if=none,id=swap,serial=1,cache=unsafe -device "$kvm_device",drive=swap) + fi + # the serial console device needs to be compiled into the target kernel + # which is why we can not use virtio-serial on other platforms + if test -n "$kvm_serial_device" ; then + qemu_args=("${qemu_args[@]}" -device "$kvm_serial_device" -device virtconsole,chardev=virtiocon0 -chardev stdio,id=virtiocon0) + else + qemu_args=("${qemu_args[@]}" -serial stdio) fi if test -n "$BUILD_JOBS" -a "$icecream" = 0 -a -z "$BUILD_THREADS" ; then @@ -170,10 +198,21 @@ test "$kvm_console" != ttyAMA0 && kvm_options="$kvm_options -cpu host" test -n "$HUGETLBFSPATH" && kvm_options="$kvm_options -mem-prealloc -mem-path $HUGETLBFSPATH" fi - set -- $qemu_bin -no-reboot -nographic -vga none -net none $kvm_options \ + qemu_rootfstype="" + if test -n "$VMDISK_FILESYSTEM" ; then + qemu_rootfstype="rootfstype=$VMDISK_FILESYSTEM" + fi + qemu_rootflags="" + if test -n "$VMDISK_MOUNT_OPTIONS" ; then + qemu_rootflags="rootflags=${VMDISK_MOUNT_OPTIONS#-o }" + fi + if test -z "$VM_NETOPT" -a -z "$VM_NETDEVOPT"; then + kvm_options="$kvm_options -net none" + fi + set -- $qemu_bin -nodefaults -no-reboot -nographic -vga none $kvm_options \ -kernel $vm_kernel \ -initrd $vm_initrd \ - -append "root=$qemu_rootdev panic=1 quiet no-kvmclock nmi_watchdog=0 rw rd.driver.pre=binfmt_misc elevator=noop console=$kvm_console init=$vm_init_script" \ + -append "root=$qemu_rootdev $qemu_rootfstype $qemu_rootflags panic=1 quiet no-kvmclock nmi_watchdog=0 rw rd.driver.pre=binfmt_misc elevator=noop console=$kvm_console init=$vm_init_script" \ ${VM_MEMSIZE:+-m $VM_MEMSIZE} \ "${qemu_args[@]}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/common_functions new/obs-build-20150615/common_functions --- old/obs-build-20150317/common_functions 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/common_functions 2015-06-15 13:40:56.000000000 +0200 @@ -29,18 +29,28 @@ extend_build_arch() { case $BUILD_ARCH in - aarch64) BUILD_ARCH="aarch64:armv7hl:armv7l:armv6hl:armv6l:armv5tel" ;; + aarch64) BUILD_ARCH="aarch64:armv8l" ;; + armv8l) BUILD_ARCH="armv8l" ;; # armv8l is aarch64 in 32bit mode. not a superset of armv7 armv7hl) BUILD_ARCH="armv7hl:armv7l:armv6hl:armv6l:armv5tel" ;; armv7l) BUILD_ARCH="armv7l:armv6l:armv5tel" ;; armv6hl) BUILD_ARCH="armv6hl:armv6l:armv5tel" ;; armv6l) BUILD_ARCH="armv6l:armv5tel" ;; armv5tel) BUILD_ARCH="armv5tel" ;; + m68k) BUILD_ARCH="m68k" ;; + mips64) BUILD_ARCH="mips64:mips" ;; + mips) BUILD_ARCH="mips" ;; i686) BUILD_ARCH="i686:i586:i486:i386" ;; i586) BUILD_ARCH="i586:i486:i386" ;; i486) BUILD_ARCH="i486:i386" ;; i386) BUILD_ARCH="i386" ;; + ia64) BUILD_ARCH="ia64" ;; + parisc64) BUILD_ARCH="hppa64:hppa" ;; + parisc) BUILD_ARCH="hppa" ;; + ppc) BUILD_ARCH="ppc" ;; ppc64) BUILD_ARCH="ppc64:ppc" ;; - ppc64le) BUILD_ARCH="ppc64le:ppc64" ;; + ppc64le) BUILD_ARCH="ppc64le" ;; + s390x) BUILD_ARCH="s390x:s390" ;; + s390) BUILD_ARCH="s390" ;; sparc64v) BUILD_ARCH="sparc64v:sparc64:sparcv9v:sparcv9:sparcv8:sparc" ;; sparc64) BUILD_ARCH="sparc64:sparcv9:sparcv8:sparc" ;; sparcv9v) BUILD_ARCH="sparcv9v:sparcv9:sparcv8:sparc" ;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/init_buildsystem new/obs-build-20150615/init_buildsystem --- old/obs-build-20150317/init_buildsystem 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/init_buildsystem 2015-06-15 13:40:56.000000000 +0200 @@ -851,13 +851,6 @@ test -x $BUILD_ROOT/sbin/ldconfig && chroot $BUILD_ROOT /sbin/ldconfig 2>&1 -# hack around a initrd incompability -# initrd's prepared by dracut for systemd remove this directory -if test -L $BUILD_ROOT/var/run -a ! -e $BUILD_ROOT/var/run; then - rm $BUILD_ROOT/var/run - mkdir $BUILD_ROOT/var/run -fi - MAIN_LIST="$PACKAGES_TO_INSTALL" progress_setup MAIN_LIST for PKG in $MAIN_LIST ; do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/initvm.c new/obs-build-20150615/initvm.c --- old/obs-build-20150317/initvm.c 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/initvm.c 2015-06-15 13:40:56.000000000 +0200 @@ -39,6 +39,7 @@ #include <sys/mount.h> #include <sys/stat.h> +#include <sys/utsname.h> #include <fcntl.h> #include <stdlib.h> #include <string.h> @@ -174,6 +175,8 @@ char buf[BUFSIZ]; FILE *fp; int line; + struct utsname myuname; + uname(&myuname); fp = fopen(datafile, "r"); if (fp == NULL) @@ -186,6 +189,7 @@ { char tokens[BUFSIZ]; char *s = tokens; + char *blacklist; char *f[n_fields]; /* field content pointers */ int n; /* current field */ char path[BUFSIZ]; @@ -194,6 +198,32 @@ { continue; } + blacklist = strchr(buf, ' '); + if (blacklist) { + int skip = 0; + char *eol; + + *blacklist = '\0'; + blacklist++; + + eol = strchr(blacklist, '\n'); + if (eol) + *eol = '\0'; + + for (n = 0; blacklist != NULL; n++) + { + char *bp = strsep(&blacklist, " "); + if (!strcmp(bp, myuname.machine)) { +#ifdef DEBUG + fprintf(stderr, " skipping on hostarch %s line %s\n", bp, buf); +#endif /* DEBUG */ + skip = 1; + break; + } + } + if (skip) + continue; + } /* copy buf and tokenize :-seperated fields into f[] */ strcpy(tokens, buf); @@ -229,11 +259,6 @@ /* Is an interpreter for this arch already registered? */ snprintf(path, sizeof(path), SYSFS_BINFMT_MISC "/%s", f[name]); ret=access(path, X_OK); -#ifdef DEBUG - fprintf(stderr, - "interpreter for '%s' is %d\n", - f[name], ret); -#endif /* DEBUG */ if (ret == 0) { #ifdef DEBUG fprintf(stderr, @@ -242,6 +267,11 @@ #endif /* DEBUG */ continue; } +#ifdef DEBUG + fprintf(stderr, + "registering interpreter for '%s'...\n", + f[name]); +#endif /* DEBUG */ /* Does the interpreter exists? */ ret=access(f[interpreter], X_OK); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/qemu-reg new/obs-build-20150615/qemu-reg --- old/obs-build-20150317/qemu-reg 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/qemu-reg 2015-06-15 13:40:56.000000000 +0200 @@ -4,20 +4,29 @@ # NOTE: this requires a qemu with the binfmt misc handler binary -:aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64-binfmt:P -:aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-arm64-binfmt:P -:arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-binfmt:P -:armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb-binfmt:P -:ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc-binfmt:P -:ppc64:M::i\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff::/usr/bin/qemu-ppc64-binfmt:P -:ppc64le:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff::/usr/bin/qemu-ppc64le-binfmt:P -:mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips-binfmt:P -:mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel-binfmt:P -#:mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32-binfmt:P -#:mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el-binfmt:P -#:mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64-binfmt:P -#:mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el-binfmt:P +# NOTE: blacklisted host machine types are added via space separated elements -:sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4-binfmt:P -:sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb-binfmt:P +:aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64-binfmt:P aarch64 +:aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-arm64-binfmt:P aarch64 + +:alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha-binfmt:P alpha + +:arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-binfmt:P armv6l armv7l armv8l +:armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb-binfmt:P armv6b armv7b armv8b + +:ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc-binfmt:P ppc ppc64 +:ppc64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc64-binfmt:P ppc64 +:ppc64le:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-ppc64le-binfmt:P ppc64le + +:m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-m68k-binfmt:P m68k + +:mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips-binfmt:P mips +:mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel-binfmt:P mipsel + +:s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x-binfmt:P s390x + +:sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4-binfmt:P sh4 +:sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb-binfmt:P sh4eb + +:sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc-binfmt:P sparc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/queryconfig new/obs-build-20150615/queryconfig --- old/obs-build-20150317/queryconfig 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/queryconfig 2015-06-15 13:40:56.000000000 +0200 @@ -61,6 +61,9 @@ die("Specify which buildflag to query\n") unless $argument; my $result = $cf->{"buildflags:$argument"}; print "$result\n" if defined $result; +} elsif ($type eq 'hostarch') { + my $result = $cf->{"hostarch"}; + print "$result\n" if defined $result; } elsif ($type eq 'target' || $type eq 'type' || $type eq 'binarytype' || $type eq 'buildengine' || $type eq 'rawmacros') { print "$cf->{$type}\n" if $cf->{$type}; } elsif ($type eq 'optflags') { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/runservices new/obs-build-20150615/runservices --- old/obs-build-20150317/runservices 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-build-20150615/runservices 2015-06-15 13:40:56.000000000 +0200 @@ -0,0 +1,80 @@ +#!/usr/bin/perl -w + +BEGIN { + unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build'); +} + +use POSIX; +use File::Temp (); +use File::Copy (); + +use strict; + +use Build::SimpleXML; + +sub ls { + local *D; + opendir(D, $_[0]) || return (); + my @r = grep {$_ ne '.' && $_ ne '..'} readdir(D); + closedir D; + return @r; +} + +sub run_services { + my ($xml, $count) = @_; + $count ||= 0; + die("_service inclusion depth limit reached\n") if $count++ > 10; + my $servicedir = "/usr/lib/obs/service"; + + my @servicxml; + my $servicexml = Build::SimpleXML::parse($xml); + die("not a _service file\n") unless $servicexml && $servicexml->{'services'}; + $servicexml = $servicexml->{'services'}->[0]; + + my $tempdir = File::Temp::tempdir('CLEANUP' => 1); + + # take default version setting + my $services = ($servicexml->{'service'} || []); + for my $s (@{$services || []}) { + # buildtime only is default + next unless $s->{'mode'} && $s->{'mode'} eq 'buildtime'; + die("missing name in service\n") unless $s->{'name'}; + + if (!-x "$servicedir/$s->{'name'}") { + die("service '$s->{'name'}' configured to run, but is not available\n"); + } + + my @run; + push @run, "$servicedir/$s->{'name'}"; + for my $param (@{$s->{'param'}}) { + next if $param->{'name'} eq 'outdir'; + next unless $param->{'_content'}; + push @run, "--$param->{'name'}"; + push @run, $param->{'_content'}; + } + push @run, "--outdir"; + push @run, $tempdir; + if (system(@run) != 0) { + die("service run failed for $s->{'name'}\n") + } + # copy back + for my $file (grep {!/^[:\.]/} ls($tempdir)) { + File::Copy::move("$tempdir/$file", $file) if -f "$tempdir/$file"; + } + } +} + +local *F; +open(F, '<', "_service") || die("_service: $!\n"); +my $xml = ''; +1 while sysread(F, $xml, 4096, length($xml)) > 0; +close F; +my $d; +eval { + $d = run_services($xml); +}; +if ($@) { + print $@; + exit(1); +} +exit(0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150317/vc new/obs-build-20150615/vc --- old/obs-build-20150317/vc 2015-03-17 08:20:24.000000000 +0100 +++ new/obs-build-20150615/vc 2015-06-15 13:40:56.000000000 +0200 @@ -106,6 +106,7 @@ fi if [ ! -e "$changelog" ]; then + created_new_changelog=true touch $changelog fi @@ -144,6 +145,9 @@ set -- `md5sum "$tmpfile"` if [ -z "$content" -a "$chksum" == "$1" ]; then echo "no changes made" + if [ "$created_new_changelog" = true ]; then + rm -f "$changelog" + fi exit 0 fi fi
