1313# -p, --password PASS BMC password (default: turing, or TURINGPI_PASSWORD env)
1414# -d, --disks DEVICES Comma-separated user disks to wipe (default: /dev/nvme0n1)
1515# --no-nvme Skip NVMe wipe
16- # --no-emmc Skip eMMC wipe (eMMC wiped by default)
1716# --clean-terraform Also clean terraform state files
1817# --force-power-off Force power off via BMC if graceful shutdown fails
18+ # --yes, -y Skip interactive confirmation (for automation)
1919# --log FILE Log output to file
2020# --dry-run Show commands without executing
2121# -h, --help Show this help message
@@ -38,11 +38,10 @@ BMC_IP="${TURINGPI_ENDPOINT:-}"
3838BMC_USER=" ${TURINGPI_USERNAME:- } "
3939BMC_PASSWORD=" ${TURINGPI_PASSWORD:- } "
4040USER_DISKS=" /dev/nvme0n1"
41- EMMC_DEVICE=" /dev/mmcblk0"
4241WIPE_NVME=true
43- WIPE_EMMC=true
4442CLEAN_TERRAFORM=false
4543FORCE_POWER_OFF=false
44+ SKIP_CONFIRM=false
4645LOG_FILE=" "
4746DRY_RUN=false
4847
@@ -117,9 +116,9 @@ while [[ $# -gt 0 ]]; do
117116 -p|--password) BMC_PASSWORD=" $2 " ; shift 2 ;;
118117 -d|--disks) USER_DISKS=" $2 " ; shift 2 ;;
119118 --no-nvme) WIPE_NVME=false; shift ;;
120- --no-emmc) WIPE_EMMC=false; shift ;;
121119 --clean-terraform) CLEAN_TERRAFORM=true; shift ;;
122120 --force-power-off) FORCE_POWER_OFF=true; shift ;;
121+ --yes|-y) SKIP_CONFIRM=true; shift ;;
123122 --log) LOG_FILE=" $2 " ; shift 2 ;;
124123 --dry-run) DRY_RUN=true; shift ;;
125124 -h|--help) show_help ;;
@@ -282,20 +281,18 @@ echo ""
282281echo " Data to be PERMANENTLY DESTROYED:"
283282echo " • Talos system partitions (STATE, EPHEMERAL)"
284283[[ " $WIPE_NVME " == " true" ]] && echo -e " ${RED} • NVMe drives: $USER_DISKS ${NC} "
285- [[ " $WIPE_EMMC " == " true" ]] && echo -e " ${RED} • eMMC boot drives: $EMMC_DEVICE ${NC} "
284+ echo " "
285+ echo -e " ${YELLOW} Note: eMMC is system disk and cannot be wiped via talosctl reset${NC} "
286286echo " "
287287[[ " $CLEAN_TERRAFORM " == " true" ]] && echo " Terraform cleanup: enabled"
288288[[ " $FORCE_POWER_OFF " == " true" ]] && echo " Force power off: enabled"
289289[[ -n " $LOG_FILE " ]] && echo " Logging to: $LOG_FILE "
290290[[ " $DRY_RUN " == " true" ]] && echo -e " ${YELLOW} DRY RUN MODE - No changes will be made${NC} "
291291echo " "
292292
293- # Confirm before proceeding
294- if [[ " $DRY_RUN " != " true" ]]; then
293+ # Confirm before proceeding (unless --yes flag or dry-run)
294+ if [[ " $DRY_RUN " != " true" && " $SKIP_CONFIRM " != " true " ]]; then
295295 echo -e " ${RED} This will PERMANENTLY DESTROY ALL DATA on these nodes!${NC} "
296- if [[ " $WIPE_EMMC " == " true" ]]; then
297- echo -e " ${RED} Nodes will be UNBOOTABLE until re-flashed via BMC!${NC} "
298- fi
299296 echo " "
300297 read -p " Type 'DESTROY' to confirm: " confirm
301298 if [[ " $confirm " != " DESTROY" ]]; then
@@ -317,18 +314,14 @@ if [[ -f "$TALOSCONFIG" ]]; then
317314 WIPE_CMD+=" --system-labels-to-wipe STATE --system-labels-to-wipe EPHEMERAL"
318315
319316 # Add NVMe disks if enabled
317+ # Note: eMMC is system disk and cannot be wiped via talosctl reset
320318 if [[ " $WIPE_NVME " == " true" && -n " $USER_DISKS " ]]; then
321319 IFS=' ,' read -ra DISK_ARRAY <<< " $USER_DISKS"
322320 for disk in " ${DISK_ARRAY[@]} " ; do
323321 WIPE_CMD+=" --user-disks-to-wipe $disk "
324322 done
325323 fi
326324
327- # Add eMMC disk if enabled
328- if [[ " $WIPE_EMMC " == " true" && -n " $EMMC_DEVICE " ]]; then
329- WIPE_CMD+=" --user-disks-to-wipe $EMMC_DEVICE "
330- fi
331-
332325 # Don't reboot - we want to shutdown
333326 WIPE_CMD+=" --reboot=false"
334327
0 commit comments