diff -Naur busybox-1.13.3.orig/include/platform.h busybox-1.13.3/include/platform.h --- busybox-1.13.3.orig/include/platform.h 2009-02-26 12:47:26.000000000 +0100 +++ busybox-1.13.3/include/platform.h 2009-05-21 17:40:57.000000000 +0200 @@ -363,3 +363,20 @@ #endif +/* TIOCGSERIAL, CBAUD and CBAUDEX are Linux specific. */ +#include +#if !defined(TIOCGSERIAL) +# if defined(__FreeBSD_kernel__) +/* +# include +# define TIOCGSERIAL LINUX_TIOCGSERIAL +# define CBAUD LINUX_CBAUD +# define CBAUDEX LINUX_CBAUDEX +*/ +// HACK; copied from http://svn.freebsd.org/viewvc/base/release/7.2.0/sys/compat/linux/linux_ioctl.h?view=markup +# define TIOCGSERIAL 0x541E +# define CBAUD 0x0000100f +# define CBAUDEX 0x00001000 +# endif +#endif + #endif /* platform.h */ diff -Naur busybox-1.13.3.orig/init/init.c busybox-1.13.3/init/init.c --- busybox-1.13.3.orig/init/init.c 2009-02-26 12:56:00.000000000 +0100 +++ busybox-1.13.3/init/init.c 2009-05-21 18:39:43.000000000 +0200 @@ -73,8 +73,10 @@ #ifndef RB_HALT_SYSTEM RB_HALT_SYSTEM = 0xcdef0123, /* FIXME: this overflows enum */ +# if !defined(__FreeBSD_kernel__) RB_ENABLE_CAD = 0x89abcdef, RB_DISABLE_CAD = 0, +# endif RB_POWER_OFF = 0x4321fedc, RB_AUTOBOOT = 0x01234567, #endif @@ -244,8 +277,10 @@ tty.c_cc[VSTOP] = 19; /* C-s */ tty.c_cc[VSUSP] = 26; /* C-z */ +#if defined(__linux__) /* use line discipline 0 */ tty.c_line = 0; +#endif /* Make it be sane */ tty.c_cflag &= CBAUD | CBAUDEX | CSIZE | CSTOPB | PARENB | PARODD; @@ -546,8 +581,10 @@ message(L_CONSOLE | L_LOG, "The system is going down NOW!"); +#if !defined(__FreeBSD_kernel__) /* Allow Ctrl-Alt-Del to reboot system. */ init_reboot(RB_ENABLE_CAD); +#endif /* Send signals to every process _except_ pid 1 */ message(L_CONSOLE | L_LOG, "Sending SIG%s to all processes", "TERM"); @@ -817,9 +859,11 @@ + (1 << SIGTSTP) , stop_handler); +#if !defined(__FreeBSD_kernel__) /* Turn off rebooting via CTL-ALT-DEL -- we get a * SIGINT on CAD so we can shut things down gracefully... */ init_reboot(RB_DISABLE_CAD); +#endif } /* Figure out where the default console should be */