Re-Exec init after pivot_root

Mark Hinds zobangub at gmail.com
Mon Mar 19 02:12:56 UTC 2007


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

Thanks,

Zoban





More information about the busybox mailing list