From 34c6f742baf81ca32e35bc86b189cc610744bd75 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sun, 12 Apr 2026 20:17:27 +0200 Subject: [PATCH] less slack space when partitioning, experiment with nilfs2 filesystem --- targets/raspberrypi.mk | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/targets/raspberrypi.mk b/targets/raspberrypi.mk index 346c975..cdd2049 100644 --- a/targets/raspberrypi.mk +++ b/targets/raspberrypi.mk @@ -1,21 +1,25 @@ ARCH := arm64 -fstype := ext4 +fstype := nilfs2 -# Partition Table (2M) + Boot Partition Root Partition + Slack Space (1M) -BOOT_MB := 254 +# define RPICONFIG := +# # dtoverlay=vc4-fkms-v3d,cma-${rpivmem} +# endef + +# Partition Table (1M) + Boot Partition Root Partition + Slack Space (1M) +BOOT_MB := 255 ifdef imagesize - ROOT_MB := $(shell printf '%i\n' "$$(( ${imagesize} - ${BOOT_MB} - 3 ))") + ROOT_MB := $(shell printf '%i\n' "$$(( ${imagesize} - ${BOOT_MB} - 2 ))") else ROOT_MB := 1791 endif define PARTLAYOUT := label: dos -: start=2MiB, size=${BOOT_MB}MiB, type=c +: start=1MiB, size=${BOOT_MB}MiB, type=c : size=${ROOT_MB}MiB, type=83 endef -define _fstab := +define FSTAB := /dev/mmcblk0p2 / ${fstype} auto,nofail,rw 0 0 /dev/mmcblk0p1 /boot/firmware vfat auto,nofail,ro 0 0 endef @@ -64,7 +68,7 @@ ${SYSROOT}/usr/bin/qemu-arm64-static: /usr/bin/qemu-arm64-static ${SYSROOT} ${VOLUME}: .FORCE dd count=0 of="$${VOLUME}" # truncate - dd bs=1M count=0 seek=$$((3 + ${BOOT_MB} + ${ROOT_MB})) \ + dd bs=1M count=0 seek=$$((2 + ${BOOT_MB} + ${ROOT_MB})) \ of="$${VOLUME}" chmod g+w "$${VOLUME}" @@ -93,9 +97,9 @@ ${CFGROOT}/boot/firmware/cmdline.txt: _config .FORCE _bootloader_raspi: ${CFGROOT}/boot/firmware/cmdline.txt _partcopy: ${VOLUME} ${PROOT} ${PBOOT} - dd conv=notrunc,sparse bs=1M seek=2 \ + dd conv=notrunc,sparse bs=1M seek=1 \ if="$${PBOOT}" of="$${VOLUME}" - dd conv=notrunc,sparse bs=1M seek=$$((2 + ${BOOT_MB})) \ + dd conv=notrunc,sparse bs=1M seek=$$((1 + ${BOOT_MB})) \ if="$${PROOT}" of="$${VOLUME}" rm -- "$${PBOOT}" "$${PROOT}" @@ -103,12 +107,12 @@ _mount_boot: _mount_root mountpoint "$${CFGROOT}" || false mkdir -p -m 755 "$${CFGROOT}/boot/firmware" mountpoint "$${CFGROOT}/boot/firmware" \ - || mount -o loop,offset=2M,sizelimit=${BOOT_MB}M \ + || 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} + 2))"M,sizelimit=${ROOT_MB}M \ + || mount -o loop,offset="$$((${BOOT_MB} + 1))"M,sizelimit=${ROOT_MB}M \ -t ${fstype} "$${VOLUME}" "$${CFGROOT}" chmod 755 "$${CFGROOT}" -- 2.39.5