Use ext4 for /boot partition on Phicomm N1Be careful when doing this, I suggest you backup your data before reformatting your /boot as ext4. Any mistake you make would potentially require a reflash of your device (or booting from USB stick to repair, at least).
Theoretically this also applies to boxes running Armbian as well as many other devices  that use U-boot to boot the system.
U-boot (used by Phicomm N1 as well as many other ARM boards) itself supports loading files from ext4 filesystem. Therefore it’s possible to use ext4 as /boot‘s filesystem even if Armbian defaults this to vfat.
Note that it was reported that U-boot had issues of being slow when reading files from ext4 partitions in certain scenarios, but that’s not the case on Phicomm N1 (at least not for me). The reason could be that either Phicomm N1 is using a newer version of U-boot (IIRC N1 is using U-boot 2015+) or the files I’m placing on /boot does not span over 4 extents.
To use ext4 for /boot, the following steps need to be performed:
- Ensure your device is booting though firmware environment variable start_emmc_autoscriptbyfw_printenv start_emmc_autoscript. If you got nothing or an error from this command, you might need to resetstart_autoscriptby:fw_setenv start_autoscript 'if usb start; then run start_usb_autoscript; fi; run start_emmc_autoscript;'
 
- Instruct U-boot to load start script from an ext4 partition instead of a vfat partition. This could be done by changing firmware variable start_emmc_autoscript(I would suggest you back up the variable by savingfw_printenv‘s output beforehand.):You might want to check out this if fw_printenv/fw_setenvdoes not work on your device.
 fw_setenv start_emmc_autoscript 'if ext4load mmc 1 1020000 emmc_autoscript; then autoscr 1020000; fi;'
 
- Use ext4loadinstead offatloadin file/boot/emmc_autoscript, which is used bystart_emmc_autoscriptvariable we changed in step 1.Generally you should already have a file named emmc_autoscript.cmdin/boot, and you would want tos/fatload/ext4load/git. But even if you don’t, the following one should work:
 setenv env_addr "0x10400000"
setenv kernel_addr "0x11000000"
setenv initrd_addr "0x13000000"
setenv dtb_mem_addr "0x1000000"
setenv boot_start booti ${kernel_addr} ${initrd_addr} ${dtb_mem_addr}
if ext4load mmc 1 ${env_addr} uEnv.ini; then env import -t ${env_addr} ${filesize}; if ext4load mmc 1 ${kernel_addr} ${kernel_name}; then if ext4load mmc 1 ${initrd_addr} uInitrd; then if ext4load mmc 1 ${dtb_mem_addr} ${dtb_name}; then run boot_start;fi;fi;fi;fi;
 emmc_autoscriptcould then be built by executing this:
 mkimage -C none -A arm64 -T script -d emmc_autoscript.cmd emmc_autoscript
 
- Backup /boot, reformat/dev/mmcblk1p1as ext4 and copy files that were in/bootback.You might also need to re-label the partition if you’re using its parition label in /etc/fstabto mount it (Armbian defaults to mount/bootwithLABEL=BOOT_EMMCin/etc/fstab).
 
- (Optional) Mark partition type of - /dev/mmcblk1p1as- Linux:
 - sfdisk --id /dev/mmcblk1 1 83
 - DO NOT REBOOT THE SYSTEM EVEN IF - SFDISKASKS YOU TO. REBOOT THE SYSTEM ONLY AFTER YOU PERFORMED ALL THE STEPS BELOW, OR YOU WILL BRICK YOUR DEVICE.
 - If you’re not sure whether you’d want to perform this step, skip ahead, it won’t hurt. - This mark is not used by the filesystem driver, it’s only a mark. This step is not necessary if you don’t mind - sfdisk -llist- /dev/mmcblk1p1as- W95 FAT32 (LBA).
 - This is what - sfdisk -lwould look like if you don’t perform this step:
 - Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk1p1      204800   466943   262144  128M  c W95 FAT32 (LBA)
/dev/mmcblk1p2      466944 15269887 14802944  7.1G 83 Linux
 - This is what it would look like if you do peform this step: - Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk1p1      204800   466943   262144  128M 83 Linux
/dev/mmcblk1p2      466944 15269887 14802944  7.1G 83 Linux
 
