# endef
# Partition Table (1M) + Boot Partition Root Partition + Slack Space (1M)
+imagesize ?= 2048
BOOT_MB := 255
-ifdef imagesize
- ROOT_MB := $(shell printf '%i\n' "$$(( ${imagesize} - ${BOOT_MB} - 2 ))")
-else
- ROOT_MB := 1791
-endif
+ROOT_MB := $(shell printf '%i\n' "$$(( ${imagesize} - ${BOOT_MB} - 2 ))")
define PARTLAYOUT :=
label: dos
_partcopy: _format
_img_mount: _partcopy _partition_raspi
_copy: _img_mount
+_bootloader_raspi: _copy # prerequisite files actually depend on _config
_umount: _config _bootloader_raspi
_target: _umount
clean: _raspberry_clean
-export VOLUME PBOOT PROOT SQUASH PARTLAYOUT
+export VOLUME PBOOT PROOT PARTLAYOUT
img_mount:
mkdir -p -m 755 "$@"
if="$${PROOT}" of="$${VOLUME}"
rm -- "$${PBOOT}" "$${PROOT}"
-_mount_boot: _mount_root
- mountpoint "$${CFGROOT}" || false
- mkdir -p -m 755 "$${CFGROOT}/boot/firmware"
- mountpoint "$${CFGROOT}/boot/firmware" \
- || mount -o loop,offset=1M,sizelimit=${BOOT_MB}M \
- -t vfat "$${VOLUME}" "$${CFGROOT}/boot/firmware"
-
_mount_root: ${CFGROOT}
mountpoint "$${CFGROOT}" \
|| mount -o loop,offset="$$((${BOOT_MB} + 1))"M,sizelimit=${ROOT_MB}M \
-t ${fstype} "$${VOLUME}" "$${CFGROOT}"
chmod 755 "$${CFGROOT}"
+_mount_boot: _mount_root
+ mkdir -p -m 755 "$${CFGROOT}/boot/firmware"
+ mountpoint "$${CFGROOT}/boot/firmware" \
+ || mount -o loop,offset=1M,sizelimit=${BOOT_MB}M \
+ -t vfat "$${VOLUME}" "$${CFGROOT}/boot/firmware"
+
_img_mount: _mount_boot _mount_root
_umount_boot: _config