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

Auto-start install.lua on tty1 in live ISO mode

parent fa39259e
Loading
Loading
Loading
Loading
+7 −0
Changes for src/syslite.cpp: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -30,10 +30,17 @@ namespace syslite {
    bool Init::loadConfig(const std::string &) {
        // Configuration is compile-time (config.h). Hostname from /etc/hostname.
        // Register TTYs based on compiled-in count.
        // On a live ISO (squashfs boot), run the installer on tty1.
        bool liveMode = std::filesystem::exists("/usr/local/sbin/install.lua")
                     && !std::filesystem::exists("/etc/fstab");
        for (int i = 1; i <= _numTtys; ++i) {
            std::string dev = "/dev/tty" + std::to_string(i);
            if (i == 1 && liveMode) {
                _ttys.addTty(dev, "/usr/local/bin/lua /usr/local/sbin/install.lua");
            } else {
                _ttys.addTty(dev);
            }
        }
        return true;
    }