Commit c924fe39 authored by jan.koester's avatar jan.koester
Browse files

test

parent 34de60e7
Loading
Loading
Loading
Loading
+10 −6
Changes for src/tty.cpp: 10 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -22,15 +22,19 @@ namespace syslite {
        entry.device = device;

        if (command.empty()) {
            // Default: toybox getty on the device
            // Extract ttyN from /dev/ttyN
            // Default: fresh's own "getty" applet. toybox is no longer
            // built by fenriros at all (build-os.sh migrated every applet
            // it used -- insmod/rmmod/lsmod/depmod/modprobe, and now getty
            // too -- onto fresh's own multi-call binary), so "/bin/toybox"
            // never exists on the built image and this exec always failed
            // with ENOENT, meaning no console could ever start. fresh's
            // getty takes "getty TTY [BAUD] [TERM]" (bare name or full
            // /dev/ path; BAUD/TERM accepted but unused), so the bare tty
            // name below works directly.
            std::string ttyName = device;
            if (ttyName.substr(0, 5) == "/dev/")
                ttyName = ttyName.substr(5);
            // Invoke the toybox getty applet directly — no /sbin/getty
            // symlink is guaranteed to exist. toybox getty expects:
            // toybox getty [OPTIONS] BAUD TTY
            entry.command = "/bin/toybox getty 0 " + ttyName;
            entry.command = "/bin/getty " + ttyName;
        } else {
            entry.command = command;
        }