mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org,
	Willy Tarreau <w@1wt.eu>,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH tip/core/rcu 6/8] rcutorture: Check initrd/init instead of initrd only
Date: Sun, 11 Nov 2018 12:01:41 -0800	[thread overview]
Message-ID: <20181111200143.10177-6-paulmck@linux.ibm.com> (raw)
In-Reply-To: <20181111200127.GA9511@linux.ibm.com>

From: Willy Tarreau <w@1wt.eu>

If the build fails, we can end up with an empty initrd directory which
prevents the build script from operating again. Better rely on the
resulting init executable instead.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 tools/testing/selftests/rcutorture/bin/mkinitrd.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/rcutorture/bin/mkinitrd.sh b/tools/testing/selftests/rcutorture/bin/mkinitrd.sh
index dbb6f0160281..56a56ea06983 100755
--- a/tools/testing/selftests/rcutorture/bin/mkinitrd.sh
+++ b/tools/testing/selftests/rcutorture/bin/mkinitrd.sh
@@ -28,8 +28,8 @@ if [ ! -d "$D" ]; then
     echo >&2 "$D does not exist: Malformed kernel source tree?"
     exit 1
 fi
-if [ -d "$D/initrd" ]; then
-    echo "$D/initrd already exists, no need to create it"
+if [ -s "$D/initrd/init" ]; then
+    echo "$D/initrd/init already exists, no need to create it"
     exit 0
 fi
 
@@ -65,7 +65,7 @@ then
 	# Filesystem creation
 	dracut --force --no-hostonly --no-hostonly-cmdline --module "base" $T/initramfs.img
 	cd $D
-	mkdir initrd
+	mkdir -p initrd
 	cd initrd
 	zcat $T/initramfs.img | cpio -id
 	cp $T/init init
@@ -79,7 +79,7 @@ fi
 # future-proof than dracut.
 echo "Could not find dracut, attempting C initrd"
 cd $D
-mkdir initrd
+mkdir -p initrd
 cd initrd
 cat > init.c << '___EOF___'
 #include <unistd.h>
-- 
2.17.1


  parent reply	other threads:[~2018-11-11 20:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-11 20:01 [PATCH tip/core/rcu 0/8] Automate initrd generation for v4.21/v5.0 Paul E. McKenney
2018-11-11 20:01 ` [PATCH tip/core/rcu 1/8] rcutorture: Automatically create initrd directory Paul E. McKenney
2018-11-11 20:01 ` [PATCH tip/core/rcu 2/8] rcutorture: Add initrd support for systems lacking dracut Paul E. McKenney
2018-11-11 20:01 ` [PATCH tip/core/rcu 3/8] rcutorture: Make initrd/init execute in userspace Paul E. McKenney
2018-11-11 20:01 ` [PATCH tip/core/rcu 4/8] rcutorture: Add cross-compile capability to initrd.sh Paul E. McKenney
2018-11-11 20:01 ` [PATCH tip/core/rcu 5/8] rcutorture: Always strip using the cross-compiler Paul E. McKenney
2018-11-11 20:01 ` Paul E. McKenney [this message]
2018-11-11 20:01 ` [PATCH tip/core/rcu 7/8] rcutorture: Import a copy of nolibc Paul E. McKenney
2018-11-11 20:01 ` [PATCH tip/core/rcu 8/8] rcutorture: Make use of nolibc when available Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181111200143.10177-6-paulmck@linux.ibm.com \
    --to=paulmck@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome