16 lines
332 B
Bash
Executable File
16 lines
332 B
Bash
Executable File
#!/bin/bash
|
|
|
|
[ $# -eq 0 ] && { echo "Usage: $0 IMG_FILE"; exit 1; }
|
|
|
|
SECTOR_BYTES=512
|
|
SECTOR_START=2048
|
|
OFFSET=$(($SECTOR_BYTES*$SECTOR_START))
|
|
|
|
./build.sh
|
|
mkdir -p boot-part
|
|
sudo mount -o rw,loop,offset=$OFFSET $1 ./boot-part
|
|
tar -xzvf build/rpi-cloud-init.tgz -C boot-part
|
|
sudo umount ./boot-part
|
|
rmdir ./boot-part
|
|
rm -rf ./build
|