Ticket #62162: qemu.patch

File qemu.patch, 12.3 KB (added by Ionic (Mihai Moldovan), 3 years ago)

mktemp patches for qemu.

  • emulators/qemu/Portfile

    diff --git a/emulators/qemu/Portfile b/emulators/qemu/Portfile
    index 5baf1c03475..47eff3b8a38 100644
    a b checksums rmd160 2c33e773f012e333f99237e3d4ff1653ea0bc88f \ 
    2929                        sha256  cb18d889b628fbe637672b0326789d9b0e3b8027e0445b936537c78549df17bc \
    3030                        size    106902800
    3131
    32 patchfiles              patch-configure.diff
     32# shell_cmds's mktemp version doesn't support parameters such as --tmpdir/-p.
     33# Most scripts that use mktemp in such a way are test scripts, which we don't need for
     34# normal building. One script is likewise not used at build time, but rather supposed to
     35# be manually called by project maintainers. Nothing we'd really care about. Still, we
     36# might want to keep the code working, even though we're not using it (currently).
     37patchfiles              patch-configure.diff \
     38                        patch-misc-mktemp-unknown-params-to-coreutils.diff
    3339patch.pre_args          -p1
    3440
    3541depends_build           port:texinfo \
    3642                        port:libtool \
    3743                        port:ninja \
    38                         port:pkgconfig
     44                        port:pkgconfig \
     45                        port:coreutils
    3946
    4047# python/perl5 is only used for build scripts, no linking
    4148depends_build-append    port:python38 \
    platform darwin 8 { 
    252259
    253260platform darwin {
    254261    if {${os.major} < 15} {
    255         depends_build-append    port:coreutils
    256         patchfiles-append       patch-Makefile-legacy-mktemp-to-coreutils.diff
     262        # Older mktemp versions (part of shell_cmds) do not support being called without
     263        # an argument. Newer ones do and behave like GNU coreutils mktemp, falling back
     264        # to an internal template.
     265        patchfiles-append       patch-misc-legacy-mktemp-to-coreutils.diff
    257266    }
    258267}
    259268
  • deleted file emulators/qemu/files/patch-Makefile-legacy-mktemp-to-coreutils.diff

    diff --git a/emulators/qemu/files/patch-Makefile-legacy-mktemp-to-coreutils.diff b/emulators/qemu/files/patch-Makefile-legacy-mktemp-to-coreutils.diff
    deleted file mode 100644
    index 2031f84cbb2..00000000000
    + -  
    1 --- a/Makefile  2019-08-15 21:01:42.000000000 +0200
    2 +++ b/Makefile  2019-11-22 13:38:08.000000000 +0100
    3 @@ -879,7 +879,7 @@ ifdef INSTALL_BLOBS
    4  endif
    5  ifneq ($(DESCS),)
    6         $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/firmware"
    7 -       set -e; tmpf=$$(mktemp); trap 'rm -f -- "$$tmpf"' EXIT; \
    8 +       set -e; tmpf=$$(gmktemp); trap 'rm -f -- "$$tmpf"' EXIT; \
    9         for x in $(DESCS); do \
    10                 sed -e 's,@DATADIR@,$(qemu_datadir),' \
    11                         "$(SRC_PATH)/pc-bios/descriptors/$$x" > "$$tmpf"; \
  • new file emulators/qemu/files/patch-misc-legacy-mktemp-to-coreutils.diff

    diff --git a/emulators/qemu/files/patch-misc-legacy-mktemp-to-coreutils.diff b/emulators/qemu/files/patch-misc-legacy-mktemp-to-coreutils.diff
    new file mode 100644
    index 00000000000..2bd1fb4e8ce
    - +  
     1--- a/roms/SLOF/tools/create_reloc_table.sh     2020-12-08 18:00:56.000000000 +0100
     2+++ b/roms/SLOF/tools/create_reloc_table.sh     2021-01-27 14:50:39.000000000 +0100
     3@@ -41,8 +41,8 @@ if [ -z $LDSFILE ]; then
     4        exit 42
     5 fi
     6 
     7-TMP1=`mktemp`
     8-TMP2=`mktemp`
     9+TMP1=`gmktemp`
     10+TMP2=`gmktemp`
     11 
     12 # Now create the two object files:
     13 $LD $LDFLAGS -T $LDSFILE -o $TMP1.o $OBJFILES || exit -1
     14--- a/roms/skiboot/hdata/test/dtdiff_wrap.sh    2020-12-08 18:00:57.000000000 +0100
     15+++ b/roms/skiboot/hdata/test/dtdiff_wrap.sh    2021-01-27 14:50:07.000000000 +0100
     16@@ -4,7 +4,7 @@
     17 # Also runs parameter through a dts->dtb->dts conversion
     18 # in order to work around dtc bugs.
     19 
     20-T=$(mktemp)
     21+T=$(gmktemp)
     22 cp /dev/stdin $T.dtb
     23 dtc -I dts -O dtb $1 > $T.orig.dtb
     24 dtdiff $T.orig.dtb $T.dtb
     25--- a/roms/skiboot/libstb/sign-with-local-keys.sh       2020-12-08 18:00:57.000000000 +0100
     26+++ b/roms/skiboot/libstb/sign-with-local-keys.sh       2021-01-27 14:50:10.000000000 +0100
     27@@ -11,7 +11,7 @@ fi
     28 KEYLOC=$3
     29 LABEL=$4
     30 
     31-T=$(mktemp -d)
     32+T=$(gmktemp -d)
     33 LABEL_ARG=""
     34 if [ ! -z "$LABEL" ]; then
     35        LABEL_ARG="-L $LABEL"
     36--- a/roms/skiboot/test/hello_world/run_mambo_hello_world.sh    2020-12-08 18:00:57.000000000 +0100
     37+++ b/roms/skiboot/test/hello_world/run_mambo_hello_world.sh    2021-01-27 14:50:15.000000000 +0100
     38@@ -34,7 +34,7 @@ fi
     39 OLD_ULIMIT_C=$(ulimit -c)
     40 ulimit -c 0
     41 
     42-t=$(mktemp) || exit 1
     43+t=$(gmktemp) || exit 1
     44 
     45 trap "rm -f -- '$t'" EXIT
     46 
     47--- a/roms/skiboot/test/hello_world/run_mambo_p9_hello_world.sh 2020-12-08 18:00:57.000000000 +0100
     48+++ b/roms/skiboot/test/hello_world/run_mambo_p9_hello_world.sh 2021-01-27 14:50:19.000000000 +0100
     49@@ -33,7 +33,7 @@ fi
     50 OLD_ULIMIT_C=$(ulimit -c)
     51 ulimit -c 0
     52 
     53-t=$(mktemp) || exit 1
     54+t=$(gmktemp) || exit 1
     55 
     56 trap "rm -f -- '$t'" EXIT
     57 
     58--- a/roms/skiboot/test/hello_world/run_qemu_hello_world.sh     2020-12-08 18:00:57.000000000 +0100
     59+++ b/roms/skiboot/test/hello_world/run_qemu_hello_world.sh     2021-01-27 14:50:22.000000000 +0100
     60@@ -24,7 +24,7 @@ fi
     61 
     62 export SKIBOOT_ZIMAGE=$(pwd)/test/hello_world/hello_kernel/hello_kernel
     63 
     64-t=$(mktemp) || exit 1
     65+t=$(gmktemp) || exit 1
     66 
     67 trap "rm -f -- '$t'" EXIT
     68 
     69--- a/roms/skiboot/test/run.sh  2020-12-08 18:00:57.000000000 +0100
     70+++ b/roms/skiboot/test/run.sh  2021-01-27 14:50:25.000000000 +0100
     71@@ -1,6 +1,6 @@
     72 #!/bin/bash
     73 
     74-t=$(mktemp) || exit 1
     75+t=$(gmktemp) || exit 1
     76 
     77 trap "rm -f -- '$t'" EXIT
     78 
     79--- a/roms/skiboot/test/run_mambo_boot_test.sh  2020-12-08 18:00:57.000000000 +0100
     80+++ b/roms/skiboot/test/run_mambo_boot_test.sh  2021-01-27 14:50:29.000000000 +0100
     81@@ -41,7 +41,7 @@ fi
     82 OLD_ULIMIT_C=$(ulimit -c)
     83 ulimit -c 0
     84 
     85-t=$(mktemp) || exit 1
     86+t=$(gmktemp) || exit 1
     87 
     88 trap "rm -f -- '$t'" EXIT
     89 
     90--- a/roms/skiboot/test/sreset_world/run_mambo_p9_sreset.sh     2020-12-08 18:00:57.000000000 +0100
     91+++ b/roms/skiboot/test/sreset_world/run_mambo_p9_sreset.sh     2021-01-27 14:50:36.000000000 +0100
     92@@ -33,7 +33,7 @@ fi
     93 OLD_ULIMIT_C=$(ulimit -c)
     94 ulimit -c 0
     95 
     96-t=$(mktemp) || exit 1
     97+t=$(gmktemp) || exit 1
     98 
     99 trap "rm -f -- '$t'" EXIT
     100 
     101--- a/roms/skiboot/test/sreset_world/run_mambo_sreset.sh        2020-12-08 18:00:57.000000000 +0100
     102+++ b/roms/skiboot/test/sreset_world/run_mambo_sreset.sh        2021-01-27 14:50:33.000000000 +0100
     103@@ -34,7 +34,7 @@ fi
     104 OLD_ULIMIT_C=$(ulimit -c)
     105 ulimit -c 0
     106 
     107-t=$(mktemp) || exit 1
     108+t=$(gmktemp) || exit 1
     109 
     110 trap "rm -f -- '$t'" EXIT
     111 
     112--- a/roms/u-boot/scripts/decodecode    2020-12-08 18:00:57.000000000 +0100
     113+++ b/roms/u-boot/scripts/decodecode    2021-01-27 14:50:48.000000000 +0100
     114@@ -19,7 +19,7 @@ die() {
     115 
     116 trap cleanup EXIT
     117 
     118-T=`mktemp` || die "cannot create temp file"
     119+T=`gmktemp` || die "cannot create temp file"
     120 code=
     121 cont=
     122 
     123--- a/scripts/coverity-scan/run-coverity-scan   2020-12-08 17:59:44.000000000 +0100
     124+++ b/scripts/coverity-scan/run-coverity-scan   2021-01-27 14:50:54.000000000 +0100
     125@@ -331,7 +331,7 @@ if [ "$DOCKER" = yes ]; then
     126     # using a volume.  A volume is enough for the token not to
     127     # leak into the Docker image.
     128     umask 077
     129-    SECRETDIR=$(mktemp -d)
     130+    SECRETDIR=$(gmktemp -d)
     131     if [ -z "$SECRETDIR" ]; then
     132         echo "Failed to create temporary directory"
     133         exit 1
     134--- a/scripts/extract-vsssdk-headers    2020-12-08 17:59:44.000000000 +0100
     135+++ b/scripts/extract-vsssdk-headers    2021-01-27 14:50:58.000000000 +0100
     136@@ -24,7 +24,7 @@ fi
     137 export LC_ALL=C
     138 MAGIC=$'\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1'
     139 offset=$(grep -abom1 "$MAGIC" "$1" | sed -n 's/:/\n/; P')
     140-tmpdir=$(mktemp -d)
     141+tmpdir=$(gmktemp -d)
     142 trap 'rm -fr -- "$tmpdir" vsssdk.msi' EXIT HUP INT QUIT ALRM TERM
     143 tail -c +$(($offset+1)) -- "$1" > vsssdk.msi
     144 
     145--- a/scripts/gensyscalls.sh    2020-12-08 17:59:44.000000000 +0100
     146+++ b/scripts/gensyscalls.sh    2021-01-27 14:51:03.000000000 +0100
     147@@ -9,7 +9,7 @@
     148 linux="$1"
     149 output="$2"
     150 
     151-TMP=$(mktemp -d)
     152+TMP=$(gmktemp -d)
     153 
     154 if [ "$linux" = "" ] ; then
     155     echo "Needs path to linux source tree" 1>&2
     156--- a/scripts/update-linux-headers.sh   2020-12-08 17:59:44.000000000 +0100
     157+++ b/scripts/update-linux-headers.sh   2021-01-27 14:51:10.000000000 +0100
     158@@ -10,7 +10,7 @@
     159 # This work is licensed under the terms of the GNU GPL version 2.
     160 # See the COPYING file in the top-level directory.
     161 
     162-tmpdir=$(mktemp -d)
     163+tmpdir=$(gmktemp -d)
     164 linux="$1"
     165 output="$2"
     166 
     167--- a/scripts/update-mips-syscall-args.sh       2020-12-08 17:59:44.000000000 +0100
     168+++ b/scripts/update-mips-syscall-args.sh       2021-01-27 14:51:06.000000000 +0100
     169@@ -12,7 +12,7 @@ fi
     170 
     171 INC=linux-user/mips/syscall-args-o32.c.inc
     172 
     173-TMP=$(mktemp -d)
     174+TMP=$(gmktemp -d)
     175 cd $TMP
     176 
     177 for file in $FILES; do
     178--- a/tests/qemu-iotests/check  2020-12-08 17:59:44.000000000 +0100
     179+++ b/tests/qemu-iotests/check  2021-01-27 14:51:20.000000000 +0100
     180@@ -121,7 +121,7 @@ mkdir -p "$TEST_DIR" || _init_error 'Fai
     181 
     182 tmp_sock_dir=false
     183 if [ -z "$SOCK_DIR" ]; then
     184-    SOCK_DIR=$(mktemp -d)
     185+    SOCK_DIR=$(gmktemp -d)
     186     tmp_sock_dir=true
     187 fi
     188 mkdir -p "$SOCK_DIR" || _init_error 'Failed to create SOCK_DIR'
  • new file emulators/qemu/files/patch-misc-mktemp-unknown-params-to-coreutils.diff

    diff --git a/emulators/qemu/files/patch-misc-mktemp-unknown-params-to-coreutils.diff b/emulators/qemu/files/patch-misc-mktemp-unknown-params-to-coreutils.diff
    new file mode 100644
    index 00000000000..b806a9f958c
    - +  
     1--- a/roms/skiboot/external/boot-tests/boot_test.sh     2020-12-08 18:00:57.000000000 +0100
     2+++ b/roms/skiboot/external/boot-tests/boot_test.sh     2021-01-27 13:29:10.000000000 +0100
     3@@ -51,7 +51,7 @@ function linux_boot {
     4            msg "IPMI sol deactivate failed; IPMI may have stalled, may just be IPMI. Good luck."
     5        fi
     6 
     7-       LINUXBOOT_LOG=$(mktemp --tmpdir boot-test-$target.XXXXXX);
     8+       LINUXBOOT_LOG=$(gmktemp --tmpdir boot-test-$target.XXXXXX);
     9        cat <<EOF | expect > $LINUXBOOT_LOG
     10 set timeout 300
     11 spawn $IPMI_COMMAND sol activate
     12--- a/roms/skiboot/external/boot-tests/fsp_support.sh   2020-12-08 18:00:57.000000000 +0100
     13+++ b/roms/skiboot/external/boot-tests/fsp_support.sh   2021-01-27 13:29:06.000000000 +0100
     14@@ -116,7 +116,7 @@ function flash {
     15 }
     16 
     17 function boot_firmware {
     18-       ISTEP_LOG=$(mktemp --tmpdir builder-1.XXXXXX);
     19+       ISTEP_LOG=$(gmktemp --tmpdir builder-1.XXXXXX);
     20        $SSHCMD "$GET_PROFILE; istep" &> $ISTEP_LOG &
     21        msg "Waiting 90 seconds for $target to boot";
     22        sleep 90;
     23--- a/roms/skiboot/external/pflash/test/test-pflash     2020-12-08 18:00:57.000000000 +0100
     24+++ b/roms/skiboot/external/pflash/test/test-pflash     2021-01-27 13:29:18.000000000 +0100
     25@@ -32,7 +32,7 @@ cmp_with_ff() {
     26        start="$2";
     27        len="$3";
     28 
     29-       blank=$(mktemp --tmpdir="$DATA_DIR" blank.pnorXXXXXX);
     30+       blank=$(gmktemp --tmpdir="$DATA_DIR" blank.pnorXXXXXX);
     31        dd status=none if=/dev/zero bs="$len" count=1 | tr '\000' '\377' > "$blank"
     32        cmp --bytes="$len" --ignore-initial="$start:0" "$file" "$blank";
     33        if [ "$?" -ne 0 ] ; then
     34--- a/roms/skiboot/external/test/test.sh        2020-12-08 18:00:57.000000000 +0100
     35+++ b/roms/skiboot/external/test/test.sh        2021-01-27 13:29:22.000000000 +0100
     36@@ -80,7 +80,7 @@ run_tests() {
     37                exit 1;
     38        fi
     39 
     40-       export DATA_DIR=$(mktemp --tmpdir -d external-test-datadir.XXXXXX);
     41+       export DATA_DIR=$(gmktemp --tmpdir -d external-test-datadir.XXXXXX);
     42        export STDERR_OUT="$DATA_DIR/stderr"
     43        export STDOUT_OUT="$DATA_DIR/stdout"
     44        if [ $# -eq 3 ] ; then
     45--- a/roms/skiboot/test/run_qemu_boot_test.sh   2020-12-08 18:00:57.000000000 +0100
     46+++ b/roms/skiboot/test/run_qemu_boot_test.sh   2021-01-27 13:29:25.000000000 +0100
     47@@ -30,7 +30,7 @@ if [ ! -f "$SKIBOOT_ZIMAGE" ]; then
     48     exit 0;
     49 fi
     50 
     51-T=$(mktemp  --tmpdir skiboot_qemu_boot_test.XXXXXXXXXX)
     52+T=$(gmktemp  --tmpdir skiboot_qemu_boot_test.XXXXXXXXXX)
     53 
     54 ( cat <<EOF | expect
     55 set timeout 600
     56--- a/scripts/clean-includes    2020-12-08 17:59:44.000000000 +0100
     57+++ b/scripts/clean-includes    2021-01-27 13:29:31.000000000 +0100
     58@@ -94,7 +94,7 @@ fi
     59 # Annoyingly coccinelle won't read a scriptfile unless its
     60 # name ends '.cocci', so write it out to a tempfile with the
     61 # right kind of name.
     62-COCCIFILE="$(mktemp --suffix=.cocci)"
     63+COCCIFILE="$(gmktemp --suffix=.cocci)"
     64 
     65 trap 'rm -f -- "$COCCIFILE"' INT TERM HUP EXIT
     66 
     67--- a/tests/migration/initrd-stress.sh  2020-12-08 17:59:44.000000000 +0100
     68+++ b/tests/migration/initrd-stress.sh  2021-01-27 13:29:36.000000000 +0100
     69@@ -3,7 +3,7 @@
     70 INITRD="$1"
     71 STRESS="$2"
     72 
     73-INITRD_DIR=$(mktemp -d -p '' "initrd-stress.XXXXXX")
     74+INITRD_DIR=$(gmktemp -d -p '' "initrd-stress.XXXXXX")
     75 trap 'rm -rf $INITRD_DIR' EXIT
     76 
     77 cp "$STRESS" "$INITRD_DIR/init"