GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix #46, #48, #51, #52: root-check order, relative --dir, verification TMPDIR, lint by tmiland-labs · Pull Request #58 · tmiland/kernel-installer

Conversation

@tmiland-labs

@tmiland-labs tmiland-labs commented Oct 17, 2026

Copy link
Copy Markdown

Fixes four of the reviewed issues. Each commit is self-contained with its own test coverage; nothing else is touched.

Issue Fix
#46 chk_permissions runs right after argument parsing, before the lsb-release prompt and distro detection. A regular user previously reached the prompt (and its package installation) before being told the script needs root. The failure now names the script even on piped runs and prints the rerun command; the README shows download-then-run as the main form. An unprivileged CI case runs first to prove the new order.
#48 The verification temp dir is scoped with local TMPDIR, so an exported TMPDIR is no longer clobbered and deleted before the build; report_build_failure now recognizes mktemp: failed to create file. The install CI job exports TMPDIR to cover it.
#51 A relative --dir is resolved with realpath -m at argument parsing, before install_kernel cds into it, so the build tree ends up under the invocation directory. The Ubuntu 24.04 CI job builds with --dir ki-build and asserts the tree lands under the invocation directory.
#52 Drop the unused success() helper (log_success is called directly). Measured with shellcheck 0.11.0: exactly this one SC2329 finding on main, none after. The other SC2329 from the issue (get_verified_tarball) already carries its disable comment.

Verification

  • shellcheck 0.11.0: clean on kernel_installer.sh, src/slib.sh, scripts/update-slib.sh (0.10.0 also clean).
  • Full local suite: 12/12 tests pass, including the new root-check order, relative --dir, TMPDIR, and build-failure report cases.
  • The commit that touches tests/test_build_failure_report.sh was verified green on its own tree.

Fixes #46
Fixes #48
Fixes #51
Fixes #52

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
tmiland-lab Bot added 3 commits October 18, 2026 01:46
@tmiland-lab
fix(lint): drop the unused success() helper
850523c
shellcheck 0.11.0 (the release a newer runner image brings) reports
SC2329 for success(): it is never invoked, so the Lint job goes red
once the runner moves, without a commit here. Today's image still
passes (0.10.0 measured locally). The other SC2329 from the issue
(get_verified_tarball) already carries its disable comment.

Measured with shellcheck 0.11.0: exactly this one finding on main,
none on this branch (kernel_installer.sh, src/slib.sh,
scripts/update-slib.sh all clean).

Fixes tmiland#52
@tmiland-lab
fix(root): check for root before the lsb-release prompt and distro de…
822bea6
…tection

A regular user could reach the lsb-release prompt (and its package
installation) before the root check at the end of the run. Run
chk_permissions right after argument parsing: distro detection, the
prompt and dependency setup all assume root.

The failure now names the script even on piped runs (where $self is
empty) and prints the exact command to rerun for file runs, e.g.
"Run it again as root: sudo bash kernel_installer.sh --stable". It
also fills in SCRIPT_ARGS, which the existing diagnostics log line
already referenced.

README: download-then-run as root is now the main instruction, piped
quick installs keep sudo, and the su-root note moved next to them.
tests/test_root_check_first.sh pins the old failure mode (the prompt
must be unreachable without root); tests/test_piped_prompts.sh runs
through passwordless sudo and skips when sudo is unavailable.

Fixes tmiland#46
@tmiland-lab
fix(verify): keep the verification TMPDIR out of the environment
9c4a9f4
get_verified_tarball reused the global TMPDIR for its temporary
directory and removed it on exit, so an exported TMPDIR was clobbered
and its directory removed before the build steps ran. Scope it with
local and quote the rm -rf.

report_build_failure also recognizes "mktemp: failed to create file"
in the build output, so a vanished TMPDIR is reported as the first
error instead of "no error message was found"; covered by a new case
in tests/test_build_failure_report.sh.

The install CI job exports TMPDIR to catch regressions.

Fixes tmiland#48
@tmiland-labs
tmiland-labs force-pushed the fix/46-48-51-52 branch from b9049bd to 30fd836 Compare October 17, 2026 23:52
@tmiland-lab
fix(dir): resolve a relative --dir at argument parsing
e0da8ef
install_kernel cd's into INSTALL_DIR and still uses the full path, so
a relative --dir was resolved a second time after the cd and the
build tree ended up outside the requested directory. realpath -m at
parsing makes it absolute while $PWD is still the invocation
directory; absolute paths are unchanged.

The Ubuntu 24.04 CI job builds with a relative --dir and asserts the
tree under the invocation directory.

Fixes tmiland#51
@tmiland-labs
tmiland-labs force-pushed the fix/46-48-51-52 branch from 30fd836 to e0da8ef Compare October 18, 2026 00:07
@tmiland
tmiland merged commit 8f0b8b1 into tmiland:main Oct 18, 2026
13 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Lint will fail once ubuntu-latest moves to Ubuntu 26.04 (newer shellcheck flags two functions) --dir with a relative path never works An exported TMPDIR breaks the build after a verified download (the verify step reuses and deletes it) Install instructions don't say to run as root, and || exit 0 closes the user's terminal when the script fails

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@tmiland-labs @tmiland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.