Hello community, here is the log from the commit of package build for openSUSE:Leap:15.2 checked in at 2020-02-04 17:53:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/build (Old) and /work/SRC/openSUSE:Leap:15.2/.build.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "build" Tue Feb 4 17:53:29 2020 rev:58 rq:765707 version:20200110 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/build/build.changes 2020-01-15 14:49:05.921366877 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.build.new.26092/build.changes 2020-02-04 17:53:30.292716139 +0100 @@ -1,0 +2,38 @@ +Mon Jan 20 08:33:37 UTC 2020 - Adrian Schröter <[email protected]> + +- fix source archive, last submit did not contain changes + => switching to git tags now to avoid this in future + +------------------------------------------------------------------- +Fri Jan 10 09:28:39 UTC 2020 - Adrian Schröter <[email protected]> + +- Arch Linux zstd format support +- fix testbuild fail with latest rpm in SP2 and Leap 15.2 +- do not retry automatically on disk full error + +------------------------------------------------------------------- +Tue Jan 7 12:54:44 UTC 2020 - Adrian Schröter <[email protected]> + +- allow to enter an existing buildroot w/o recipe +- generate milestone files also for pure online media +- fix ccache setup of non-dotted compiler versions + +------------------------------------------------------------------- +Thu Dec 5 08:57:27 UTC 2019 - Adrian Schröter <[email protected]> + +- qemu vm_type is running qemu system emulator now. Works for: + * aarch64 + * armv7l + * ppc64/ppc64le + * s390/s390x + * riscv64 + Note: this requires a kernel and initrd in build target via + kernel-obs-build mechanic +- various --shell improvements +- new --shell-cmd to run commands in chroot/KVM/Qemu/... directly +- raising minimal required memory in qemu mode to 512MB to be able + to run Linux kernel at least +- Normalize epoch 0 away when reading the module info +- Add systemd-nspawn backend (by Oleg Girko) + +------------------------------------------------------------------- Old: ---- obs-build-20191114.tar.gz New: ---- obs-build-20200110.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ build.spec ++++++ --- /var/tmp/diff_new_pack.cpohBm/_old 2020-02-04 17:53:31.104716629 +0100 +++ /var/tmp/diff_new_pack.cpohBm/_new 2020-02-04 17:53:31.104716629 +0100 @@ -1,7 +1,7 @@ # # spec file for package build # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,7 +22,7 @@ Summary: A Script to Build SUSE Linux RPMs License: GPL-2.0-only OR GPL-3.0-only Group: Development/Tools/Building -Version: 20191114 +Version: 20200110 Release: 0 Source: obs-build-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.cpohBm/_old 2020-02-04 17:53:31.136716648 +0100 +++ /var/tmp/diff_new_pack.cpohBm/_new 2020-02-04 17:53:31.136716648 +0100 @@ -1,5 +1,5 @@ pkgname=build -pkgver=20191114 +pkgver=20200110 pkgrel=0 pkgdesc="Build packages in sandbox" arch=('i686' 'x86_64') ++++++ _service ++++++ --- /var/tmp/diff_new_pack.cpohBm/_old 2020-02-04 17:53:31.156716660 +0100 +++ /var/tmp/diff_new_pack.cpohBm/_new 2020-02-04 17:53:31.156716660 +0100 @@ -1,6 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> - <param name="versionformat">%ad</param> + <param name="revision">20200110</param> + <param name="version">20200110</param> <param name="url">git://github.com/openSUSE/obs-build.git</param> <param name="scm">git</param> <param name="extract">dist/build.changes</param> ++++++ build.dsc ++++++ --- /var/tmp/diff_new_pack.cpohBm/_old 2020-02-04 17:53:31.176716672 +0100 +++ /var/tmp/diff_new_pack.cpohBm/_new 2020-02-04 17:53:31.176716672 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: build -Version: 20191114 +Version: 20200110 Binary: build Maintainer: Adrian Schroeter <[email protected]> Architecture: all ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.cpohBm/_old 2020-02-04 17:53:31.200716687 +0100 +++ /var/tmp/diff_new_pack.cpohBm/_new 2020-02-04 17:53:31.200716687 +0100 @@ -1,4 +1,4 @@ -build (20191114) unstable; urgency=low +build (20200110) unstable; urgency=low * Update to current git trunk - add sles11sp2 build config and adapt autodetection ++++++ obs-build-20191114.tar.gz -> obs-build-20200110.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/Build/Arch.pm new/obs-build-20200110/Build/Arch.pm --- old/obs-build-20191114/Build/Arch.pm 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/Build/Arch.pm 2020-01-10 10:30:13.000000000 +0100 @@ -143,6 +143,16 @@ return $h eq "\3757zXZ"; } +sub iszstd { + my ($fn) = @_; + local *F; + return 0 unless open(F, '<', $fn); + my $h; + return 0 unless read(F, $h, 4) == 4; + close F; + return $h eq "(\265\057\375"; +} + sub lzmadec { my ($fn) = @_; my $nh; @@ -156,13 +166,28 @@ return $nh; } +sub zstddec { + my ($fn) = @_; + my $nh; + my $pid = open($nh, '-|'); + return undef unless defined $pid; + if (!$pid) { + $SIG{'PIPE'} = 'DEFAULT'; + exec('zstdcat', $fn); + die("zstdcat $!\n"); + } + return $nh; +} + sub queryvars { my ($handle) = @_; if (ref($handle)) { die("arch pkg query not implemented for file handles\n"); } - if ($handle =~ /\.xz$/ || islzma($handle)) { + if ($handle =~ /\.zst$/ || iszstd($handle)) { + $handle = zstddec($handle); + } elsif ($handle =~ /\.xz$/ || islzma($handle)) { $handle = lzmadec($handle); } my $tar = Archive::Tar->new; @@ -184,7 +209,9 @@ if (ref($handle)) { die("arch pkg query not implemented for file handles\n"); } - if ($handle =~ /\.xz$/ || islzma($handle)) { + if ($handle =~ /\.zst$/ || iszstd($handle)) { + $handle = zstddec($handle); + } elsif ($handle =~ /\.xz$/ || islzma($handle)) { $handle = lzmadec($handle); } my @files; @@ -251,7 +278,9 @@ if (ref($handle)) { die("arch pkg query not implemented for file handles\n"); } - if ($handle =~ /\.xz$/ || islzma($handle)) { + if ($handle =~ /\.zst$/ || iszstd($handle)) { + $handle = zstddec($handle); + } elsif ($handle =~ /\.xz$/ || islzma($handle)) { $handle = lzmadec($handle); } my $tar = Archive::Tar->new; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/Build/Modules.pm new/obs-build-20200110/Build/Modules.pm --- old/obs-build-20191114/Build/Modules.pm 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/Build/Modules.pm 2020-01-10 10:30:13.000000000 +0100 @@ -52,7 +52,11 @@ next unless $data->{'artifacts'}; my $rpms = $data->{'artifacts'}->{'rpms'}; next unless $rpms && ref($rpms) eq 'ARRAY'; - push @{$res->{$_}}, $module for @$rpms; + for my $rpm (@$rpms) { + my $nrpm = $rpm; + $nrpm =~ s/-0:([^-]*-[^-]*\.[^\.]*)$/-$1/; + push @{$res->{$nrpm}}, $module; + } } # unify for (values %$res) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/Build.pm new/obs-build-20200110/Build.pm --- old/obs-build-20191114/Build.pm 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/Build.pm 2020-01-10 10:30:13.000000000 +0100 @@ -1799,7 +1799,7 @@ return Build::Rpm::query($handle, %opts) if $do_rpm && $binname =~ /\.d?rpm$/; return Build::Deb::query($handle, %opts) if $do_deb && $binname =~ /\.deb$/; return Build::Kiwi::queryiso($handle, %opts) if $do_kiwi && $binname =~ /\.iso$/; - return Build::Arch::query($handle, %opts) if $do_arch && $binname =~ /\.pkg\.tar(?:\.gz|\.xz)?$/; + return Build::Arch::query($handle, %opts) if $do_arch && $binname =~ /\.pkg\.tar(?:\.gz|\.xz|\.zst)?$/; return Build::Arch::query($handle, %opts) if $do_arch && $binname =~ /\.arch$/; return undef; } @@ -1829,7 +1829,7 @@ return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.iso$/; return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.raw$/; return Build::Kiwi::queryhdrmd5(@_) if $do_kiwi && $binname =~ /\.raw.install$/; - return Build::Arch::queryhdrmd5(@_) if $do_arch && $binname =~ /\.pkg\.tar(?:\.gz|\.xz)?$/; + return Build::Arch::queryhdrmd5(@_) if $do_arch && $binname =~ /\.pkg\.tar(?:\.gz|\.xz|\.zst)?$/; return Build::Arch::queryhdrmd5(@_) if $do_arch && $binname =~ /\.arch$/; return undef; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/build new/obs-build-20200110/build --- old/obs-build-20191114/build 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/build 2020-01-10 10:30:13.000000000 +0100 @@ -104,6 +104,7 @@ SIGNDUMMY= DO_STATISTICS= RUN_SHELL= +RUN_SHELL_CMD= CCACHE= DLNOSIGNATURE= BUILD_FLAVOR= @@ -163,6 +164,10 @@ --shell Instead of starting a build start a root shell in the build root. + --shell-cmd CMD + Run the command CMD instead of giving a root shell + --shell option is implicit set. + --sysrq $ Sends a single specifed char as sysrq to the running kernel of the build. @@ -305,7 +310,7 @@ --vm-type TYPE Use virtual machine instead of chroot - TYPE is one of xen|kvm|uml|qemu|lxc|zvm|openstack|ec2|docker|pvm + TYPE is one of xen|kvm|uml|qemu|lxc|zvm|openstack|ec2|docker|pvm|nspawn --vm-worker GUEST GUEST is a z/VM build worker controlled by the controlling @@ -403,23 +408,24 @@ # add build time statistics recipe_build_time_statistics - # check for disk full - if test "$1" -eq 1 -a -x /bin/df ; then - echo - echo "$HOST failed \"build $RECIPEFILE\" at `date --utc`." - echo - # okay, it failed, but maybe because disk space? - if df $BUILD_ROOT 2>/dev/null | grep -q "100%"; then - df $BUILD_ROOT 2>/dev/null + # chroot environment only + if test -z "$VM_TYPE" -o -n "$RUNNING_IN_VM" ; then + # check for disk full for an automatic build retry + if test "$1" -eq 1 -a -x /bin/df ; then echo - echo "$HOST ran out of disk space. Please try again." + echo "$HOST failed \"build $RECIPEFILE\" at `date --utc`." echo - set 3 + # okay, it failed, but maybe because disk space? + if df $BUILD_ROOT 2>/dev/null | grep -q "100%"; then + df $BUILD_ROOT 2>/dev/null + echo + echo "$HOST ran out of disk space. Please try again." + echo + set 3 + fi fi - fi - # run recipe cleanup code - if test -z "$VM_TYPE" -o -n "$RUNNING_IN_VM" ; then + # run recipe cleanup code test -n "$BUILDTYPE" && recipe_cleanup fi @@ -466,7 +472,7 @@ setupccache() { if test -n "$CCACHE" ; then if mkdir -p $BUILD_ROOT/var/lib/build/ccache/bin; then - for i in $(ls $BUILD_ROOT/usr/bin | grep -E '^(cc|gcc|[cg][+][+]|clang|clang[+][+])([-]?[234][.]?[0-9])*$'); do + for i in $(ls $BUILD_ROOT/usr/bin | grep -E '^(cc|gcc|[cg][+][+]|clang|clang[+][+])([-]?[.0-9])*$'); do rm -f $BUILD_ROOT/var/lib/build/ccache/bin/$i test -e $BUILD_ROOT/usr/bin/$i || continue echo '#! /bin/sh' > $BUILD_ROOT/var/lib/build/ccache/bin/$i @@ -1017,6 +1023,11 @@ ;; -shell) RUN_SHELL=1 + ;; + -shell-cmd) + needarg + RUN_SHELL=1 + RUN_SHELL_CMD="$ARG" shift ;; -signdummy) @@ -1121,6 +1132,12 @@ set_build_arch +if test "$DO_INIT" = false -a -n "$RUN_SHELL"; then + mount_stuff + chroot $BUILD_ROOT su - $BUILD_USER + cleanup_and_exit $? +fi + expand_recipe_directories if test -n "$LIST_STATE" ; then @@ -1155,9 +1172,9 @@ if test -z "$RUNNING_IN_VM"; then LOGFILE="$BUILD_ROOT/.build.log" else - # lxc and docker are special cases: vm shares logfile with host + # lxc, docker and nspawn are special cases: vm shares logfile with host case "$VM_TYPE" in - lxc|docker) + lxc|docker|nspawn) ;; *) LOGFILE="$BUILD_ROOT/.build.log" @@ -1243,7 +1260,7 @@ test "$VM_TYPE" = zvm && ADDITIONAL_PACKS="$ADDITIONAL_PACKS udev libcap2" # we need to do this before the vm is started - if test -n "$CHANGELOG" -a -z "$RUNNING_IN_VM" ; then + if test -n "$CHANGELOG" -a -z "$RUNNING_IN_VM" -a -z "$RUN_SHELL" ; then recipe_create_changelog "$MYSRCDIR/$RECIPEFILE" fi @@ -1383,10 +1400,13 @@ setupccache if test -n "$RUN_SHELL" ; then - echo "You may want to initialize environment via:" - echo " su - $BUILD_USER" - chroot $BUILD_ROOT - cleanup_and_exit 0 + if test -n "$RUN_SHELL_CMD"; then + chroot $BUILD_ROOT "${RUN_SHELL_CMD:=/bin/bash}" + cleanup_and_exit $? + else + chroot $BUILD_ROOT su - $BUILD_USER + cleanup_and_exit $? + fi fi # fill build directories with sources. Also sets TOPDIR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/build-recipe-arch new/obs-build-20200110/build-recipe-arch --- old/obs-build-20191114/build-recipe-arch 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/build-recipe-arch 2020-01-10 10:30:13.000000000 +0100 @@ -47,7 +47,10 @@ } recipe_build_arch() { - _arch_recipe_makepkg -ef < /dev/null && BUILD_SUCCEEDED=true + # Build binary and source package + _arch_recipe_makepkg -ef < /dev/null && \ + _arch_recipe_makepkg -ef --allsource < /dev/null && \ + BUILD_SUCCEEDED=true } recipe_resultdirs_arch() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/build-recipe-kiwi new/obs-build-20200110/build-recipe-kiwi --- old/obs-build-20191114/build-recipe-kiwi 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/build-recipe-kiwi 2020-01-10 10:30:13.000000000 +0100 @@ -356,7 +356,8 @@ /usr/bin/sha256sum "$i" > "$i.sha256" mv "$i.sha256" $BUILD_ROOT/$TOPDIR/KIWI/. fi - mv "$i" $BUILD_ROOT/$TOPDIR/KIWI/. ;; + mv "$i" $BUILD_ROOT/$TOPDIR/KIWI/. + test -n "$milestone" && echo "$milestone" > $BUILD_ROOT/$TOPDIR/OTHER/${i%.iso}.milestone ;; *.packages) mv $i $BUILD_ROOT/$TOPDIR/OTHER/. ;; *.report) mv $i $BUILD_ROOT/$TOPDIR/OTHER/. @@ -364,8 +365,11 @@ ;; scripts) ;; *0) ;; - *) test -d $i -a "$drop_repo" != true && mv $i $BUILD_ROOT/$TOPDIR/KIWI/. ;; - esac + *) if test -d $i -a "$drop_repo" != true; then + mv $i $BUILD_ROOT/$TOPDIR/KIWI/. + test -n "$milestone" && echo "$milestone" > $BUILD_ROOT/$TOPDIR/OTHER/${i}.milestone + fi ;; + esac done popd } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/build-vm new/obs-build-20200110/build-vm --- old/obs-build-20191114/build-vm 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/build-vm 2020-01-10 10:30:13.000000000 +0100 @@ -51,7 +51,8 @@ VM_INITRD= VM_WORKER= VM_SERVER= -VM_MEMSIZE= +# the qemu default size is not able to run our default kernel anymore +VM_MEMSIZE=512 VM_NETOPT=() VM_NETDEVOPT=() VM_DEVICEOPT=() @@ -78,7 +79,7 @@ # openstack specific VM_OPENSTACK_FLAVOR= -for i in ec2 emulator kvm lxc openstack qemu uml xen zvm docker pvm; do +for i in ec2 emulator kvm lxc openstack qemu uml xen zvm docker pvm nspawn; do . "$BUILD_DIR/build-vm-$i" done @@ -150,7 +151,7 @@ needarg VM_TYPE="$ARG" case "$VM_TYPE" in - lxc|docker) ;; + lxc|docker|nspawn) ;; ec2|xen|kvm|uml|qemu|emulator|openstack|zvm|pvm) test -z "$VM_ROOT" && VM_ROOT=1 ;; @@ -303,7 +304,7 @@ fi exec >&0 2>&0 # so that the logging tee finishes sleep 1 # wait till tee terminates - test "$VM_TYPE" = lxc -o "$VM_TYPE" = docker && exit $1 + test "$VM_TYPE" = lxc -o "$VM_TYPE" = docker -o "$VM_TYPE" = nspawn && exit $1 kill -9 -1 # goodbye cruel world if ! test -x /sbin/halt ; then test -e /proc/sysrq-trigger || mount -n -tproc none /proc @@ -532,7 +533,7 @@ fi RUNNING_IN_VM=true test -e /proc/version || mount -orw -n -tproc none /proc - if test "$VM_TYPE" != lxc -a "$VM_TYPE" != docker ; then + if test "$VM_TYPE" != lxc -a "$VM_TYPE" != docker -a "$VM_TYPE" != nspawn ; then mount -n ${VMDISK_MOUNT_OPTIONS},remount,rw / fi umount /run >/dev/null 2>&1 @@ -737,9 +738,11 @@ 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" + local vm_type="$VM_TYPE" + test "$vm_type" = "qemu" && vm_type=kvm + 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" elif test -n "$kernel" -a -e "$kernel" -a -e "$kernel.hostarch" ; then hostarchfile="$kernel.hostarch" fi @@ -849,7 +852,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[567]}" && PERSONALITY=8 ;; # workaround, to be removed esac - test "$VM_TYPE" = lxc -o "$VM_TYPE" = docker && PERSONALITY=0 + test "$VM_TYPE" = lxc -o "$VM_TYPE" = docker -o "$VM_TYPE" = nspawn && PERSONALITY=0 echo "PERSONALITY='$PERSONALITY'" >> $BUILD_ROOT/.build/build.data echo "VM_HOSTNAME='$HOST'" >> $BUILD_ROOT/.build/build.data echo -n "definesnstuff=(" >> $BUILD_ROOT/.build/build.data @@ -860,6 +863,7 @@ echo ")" >> $BUILD_ROOT/.build/build.data echo "VM_TYPE='$VM_TYPE'" >> $BUILD_ROOT/.build/build.data echo "RUN_SHELL='$RUN_SHELL'" >> $BUILD_ROOT/.build/build.data + echo "RUN_SHELL_CMD='$RUN_SHELL_CMD'" >> $BUILD_ROOT/.build/build.data echo "DO_STATISTICS='$DO_STATISTICS'" >> $BUILD_ROOT/.build/build.data echo "TIME_PREINSTALL='$TIME_PREINSTALL'" >> $BUILD_ROOT/.build/build.data echo "VM_WATCHDOG='$VM_WATCHDOG'" >> $BUILD_ROOT/.build/build.data @@ -878,20 +882,19 @@ umount -n $BUILD_ROOT/mnt 2> /dev/null || true vm_init_script="/.build/build" - if test -n "$RUN_SHELL"; then - vm_init_script="/bin/bash" - fi if check_use_emulator ; then - vm_init_script="/.build/$INITVM_NAME" + vm_init_script="/.build/$INITVM_NAME" fi if test -n "$VM_ROOT" ; then # copy out kernel & initrd (if they exist) during unmounting VM image KERNEL_TEMP_DIR= - if test -z "$VM_KERNEL" -a -e "$BUILD_ROOT/.build.kernel.$VM_TYPE" ; then + local vm_type="$VM_TYPE" + test "$vm_type" = "qemu" && vm_type=kvm + if test -z "$VM_KERNEL" -a -e "$BUILD_ROOT/.build.kernel.$vm_type" ; then KERNEL_TEMP_DIR=`mktemp -d` - cp "$BUILD_ROOT/.build.kernel.$VM_TYPE" "$KERNEL_TEMP_DIR/kernel" - if test -e "$BUILD_ROOT/.build.initrd.$VM_TYPE" ; then - cp "$BUILD_ROOT/.build.initrd.$VM_TYPE" "$KERNEL_TEMP_DIR/initrd" + cp "$BUILD_ROOT/.build.kernel.$vm_type" "$KERNEL_TEMP_DIR/kernel" + if test -e "$BUILD_ROOT/.build.initrd.$vm_type" ; then + cp "$BUILD_ROOT/.build.initrd.$vm_type" "$KERNEL_TEMP_DIR/initrd" fi fi check_exit @@ -931,7 +934,7 @@ fi vm_attach_root - if test -n "$VM_SWAP" ; then + if test -n "$VM_SWAP" -a -z "$RUN_SHELL" ; then vm_attach_swap BUILDSTATUS=$(dd if="$VM_SWAP" bs=12 count=1 2>/dev/null | tr '\0' a) case $BUILDSTATUS in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/build-vm-nspawn new/obs-build-20200110/build-vm-nspawn --- old/obs-build-20191114/build-vm-nspawn 1970-01-01 01:00:00.000000000 +0100 +++ new/obs-build-20200110/build-vm-nspawn 2020-01-10 10:30:13.000000000 +0100 @@ -0,0 +1,73 @@ +# +# systemd-nspawn specific functions +# +################################################################ +# +# Copyright (c) 2019 Oleg Girko +# +# 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_nspawn() { + VM_ROOT= + VM_SWAP= +} + +vm_startup_nspawn() { + local name="${BUILD_ROOT##*/}" + name="obsbuild.${name//_/-}" + systemd-nspawn -D "$BUILD_ROOT" -M "$name" --private-network --pipe "$vm_init_script" + return "$?" +} + +vm_kill_nspawn() { + local name="${BUILD_ROOT##*/}" + name="obsbuild.${name//_/-}" + machinectl terminate "$name" +} + +vm_fixup_nspawn() { + : +} + +vm_attach_root_nspawn() { + : +} + +vm_attach_swap_nspawn() { + : +} + +vm_detach_root_nspawn() { + : +} + +vm_detach_swap_nspawn() { + : +} + +vm_sysrq_nspawn() { + : +} + +vm_wipe_nspawn() { + : +} + +vm_cleanup_nspawn() { + : +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/build-vm-qemu new/obs-build-20200110/build-vm-qemu --- old/obs-build-20191114/build-vm-qemu 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/build-vm-qemu 2020-01-10 10:30:13.000000000 +0100 @@ -21,14 +21,205 @@ # ################################################################ -# just forward everything to kvm... +# This used to be just an alias for kvm. +# Now it is used to emulate foreign architectures via qemu system emulator. +# Note: this is not for the faster qemu user land emulator, this is is still +# handled in chroot or kvm mode vm_verify_options_qemu() { - vm_verify_options_kvm + if test -n "$KILL" -o -n "$DO_WIPE" ; then + return + fi + + vm_kernel=/.build.kernel.kvm + vm_initrd=/.build.initrd.kvm + + # overwrite some options for specific build architectures + case $BUILD_ARCH in + armv6l|armv7l) + qemu_bin="/usr/bin/qemu-system-arm" + qemu_console=ttyAMA0 + qemu_options="-M virt" + qemu_device=virtio-blk-device + qemu_rng_device=virtio-rng-device + qemu_cpu="-cpu cortex-a15" + ;; + armv8l|aarch32|aarch64|aarch64_ilp32) + qemu_bin="/usr/bin/qemu-system-aarch64" + qemu_console=ttyAMA0 + qemu_cpu="-cpu cortex-a72" + qemu_options="$qemu_options -M virt" + qemu_device=virtio-blk-device + qemu_rng_device=virtio-rng-device + ;; + ppc|ppcle|ppc64|ppc64le) + qemu_bin="/usr/bin/qemu-system-ppc64" + qemu_console=hvc0 + qemu_options="-M pseries" + qemu_cpu="" + grep -q PPC970MP /proc/cpuinfo && qemu_check_ppc970 + qemu_device=virtio-blk + qemu_rng_device=virtio-rng + ;; + riscv64) + qemu_bin="/usr/bin/qemu-system-riscv64" + qemu_console=ttyS0 + qemu_cpu="-cpu rv64" + qemu_options="$qemu_options -M virt -bios /usr/share/qemu/opensbi-riscv64-virt-fw_jump.bin" + qemu_device=virtio-blk-device + qemu_rng_device=virtio-rng-device + ;; + s390|s390x) + qemu_bin="/usr/bin/qemu-system-s390x" + qemu_cpu="-cpu qemu" + qemu_console=hvc0 + qemu_device=virtio-blk-ccw + qemu_serial_device=virtio-serial-ccw + qemu_rng_device=virtio-rng-ccw + ;; + x86_64) + qemu_bin="/usr/bin/qemu-system-x86_64" + qemu_cpu="-cpu qemu64" + # Use defaults and fallbacks for other values + ;; + # + # untested architectures + # + hppa) + qemu_bin="/usr/bin/qemu-system-hppa" + qemu_console=ttyAMA0 + qemu_cpu="" + qemu_options="$qemu_options -bios /usr/share/qemu/hppa-firmware.img" + ;; + m68k) + qemu_bin="/usr/bin/qemu-system-m68k" + qemu_console=ttyAMA0 + qemu_cpu="-cpu m68000" + qemu_options="$qemu_options -M none" + ;; + riscv32) + qemu_bin="/usr/bin/qemu-system-riscv32" + qemu_console=ttyS0 + qemu_cpu="-cpu rv32" + qemu_options="$qemu_options -M virt -bios /usr/share/qemu/opensbi-riscv32-virt-fw_jump.bin" + qemu_device=virtio-blk-device + qemu_rng_device=virtio-rng-device + ;; + esac + + case $qemu_device in + virtio*) + VM_ROOTDEV=/dev/disk/by-id/virtio-0 + VM_SWAPDEV=/dev/disk/by-id/virtio-1 + ;; + *) + VM_ROOTDEV=/dev/sda + 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 + qemu_options="$qemu_options -net $item" + done + fi + if test -n "$VM_NETDEVOPT" ; then + for item in "${VM_NETDEVOPT[@]}" ; do + qemu_options="$qemu_options -netdev $item" + done + fi + fi + if test -n "$VM_DEVICEOPT" ; then + for item in "${VM_DEVICEOPT[@]}" ; do + qemu_options="$qemu_options -device $item" + done + fi + + if test -n "$qemu_rng_device" ; then + if test -c /dev/hwrng && + test -f /sys/class/misc/hw_random/rng_current && + test "$(cat /sys/class/misc/hw_random/rng_current)" != none; then + rng_dev="/dev/hwrng" + else + rng_dev="/dev/random" + fi + qemu_options="$qemu_options -object rng-random,filename=$rng_dev,id=rng0 -device $qemu_rng_device,rng=rng0" + fi } vm_startup_qemu() { - vm_startup_kvm + qemu_args=(-drive file="$VM_ROOT",format=raw,if=none,id=disk,cache=unsafe -device "$qemu_device",drive=disk,serial=0) + if [ -n "$VM_USER" ] ; then + getent passwd "$VM_USER" > /dev/null || cleanup_and_exit 3 "cannot find KVM user '$VM_USER'" + else + # use qemu user by default if available + getent passwd qemu >/dev/null && VM_USER=qemu + fi + [ -n "$VM_USER" ] && qemu_options="$qemu_options -runas $VM_USER" + if test -n "$VM_SWAP" ; then + qemu_args=("${qemu_args[@]}" -drive file="$VM_SWAP",format=raw,if=none,id=swap,cache=unsafe -device "$qemu_device",drive=swap,serial=1) + 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 "$qemu_serial_device" ; then + if test -n "$VM_CONSOLE_INPUT" ; then + qemu_args=("${qemu_args[@]}" -device "$qemu_serial_device" -device virtconsole,chardev=virtiocon0 -chardev stdio,mux=on,id=virtiocon0 -mon chardev=virtiocon0) + else + qemu_args=("${qemu_args[@]}" -device "$qemu_serial_device" -device virtconsole,chardev=virtiocon0 -chardev stdio,id=virtiocon0) + fi + elif test -n "$VM_CONSOLE_INPUT" ; then + qemu_args=("${qemu_args[@]}" -serial mon:stdio) + else + if ! test -e "${VM_ROOT}.qemu/monitor"; then + mkdir -p "${VM_ROOT}.qemu" + mkfifo "${VM_ROOT}.qemu/monitor" + chown "$VM_USER" "${VM_ROOT}.qemu" + fi + qemu_args=("${qemu_args[@]}" -serial stdio -chardev socket,id=monitor,server,nowait,path="${VM_ROOT}.qemu/monitor" -mon chardev=monitor,mode=readline) + fi + + if test -n "$BUILD_JOBS" -a "$icecream" = 0 -a -z "$BUILD_THREADS" ; then + qemu_args=("${qemu_args[@]}" "-smp" "$BUILD_JOBS") + elif test -n "$BUILD_JOBS" -a -n "$BUILD_THREADS" ; then + qemu_args=("${qemu_args[@]}" "-smp" "$BUILD_JOBS,threads=$BUILD_THREADS") + fi + qemu_append="root=$VM_ROOTDEV" + if test -n "$VMDISK_FILESYSTEM" ; then + qemu_append="$qemu_append rootfstype=$VMDISK_FILESYSTEM" + fi + if test -n "$VMDISK_MOUNT_OPTIONS" ; then + qemu_append="$qemu_append rootflags=${VMDISK_MOUNT_OPTIONS#-o }" + fi + qemu_append="$qemu_append $vm_linux_kernel_parameter" + qemu_append="$qemu_append panic=1 quiet no-kvmclock elevator=noop" + qemu_append="$qemu_append nmi_watchdog=0 rw rd.driver.pre=binfmt_misc" + qemu_append="$qemu_append console=$qemu_console init=$vm_init_script" + if test -z "$VM_NETOPT" -a -z "$VM_NETDEVOPT"; then + qemu_options="$qemu_options -net none" + fi + if test -n "$VM_TELNET"; then + qemu_options="$qemu_options -netdev user,id=telnet,hostfwd=tcp:127.0.0.1:$VM_TELNET-:23 -device e1000,netdev=telnet" + fi + if test -n "$VM_CUSTOMOPT"; then + qemu_options="$qemu_options $VM_CUSTOMOPT" + fi + set -- $qemu_bin -nodefaults -no-reboot -nographic -vga none $qemu_cpu $qemu_options \ + -kernel $vm_kernel \ + -initrd $vm_initrd \ + -append "$qemu_append" \ + ${VM_MEMSIZE:+-m $VM_MEMSIZE} \ + "${qemu_args[@]}" + + if test "$PERSONALITY" != 0 ; then + # have to switch back to PER_LINUX to make qemu work + set -- linux64 "$@" + fi + export QEMU_AUDIO_DRV=none # we do not want to have sound inside the VMs + echo "$@" + "$@" + qemu_ret=$? + test "$qemu_ret" = "137" && cleanup_and_exit 3 "qemu got SIGKILL" } vm_kill_qemu() { @@ -60,10 +251,10 @@ } vm_sysrq_qemu() { - : + vm_sysrq_kvm } vm_wipe_qemu() { - : + vm_wipe_kvm } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/configs/arch.conf new/obs-build-20200110/configs/arch.conf --- old/obs-build-20191114/configs/arch.conf 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/configs/arch.conf 2020-01-10 10:30:13.000000000 +0100 @@ -23,4 +23,4 @@ Prefer: mesa-libgl Prefer: curl:ca-certificates Prefer: glib-networking:ca-certificates - +Prefer: iptables \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/configs/sl15.2.conf new/obs-build-20200110/configs/sl15.2.conf --- old/obs-build-20191114/configs/sl15.2.conf 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/configs/sl15.2.conf 2020-01-10 10:30:13.000000000 +0100 @@ -51,6 +51,9 @@ Preinstall: liblua5_3-5 +# Needed with latest rpm (Use libgcrypt as crypto library for SP2 and Leap 15.2 [jsc#SLE-9552]) +Preinstall: libgcrypt20 libgpg-error0 + FileProvides: /bin/csh tcsh FileProvides: /bin/logger util-linux-systemd FileProvides: /sbin/netconfig sysconfig-netconfig diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/configs/sle15.2.conf new/obs-build-20200110/configs/sle15.2.conf --- old/obs-build-20191114/configs/sle15.2.conf 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/configs/sle15.2.conf 2020-01-10 10:30:13.000000000 +0100 @@ -55,6 +55,9 @@ Preinstall: libpopt0 libelf1 liblua5_3-5 Preinstall: libpcre1 +# Needed with latest rpm (Use libgcrypt as crypto library for SP2 [jsc#SLE-9552]) +Preinstall: libgcrypt20 libgpg-error0 + Runscripts: aaa_base Prefer: libdb-4_8-devel diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/dist/PKGBUILD new/obs-build-20200110/dist/PKGBUILD --- old/obs-build-20191114/dist/PKGBUILD 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/dist/PKGBUILD 2020-01-10 10:30:13.000000000 +0100 @@ -1,5 +1,5 @@ pkgname=build -pkgver=20170320 +pkgver=20200110 pkgrel=0 pkgdesc="Build packages in sandbox" arch=('i686' 'x86_64') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/dist/build.changes new/obs-build-20200110/dist/build.changes --- old/obs-build-20191114/dist/build.changes 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/dist/build.changes 2020-01-10 10:30:13.000000000 +0100 @@ -1,4 +1,36 @@ ------------------------------------------------------------------- +Fri Jan 10 09:28:39 UTC 2020 - Adrian Schröter <[email protected]> + +- Arch Linux zstd format support +- fix testbuild fail with latest rpm in SP2 and Leap 15.2 +- do not retry automatically on disk full error + +------------------------------------------------------------------- +Tue Jan 7 12:54:44 UTC 2020 - Adrian Schröter <[email protected]> + +- allow to enter an existing buildroot w/o recipe +- generate milestone files also for pure online media +- fix ccache setup of non-dotted compiler versions + +------------------------------------------------------------------- +Thu Dec 5 08:57:27 UTC 2019 - Adrian Schröter <[email protected]> + +- qemu vm_type is running qemu system emulator now. Works for: + * aarch64 + * armv7l + * ppc64/ppc64le + * s390/s390x + * riscv64 + Note: this requires a kernel and initrd in build target via + kernel-obs-build mechanic +- various --shell improvements +- new --shell-cmd to run commands in chroot/KVM/Qemu/... directly +- raising minimal required memory in qemu mode to 512MB to be able + to run Linux kernel at least +- Normalize epoch 0 away when reading the module info +- Add systemd-nspawn backend (by Oleg Girko) + +------------------------------------------------------------------- Thu Nov 14 13:18:14 UTC 2019 - Adrian Schröter <[email protected]> - Add Fedora module parser diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/dist/build.dsc new/obs-build-20200110/dist/build.dsc --- old/obs-build-20191114/dist/build.dsc 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/dist/build.dsc 2020-01-10 10:30:13.000000000 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: build -Version: 20160531 +Version: 20200110 Binary: build Maintainer: Adrian Schroeter <[email protected]> Architecture: all diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/dist/build.spec new/obs-build-20200110/dist/build.spec --- old/obs-build-20191114/dist/build.spec 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/dist/build.spec 2020-01-10 10:30:13.000000000 +0100 @@ -22,7 +22,7 @@ Summary: A Script to Build SUSE Linux RPMs License: GPL-2.0-only OR GPL-3.0-only Group: Development/Tools/Building -Version: 20190709 +Version: 20200110 Release: 0 Source: obs-build-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20191114/init_buildsystem new/obs-build-20200110/init_buildsystem --- old/obs-build-20191114/init_buildsystem 2019-11-14 14:18:59.000000000 +0100 +++ new/obs-build-20200110/init_buildsystem 2020-01-10 10:30:13.000000000 +0100 @@ -425,6 +425,7 @@ local cachedir="$(getcachedir "$url")" local name="$(basename "$url")" + name=${name/%.pkg.tar.zst/.arch} name=${name/%.pkg.tar.?z/.arch} SRC="$cachedir/$name" local destdir="$cachedir/tmp" @@ -670,7 +671,8 @@ ;; esac fi - SRCSUF=${SRC/%.pkg.tar.?z/.arch} + SRCSUF=${SRC/%.pkg.tar.zst/.arch} + SRCSUF=${SRCSUF/%.pkg.tar.?z/.arch} ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}" done < $RPMLIST @@ -698,7 +700,8 @@ if test -s $BUILD_ROOT/.init_b_cache/rpmlist.download ; then echo "calculating packages to download..." while read PKG SRC ; do - SRCSUF=${SRC/%.pkg.tar.?z/.arch} + SRCSUF=${SRC/%.pkg.tar.zst/.arch} + SRCSUF=${SRCSUF/%.pkg.tar.?z/.arch} if test -s "$BUILD_ROOT/.init_b_cache/rpms/$PKG.id" ; then read cachepkgid < $BUILD_ROOT/.init_b_cache/rpms/$PKG.id echo "PKG $PKG $cachepkgid" @@ -717,7 +720,8 @@ # remove found packages from download list rm -f $BUILD_ROOT/.init_b_cache/rpmlist.download2 while read PKG SRC ; do - SRCSUF=${SRC/%.pkg.tar.?z/.arch} + SRCSUF=${SRC/%.pkg.tar.zst/.arch} + SRCSUF=${SRCSUF/%.pkg.tar.?z/.arch} test -L "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}" || echo "$PKG $SRC" >>$BUILD_ROOT/.init_b_cache/rpmlist.download2 done < $BUILD_ROOT/.init_b_cache/rpmlist.download rm -f $BUILD_ROOT/.init_b_cache/rpmlist.download @@ -732,7 +736,8 @@ progress_step PACKAGES_TO_DOWNLOAD downloadpkg "$SRC" # downloadpkg modified $SRC, so it has a right name for use - SRCSUF=${SRC/%.pkg.tar.?z/.arch} + SRCSUF=${SRC/%.pkg.tar.zst/.arch} + SRCSUF=${SRCSUF/%.pkg.tar.?z/.arch} ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}" done < $BUILD_ROOT/.init_b_cache/rpmlist.download rm -f $BUILD_ROOT/.init_b_cache/rpmlist.download
