Skip to content

Instantly share code, notes, and snippets.

View porschemad911's full-sized avatar

John Williams porschemad911

  • Canberra, Australia
View GitHub Profile
@macromorgan
macromorgan / README.md
Last active February 11, 2025 02:42
Debootstrap Development Image

Start with making your "flashable" image. I use 2GB and work from there. fallocate can work too, but some filesystems may not support it.

dd if=/dev/zero of=disk.img bs=1M count=2048

Create your partitions on the disk. I use fdisk and generate a gpt partition table. Note that I leave a slight offset (16MB) for U-Boot and the Rockchip loader stuff, but in my case I will be using U-Boot from the internal SPI and the storage space is entirely optional.

fdisk disk.img

I create my first partition at offset 32768 (16MB exactly) and have it end at 294911 (128MB + 16MB). This gives my boot partition 128MB to work with and ensures that my root partition starts at sector 294912. When working with 512 byte blocks (which we almost always are) it's important to ensure your starting block numbers are always divisible by 8 so that they are 4k aligned.