diff --git a/Changelog b/Changelog index 1de1a97a..7284c0e1 100644 --- a/Changelog +++ b/Changelog @@ -2,6 +2,7 @@ O.4 () - create /dev/initctl fifo in finit-alt (for reboot) - default username for finit-alt configurable in Makefile - create loopback device node in finit-alt (for squashfs) + - add option to use built-in run-parts instead of /bin/run-parts 0.3 (20080223) - Change poweroff method to reboot(RB_POWER_OFF) (Metalshark) diff --git a/Makefile b/Makefile index b01bc957..56325962 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,9 @@ CFLAGS += -march=pentium-m # and CONFIG_HPET_RTC_IRQ. #CFLAGS += -DDIRECTISA +# Use built-in run-parts instead of /bin/run-parts +#CFLAGS += BUILTIN_RUNPARTS + ifneq ($(USER), "user") CFLAGS += -DDEFUSER=\"$(USER)\" endif diff --git a/finit-alt.c b/finit-alt.c index f6108b2c..58f98f39 100644 --- a/finit-alt.c +++ b/finit-alt.c @@ -235,7 +235,11 @@ int main() touch("/etc/resolvconf/run/enable-updates"); chdir("/etc/resolvconf/run/interface"); +#ifdef BUILTIN_RUNPARTS + run_parts("/etc/resolvconf/update.d", "-i", NULL); +#else system(RUNPARTS " --arg=i /etc/resolvconf/update.d"); +#endif chdir("/"); #ifdef TOUCH_ETC_NETWORK_RUN_IFSTATE diff --git a/finit-mod.c b/finit-mod.c index 38f00670..30f11236 100644 --- a/finit-mod.c +++ b/finit-mod.c @@ -189,7 +189,11 @@ int main() touch("/etc/resolvconf/run/enable-updates"); chdir("/etc/resolvconf/run/interface"); +#ifdef BUILTIN_RUNPARTS + run_parts("/etc/resolvconf/update.d", "-i", NULL); +#else system("/bin/run-parts --arg=-i /etc/resolvconf/update.d"); +#endif chdir("/"); touch("/etc/network/run/ifstate"); diff --git a/helpers.c b/helpers.c index e5a67d53..4c76d594 100644 --- a/helpers.c +++ b/helpers.c @@ -10,8 +10,11 @@ #include #include #include + +#ifdef BUILTIN_RUNPARTS #include #include +#endif #include "helpers.h" @@ -93,13 +96,7 @@ void copyfile(char *src, char *dst, int size) } } -#if 0 - -/* Running the system /bin/run-parts is good enough, enable this if you - can't use it. Some distributions have it under /usr/bin, in this case - you can assume that the distribution is broken or run-parts is not used - in the boot process. - */ +#ifdef BUILTIN_RUNPARTS #define NUM_SCRIPTS 128 /* ought to be enough for anyone */ #define NUM_ARGS 16 diff --git a/helpers.h b/helpers.h index 80bf6ac1..5faa88ba 100644 --- a/helpers.h +++ b/helpers.h @@ -4,6 +4,9 @@ int makepath (char *); void ifconfig (char *, char *, char *, int); void copyfile (char *, char *, int); + +#ifdef BUILTIN_RUNPARTS int run_parts (char *, ...); +#endif #endif