- Remember to update filesystem type for /bootspecified in/etc/fstab.
Run reboot now, and now the device should be booted from the ext4 /boot partition:
[root@n1-box ~]# df -hT
Filesystem     Type      Size  Used Avail Use% Mounted on
/dev/mmcblk1p1 ext4      120M   32M   80M  30% /boot
/dev/mmcblk1p2 ext4      6.9G  800M  6.1G  11% /
...
Be careful when doing this, I suggest you backup your data before reformatting your /boot as ext4. Any mistake you make would potentially require a reflash of your device (or booting from USB stick to repair, at least).
Theoretically this also applies to boxes running Armbian as well as many other devices that use U-boot to boot the system.
U-boot (used by Phicomm N1 as well as many other ARM boards) itself supports loading files from ext4 filesystem. Therefore it’s possible to use ext4 as /boot‘s filesystem even if Armbian defaults this to vfat.
Note that it was reported that U-boot had issues of being slow when reading files from ext4 partitions in certain scenarios, but that’s not the case on Phicomm N1 (at least not for me). The reason could be that either Phicomm N1 is using a newer version of U-boot (IIRC N1 is using U-boot 2015+) or the files I’m placing on /boot does not span over 4 extents.
To use ext4 for /boot, the following steps need to be performed:
- Ensure your device is booting though firmware environment variable start_emmc_autoscriptbyfw_printenv start_emmc_autoscript. If you got nothing or an error from this command, you might need to resetstart_autoscriptby:fw_setenv start_autoscript 'if usb start; then run start_usb_autoscript; fi; run start_emmc_autoscript;'
- Instruct U-boot to load start script from an ext4 partition instead of a vfat partition. This could be done by changing firmware variable start_emmc_autoscript(I would suggest you back up the variable by savingfw_printenv‘s output beforehand.):You might want to check out this if fw_printenv/fw_setenvdoes not work on your device.fw_setenv start_emmc_autoscript 'if ext4load mmc 1 1020000 emmc_autoscript; then autoscr 1020000; fi;'
- Use ext4loadinstead offatloadin file/boot/emmc_autoscript, which is used bystart_emmc_autoscriptvariable we changed in step 1.Generally you should already have a file named emmc_autoscript.cmdin/boot, and you would want tos/fatload/ext4load/git. But even if you don’t, the following one should work:setenv env_addr "0x10400000" setenv kernel_addr "0x11000000" setenv initrd_addr "0x13000000" setenv dtb_mem_addr "0x1000000" setenv boot_start booti ${kernel_addr} ${initrd_addr} ${dtb_mem_addr} if ext4load mmc 1 ${env_addr} uEnv.ini; then env import -t ${env_addr} ${filesize}; if ext4load mmc 1 ${kernel_addr} ${kernel_name}; then if ext4load mmc 1 ${initrd_addr} uInitrd; then if ext4load mmc 1 ${dtb_mem_addr} ${dtb_name}; then run boot_start;fi;fi;fi;fi;emmc_autoscriptcould then be built by executing this:mkimage -C none -A arm64 -T script -d emmc_autoscript.cmd emmc_autoscript
- Backup /boot, reformat/dev/mmcblk1p1as ext4 and copy files that were in/bootback.You might also need to re-label the partition if you’re using its parition label in /etc/fstabto mount it (Armbian defaults to mount/bootwithLABEL=BOOT_EMMCin/etc/fstab).
- (Optional) Mark partition type of - /dev/mmcblk1p1as- Linux:- sfdisk --id /dev/mmcblk1 1 83- DO NOT REBOOT THE SYSTEM EVEN IF - SFDISKASKS YOU TO. REBOOT THE SYSTEM ONLY AFTER YOU PERFORMED ALL THE STEPS BELOW, OR YOU WILL BRICK YOUR DEVICE.- If you’re not sure whether you’d want to perform this step, skip ahead, it won’t hurt. - This mark is not used by the filesystem driver, it’s only a mark. This step is not necessary if you don’t mind - sfdisk -llist- /dev/mmcblk1p1as- W95 FAT32 (LBA).- This is what - sfdisk -lwould look like if you don’t perform this step:- Device Boot Start End Sectors Size Id Type /dev/mmcblk1p1 204800 466943 262144 128M c W95 FAT32 (LBA) /dev/mmcblk1p2 466944 15269887 14802944 7.1G 83 Linux- This is what it would look like if you do peform this step: - Device Boot Start End Sectors Size Id Type /dev/mmcblk1p1 204800 466943 262144 128M 83 Linux /dev/mmcblk1p2 466944 15269887 14802944 7.1G 83 Linux
- Remember to update filesystem type for /bootspecified in/etc/fstab.
Run reboot now, and now the device should be booted from the ext4 /boot partition:
[root@n1-box ~]# df -hT
Filesystem     Type      Size  Used Avail Use% Mounted on
/dev/mmcblk1p1 ext4      120M   32M   80M  30% /boot
/dev/mmcblk1p2 ext4      6.9G  800M  6.1G  11% /
...
thanks for the idea, you may want to fallback to fat, so it is able to boot future whatever distro.
https://github.com/cattyhouse/N1-install#ext4-on-boot