On Wed, Nov 21, 2007 at 10:46:11AM +0100, Frantisek Dufka wrote: > Hello, > > I did google search and poked around in busybox init/* sources but still > don't know how/if this is possible. > > I'd like to implement quicker reboot on Nokia 770 tablet without doing > real reboot that goes through bootloader and kernel. For this I think I > need to tell init to exec my script (as pid 1). How? > > 770 boot process is like > - bootloader loads kernel (from /dev/mtdblock2) > -kernel runs /linuxrc in /dev/mtdblock3 (uclibc system with busybox 1.00). > - linuxrc does some stuff, mounts real root and then switches to it via > pivot_root like this: > > cd /mnt/new_root > pivot_root . mnt/initfs > exec /usr/sbin/chroot . /sbin/init $def_runlevel <dev/console > >dev/console 2>&1 > > Real root filesystem has busybox 1.4.1 and glibc, /sbin/init is busybox > init. > > what I'd like to do is put genie back to bottle, shutdown everything, > pivot_root back to /dev/mtdblock3 (mounted to /mnt/initfs) and run > /linuxrc as pid 1 again. > > First I implemented it as new runlevel an basically it works except when > being back in /linuxrc I am not pid 1 and still have original init as > pid 1 keeping old root busy and preventing me to boot different root > again via same pivot_root trick and running different /sbin/init. > Obviously init cannot be killed so it needs to be replaced. > > init/init.c has "static void exec_signal(int sig ATTRIBUTE_UNUSED)" > which looks like code I need but I don't know how to invoke it with my > script or binary.
In inittab, add something like: ::restart:/sbin/init Then kill init with signal QUIT: kill -QUIT 1 Then init will execute the program at /sbin/init, that can be a symlink to /linuxrc in your mtdblock3, or change the inittab directoy. -- lfr 0/0
pgpIUP39vRb7m.pgp
Description: PGP signature
_______________________________________________ busybox mailing list [email protected] http://busybox.net/cgi-bin/mailman/listinfo/busybox
