From patchwork Fri Nov 23 02:16:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChenQi X-Patchwork-Id: 151829 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1479731ljp; Thu, 22 Nov 2018 18:10:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/UqNd+SWgqCYU/GaHvXviPmkHNRDfY2Yo6IzXpzJHsbS4yG5IKUZsrVUiRyvGMCN2ukmYrV X-Received: by 2002:a17:902:584:: with SMTP id f4mr1336926plf.28.1542939051878; Thu, 22 Nov 2018 18:10:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542939051; cv=none; d=google.com; s=arc-20160816; b=YtrbZ3j/ULW6Oi2hyyBno02WuLEh9mWdtuMewEC6iTdIashXkKrCdkx4sn6eQc185V AkqbWcyoT+REwE4pRpwJhZQwqXXLGpiyC3f+k0ByWk3/uJJ8ETQDaQpJAi0Tgvee1pax qrbV1PLPGxtOXw310bShq0hTPjp0VdZ+xq0mdOUZanEzlh5Qpb1Zp6CMH1WtGXa9bFSU BJxaXp01hTplqM1pSRdk8Qd0M/oV+wEkfpTD+tGUHukfk9QTP7nG43SK1RxuzSpuwrVi 3A8WeEOZVP+EJkJwt9qq9GhRi4mrxRjnRwCYjSKCXqydZlvvRf3kByNonH10NM/uYNXr mPzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=u0R90eDTKvyVZDQqZdbR9VB3HsyOyDnihIjf9YLqMZk=; b=ix7EFm2vqtX52aAF+yFd+l3hcyO0ozSSPgQIkeGuaeAist81Tb50wiph3B6FB1cCwK lTCFq5Gxe1NeznjSfDrbY4D3EILLvnKWYTlodg0RBkMrfbfsOXEWVwkdFw2fKi4T5Syw 2scvKPyEbwu4lW9i5ks57tkM/NPgvxc4PaueWaL7RGHWlbJLVDAGQCZOPdOQfYG8gqhR +Ngo9jSIzQ56VcY5QoQVei3YsCjjjajsIz5JZ+pryq6Hcftj3elxK2k16Gng/pqsOhYa +bVxdjzH9DlOMD4pl5h8BYXq2hhtC7IVkj8YWR5MvZvICVQuGqd8qAX9gr6b2pZhrAXZ n3sw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id y13si52530752pgj.157.2018.11.22.18.10.51; Thu, 22 Nov 2018 18:10:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from 165.28.230.35.bc.googleusercontent.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id ECFF46C667; Fri, 23 Nov 2018 02:10:47 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by mail.openembedded.org (Postfix) with ESMTP id 92EC56C655 for ; Fri, 23 Nov 2018 02:10:44 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id wAN2AjEK022845 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL) for ; Thu, 22 Nov 2018 18:10:45 -0800 (PST) Received: from pek-qchen1-d1.corp.ad.wrs.com (128.224.163.141) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.408.0; Thu, 22 Nov 2018 18:10:45 -0800 From: Chen Qi To: Date: Fri, 23 Nov 2018 10:16:31 +0800 Message-ID: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [OE-core] [PATCH 8/9] busybox: ship a symlink farm for ptest X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org From: Ross Burton Ship a symlink farm for busybox, which correctly considers SUID split. This ensures that all utilities used in busybox's test cases will first use that ones that are provided by busybox. Modify run-ptest to prepend the directory to PATH, and also change variable name from current_dir to current_path, as the former is a little misleading. `readlink -f $0' gets a path to the current script instead of the current directory. Signed-off-by: Chen Qi --- meta/recipes-core/busybox/busybox.inc | 14 ++++++++++++++ meta/recipes-core/busybox/files/run-ptest | 5 +++-- 2 files changed, 17 insertions(+), 2 deletions(-) -- 1.9.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc index b45d2b6..68ba8c6 100644 --- a/meta/recipes-core/busybox/busybox.inc +++ b/meta/recipes-core/busybox/busybox.inc @@ -352,6 +352,20 @@ do_install_ptest () { cp -r ${B}/testsuite ${D}${PTEST_PATH}/ cp ${B}/.config ${D}${PTEST_PATH}/ ln -s /bin/busybox ${D}${PTEST_PATH}/busybox + + mkdir ${D}${PTEST_PATH}/bin + if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then + while read link; do + ln -s ${base_bindir}/busybox.suid ${D}${PTEST_PATH}/bin/$(basename $link) + done <${D}${sysconfdir}/busybox.links.suid + while read link; do + ln -s ${base_bindir}/busybox.nosuid ${D}${PTEST_PATH}/bin/$(basename $link) + done <${D}${sysconfdir}/busybox.links.nosuid + else + while read link; do + ln -s ${base_bindir}/busybox ${D}${PTEST_PATH}/bin/$(basename $link) + done <${D}${sysconfdir}/busybox.links + fi } inherit update-alternatives diff --git a/meta/recipes-core/busybox/files/run-ptest b/meta/recipes-core/busybox/files/run-ptest index 8b99bed..b19e5b5 100644 --- a/meta/recipes-core/busybox/files/run-ptest +++ b/meta/recipes-core/busybox/files/run-ptest @@ -1,7 +1,8 @@ #!/bin/sh -current_dir=$(readlink -f $0) -export bindir=$(dirname $current_dir) +current_path=$(readlink -f $0) +export bindir=$(dirname $current_path) +export PATH=$bindir/bin:$PATH export SKIP_KNOWN_BUGS=1 cd testsuite || exit 1