Skip to content

Early Boot /usr Separation: Transition RC Scripts to rootfs-only (/) Binaries #10

@sighook

Description

@sighook

Description:
Currently, several rc scripts in the package rely on binaries located in /usr (/usr/bin/logger, /usr/sbin/syslogd, /usr/bin/find, etc.) and resources like fonts and keymaps under /usr. On systems with a separate /usr filesystem, these scripts fail in early boot, leading to:

  • Lost boot logs when logger or syslogd is invoked too early.
  • Failed /tmp and /var/lock cleanup using /usr/bin/find.
  • Keyboard, console, and font setup (loadkeys, setterm, setfont) may fail if font/keymap files are only in /usr.

Current Workarounds:

  • BOOTLOG=YES captures early boot logs via bootlogd.
  • Some scripts wrap /usr binaries with existence checks, but usage is inconsistent.
  • Users may need to manually ensure /usr is available early.

Proposed Transition / Solution:

  1. Rootfs-only binaries in early boot:

    • Move essential binaries to /bin or /sbin (or ensure copies exist).

      • Examples: logger, syslogd, find, loadkeys, setterm, setfont.
  2. Minimal resources on rootfs:

    • Include a minimal set of fonts and keymaps under /lib or /etc for early console setup.
  3. Early-boot safe scripts:

    • Replace /usr/bin/find calls with rootfs-safe shell loops.
    • Replace /usr/bin/logger calls with a wrapper that falls back to stdout.
  4. Conditional execution / fallbacks:

    • If binaries or resources are missing, skip gracefully instead of failing early boot.
  5. Documentation:

    • Document changed fonts/keymaps location in rc.conf manual page.
    • Document that /usr may not be available in early boot.
    • Recommend bootlogd for capturing early messages.

Goal:

  • Ensure that all early-boot steps (cleanup, console setup, minimal logging) work reliably before /usr is mounted, while transitioning multiuser services to run after /usr becomes available.
  • Keep scripts minimal, readable, and KISS-friendly.

Notes / References:

  • Historical approaches in Slackware, CRUX, Debian pre-systemd, and Red Hat pre-systemd.
  • Rootfs-only early boot ensures robust system startup even with a separate /usr.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    Projects

    Status

    Tools

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions