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
${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}"
_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}"
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}"