#!/usr/bin/env bash
set -o xtrace
set -o errexit
MicroSD="/dev/sdX"
DIR="/tmp/bbb"
MNT="$DIR/mnt"
rm -rf $DIR
mkdir -p "$MNT"
dd if=/dev/zero of=$MicroSD bs=2M count=1 conv=fsync oflag=direct status=progress
echo -e "label:dos\nstart=2M" | sfdisk $MicroSD
yes | mkfs.ext4 -O '^metadata_csum,^64bit' -m1 ${MicroSD}1
mount ${MicroSD}1 "$MNT"
am33x=ArchLinuxARM-am33x-latest.tar.gz
curl -L -o $DIR/$am33x "http://os.archlinuxarm.org/os/$am33x"
bsdtar -xpf "$DIR/$am33x" -C "$MNT" && sync
dd if=$MNT/boot/MLO of=$MicroSD bs=128k count=1 seek=1 conv=notrunc,fsync oflag=direct status=progress
dd if=$MNT/boot/u-boot.img of=$MicroSD bs=384k count=2 seek=1 conv=notrunc,fsync oflag=direct status=progress
umount "$MNT"
exit
BBB не видит карту