2013-03-11 47 views
0

我試圖修補Android的init以允許卸載Android並在已經初始化的硬件上加載Ubuntu。 here是我正在嘗試的補丁。fork()返回現有進程的pid

,但殺死後-USR1 1內核去恐慌和重啓後我看到旁邊的RAM控制檯:

[ 96.671325] init: Got SIGUSR1, trying to execve /system/xbin/ubuntu.sh 
[ 96.680786] init: fork done, pid=1 
[ 96.685089] [K] Kernel panic - not syncing: Attempted to kill init! 
[ 96.685150] [<c010ac50>] (unwind_backtrace+0x0/0xe0) from [<c0596408>] (panic+0x6c/0x198) 
[ 96.685150] [<c0596408>] (panic+0x6c/0x198) from [<c017e1d0>] (do_exit+0x98/0x650) 
[ 96.685180] [<c017e1d0>] (do_exit+0x98/0x650) from [<c017ea34>] (do_group_exit+0x84/0xc0) 
[ 96.685211] [<c017ea34>] (do_group_exit+0x84/0xc0) from [<c017ea80>] (__wake_up_parent+0x0/0x18) 
[ 96.685241] CPU1: stopping 
[ 96.685333] [<c010ac50>] (unwind_backtrace+0x0/0xe0) from [<c0109e2c>] (handle_IPI+0xd4/0x140) 
[ 96.685424] [<c0109e2c>] (handle_IPI+0xd4/0x140) from [<c01053cc>] (__irq_svc+0x4c/0xe4) 
[ 96.685516] [<c01053cc>] (__irq_svc+0x4c/0xe4) from [<c01058c0>] (ret_fast_syscall+0x0/0x30) 
[ 96.785858] subsystem-fatal-8x60: Q6 NMI was sent. 
[ 96.790924] [K] Rebooting in 5 seconds.. 
[ 101.798248] [K] Going down for restart now 

如何叉(返程PID == 1(的子進程))到父進程,init,它已經有了pid == 1?

謝謝!

+0

strerror在信號處理程序中不安全,我不知道ERROR會做什麼,也看不到您調用的腳本。這並不能回答你的問題,但它的信息會很方便。 – Joe 2013-03-11 10:49:01

+0

[here](http://dl.dropbox.com/u/100376233/Linux-shooteru/DAY1/ubuntu.sh)是腳本,但它有道理,如果init本身有問題?謝謝你,我使用strerror_r更新補丁() – 2013-03-11 11:06:53

+0

再次感謝你,在更新補丁之後,現在看起來好了。 – 2013-03-11 11:17:43

回答

0

strerror在信號處理程序中不安全,所以從這裏開始! :-)