jffs2_tool 编译失败
configure: WARNING: cannot find ZLIB library required for mkfs programs
configure: mtd-utils can optionally be built without mkfs.ubifs
configure: mtd-utils can optionally be built without mkfs.jffs2
configure: error: missing one or more dependencies
Makefile:45: recipe for target '/root/hi3516/Hi3516CV500R001C02SPC011/01.software/board/Hi3516CV500_SDK_V2.0.1.1/osdrv/tools/pc/jffs2_tool/tmp/sbin/mkfs.jffs2' failed
make[1]: *** [/root/hi3516/Hi3516CV500R001C02SPC011/01.software/board/Hi3516CV500_SDK_V2.0.1.1/osdrv/tools/pc/jffs2_tool/tmp/sbin/mkfs.jffs2] Error 1
make[1]: Leaving directory '/root/hi3516/Hi3516CV500R001C02SPC011/01.software/board/Hi3516CV500_SDK_V2.0.1.1/osdrv/tools/pc/jffs2_tool'
Makefile:269: recipe for target 'hipctools' failed
make: *** [hipctools] Error 2
经过各种上网搜索,https://www.cnblogs.com/Ocean-Star/p/8902397.html , 提供了一种解决办法,先手工编译jffs2_tool,再将编译好的文件【mkfs.jffs2 、mkfs.ubifs 、ubinize】 手动拷贝到对应目录 ,再将osdrv目录下的Makefile涉及到jffs2_tool的部分注释掉
#make -C $(OSDRV_DIR)/tools/pc/jffs2_tool/
#cp $(OSDRV_DIR)/tools/pc/jffs2_tool/mkfs.jffs2 $(OSDRV_DIR)/pub/bin/pc
#cp $(OSDRV_DIR)/tools/pc/jffs2_tool/mkfs.ubifs $(OSDRV_DIR)/pub/bin/pc
#cp $(OSDRV_DIR)/tools/pc/jffs2_tool/ubinize $(OSDRV_DIR)/pub/bin/pc
经过上述操作之后,还是会报类似的错误,查看:$(OSDRV_DIR)/tools/pc/jffs2_tool/readme_cn.txt ,才发现根本原因在于编译mtd-utils会失败
#OSDRV_DIR 目录下面的Makefile 第310行,还有编译mtd-utils会失败
make -C $(OSDRV_DIR)/tools/board/mtd-utils/
cp $(OSDRV_DIR)/tools/board/mtd-utils/bin/* $(OSDRV_DIR)/pub/bin/$(PUB_BOARD)
【mtd-utils2.0.2】编译解决方案,亲测有效
sudo apt-get install zlib1g-dev liblzo2-dev uuid-dev pkg-config automake
然后再到$(OSDRV_DIR) 目录下面执行 make all 就可以了。