Skip to content

Commit 9fde591

Browse files
Kabuki94claude
andcommitted
fix(/): remove chmod blockers + broken less invoke from at-/ entries
MiOS = mios.git overlaid at /. The operator-facing entries are at the root: ./install.sh, ./mios-pipeline.sh, just build, etc. Two bugs were blocking those entries from running cleanly inside MiOS-DEV after the quadlet-overlay seed populates /: 1. `just build` -> preflight recipe -> "chmod +x tools/preflight.sh" -> "Operation not permitted" when the operator (mios) isn't the file owner. Files at / are checked out by quadlet-overlay-seed running as root in the systemd-nspawn, so they're root-owned. Mios runs `just build`, hits chmod EPERM on a root-owned file, recipe aborts. The chmod was redundant anyway: tools/preflight.sh, tools/flight-control.sh, and tools/mios-overlay.sh are ALL stored in git's index as mode 100755 (executable). After `git reset --hard FETCH_HEAD` they're already +x; chmod is a no-op... that fails for non-owners. Removed all 5 chmod lines. Verified with `git ls-files -s tools/preflight.sh tools/flight-control.sh tools/mios-overlay.sh`: 100755 6c5b115... tools/preflight.sh 100755 9e8c28b... tools/flight-control.sh 100755 4735f72... tools/mios-overlay.sh 2. `./install.sh` -> agreements banner -> less -> "Missing filename ("less --help" for help)" abort. The renderer in automation/lib/agreements-banner.sh was: mios_agreement_summary | less -RFXK <"$tty_in" >"$tty_out" The `<"$tty_in"` REPLACES the pipe's stdin with /dev/tty (a TTY, not piped data). less sees no filename arg AND no piped input, aborts. The intent was "read content from pipe, keyboard from /dev/tty" -- less does that automatically when stdin is a pipe. No `<` redirect needed. After this commit: * `just preflight` works as mios (no sudo, no chmod EPERM) * `just build` proceeds past preflight * `./install.sh` renders the agreement banner cleanly, then hits its own EUID guard ("must run as root: sudo $0") which is correct behavior for a phase-3 system installer * `./mios-pipeline.sh` (the canonical operator entry per install.sh's v0.2.4+ NOTICE) gets the same fix free Both fixes are at /-level operator entries. The deeper question (should mios.git tracked files be mios-owned at /?) is a separate design discussion and not touched here -- this commit is just to unblock the entries that were already designed to work as mios. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 9878b41 commit 9fde591

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

Justfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,22 @@ BIB := env_var_or_default("MIOS_BIB_IMAGE", MIOS_IMG_BIB)
3434

3535
# Run preflight system check
3636
preflight:
37-
@chmod +x tools/preflight.sh
3837
@./tools/preflight.sh
3938

4039
# Show current flight status and variable mappings
4140
flight-status:
42-
@chmod +x tools/flight-control.sh
4341
@./tools/flight-control.sh
4442

4543
# Unified initialization (Mode 2: User-space)
4644
init:
47-
@chmod +x tools/mios-overlay.sh
4845
sudo ./tools/mios-overlay.sh
4946

5047
# System-wide deployment (Mode 1: FHS system install)
5148
deploy:
52-
@chmod +x tools/mios-overlay.sh
5349
sudo ./tools/mios-overlay.sh
5450

5551
# Live ISO Initiation (Mode 0: Overlay onto root)
5652
live-init:
57-
@chmod +x tools/mios-overlay.sh
5853
sudo ./tools/mios-overlay.sh
5954

6055
# bootc container lint -- runs against the locally built image.

automation/lib/agreements-banner.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,16 @@ _mios_agreement_render() {
175175
# -F quit immediately if content fits on one screen
176176
# -X do not clear the screen on exit
177177
# -K abort on Ctrl-C without leaving terminal in alt screen
178-
mios_agreement_summary | less -RFXK <"$tty_in" >"$tty_out"
178+
#
179+
# No `<"$tty_in"` redirect: the previous `cmd | less <"$tty_in"`
180+
# form was wrong -- the `<` redirect REPLACES the pipe stdin,
181+
# so less saw `</dev/tty` (a TTY, not piped data) AND no
182+
# filename arg, then aborted with:
183+
# Missing filename ("less --help" for help)
184+
# which is what the operator hit running ./install.sh from /
185+
# inside MiOS-DEV. less reads keyboard input from /dev/tty
186+
# automatically when stdin is a pipe; no override needed.
187+
mios_agreement_summary | less -RFXK >"$tty_out"
179188
else
180189
mios_agreement_summary >"$tty_out"
181190
fi

0 commit comments

Comments
 (0)