Expanding OpenWrt squashfs image (SDcard)

Alternatively instruct image builder how large the partitions are made.

The BASH-script below is also generating SquashFS & F2FS images, which should make the RPi less susceptible to power-loss induced filesystem corruption. Please consider using those images if your RPi does not have a uninterruptible-power-supply:


#Documentation: https://openwrt.org/docs/guide-user/additional-software/imagebuilder

KERNEL_PARTSIZE=128 #Kernel-Partitionsize in MB
ROOTFS_PARTSIZE=4096 #Rootfs-Partitionsize in MB

# download image builder
if [ ! -f "${BUILDER##*/}" ]; then
	wget "$BUILDER"
	tar xJvf "${BUILDER##*/}"

mkdir "$OUTPUT"
cd openwrt-*/

# list all targets for this image builder, consider 'make help' as well
# make info

# clean previous images
make clean

# Packages are added if no prefix is given, '-packaganame' does not integrate a package

make image  PROFILE="rpi" \
           PACKAGES="kmod-rt2800-usb rt2800-usb-firmware kmod-cfg80211 kmod-lib80211 kmod-mac80211 kmod-rtl8192cu \
                     luci-base luci-ssl luci-mod-admin-full luci-theme-bootstrap \
                     kmod-usb-storage kmod-usb-ohci kmod-usb-uhci e2fsprogs fdisk resize2fs \
                     htop debootstrap" \

Edit #1: Suggest using SquashFS/F2FS. This combination is less susceptible to power-loss and subsequent filesystem-corruption.