Last active
August 29, 2015 14:19
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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