-
Build docker image. Run
docker build -t raspbian-cross .
. -
Download raspbian image from unzip and save it as
raspbian.img
which is the image to be customized. -
Extend the image size for our installation. Run
dd if=/dev/zero bs=1M count=1024 >> raspbian.img
. It will extend the image 1GB. -
Make raspbian.img as loopback device. Run
losetup -fP raspbian.img
. -
Extend partition. Run
gparted /dev/loop0
(The nameloop0
may be different. Check by runnnglosetup -l
).
- (If didn't yet): Make raspbian.img as loopback device. Run
losetup -fP raspbian.img
. - Mount loop0p2. Run
mount /dev/loop0p2 /mnt
. - Login image via docker. Run
docker run --rm -it --privileged -v /mnt:/raspbian raspbian-cross:latest
. - (The first time only): Copy
qeu-arm-static
binary to raspbian. Runcp /usr/bin/qemu-arm-static /raspbian/usr/bin/
- Chroot. Run
chroot /raspbian /bin/bash
- You can now modify the image. Modify.
Run dd bs=1m if=raspbian.img of=/dev/<SD card>