BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000708 [BusyBox] Other minor always 02-09-06 05:03 02-13-06 23:34
Reporter hel View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version svn
Summary 0000708: switch_root parses init parameters wrongly
Description I could reproduce this problem with busybox r13886 compiled statically against uclibc --- used in an initramfs

the command
switch_root -c /dev/console /mnt/newroot /sbin/init 1
does not deliver the "1" over to init

however
switch_root -c /dev/console /mnt/newroot /sbin/init dummy 1
does start init in the correct runlevel.
Additional Information
Attached Files

- Relationships

- Notes
(0001085)
brain0
02-12-06 15:28

I have the same issue, but even worse. Because of a wrong execv call, /sbin/init will hang forever after I do
exec /sbin/switch_root /new_root /sbin/init
This is because the first argument passed by all exec calls should be the program name itself. This patch fixes it:

diff -ur busybox-1.1.0.orig/util-linux/switch_root.c busybox-1.1.0/util-linux/switch_root.c
--- busybox-1.1.0.orig/util-linux/switch_root.c 2006-01-11 06:44:22.000000000 +0100
+++ busybox-1.1.0/util-linux/switch_root.c 2006-02-12 21:47:37.000000000 +0100
@@ -118,6 +118,6 @@
     }
 
     // Exec real init. (This is why we must be pid 1.)
- execv(argv[optind],argv+optind+1);
+ execv(argv[optind],argv+optind);
     bb_error_msg_and_die("Bad init '%s'",argv[optind]);
 }
 
(0001089)
landley
02-13-06 23:34

svn 14007
 

- Issue History
Date Modified Username Field Change
02-09-06 05:03 hel New Issue
02-09-06 05:03 hel Status new => assigned
02-09-06 05:03 hel Assigned To  => BusyBox
02-12-06 15:28 brain0 Note Added: 0001085
02-13-06 23:34 landley Status assigned => closed
02-13-06 23:34 landley Note Added: 0001089
02-13-06 23:34 landley Resolution open => fixed
02-13-06 23:34 landley Fixed in Version  => svn


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker