Skip to content

Instantly share code, notes, and snippets.

@huyvometropolis
huyvometropolis / update-aimobile-ext4.sh
Last active April 28, 2026 19:15
Update AIMobile yocto OS on the flight. It checks the active slot, picks the other partition, writes, flips the slot, and reboots — nothing else.
#!/bin/bash
set -euo pipefail
ROOTFS="${1:?Usage: $0 <rootfs.ext4>}"
[ -f "$ROOTFS" ] || { echo "Error: file not found: $ROOTFS"; exit 1; }
ACTIVE=$(/usr/sbin/nvbootctrl get-current-slot)
if [ "$ACTIVE" = "0" ]; then