Skip to content

Instantly share code, notes, and snippets.

@jitomesky
Created August 27, 2014 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jitomesky/4465dec3d84fd32c3126 to your computer and use it in GitHub Desktop.
Save jitomesky/4465dec3d84fd32c3126 to your computer and use it in GitHub Desktop.
NOOBS用のOSイメージを自動で作ってくれるスクリプト
#!/bin/sh
mount /dev/sdb6 /mnt
mount /dev/sdb5 /mnt/boot
cd /mnt
rm -rf ~/raspi_img
mkdir ~/raspi_img
tar cpf ~/raspi_img/root.tar ./* --exclude=proc/* --exclude=sys/* --exclude=dev/pts/* --exclude=boot/*
cd boot
tar cpf ~/raspi_img/boot.tar ./*
cd ~/raspi_img
du -am > filesize.txt
xz -9 -e ~/raspi_img/root.tar
xz -9 -e ~/raspi_img/boot.tar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment