ntadmin / DGND3700v2

Custom firmware for the Netgear DGND3700v2
12 stars 4 forks source link

Resolve issues in init.c in new busybox #24

Closed ntadmin closed 7 years ago

ntadmin commented 8 years ago

diff for init.c (1.13.4 vs 1.13.4 Netgear modded), as this seems likely to trash boot up ...

36,37c36
< //#define INIT_SCRIPT  "/etc/init.d/rcS"      /* Default sysinit script. */
< #define INIT_SCRIPT  "/usr/etc/rcS"   /* Default sysinit script. */

---
> #define INIT_SCRIPT  "/etc/init.d/rcS"        /* Default sysinit script. */
693c692
<               new_init_action(ASKFIRST, bb_default_login_shell, "/dev/ttyS0");

---
>               new_init_action(ASKFIRST, bb_default_login_shell, "");
695,697c694,696
< //            new_init_action(ASKFIRST, bb_default_login_shell, VC_2);
< //            new_init_action(ASKFIRST, bb_default_login_shell, VC_3);
< //            new_init_action(ASKFIRST, bb_default_login_shell, VC_4);

---
>               new_init_action(ASKFIRST, bb_default_login_shell, VC_2);
>               new_init_action(ASKFIRST, bb_default_login_shell, VC_3);
>               new_init_action(ASKFIRST, bb_default_login_shell, VC_4);
699c698
<               new_init_action(SYSINIT, INIT_SCRIPT, "/dev/console");

---
>               new_init_action(SYSINIT, INIT_SCRIPT, "");

Seems to:

ntadmin commented 8 years ago

INIT_SCRIPT is only set in the code if it hasn't already been set. So, if we can set this from the make command, then all is good. this can be done by modifying our packages Makefile: https://github.com/ntadmin/DGND3700v2/commit/e72d8ce745d94dddf6f64b32d4c38d31f23d50dc

ntadmin commented 8 years ago

The other lines:

  1. Change it to only have one default 'askfirst' shell, and to put it on /dev/ttyS0, rather than 4 on tty1-4. The device only seems to
  2. Set the init script to run on /dev/console rather than some kind of default.gG

ls -al of the relevant /dev entries:

crw-r--r--    1 root     root       5,   1 Jul 18 15:11 console
crw-r--r--    1 root     root       5,   0 May 13  2010 tty
crw-r--r--    1 root     root       4,   0 May 13  2010 tty0
crw-r--r--    1 root     root       4,   1 May 13  2010 tty1
crw-r--r--    1 root     root       4,  64 Jan  1  1970 ttyS0
crw-r--r--    1 root     root       4,  65 May 13  2010 ttyS1
ntadmin commented 8 years ago

Key question: what happens if we get the /dev things wrong?

ntadmin commented 7 years ago

OK, busybox now has the init script correct in it, it seems to point to /usr/etc/rcS. How to tell if it works?

ntadmin commented 7 years ago

Tested and it now boots with only the updated busybox in it.