bbc6fb1 chowned the directory correctly but it stayed empty at build
time, and bee_layer_classify (squashfs-layers.sh) only tracks regular
files and symlinks via `find ... -type f -o -type l` — an empty
directory is silently dropped from every layer's rsync --files-from
list and never reaches the built ISO. dcgmi diag's deployment check
still failed with DCGM_FR_FILE_CREATE_PERMISSIONS after rebuilding on
top of that fix because the directory simply didn't exist at boot.
Seed /var/log/nvidia-dcgm/.keep so the directory rides along the
classifier as an implied parent (rsync -a preserves its ownership),
and stop 9999-slim's log sweep from deleting that marker before the
classifier ever sees it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
36 lines
2.2 KiB
Bash
Executable File
36 lines
2.2 KiB
Bash
Executable File
#!/bin/sh
|
|
# 9999-slim.hook.chroot — strip non-essential files to reduce squashfs size.
|
|
set -e
|
|
|
|
# ── Man pages and documentation ───────────────────────────────────────────────
|
|
find /usr/share/man -mindepth 1 -delete 2>/dev/null || true
|
|
find /usr/share/doc -mindepth 1 ! -name 'copyright' -delete 2>/dev/null || true
|
|
find /usr/share/info -mindepth 1 -delete 2>/dev/null || true
|
|
find /usr/share/groff -mindepth 1 -delete 2>/dev/null || true
|
|
find /usr/share/lintian -mindepth 1 -delete 2>/dev/null || true
|
|
|
|
# ── Locales — keep only C and en_US ──────────────────────────────────────────
|
|
find /usr/share/locale -mindepth 1 -maxdepth 1 \
|
|
! -name 'en' ! -name 'en_US' ! -name 'locale.alias' \
|
|
-exec rm -rf {} + 2>/dev/null || true
|
|
find /usr/share/i18n/locales -mindepth 1 \
|
|
! -name 'en_US' ! -name 'i18n' ! -name 'iso14651_t1' ! -name 'iso14651_t1_common' \
|
|
-delete 2>/dev/null || true
|
|
|
|
# ── Python cache ──────────────────────────────────────────────────────────────
|
|
find /usr /opt -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true
|
|
find /usr /opt -name '*.pyc' -delete 2>/dev/null || true
|
|
|
|
# ── APT cache and lists ───────────────────────────────────────────────────────
|
|
apt-get clean
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# ── Misc ──────────────────────────────────────────────────────────────────────
|
|
rm -rf /tmp/* /var/tmp/* 2>/dev/null || true
|
|
# /var/log/nvidia-dcgm/.keep is intentionally seeded by 9000-bee-setup so an
|
|
# otherwise-empty DCGM_HOME_DIR survives the squashfs layer classifier (which
|
|
# only tracks files/symlinks, not empty directories) — never sweep it up here.
|
|
find /var/log -type f ! -path '/var/log/nvidia-dcgm/.keep' -delete 2>/dev/null || true
|
|
|
|
echo "=== slim: done ==="
|