Last active
August 29, 2015 14:16
-
-
Save lancehudson/88c04ca7b175d77e3284 to your computer and use it in GitHub Desktop.
Script to build Rasp Pi Images for noobs from tar.gz
This file contains 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 | |
#URL=http://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz | |
URL=$1 | |
wget $URL -O image.tgz | |
fallocate -l 2G root.img | |
mkfs.ext4 root.img | |
mkdir root | |
mount -t ext4 root.img root | |
bsdtar -xpf image.tgz -C root | |
cd root/boot | |
tar -cpf ../../boot.tar * | |
cd .. | |
rm -rf boot | |
tar -cpf ../root.tar * | |
cd .. | |
umount root | |
rm root.img | |
ls -lah *.tar | |
xz -9 -e boot.tar | |
xz -9 -e root.tar | |
rm image.tgz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment