IPMI hang fix (Lenovo XCC SR650 V3): - Add pluggable ipmi_profile system with per-vendor timeouts and fruEarlyExit flag - Lenovo profile: 90s FRU timeout, streaming early-exit stops after PSU blocks found - collectFRUEarlyExit streams ipmitool fru print and kills process once PSU blocks are followed by a non-PSU header (~6s instead of ~108s on 54-device FRU list) - collectBMCFirmware and collectPSUs accept manufacturer and apply profile timeouts VROC license detection: - Detect VMD/VROC controller in PCIe list, run mdadm --detail-platform - Parse "License:" line; store as snap.VROCLicense in HardwareSnapshot Blackbox service fix: - bee-blackbox.service was missing from systemctl enable list in ISO build hook - Service never started on boot; state file never written; UI button stayed "Enable" Drop qrencode: - Remove from package list, standardTools API check, and runtime-flows doc Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
89 lines
3.2 KiB
Bash
Executable File
89 lines
3.2 KiB
Bash
Executable File
#!/bin/sh
|
|
# 9000-bee-setup.hook.chroot — runs inside Debian chroot during live-build
|
|
# Enables bee systemd services and configures the live environment.
|
|
set -e
|
|
|
|
echo "=== bee chroot setup ==="
|
|
|
|
GPU_VENDOR=$(cat /etc/bee-gpu-vendor 2>/dev/null || echo nvidia)
|
|
echo "=== GPU vendor: ${GPU_VENDOR} ==="
|
|
|
|
ensure_bee_console_user() {
|
|
if id bee >/dev/null 2>&1; then
|
|
usermod -d /home/bee -s /bin/bash bee 2>/dev/null || true
|
|
else
|
|
useradd -d /home/bee -m -s /bin/bash -U bee
|
|
fi
|
|
|
|
mkdir -p /home/bee
|
|
chown -R bee:bee /home/bee
|
|
echo "bee:eeb" | chpasswd
|
|
groupadd -f ipmi 2>/dev/null || true
|
|
usermod -aG sudo,video,input,render,ipmi bee 2>/dev/null || true
|
|
}
|
|
|
|
ensure_bee_console_user
|
|
|
|
# Enable common bee services
|
|
systemctl enable bee-hpc-tuning.service
|
|
systemctl enable bee-network.service
|
|
systemctl enable bee-preflight.service
|
|
systemctl enable bee-audit.service
|
|
systemctl enable bee-web.service
|
|
systemctl enable bee-sshsetup.service
|
|
systemctl enable bee-blackbox.service
|
|
systemctl enable bee-selfheal.timer
|
|
systemctl enable bee-boot-status.service
|
|
systemctl enable ssh.service
|
|
systemctl enable lightdm.service 2>/dev/null || true
|
|
systemctl enable qemu-guest-agent.service 2>/dev/null || true
|
|
systemctl enable serial-getty@ttyS0.service 2>/dev/null || true
|
|
systemctl enable serial-getty@ttyS1.service 2>/dev/null || true
|
|
systemctl enable bee-journal-mirror@ttyS1.service 2>/dev/null || true
|
|
|
|
# Enable GPU-vendor specific services
|
|
if [ "$GPU_VENDOR" = "nvidia" ]; then
|
|
systemctl enable nvidia-dcgm.service 2>/dev/null || true
|
|
systemctl enable nvidia-fabricmanager.service 2>/dev/null || true
|
|
systemctl enable bee-nvidia.service
|
|
elif [ "$GPU_VENDOR" = "amd" ]; then
|
|
# ROCm symlinks (packages install to /opt/rocm-*/bin/)
|
|
for tool in rocm-smi rocm-bandwidth-test rvs; do
|
|
if [ ! -e /usr/local/bin/${tool} ]; then
|
|
bin_path="$(find /opt -path "*/bin/${tool}" -type f 2>/dev/null | sort | tail -1)"
|
|
[ -n "${bin_path}" ] && ln -sf "${bin_path}" /usr/local/bin/${tool}
|
|
fi
|
|
done
|
|
fi
|
|
# nogpu: no GPU services needed
|
|
|
|
# Ensure scripts are executable
|
|
chmod +x /usr/local/bin/bee-hpc-tuning 2>/dev/null || true
|
|
chmod +x /usr/local/bin/bee-network.sh 2>/dev/null || true
|
|
chmod +x /usr/local/bin/bee-sshsetup 2>/dev/null || true
|
|
chmod +x /usr/local/bin/bee-smoketest 2>/dev/null || true
|
|
chmod +x /usr/local/bin/bee 2>/dev/null || true
|
|
chmod +x /usr/local/bin/bee-log-run 2>/dev/null || true
|
|
chmod +x /usr/local/bin/bee-selfheal 2>/dev/null || true
|
|
chmod +x /usr/local/bin/bee-boot-status 2>/dev/null || true
|
|
chmod +x /usr/local/bin/bee-install 2>/dev/null || true
|
|
chmod +x /usr/local/bin/bee-remount-medium 2>/dev/null || true
|
|
if [ "$GPU_VENDOR" = "nvidia" ]; then
|
|
chmod +x /usr/local/bin/bee-nvidia-load 2>/dev/null || true
|
|
chmod +x /usr/local/bin/bee-gpu-burn 2>/dev/null || true
|
|
chmod +x /usr/local/bin/bee-john-gpu-stress 2>/dev/null || true
|
|
chmod +x /usr/local/bin/bee-nccl-gpu-stress 2>/dev/null || true
|
|
fi
|
|
|
|
# Reload udev rules
|
|
udevadm control --reload-rules 2>/dev/null || true
|
|
|
|
# Create export directory
|
|
mkdir -p /appdata/bee/export
|
|
|
|
if [ -f /etc/sudoers.d/bee ]; then
|
|
chmod 0440 /etc/sudoers.d/bee
|
|
fi
|
|
|
|
echo "=== bee chroot setup complete (${GPU_VENDOR}) ==="
|