in console_init (init/init.c), the ioctl TIOCGSERIAL might always fails on some platform. This is because init.c has its own definition of struct serial_struct, and some architecture (sh to give one) defines TIOCGSERIAL this way : #define TIOCGSERIAL _IOR('T', 30, struct serial_struct) So TIOCGSERIAL depends of sizeof(struct serial_struct), which is different in the kernel and init.c. One solution would be to include the header #include <linux/serial.h> in init.c, but i understand that this would create a build dependency of busybox to the kernel headers. Another one would be to use another serial port specific ioctl. Maybe TIOCSERGWILD or TIOCSERCONFIG would do the trick ? And one would be to change the kernel headers, but that's seems quite extreme :-) And one little remark, it is not possible to give a console= environment variable from the kernel cmdline to busybox, as it is already a standard option for the kernel. So it is only possible to use it from an initramfs. Would it be possible to change the console= option in console_init() by a init_console= ?...
Created attachment 161 [details] Test for Linux console in a more generic and sensible way Please try attached patch.
Applied as rev 25747, please confirm it works for you.
This patch works fine in my environment. Thank you !