← Commit list

7d834c9bb

Denys Vlasenko
Denys Vlasenko
2017-08-22
SUCCESS Duration: 144s

Subject

run-init: if doing dry run, do not require pid==1

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

util-linux/switch_root.c+5 -2
@@ -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();
}