Skip to content

Instantly share code, notes, and snippets.

@hqmatics
Created August 19, 2016 13:08
Show Gist options
  • Save hqmatics/8c12c45174e6893c03addff16a1be2cd to your computer and use it in GitHub Desktop.
Save hqmatics/8c12c45174e6893c03addff16a1be2cd to your computer and use it in GitHub Desktop.
Format SD and write ArchLinux
umount /dev/sdc1
sed -e 's/\t\([\+0-9a-zA-Z]*\)[ \t].*/\1/' << EOF | fdisk /dev/sdc
o
n
p
1
+100M
t
c
n
p
2
w
EOF
echo "--- FORMAT PARTITIONS ---"
mkfs.vfat /dev/sdc1
mount /dev/sdc1 boot
mkfs.ext4 /dev/sdc2
mount /dev/sdc2 root
echo "--- COPY FILES ---"
echo "bsdtar..."
bsdtar -xpf ArchLinuxARM-rpi-2-acuserver-2016-02.tar.gz -C root
#bsdtar -xpf ArchLinuxARM-rpi-2-ax100_2016-03-01.tar.gz -C root
echo "Copied, syncing..."
sync
echo "Moving..."
mv root/boot/* boot
echo "Moved, syncing..."
sync
umount boot root
echo "--- FINISHED ---"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment