projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
753c404
)
run-init: if doing dry run, do not require pid==1
author
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 22 Aug 2017 09:40:27 +0000
(11:40 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Tue, 22 Aug 2017 09:40:27 +0000
(11:40 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/switch_root.c
patch
|
blob
|
history
diff --git
a/util-linux/switch_root.c
b/util-linux/switch_root.c
index 16abcb634fe60d92670a3961acde603a7ebd036e..080b05e45a327eb7d0c7a44d45e3c2a75fbe286d 100644
(file)
--- a/
util-linux/switch_root.c
+++ b/
util-linux/switch_root.c
@@
-227,9
+227,12
@@
int switch_root_main(int argc UNUSED_PARAM, char **argv)
xstat("/", &st);
rootdev = st.st_dev;
xstat(".", &st);
- if (st.st_dev == rootdev
|| getpid() != 1
) {
+ if (st.st_dev == rootdev) {
// Show usage, it says new root must be a mountpoint
- // and we must be PID 1
+ bb_show_usage();
+ }
+ if (!dry_run && getpid() != 1) {
+ // Show usage, it says we must be PID 1
bb_show_usage();
}