Changelog

  • note this will be probably automated in the future

LnOS Autostart Fixes - Final Changes

Overview

This document summarizes the final changes made to fix the autostart functionality across all LnOS platforms (x86_64 ISO, Full ARM, and Minimal ARM). The solution uses a custom shell script approach that runs the LnOS installer automatically when root logs in.

Problem Summary

  • x86_64 ISO: Autostart was not working - scripts were running but output was hidden in log files
  • ARM Images: Using different autostart methods (instructions-only bashrc, systemd services)
  • Root Cause: Complex systemd services and shell profile issues prevented direct terminal output

Solution: Custom Shell Script Approach

How It Works

  1. Boot systemAuto-login as rootCustom shell script runsLnOS installer startsDrop to bash shell
  2. No complex systemd services
  3. No shell profile dependencies
  4. Direct terminal output
  5. Simple and reliable

Files Modified

1. x86_64 ISO Files

archiso/airootfs/usr/local/bin/lnos-shell.sh (NEW)

#!/bin/bash
# LnOS Shell - runs installer then drops to bash

echo "=========================================="
echo "      Welcome to LnOS Live Environment"
echo "=========================================="
echo ""

# Wait a moment for system to settle
sleep 2

# Check if installer exists and run it
if [[ -f /root/LnOS/scripts/LnOS-installer.sh ]]; then
    cd /root/LnOS/scripts
    chmod +x ./LnOS-installer.sh
    echo "Starting LnOS installer..."
    ./LnOS-installer.sh --target=x86_64
else
    echo "ERROR: LnOS installer not found!"
    echo "Available files in /root/LnOS/scripts/:"
    ls -la /root/LnOS/scripts/ 2>/dev/null || echo "Directory not found"
fi

echo ""
echo "LnOS installer completed. Dropping to shell..."
echo ""

# Drop to bash shell
exec /bin/bash

archiso/airootfs/root/.bashrc (SIMPLIFIED)

#!/bin/bash
# Simple LnOS Autostart - run once on tty1
if [[ $(tty) == "/dev/tty1" ]] && [[ ! -f /tmp/lnos-autostart-run ]]; then
    # Mark that we've run
    touch /tmp/lnos-autostart-run

    # Wait a moment for system to settle
    sleep 2

    # Run the autostart script directly
    if [[ -f /usr/local/bin/lnos-autostart.sh ]]; then
        /usr/local/bin/lnos-autostart.sh
    fi
fi

archiso/airootfs/root/.profile (NEW)

#!/bin/bash
# Simple LnOS autostart - run once when root logs in
if [[ ! -f /tmp/lnos-autostart-run ]]; then
    touch /tmp/lnos-autostart-run

    # Wait a moment for system to settle
    sleep 2

    # Run the installer directly
    if [[ -f /root/LnOS/scripts/LnOS-installer.sh ]]; then
        cd /root/LnOS/scripts
        chmod +x ./LnOS-installer.sh
        ./LnOS-installer.sh --target=x86_64
    fi
fi

archiso/airootfs/root/customize_airootfs.sh (UPDATED)

  • Added: Custom shell script creation
  • Added: chsh -s /usr/local/bin/lnos-shell.sh root to set custom shell
  • Disabled: Systemd services that don't work with terminal output
  • Simplified: Autologin configuration

archiso/profiledef.sh (UPDATED)

  • Added: File permissions for new shell script and profile files
  • Added: ["/root/.profile"]="0:0:644"
  • Added: ["/usr/local/bin/lnos-shell.sh"]="0:0:755"

archiso/airootfs/etc/systemd/system/lnos-autostart.service (UPDATED)

  • Changed: Output from journal to tty for terminal display
  • Added: TTY configuration for direct terminal output

2. ARM Build Files

build-arm-image.sh (UPDATED)

  • Replaced: Instruction-only bashrc with custom shell script
  • Added: lnos-shell.sh creation for ARM
  • Added: chsh -s /usr/local/bin/lnos-shell.sh root
  • Simplified: bashrc to just source system bashrc

build-arm-minimal.sh (UPDATED)

  • Replaced: Basic autostart script with custom shell script
  • Removed: Old systemd service approach
  • Added: lnos-shell.sh creation for minimal ARM
  • Added: chsh -s /usr/local/bin/lnos-shell.sh root

Key Changes Summary

Removed Complexity

  • Systemd services for autostart (don't work well with terminal output)
  • Complex bashrc logic with extensive logging
  • Output redirection to log files
  • Multiple autostart methods causing conflicts

Added Simplicity

  • Custom shell script as root's default shell
  • Direct terminal output - no hidden logs
  • Consistent approach across all platforms
  • Simple execution flow - boot → login → installer → shell

Platform Consistency

  • x86_64 ISO: Custom shell script autostart
  • Full ARM Image: Custom shell script autostart
  • Minimal ARM Image: Custom shell script autostart

Testing Results

x86_64 ISO

  • Autostart works - installer runs automatically
  • Terminal output visible - no hidden logs
  • Simple flow - boot → login → installer → shell

ARM Images (Expected)

  • Same behavior as x86_64 ISO
  • Automatic installer startup
  • Direct terminal output
  • Consistent user experience

Commit History

  1. 720e278 - fix: add /root/.bashrc to file permissions so it's included in ISO
  2. dfaf721 - fix: add multiple autostart methods - system bashrc, boot service, and enhanced logging
  3. 5b7a985 - fix: remove TTY restriction from autostart script to allow it to run on any TTY
  4. 5c83ab4 - fix: change systemd service to output to terminal instead of journal
  5. 2f9b08f - fix: use bashrc method for autostart with direct terminal output, disable systemd services
  6. 0ca85ba - simplify: remove complex logic and logging, use direct terminal output
  7. 3c08562 - simple: add .profile for direct autostart when root logs in
  8. b9f77b5 - fix: use custom shell script as root's default shell for direct autostart
  9. 09bcc75 - fix: update ARM builds to use same shell-based autostart as x86_64

Final Solution Benefits

  1. Reliability: No complex dependencies or shell profile issues
  2. Visibility: Direct terminal output - no hidden logs
  3. Consistency: Same approach across all platforms
  4. Simplicity: Easy to understand and maintain
  5. User Experience: Automatic installer startup on all platforms

Usage

Building x86_64 ISO

./build-iso.sh

Building ARM Images

# Full ARM image
sudo ./build-arm-image.sh rpi4

# Minimal ARM image
sudo ./build-arm-minimal.sh rpi4

Expected Behavior

  1. Boot the ISO/image
  2. Automatic login as root
  3. LnOS installer starts automatically
  4. After installer completes, drops to bash shell

The autostart functionality is now consistent, reliable, and provides direct terminal output across all LnOS platforms.

results matching ""

    No results matching ""