"/dev/tty: No such device or address" on custom tiny Linux w/ BusyBox - WTF?
I've been working on a tiny Linux distro running just a minimal Linux kernel, BusyBox, and a custom init for a pseudo-embedded project for use exclusively under QEMU/KVM with serial console on stdio or a socket.
The init isn't that hard of a worker; it just mounts the necessary filesystems and runs /bin/sh as root. Come on now, it's a single-user system for a sandbox! This project is something I've been working on off and on with little success, mostly because of an error I could not figure out kept getting in my way: Code:
/bin/sh: can't access tty; job control turned off Code:
# edited for formatting, /bin/sh printed inside of the strace Code:
cat: can't open '/dev/tty': No such device or address Code:
# ls -l /dev/tty Also, I couldn't get virtio console to work for an additional half hour. Whatever, it probably won't change anything. No change. WTF? :banghead: I was already typing a question here when I noticed the "Click Here to Find Similar Threads" button. Alright, fine. After reading and re-reading 3 of the relevant matches, some inittab and agetty stuff clicked in my head. /dev/tty is getty's job! (I guess.) I went back to the drawing board, and decided to test getty before I posted. After fumbling over the way BusyBox wants the command line arguments in my fluster, I eloquently typed: Code:
# getty -n -l /bin/sh 9600 ttyS0 Code:
# Thanks for being my rubber duck with advice, LQ.org! ...time to rewrite my init. P.S., special thanks to greenleaf! :jawa: |
All times are GMT -5. The time now is 03:20 PM. |