Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save blueskychan-dev/aee14e234ca2acdaa3987b0365cae413 to your computer and use it in GitHub Desktop.
Save blueskychan-dev/aee14e234ca2acdaa3987b0365cae413 to your computer and use it in GitHub Desktop.
Boot armbian from PC Burning mode (Design for linux)
#!/bin/bash
# =====================================================
# Armbian Boot Helper (PC Burning Mode)
# Author: blueskychan-dev
# Requires: https://github.com/althafvly/AmlogicKitchen
# Please execute this script inside the AmlogicKitchen folder
# =====================================================
# ==== CONFIGURATION VARIABLES ====
# Kernel image path
KERNEL_IMG="/Image"
# Initrd image path
INITRD_IMG="/uInitrd"
# DTB file path (change as needed)
DTB_PATH="/dtb/amlogic/modded.dtb"
#DTB_PATH="/dtb/amlogic/meson-sm1-x96-air-gbit.dtb"
# Boot device: mmc 0 = SD card, mmc 1 = eMMC, usb 0 = USB
BOOT_DEVICE="mmc 0"
# Boot arguments (edit UUID and parameters as needed)
BOOT_ARGS="root=UUID=59d0e9ab-ff9a-43f7-8841-e8f5956645c0 rootflags=data=writeback console=ttyAML0,115200n8 console=tty0 rw no_console_suspend consoleblank=0 fsck.fix=no fsck.repair=yes net.ifnames=0 splash plymouth.ignore-serial-consoles"
# Memory addresses (default for Amlogic U-Boot)
ADDR_KERNEL="0x02000000"
ADDR_INITRD="0x13000000"
ADDR_DTB="0x04000000"
# ==== SCRIPT START ====
echo "=== Armbian Boot Helper (PC Burning Mode) ==="
echo "Author: blueskychan-dev"
echo
# Ensure we're inside the AmlogicKitchen directory
if [ ! -f bin/update ]; then
echo "[!] 'bin/update' not found."
echo "Make sure you run this script from inside the AmlogicKitchen folder:"
echo " https://github.com/althafvly/AmlogicKitchen"
exit 1
fi
# Check if Amlogic USB device is detected
if ! lsusb | grep -iq 'Amlogic'; then
echo "[!] Amlogic device not detected!"
echo "Please ensure your Amlogic box is connected via USB."
exit 1
fi
echo "[+] Amlogic device found!"
echo
# Display summary of settings
echo "Configuration Summary:"
echo "----------------------------------------"
echo "Boot Device: $BOOT_DEVICE"
echo "Kernel Image: $KERNEL_IMG → $ADDR_KERNEL"
echo "Initrd Image: $INITRD_IMG → $ADDR_INITRD"
echo "DTB File: $DTB_PATH → $ADDR_DTB"
echo "Boot Args: $BOOT_ARGS"
echo "Boot Command: booti $ADDR_KERNEL $ADDR_INITRD $ADDR_DTB"
echo "----------------------------------------"
echo
# Ask for confirmation
read -p "Proceed with boot? [Y/n] " confirm
if [[ "$confirm" =~ ^[Nn]$ ]]; then
echo "Aborted by user."
exit 0
fi
echo "[*] Sending boot commands to device..."
# Load kernel
sudo bin/update bulkcmd "fatload $BOOT_DEVICE $ADDR_KERNEL $KERNEL_IMG" || exit 1
# Load initrd
sudo bin/update bulkcmd "fatload $BOOT_DEVICE $ADDR_INITRD $INITRD_IMG" || exit 1
# Load DTB
sudo bin/update bulkcmd "fatload $BOOT_DEVICE $ADDR_DTB $DTB_PATH" || exit 1
# Set bootargs
sudo bin/update bulkcmd "setenv bootargs $BOOT_ARGS" || exit 1
# Boot
sudo bin/update bulkcmd "booti $ADDR_KERNEL $ADDR_INITRD $ADDR_DTB" || true
echo "[✓] Boot sequence completed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment