From patchwork Thu May 19 03:42:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 623786 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r9H2j3KvHz9sBc for ; Thu, 19 May 2016 13:42:53 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=1CqQN+Za; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3r9H2j2GttzDqcq for ; Thu, 19 May 2016 13:42:53 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=1CqQN+Za; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3r9Gz65kwpzDqKY for ; Thu, 19 May 2016 13:39:46 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=1CqQN+Za; dkim-atps=neutral Received: by mail-io0-x243.google.com with SMTP id i75so12974361ioa.2 for ; Wed, 18 May 2016 20:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Lbap+uONkot5VHTt9IEsKcc+lktRbCUGRwmPTGq10eY=; b=1CqQN+ZaNz2msoYUX0UlNxolLGRJXoYLXn3AjXMKUa3QyMXSSHvHII/MO99dGDPx0x lFtNzLpSN4zGdsB3KLmKoncPjh71QrTKRNfAeMUeDBGTwmdX+Or75VdgveocDOKKukQS ig4X1814xNR09eLK7arA84VyGedKR+Pui36TkV6q/nMQKTAiyZC8UVASaw63lCj8QPbz jnwW+xy25I+SAy/p71bHp86yiwkl59PpAhFjw9WDK8n9eFc64+ElEOJqSPj0iZdkOZ5J JDxyDhbi8Qiz2nY+zXkEAYGS9ge9R6KFLwaTHbKBmGzPuO90oHfQtIddy5IpoadPmIRq zl4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Lbap+uONkot5VHTt9IEsKcc+lktRbCUGRwmPTGq10eY=; b=WG2Z+le5KtEv5Tc+mbJfxUOpsgVgTz7Lb5L9ZSEJ0eyoqCVlL4NOMJjOPvxeRUFddY YY3LCzXLvm8hyLpLCLd6crCWhGxt4fFsxQD7E2FkyoUxgDx2h9oMIn6wSNYRJr0k/p1m HUQvfFLP7Ngg9oaRkDr6+2cqzQjfSeTxSa6HSSqcjN4KQVM8qIAQ6pDMhbtnMljKEHQ2 E6SRBCWtUpVkVJNlAi4/k/SiSz5LhwaaP7sKN6Dgs/m6VbUqyS8Cz+zVC0Vdz3o0K0pb NEWE9c0VjQWqV/LQevRKzIe1/fRGAC1g7gcBs2973pMNVvUqP+MNHS+0b5xCW0jrYAhu NtTA== X-Gm-Message-State: AOPr4FWKo+ZKauDrS/HqcjN2rfDWBmGoogwRJvYVEsQcShAZV1e5EDhbqq5jfnYIidat1Q== X-Received: by 10.107.39.7 with SMTP id n7mr8159915ion.145.1463629184567; Wed, 18 May 2016 20:39:44 -0700 (PDT) Received: from localhost ([106.38.0.83]) by smtp.gmail.com with ESMTPSA id in3sm3732519igb.12.2016.05.18.20.39.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 May 2016 20:39:43 -0700 (PDT) From: Boqun Feng To: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 1/4] rcutorture/doc: Add a new way to create initrd using dracut Date: Thu, 19 May 2016 11:42:21 +0800 Message-Id: <1463629344-20471-2-git-send-email-boqun.feng@gmail.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1463629344-20471-1-git-send-email-boqun.feng@gmail.com> References: <1463629344-20471-1-git-send-email-boqun.feng@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boqun Feng , Lai Jiangshan , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , "Paul E. McKenney" MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Using dracut is another way to get an initramfs for kvm based rcu torture tests, which is more flexible than using the host's initramfs image, because modules and binaries may be added or removed via dracut command options. So add an example in the document, in case that there are some situations where host's initramfs couldn't be used. Signed-off-by: Boqun Feng --- tools/testing/selftests/rcutorture/doc/initrd.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/testing/selftests/rcutorture/doc/initrd.txt b/tools/testing/selftests/rcutorture/doc/initrd.txt index 4170e714f044..833f826d6ec2 100644 --- a/tools/testing/selftests/rcutorture/doc/initrd.txt +++ b/tools/testing/selftests/rcutorture/doc/initrd.txt @@ -13,6 +13,22 @@ cd initrd cpio -id < /tmp/initrd.img.zcat ------------------------------------------------------------------------ +Another way to create an initramfs image is using "dracut"[1], which is +available on many distros, however the initramfs dracut generates is a cpio +archive with another cpio archive in it, so an extra step is needed to create +the initrd directory hierarchy. + +Here are the commands to create a initrd directory for rcutorture using +dracut: + +------------------------------------------------------------------------ +dracut --no-hostonly --no-hostonly-cmdline --module "base bash shutdown" /tmp/initramfs.img +cd tools/testing/selftests/rcutorture +mkdir initrd +cd initrd +/usr/lib/dracut/skipcpio /tmp/initramfs.img | zcat | cpio -id < /tmp/initramfs.img +------------------------------------------------------------------------ + Interestingly enough, if you are running rcutorture, you don't really need userspace in many cases. Running without userspace has the advantage of allowing you to test your kernel independently of the @@ -89,3 +105,9 @@ while : do sleep 10 done +------------------------------------------------------------------------ + +References: +[1]: https://dracut.wiki.kernel.org/index.php/Main_Page +[2]: http://blog.elastocloud.org/2015/06/rapid-linux-kernel-devtest-with-qemu.html +[3]: https://www.centos.org/forums/viewtopic.php?t=51621