[openwrt/openwrt] yafut: add a kernel update tool for MikroTik NAND

LEDE Commits lede-commits at lists.infradead.org
Tue Apr 18 04:53:18 PDT 2023


ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/27acf2413e91247e16e4f52c6008ec0f5a5cf4a6

commit 27acf2413e91247e16e4f52c6008ec0f5a5cf4a6
Author: Michał Kępień <openwrt at kempniu.pl>
AuthorDate: Fri Mar 31 12:40:31 2023 +0200

    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 at kempniu.pl>
---
 package/utils/yafut/Makefile | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

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))




More information about the lede-commits mailing list