]> git.plutz.net Git - blast/blobdiff - Makefile
raspi filesystem experiments
[blast] / Makefile
index 31f844eef8ada7307a9c9b3c1d38ede53efd3fe5..453fa6af0fe4c3f48a31251b0903fcae49c223ff 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -152,8 +152,8 @@ else ifdef raspi
   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
+  PACKAGES += firmware-brcm80211 libraspberrypi-bin libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel initramfs-tools btrfs-tools
+  fstype := btrfs
 
   _target: _umount _config
   
@@ -168,7 +168,7 @@ else ifdef raspi
   _copy: _install _img_mount
   _config: _copy _img_mount
   _bootloader_raspi: _img_mount
-  _umount: _img_mount _config _bootloader_raspi
+  _umount: _copy _config _bootloader_raspi
 
 else
   _target:
@@ -256,6 +256,7 @@ _install: ${SYSROOT} _aptkeys _norecommends
        chroot "$${SYSROOT}" rm /usr/sbin/udevadm
 
 _copy: ${SYSROOT} ${CFGROOT}
+       sync
        cp -au "$${SYSROOT}/." "$${CFGROOT}/"
 
 _config: ${CFGROOT}
@@ -309,7 +310,7 @@ _sparse: ${PBOOT} ${PROOT}
 ifdef raspi
 _format_root: ${PROOT}
        -umount "$${CFGROOT}/boot" "$${CFGROOT}" "${PROOT}"
-       mkfs.nilfs2 -f -L FSROOT "$${PROOT}"
+       mkfs.${fstype} -f -L FSROOT "$${PROOT}"
 else
 _format_root: ${PROOT}
        -umount "$${CFGROOT}/boot" "$${CFGROOT}" "${PROOT}"
@@ -394,6 +395,7 @@ _efi_mount: ${PBOOT}
        mount -t vfat -o loop "$${PBOOT}" "efi/"
 
 _efi_umount: _efi_mount
+       sync
        umount efi/ && rmdir efi/
 
 .PHONY: _syslinux_mbr _grub_mbr
@@ -437,10 +439,12 @@ _img_mount: ${CFGROOT}
        || mount -o loop,offset=2M,sizelimit=${BOOT_MB}M \
                 -t vfat "$${VOLUME}" "$${CFGROOT}/boot"
 
-_umount_boot: ${CFGROOT}
+_umount_boot: ${CFGROOT} _config
+       sync
        -umount "$${CFGROOT}/boot"
 
-_umount_root: _umount_boot
+_umount_root: _umount_boot _config
+       sync
        umount "$${CFGROOT}" && rmdir "$${CFGROOT}"
 
 _umount: _umount_boot _umount_root