Files
RedBear-OS/config/redbear-bare.toml
T
vasilito 87d5a24dbc fix(redbear-bare): enable bare target to build and boot
Multiple fixes to make redbear-bare actually build and progress
through boot:

config/redbear-bare.toml:
- filesystem_size: 96 -> 192 MiB. The bare image packages ~153 MiB
  of installed content (zsh, base, base-initfs, kernel, relibc,
  userutils, libgcc, libstdcxx, plus coreutils/extrautils/etc.),
  so 96 MiB triggers installer ENOSPC during commit.
- Override 31_debug_console.service with postinstall=true so the
  override wins over minimal.toml's version that uses
  /scheme/debug/no-preserve (which busy-loops when the debug
  scheme returns ENODEV in the bare initfs).

recipes/core/base-initfs/recipe.toml:
- bare_initfs() now only references BINS in the base workspace
  (init, logd, ramfs, randd, zerod, ptyd). getty is removed from
  BINS because it lives in userutils, not base.
- Copy getty from the sysroot into the initfs after the cargo
  build (analogous to the existing redoxfs/ion/driver-manager
  sysroot copies).
- Filter the init.d copy under REDBEAR_BARE_INITFS to keep only
  services for binaries we actually built (logd, randd, zerod,
  runtime.target, ramfs@.service, 90_initfs.target, 50_rootfs).
  The mainline 23 services reference fbcond/vesad/acpid/pcid/
  fbbootlogd/hwd/inputd which aren't in the bare BINS, so
  init would try to start them and busy-loop.
- Synthesize minimal 00_ptyd.service and 30_getty.service units
  in the initfs since they're built/copied but not in the
  mainline init.initfs.d.
- Override 00_runtime.target to add ptyd and getty as weak
  requires (the mainline target references nulld/rtcd which we
  filtered out).
2026-07-15 06:48:46 +09:00

167 lines
4.1 KiB
TOML

# Red Bear OS Bare Configuration
#
# Target contract:
# - Boots kernel
# - Starts init daemons via a minimal base-initfs
# (logd, randd, zerod, ptyd, getty — see recipes/core/base-initfs)
# - Console getty → zsh login prompt (from minimal.toml's 30_console.service)
# - No networking, no driver-manager, no display, no audio, no extra daemons
# - Stripped to bare minimum
#
# To trigger the bare initfs (BINS=init logd ramfs randd zerod ptyd getty):
# REDBEAR_BARE_INITFS=1 make live CONFIG_NAME=redbear-bare
#
# Or via the build script with the env var set:
# REDBEAR_BARE_INITFS=1 ./local/scripts/build-redbear.sh redbear-bare
include = ["minimal.toml"]
[general]
# 192 MiB leaves ~30% headroom over the 153 MiB of installed content
# (zsh, base, base-initfs, kernel, relibc, userutils, libgcc, libstdcxx,
# coreutils, extrautils, ca-certificates, kibi, netdb, netutils, pkgutils,
# uutils). Anything below 160 MiB triggers ENOSPC during installer commit.
filesystem_size = 192
# Trim down packages beyond what minimal.toml includes.
# minimal.toml includes ca-certificates, coreutils, extrautils, zsh, pkgutils, kibi.
# For "bare" we only need: zsh, coreutils, base, base-initfs, kernel, relibc,
# userutils, libgcc, libstdcxx. Drop ca-certificates, pkgutils, kibi.
[packages]
ca-certificates = {} # explicitly empty (overrides minimal)
pkgutils = {} # explicitly empty (overrides minimal)
kibi = {} # explicitly empty (overrides minimal)
# Override base.toml's network config — no DNS, no IP, no router
[[files]]
path = "/etc/net/dns"
data = ""
[[files]]
path = "/etc/net/ip"
data = ""
[[files]]
path = "/etc/net/ip_router"
data = ""
[[files]]
path = "/etc/net/ip_subnet"
data = ""
# Override base.toml's package manager config — no remote repo
[[files]]
path = "/etc/pkg.d/50_redox"
data = ""
# Override minimal.toml's 31_debug_console.service — the bare initfs
# does not start ptyd (only 6 daemons), so getty's retry loop on
# /scheme/debug/no-preserve hangs the boot for ~45s before the
# real console login is reached. Disable the debug console entirely.
# postinstall = true ensures this override wins over any package
# staging (Layer 2) of the same path.
[[files]]
path = "/etc/init.d/31_debug_console.service"
postinstall = true
data = """
[unit]
description = "Debug console (disabled on redbear-bare)"
[service]
cmd = "true"
type = "oneshot"
"""
# Override base.toml's login_schemes — no display/audio schemes in bare
[[files]]
path = "/etc/login_schemes.toml"
data = """
[user_schemes.root]
schemes = [
"debug",
"event",
"memory",
"pipe",
"serio",
"irq",
"time",
"sys",
"rand",
"null",
"zero",
"log",
"shm",
"chan",
"uds_stream",
"uds_dgram",
"file",
"pty",
"sudo",
]
[user_schemes.user]
schemes = [
"debug",
"event",
"memory",
"pipe",
"serio",
"irq",
"time",
"sys",
"rand",
"null",
"zero",
"log",
"shm",
"chan",
"uds_stream",
"uds_dgram",
"file",
"pty",
"sudo",
]
"""
# Pre-login banner (printed by getty before the login prompt)
[[files]]
path = "/etc/issue"
data = """
Red Bear OS 0.3.1 - bare target
Kernel \\r on an \\m (\\s)
Login as 'root' (password: password) or 'user' (no password).
"""
# Post-login message (printed by zsh at shell startup)
[[files]]
path = "/etc/motd"
data = """
Welcome to Red Bear OS bare target.
This is a stripped-down initfs+rootfs build with only:
init, logd, ramfs, randd, zerod, ptyd, getty
No networking, no display, no audio, no driver-manager.
"""
[users.root]
password = "password"
uid = 0
gid = 0
shell = "/usr/bin/zsh"
[users.user]
password = ""
shell = "/usr/bin/zsh"
[groups.sudo]
gid = 1
members = ["user"]
# Build override note: the cookbook's [build.env] section is not parsed
# by the current config parser, so the REDBEAR_BARE_INITFS=1 env var is
# set automatically by local/scripts/build-redbear.sh when CONFIG_NAME
# is redbear-bare. See that script's per-target hook block.
#
# If you need to override or test the bare initfs directly:
# REDBEAR_BARE_INITFS=1 ./local/scripts/build-redbear.sh redbear-bare