-VOLUME := ${raspi}
-PBOOT := rpi_boot.img
-PROOT := rpi_root.img
-SYSROOT := rpi_root/
-CFGROOT := img_mount/
-
-ARCH := armhf
-KEYRING := keys/raspbian-archive-keyring.gpg
-BOOTSTRAP := http://raspbian.raspberrypi.org/raspbian
-
-define SOURCES =
-deb http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi
-deb http://archive.raspberrypi.org/debian stretch main
-endef
-
-PACKAGES := ${PACKAGES} firmware-brcm80211 libraspberrypi-bin libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel
-
-_target: _umount _partcopy _config _install
-
-_qemu:
-_bootstrap: _qemu
-_install: _bootstrap
-_sparse:
-_format: _sparse
-_mount: _format
-_copy: _install _mount
-_config_raspi: _copy _mount
-_config: _copy _mount _config_raspi
-_umount: _mount _config
-_partition_raspi:
-_partcopy: _partition_raspi _umount
+ VOLUME := ${raspi}
+ PBOOT := rpi_boot.img
+ PROOT := rpi_root.img
+ SYSROOT := rpi_root_${release}/
+ CFGROOT := img_mount/
+
+ ARCH := armhf
+ KEYRING := keys/raspbian-archive-keyring.gpg
+ BOOTSTRAP := http://raspbian.raspberrypi.org/raspbian
+
+ define SOURCES :=
+ deb http://raspbian.raspberrypi.org/raspbian ${release} main non-free firmware rpi
+ deb http://archive.raspberrypi.org/debian ${release} main
+ endef
+
+ PACKAGES += firmware-brcm80211 libraspberrypi-bin libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel initramfs-tools nilfs-tools
+ fstype := nilfs2
+
+ _target: _umount _config
+
+ _qemu:
+ _bootstrap: _qemu
+ _install: _bootstrap
+ _sparse:
+ _format: _sparse
+ _partition_raspi: _sparse
+ _partcopy: _partition_raspi _format
+ _img_mount: _partcopy
+ _copy: _install _img_mount
+ _config: _copy _img_mount
+ _bootloader_raspi: _img_mount
+ _umount: _img_mount _config _bootloader_raspi