Re-Exec init after pivot_root

Denis Vlasenko vda.linux at googlemail.com
Mon Mar 19 21:14:48 UTC 2007


Hi Mark,

On Monday 19 March 2007 03:12, Mark Hinds wrote:
> I'm using pivot_root to switch from a JFFS2 rootfs to tempfs rootfs
> to do SW updates on the abobe JFFS2 rootfs. It was very handy to
> restart init via re-exec'ing in a signal handler so I added a new signal
> handler to busybox's init_main
> 
> #ifdef CONFIG_FEATURE_INIT_REXEC
>          signal(SIGINT, rexec_signal);
> #endif
> 
> rexec_signal does much of what shutdown does, except
> when its done it exec's /sbin/init, and boom - we're
> running in fresh init in the new pivot'd rootfs and can
> do as I please to the JFFS2 rootfs.
> 
> Questions:
> 1. Does this make sense?

Don't know, because I didn't fully understand what exactly
are you trying to achieve. You pivot-rooted to tmpfs, and
then... you want to send SIGINT to init in order to re-exec it?
why? I obviously miss something here...

> 2. Is there a better way?
> 3. If Re-exec'ing init is usefull, then how does one get such a mod into busybox?
--
vda



More information about the busybox mailing list