From patchwork Fri Jun 30 14:58:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 13298300 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59218EB64DA for ; Fri, 30 Jun 2023 14:58:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232480AbjF3O60 (ORCPT ); Fri, 30 Jun 2023 10:58:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231849AbjF3O6Z (ORCPT ); Fri, 30 Jun 2023 10:58:25 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DD0A359E; Fri, 30 Jun 2023 07:58:23 -0700 (PDT) X-QQ-mid: bizesmtp87t1688137093tnenfezj Received: from linux-lab-host.localdomain ( [119.123.131.49]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 30 Jun 2023 22:58:12 +0800 (CST) X-QQ-SSF: 01200000000000D0W000000A0000000 X-QQ-FEAT: D2GZf6M6C/iXFYl/ZWwOsCC60g16lUOAO1Y9zKzd1LwnO/woTAQ+CfFAkq+Wq yVeX7w8gzVRaC0SNKCQtyPkZN/zhk/F1PWjZql1ldLzLVQFuQbSiRXTcGXfcbeHLxXXnyQ+ lBWoXyFAGge/HaepE42/QBGraYZT7/W6Y/K26Vrhy2hEl5nmDxNYXX5FANYRVFqUj4XE5mO jTe2Kfpzs4ti027IGCj9+5QK1o8po3R0YfxRGGvR14JiAva+J1DyAaPebh27Xgh/Q6Wxmdu T9vYY1X2oIJAX6qK79cvfirKVYbg83JWPlQPDPwV45vrB5Khperyo2EACncI7za7Elp7jXl zUPTppk7VqkRdqR6/XBT+vVjhRkQZHUuSsSGlj2k7VhjEAUtX5YedXd8D2g7ulSPoo3qCqH X-QQ-GoodBg: 0 X-BIZMAIL-ID: 3647784010068437256 From: Zhangjin Wu To: thomas@t-8ch.de, w@1wt.eu Cc: arnd@arndb.de, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Subject: [PATCH v3 12/14] selftests/nolibc: prepare /tmp for tmpfs or ramfs Date: Fri, 30 Jun 2023 22:58:02 +0800 Message-Id: <020ca58ad59035488d6a50b14113ed7401e797f4.1688134400.git.falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org create a /tmp directory and mount tmpfs there, if tmpfs is not mountable, use ramfs as tmpfs. tmpfs will be used instead of procfs for some tests. Reviewed-by: Thomas Weißschuh Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/nolibc-test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index b7ea95dad0fb..906b70ddec79 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -1053,6 +1053,10 @@ int prepare(void) } } + /* try to mount /tmp if not mounted, if not mountable, use ramfs as tmpfs */ + mkdir("/tmp", 0755); + mount("none", "/tmp", "tmpfs", 0, 0); + return 0; }