#!/bin/bash
# Script to configure NVRAM and signal the installer

if [[ -z "${TARGET_DISK_DEVICE}" ]]; then
  echo "ERROR: Could not identify target disk device using size ~${TARGET_SIZE_GB}GB."
  echo "Debug Info: TARGET_SIZE_GB was: ${TARGET_SIZE_GB}"
  echo "--- diskutil list physical output ---"
  diskutil list physical
  echo "-----------------------------------"
fi

# Additional NVRAM configuration steps (simplified for clarity)
echo "Configuring NVRAM settings..."
# Add actual NVRAM commands here as needed

# Signal the installer process (simplified)
INSTALLER_PID=$(ps aux | grep "[s]tartosinstall.sh" | awk '{print $2}' | head -n 1)
if [[ -n "${INSTALLER_PID}" ]]; then
  echo "NVRAM background script PID: ${INSTALLER_PID}"
else
  echo "ERROR: Could not find background script PID."
fi
