From: Paul Hänsch Date: Mon, 20 Apr 2026 04:33:24 +0000 (+0200) Subject: simplified size calculation X-Git-Url: http://git.plutz.net/?a=commitdiff_plain;h=558dffe6785627a2963fdf6cc5d7be8b03145b71;p=blast simplified size calculation --- diff --git a/targets/raspberrypi.mk b/targets/raspberrypi.mk index 14e4194..e582c25 100644 --- a/targets/raspberrypi.mk +++ b/targets/raspberrypi.mk @@ -6,12 +6,9 @@ fstype := nilfs2 # 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 @@ -51,11 +48,12 @@ _partition_raspi: _sparse _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 "$@" @@ -103,19 +101,18 @@ _partcopy: ${VOLUME} ${PROOT} ${PBOOT} 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