Skip to content

Commit 4d8f73e

Browse files
author
Gemini CLI
committed
v0.2.0 - Internal version sync for automation scripts
1 parent 63d8358 commit 4d8f73e

2 files changed

Lines changed: 80 additions & 0 deletions

File tree

automation/37-flatpak-env.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# MiOS v0.2.0 37-flatpak-env: Capture Flatpak environment for boot-time install
3+
set -euo pipefail
4+
5+
echo "?"
6+
echo " MiOS v0.2.0 Flatpak Environment"
7+
echo "?"
8+
9+
# Directory for MiOS system-level environment definitions (USR-OVER-ETC compliance)
10+
# Using /usr/lib/mios/env.d as a "venv/env" style storage
11+
mkdir -p /usr/lib/mios/env.d
12+
13+
# Capture MIOS_FLATPAKS if set (from build-arg)
14+
# This creates a system-baked environment file that mios-flatpak-install can read.
15+
ENV_FILE="/usr/lib/mios/env.d/flatpaks.env"
16+
17+
echo "# MiOS System Environment Definition" > "$ENV_FILE"
18+
echo "# Generated at build time: $(date -u)" >> "$ENV_FILE"
19+
20+
if [[ -n "${MIOS_FLATPAKS:-}" ]]; then
21+
echo "MIOS_FLATPAKS=\"${MIOS_FLATPAKS}\"" >> "$ENV_FILE"
22+
echo "[37-flatpak-env] Captured MIOS_FLATPAKS to ${ENV_FILE}"
23+
else
24+
echo "MIOS_FLATPAKS=\"\"" >> "$ENV_FILE"
25+
echo "[37-flatpak-env] MIOS_FLATPAKS not set, created empty env file."
26+
fi
27+
28+
chmod 644 "$ENV_FILE"
29+
30+
echo "[37-flatpak-env] Flatpak environment configured in /usr."

automation/90-generate-sbom.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
# MiOS v0.2.0 90-generate-sbom: Generate Software Bill of Materials (SBOM)
3+
# Uses Syft to generate CycloneDX and SPDX manifests for the final image.
4+
set -euo pipefail
5+
6+
# shellcheck source=lib/common.sh
7+
source "$(dirname "$0")/lib/common.sh"
8+
9+
echo "[90-generate-sbom] Starting SBOM generation..."
10+
11+
ARTIFACT_DIR="/usr/lib/mios/artifacts/sbom"
12+
mkdir -p "$ARTIFACT_DIR"
13+
14+
# Check if syft is available
15+
if ! command -v syft &> /dev/null; then
16+
echo "[90-generate-sbom] WARN: Syft not found. Attempting to install..."
17+
# Syft is in packages-utils, but if it's missing for some reason, try to install it.
18+
dnf install -y syft || {
19+
echo "[90-generate-sbom] ERROR: Failed to install Syft. Skipping SBOM generation."
20+
exit 0 # Non-fatal
21+
}
22+
fi
23+
24+
VERSION=$(cat /ctx/VERSION 2>/dev/null || echo "v0.2.0")
25+
TIMESTAMP=$(date -u +%Y%m%dT%H%M%SZ)
26+
27+
echo "[90-generate-sbom] Scanning root filesystem..."
28+
29+
# Generate CycloneDX (JSON) - Primary for AI and automation
30+
syft scan dir:/ \
31+
--output cyclonedx-json \
32+
--file "${ARTIFACT_DIR}/mios-sbom-${VERSION}-${TIMESTAMP}.cyclonedx.json" \
33+
--exclude "/ctx" \
34+
--exclude "/var/cache"
35+
36+
# Generate SPDX (Tag-Value) - Standard compliance
37+
syft scan dir:/ \
38+
--output spdx-tag-value \
39+
--file "${ARTIFACT_DIR}/mios-sbom-${VERSION}-${TIMESTAMP}.spdx.txt" \
40+
--exclude "/ctx" \
41+
--exclude "/var/cache"
42+
43+
# Create latest symlinks
44+
ln -sf "mios-sbom-${VERSION}-${TIMESTAMP}.cyclonedx.json" "${ARTIFACT_DIR}/latest.cyclonedx.json"
45+
ln -sf "mios-sbom-${VERSION}-${TIMESTAMP}.spdx.txt" "${ARTIFACT_DIR}/latest.spdx.txt"
46+
47+
echo "[90-generate-sbom] SBOMs generated in ${ARTIFACT_DIR}:"
48+
ls -lh "$ARTIFACT_DIR"
49+
50+
echo "[90-generate-sbom] Done."

0 commit comments

Comments
 (0)