aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Kępień <openwrt@kempniu.pl>2023-03-31 12:40:31 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2023-04-18 13:53:04 +0200
commit27acf2413e91247e16e4f52c6008ec0f5a5cf4a6 (patch)
treeb262a583237cbf15e8c147afce2072bd2af85183
parentfa4dc86e980851f01e243f94ffe7e0a928f6c16d (diff)
downloadupstream-27acf2413e91247e16e4f52c6008ec0f5a5cf4a6.tar.gz
upstream-27acf2413e91247e16e4f52c6008ec0f5a5cf4a6.tar.bz2
upstream-27acf2413e91247e16e4f52c6008ec0f5a5cf4a6.zip
yafut: add a kernel update tool for MikroTik NAND
Commit 9d96b6fb72 ("ath79/mikrotik: disable building NAND images") disabled building images for MikroTik devices with NAND flash due to a less than satisfactory method used for updating the kernel on those devices back then. To address the problem, add support for updating the kernel on MikroTik devices with NAND flash using a new tool, Yafut, which enables copying files from/to Yaffs file systems even if the kernel does not have native support for the Yaffs file system compiled in. Instead of erasing the entire NAND partition holding the kernel during every system upgrade (which is what the previously-used approach employing kernel2minor involved), Yafut preserves the Yaffs filesystem present on that partition and only replaces the kernel executable. This allows bad block information to be preserved across sysupgrade runs and also enables wear leveling on the NAND partition holding the kernel. Yafut does not rely on kernel2minor in any way and intends to eventually supersede the latter for NAND devices. Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
-rw-r--r--package/utils/yafut/Makefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/package/utils/yafut/Makefile b/package/utils/yafut/Makefile
new file mode 100644
index 0000000000..fe27db97d2
--- /dev/null
+++ b/package/utils/yafut/Makefile
@@ -0,0 +1,35 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=yafut
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL=https://github.com/kempniu/yafut.git
+PKG_SOURCE_DATE:=2023-03-31
+PKG_SOURCE_VERSION:=16435e89d449f953712983315e1a89cdb678620d
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+CMAKE_INSTALL:=1
+
+define Package/yafut
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Yet Another File UTility
+ DEPENDS:=@NAND_SUPPORT
+endef
+
+define Package/yafut/description
+ A program for copying files from/to Yaffs file systems from userspace.
+endef
+
+define Package/yafut/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/yafut $(1)/usr/bin
+endef
+
+$(eval $(call BuildPackage,yafut))