WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Request to include a tiny BusyBox hack in Core  (Read 2611 times)

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Request to include a tiny BusyBox hack in Core
« on: February 10, 2012, 07:57:03 PM »
As I'm quite lazy I wonder whether it would be possible to include a ca. 65 byte long (or rather short) command sequence as an additional script (e.g. '/sbin/ctty-hack') in Core:
    #!/bin/sh
    exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'

The purpose is to work around the Busybox shell limitation described in their FAQ (i.e. when one starts Core with boot code 'rdinit=/bin/sh' one ends up with a situation where the TTY is '/dev/console', that means that one can't use the likes of 'Ctrl-C' or 'Ctrl-Z' or that 'less' won't work).

An alternative would be to include one more applet (i.e. 'cttyhack') in the BusyBox build (e.g. via 'CONFIG_CTTYHACK=y'), but even though the source is really small, it might still be more than a 65 bytes increase (plus it would require to wait for the next BusyBox re-built).

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Request to include a tiny BusyBox hack in Core
« Reply #1 on: February 10, 2012, 10:10:00 PM »
Done. Added /sbin/ctty-hack
10+ Years Contributing to Linux Open Source Projects.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Request to include a tiny BusyBox hack in Core
« Reply #2 on: February 11, 2012, 04:36:00 PM »
Thank you, Robert. I really appreciate that you are willing to support even such a rather "fringe use case".