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 — Deleting the build folder can remove the marker first (btrfs), so an interrupted cleanup blocks the next run · Issue #69 · tmiland/kernel-installer

Deleting the build folder can remove the marker first (btrfs), so an interrupted cleanup blocks the next run #69

New issue
Copy link
New issue
Copy link
Closed
#73
Closed
Deleting the build folder can remove the marker first (btrfs), so an interrupted cleanup blocks the next run#69
#73
Copy link

Description

@davmonk
davmonk
opened on Nov 10, 2026
Issue body actions

Problem

The build folder is removed in one pass: rm -rf at the start of an install (kernel_installer.sh:1403), in fatal() (:192) and after a failed run (:1712), and find -delete in the end-of-run cleanup (:1605). Nothing makes sure the .kernel_installer marker is deleted last. The order is the order the filesystem lists entries in:

  • btrfs lists them in creation order, and the script creates the marker first (:1404), so the marker is deleted first.
  • ext4 (hash order) and tmpfs put the marker last in my tests.

If the delete is interrupted (Ctrl-C, a closed terminal, a crash), a btrfs folder is left with most of the build tree and no marker. The next run then stops with "Install directory ... is not empty and does not look like it was created by this script" (:1398), and the user has to clean it up by hand.

Suggested fix

Delete everything except the marker, then the marker:

find "$INSTALL_DIR" -mindepth 1 ! -path "$INSTALL_DIR/$INSTALL_DIR_MARKER" -delete
rm -f "$INSTALL_DIR/$INSTALL_DIR_MARKER"
rmdir "$INSTALL_DIR"

Use the same for the three rm -rf "$INSTALL_DIR" calls (a small helper would cover all four).

How this was checked

Ubuntu 26.04 (monk-sigma), home folder on btrfs, GNU findutils and GNU rm. I built a folder in the same order as install_kernel: folder, marker, tarball, a source tree of 300,000 files, then packages.

  • ls -f -A listed .kernel_installer first; find -depth visited it at position 1 of 300,006.
  • find <dir> -mindepth 1 -delete, stopped with SIGTERM after 0.3 s: marker gone, 279,633 entries left. is_safe_install_dir (copied unchanged from the script) then returned "not safe".
  • rm -rf <dir> on a fresh tree, stopped the same way: marker gone, 278,606 entries left.
  • Control: on ext4 (Linux Mint 22.3) and tmpfs the marker was the last entry visited, so an interrupt there leaves the marker in place.
  • Not tested: an interrupt during a real installer run (the test used the same commands on a same-shaped folder).

Activity

  1. tmiland
    added a commit that references this issue on Nov 10, 2026

    fix: validate kernel versions and harden the build directory (#63, #62,

    3810bd7
  2. tmiland
    closed this as completedin #73on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.