Files
RedBear-OS/mk/redbear.mk
T
vasilito d26675708e Phase 4: RAM-disk boot, recipe catalog, collision validation
L1: Add make qemu-ram target — copies disk image to host tmpfs before
    QEMU boots, eliminating host disk I/O during OS runtime.
    Usage: make qemu-ram CONFIG_NAME=redbear-full QEMU_MEM=12288

L2: Create local/recipes/AGENTS.md — comprehensive catalog of all 165
    custom recipes across 15 categories with descriptions.

L3: CollisionTracker already fully implemented and wired into installer
    (recipes/core/installer/source/src/collision.rs, 267 lines).

L4: Add scripts/validate-collision-log.sh to make validate target —
    scans build logs for [COLLISION-ERROR]/[COLLISION-WARN] markers
    from the runtime CollisionTracker.
2026-05-28 18:16:48 +03:00

59 lines
2.0 KiB
Makefile

# Red Bear OS integration — runs before repo cook and disk image creation
# Ensures all custom recipe symlinks, patches, assets, and firmware are staged.
REDBEAR_TAG=$(BUILD)/redbear.tag
$(REDBEAR_TAG): FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
bash -c 'export REDBEAR_TAG="$$1"; exec bash local/scripts/integrate-redbear.sh' _ '$(REDBEAR_TAG)'
endif
redbear: $(REDBEAR_TAG)
redbear_clean:
rm -f "$(REDBEAR_TAG)"
# Source archival — exports fully-patched, versioned source archives
# for all recipes with source/ directories to sources/<target>/
# Runs after `make all` and also standalone via `make sources`
SOURCES_DIR=$(BUILD)/../sources/$(TARGET)
SOURCES_TAG=$(SOURCES_DIR)/.sources-tag
# Standalone: archive what's cached (no rebuild needed)
sources:
@echo "Archiving fully-patched source packages..."
bash local/scripts/archive-sources.sh --all
@mkdir -p "$(SOURCES_DIR)"
@touch "$(SOURCES_TAG)"
@echo "Sources archived: $$(wc -l < $(SOURCES_DIR)/packages.txt 2>/dev/null || echo 0) packages"
# Hook: run after full build
$(BUILD)/harddrive.img: sources
# ── RAM-disk QEMU boot ──────────────────────────────────────────────────
# Copies harddrive.img (or live ISO) into tmpfs before booting QEMU.
# Eliminates all disk I/O during OS runtime. Requires sufficient RAM:
# QEMU_MEM (default 2048 MiB) + image size + 512 MiB overhead.
#
# Usage:
# make qemu-ram # Boot from RAM (default config)
# make qemu-ram CONFIG_NAME=redbear-full QEMU_MEM=12288
# make qemu-ram live=yes # RAM-disk live ISO boot
#
# The tmpfs is mounted at /tmp/redbear-ram-<uid>/ and auto-cleaned on exit.
RAMDIR=/tmp/redbear-ram-$$(id -u)
.PHONY: qemu-ram qemu-ram-clean
qemu-ram: qemu-deps
@bash local/scripts/qemu-ram.sh "$(QEMU)" "$(DISK)" "$(QEMUFLAGS)" "$(RAMDIR)"
qemu-ram-clean:
@mountpoint -q $(RAMDIR) && umount $(RAMDIR) || true
@rmdir $(RAMDIR) 2>/dev/null || true
FORCE: