Skip to content

Instantly share code, notes, and snippets.

@voxxit
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save voxxit/bbcd0cdac2f3fa6d9e44 to your computer and use it in GitHub Desktop.

Select an option

Save voxxit/bbcd0cdac2f3fa6d9e44 to your computer and use it in GitHub Desktop.
curl -sSL http://git.io/vvDYD > mkarch; chmod +x mkarch; disk=/dev/sdb ./mkarch
#!/bin/bash
set -e
set -x
disk="/dev/sdb"
rootfs="ArchLinuxARM-rpi-2-latest.tar.gz"
pushd $(mktemp -d)
mkdir root boot
mkfs.vfat ${disk}1
mkfs.ext4 ${disk}2
mount ${disk}1 boot
mount ${disk}2 root
if [ ! -f ~/${rootfs} ]; then
curl -fsSL http://archlinuxarm.org/os/${rootfs} > ~/${rootfs}
fi
ln -nfs ~/${rootfs} ${rootfs}
bsdtar -xpf ${rootfs} -C root
mv root/boot/* boot
sync
umount root boot
rm -rf root boot
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment