From patchwork Mon Feb 8 12:38:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 378569 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp4876905jah; Mon, 8 Feb 2021 09:38:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2Q/9oLOOwhM4ddAP5K6+JQCp7F4yOJr7Cjvih0ga+sBcDuGEo+5poft5rvm5tQ3c5iJEl X-Received: by 2002:a25:50d:: with SMTP id 13mr6504971ybf.5.1612805898508; Mon, 08 Feb 2021 09:38:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612805898; cv=none; d=google.com; s=arc-20160816; b=rQ8Y/UP4VdFmocizrFIGcxP1gTOACnPkzc42p8vUt3On2WiKwXd6pAPeFzkSXuNiNG /1t7zB5bzGRpfjDdpjvYDFCzIfDRrb0R9lFy0EZsSzu0HygXu9xHdJUGV4sE4lFuvH+i DWl6C388gle2tj+Jh5pkIQkV+sEE9NrdCuxdw1wAOUmVTKIAB13G3ZCWk+Zxd+tQ7/QS 03raQGbg1cTMcJFL/SP4sX87CbL1B3v4wknr9vM1yd1vNvq98nPXWpEIzW1h/KFuh6Dg FHUdD1P+sUc4GbHFNCZcCrn3mfwoN8ayixsahNPa6UONBPGIFyvtQL9DxhIyrAa/V8ZV uy3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=l+elDiMrFXDDD+nT/WQU5kV+TB/XEnR+Ql7bQKLVzgA=; b=N7ziZ63/MH3Su/5vmLeBz5zd4uWeAAGx/+vHDPp1jaIgvXcz+oXWgJt3gjBE43CYzb 4q3ACGzJ7DZV5POOhT5ROob3XwKhuzeNFRZzv9yNKSRAHhRoBQzFRq+cKODCH5npeI1l oDP4pWwYoLkl6eu1gDuCzFJuYUHOYgJuLwtCU9n7HH3FqTET93M2V6utVXi2hfMxysWs 7iMzWNax5r9usI2V9u1jcSPP/BiW2nmxIUEJHMQL0vcHcP6mlt4tt5xK2rGXPF6vi3mM 940B8YIMn8wucTynybbN2+QImV18xwRYGZ3t5tCtPqsLuhyjRfziyTxCbMr74VUhznDr lvCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MQ8fCs51; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c62si14527704yba.181.2021.02.08.09.38.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Feb 2021 09:38:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=MQ8fCs51; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9AUL-0001tj-V0 for patch@linaro.org; Mon, 08 Feb 2021 12:38:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l95pA-0003fr-RN for qemu-devel@nongnu.org; Mon, 08 Feb 2021 07:39:32 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:43044) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l95oh-0007ih-Da for qemu-devel@nongnu.org; Mon, 08 Feb 2021 07:39:12 -0500 Received: by mail-wr1-x431.google.com with SMTP id z6so16845832wrq.10 for ; Mon, 08 Feb 2021 04:38:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l+elDiMrFXDDD+nT/WQU5kV+TB/XEnR+Ql7bQKLVzgA=; b=MQ8fCs51nGcAi+iPDyRLztZgtd/xph2Vn6AvSxWz2N5wy7Svpnk5sQBW7yUh489NqJ XItKlQl6PVXVFjYmf9khSvzdnV3bULZsrqKFpIdJRP+0D4mIC7EnS4iIxVi4DuWzZkhZ sBZQQR9QjDo6p9fbRoOflZMYLbJHWmx7AvquVSPBFkuD/Xx3OXCIwPEGq7atBjuVHNgV 8Cs6LeA+ek0pe7xruz1dxTM0ROXpWT8tPzsaHtwSEfA11ox1ZSOIrCWR+YCvAN1g1NPF NmiNt95QQFOgj698ddH/qxcklMlS0W6fu7AuwOMDlPpm2e7Z9aC5kuQX4GlDzHpyU/YV T1MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l+elDiMrFXDDD+nT/WQU5kV+TB/XEnR+Ql7bQKLVzgA=; b=C6bZR21lEctRij+iCxPqq38uDxepCDiK16E9nyBf6gqEAU09O2OJx0L5+4j40FABKx gXki/Pe7QWyLHOQkFn1yJoIbJKSXD2boSabgxWLVtW/mSIu/zNluJ/Rc0PV5z1bD3ydF MKOP/F3oqaQcNooHVBUT7qIQRGeMAmJ6eyxOy7gaHtdUuGWf2qGw/71ysSSUOVF9v1Wb CL0qRHWDJo8/EHOqtQZ7OslXmfwh6WuTHMjKhdiWiST2SO89oi8awNSNvseW92siJjDx ZFKrEQx3dUgcPbaGWtP3XufmpP3YWo5tdClNoS7YU7YoGZaJ/z5ggassVrgdzpIK0Kxd eHbA== X-Gm-Message-State: AOAM5314yhoJkFBthzhzaC9cLIkHY9zNu95QwYxVaIzB0Rr8HlRyKpBI qkk8X4pjUpOhtHMKL/kFAbmYsg== X-Received: by 2002:adf:ea02:: with SMTP id q2mr20058475wrm.25.1612787912106; Mon, 08 Feb 2021 04:38:32 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r13sm22532595wmh.9.2021.02.08.04.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 04:38:26 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 300A21FF91; Mon, 8 Feb 2021 12:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 05/16] tests/docker: preserve original name when copying libs Date: Mon, 8 Feb 2021 12:38:10 +0000 Message-Id: <20210208123821.19818-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210208123821.19818-1-alex.bennee@linaro.org> References: <20210208123821.19818-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" While it is important we chase down the symlinks to copy the correct data we can confuse the kernel by renaming the interpreter to what is in the binary. Extend _copy_with_mkdir to preserve the original name of the file when asked. Fixes: 5e33f7fead ("tests/docker: better handle symlinked libs") Signed-off-by: Alex Bennée Message-Id: <20210202134001.25738-5-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/docker/docker.py b/tests/docker/docker.py index fb3de41c0b..39da3fefcf 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -93,7 +93,7 @@ def _guess_engine_command(): commands_txt) -def _copy_with_mkdir(src, root_dir, sub_path='.'): +def _copy_with_mkdir(src, root_dir, sub_path='.', name=None): """Copy src into root_dir, creating sub_path as needed.""" dest_dir = os.path.normpath("%s/%s" % (root_dir, sub_path)) try: @@ -102,7 +102,7 @@ def _copy_with_mkdir(src, root_dir, sub_path='.'): # we can safely ignore already created directories pass - dest_file = "%s/%s" % (dest_dir, os.path.basename(src)) + dest_file = "%s/%s" % (dest_dir, name if name else os.path.basename(src)) try: copy(src, dest_file) @@ -155,8 +155,9 @@ def _copy_binary_with_libs(src, bin_dest, dest_dir): if libs: for l in libs: so_path = os.path.dirname(l) + name = os.path.basename(l) real_l = os.path.realpath(l) - _copy_with_mkdir(real_l, dest_dir, so_path) + _copy_with_mkdir(real_l, dest_dir, so_path, name) def _check_binfmt_misc(executable):