1 diff -urN busybox-dist/include/applets.h busybox/include/applets.h
2 --- busybox-dist/include/applets.h 2004-03-16 09:56:27.000000000 -0600
3 +++ busybox/include/applets.h 2004-03-16 10:00:14.000000000 -0600
6 APPLET(reset, reset_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
8 +#ifdef CONFIG_RESETMON
9 + APPLET(resetmon, resetmon_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
12 APPLET(rm, rm_main, _BB_DIR_BIN, _BB_SUID_NEVER)
14 diff -urN busybox-dist/include/usage.h busybox/include/usage.h
15 --- busybox-dist/include/usage.h 2004-03-16 09:56:27.000000000 -0600
16 +++ busybox/include/usage.h 2004-03-16 10:00:14.000000000 -0600
17 @@ -2024,6 +2024,11 @@
18 #define reset_full_usage \
21 +#define resetmon_trivial_usage \
23 +#define resetmon_full_usage \
24 + "Return an exit code of TRUE (0) if reset is NOT pressed."
26 #define rm_trivial_usage \
28 #define rm_full_usage \
29 diff -urN busybox-dist/miscutils/Config.in busybox/miscutils/Config.in
30 --- busybox-dist/miscutils/Config.in 2004-03-15 02:28:46.000000000 -0600
31 +++ busybox/miscutils/Config.in 2004-03-16 10:00:14.000000000 -0600
33 to advance or rewind a tape past a specified number of archive
36 +config CONFIG_RESETMON
40 + Linksys wrt54g reset button monitor. Returns TRUE if NOT pressed.
45 diff -urN busybox-dist/miscutils/Makefile.in busybox/miscutils/Makefile.in
46 --- busybox-dist/miscutils/Makefile.in 2004-03-15 02:28:46.000000000 -0600
47 +++ busybox/miscutils/Makefile.in 2004-03-16 10:00:14.000000000 -0600
49 MISCUTILS-$(CONFIG_LAST) += last.o
50 MISCUTILS-$(CONFIG_MAKEDEVS) += makedevs.o
51 MISCUTILS-$(CONFIG_MT) += mt.o
52 +MISCUTILS-$(CONFIG_RESETMON) += resetmon.o
53 MISCUTILS-$(CONFIG_RX) += rx.o
54 MISCUTILS-$(CONFIG_STRINGS) += strings.o
55 MISCUTILS-$(CONFIG_TIME) += time.o
56 diff -urN busybox-dist/miscutils/resetmon.c busybox/miscutils/resetmon.c
57 --- busybox-dist/miscutils/resetmon.c 1969-12-31 18:00:00.000000000 -0600
58 +++ busybox/miscutils/resetmon.c 2004-03-16 10:00:14.000000000 -0600
66 +int resetmon_main(int argc, char **argv) {
71 + if ((fd = open("/dev/gpio/control",O_RDWR))<0) goto error;
76 + if ((fd = open("/dev/gpio/outen",O_RDWR))<0) goto error;
82 + if ((fd = open("/dev/gpio/in",O_RDONLY))<0) goto error;
85 + return !(val&RESET);