[source] tools: add kernel2minor utility for Mikrotik devices

LEDE Commits lede-commits at lists.infradead.org
Tue Jul 5 23:56:41 PDT 2016


blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/?p=source.git;a=commitdiff;h=17ee6bb8f344dd1db027186de272badb6ba2020b

commit 17ee6bb8f344dd1db027186de272badb6ba2020b
Author: Sergey Sergeev <adron at yapic.net>
AuthorDate: Tue Jun 28 14:55:12 2016 +0300

    tools: add kernel2minor utility for Mikrotik devices
    
    This patch adds support of Mikrotik yaffs2 filesystem image for kernel file
    and tools/kernel2minor package.
    We neede this to boot kernel through RouterBoot on new Mikrotik NOR flash devices.
    
    Signed-off-by: Sergey Sergeev <adron at yapic.net>
---
 scripts/target-metadata.pl             |  1 +
 target/Config.in                       |  3 +++
 target/linux/ar71xx/mikrotik/target.mk |  4 ++--
 tools/Makefile                         |  1 +
 tools/kernel2minor/Makefile            | 31 +++++++++++++++++++++++++++++++
 5 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl
index ea6462c..ca9940e 100755
--- a/scripts/target-metadata.pl
+++ b/scripts/target-metadata.pl
@@ -27,6 +27,7 @@ sub target_config_features(@) {
 		/ext4/ and $ret .= "\tselect USES_EXT4\n";
 		/targz/ and $ret .= "\tselect USES_TARGZ\n";
 		/cpiogz/ and $ret .= "\tselect USES_CPIOGZ\n";
+		/minor/ and $ret .= "\tselect USES_MINOR\n";
 		/ubifs/ and $ret .= "\tselect USES_UBIFS\n";
 		/fpu/ and $ret .= "\tselect HAS_FPU\n";
 		/spe_fpu/ and $ret .= "\tselect HAS_SPE_FPU\n";
diff --git a/target/Config.in b/target/Config.in
index 843fbee..6a29d53 100644
--- a/target/Config.in
+++ b/target/Config.in
@@ -63,6 +63,9 @@ config USES_TARGZ
 config USES_CPIOGZ
 	bool
 
+config USES_MINOR
+	bool
+
 config USES_UBIFS
 	bool
 	select NAND_SUPPORT
diff --git a/target/linux/ar71xx/mikrotik/target.mk b/target/linux/ar71xx/mikrotik/target.mk
index b2fb0df..cb2447a 100644
--- a/target/linux/ar71xx/mikrotik/target.mk
+++ b/target/linux/ar71xx/mikrotik/target.mk
@@ -1,5 +1,5 @@
-BOARDNAME:=Mikrotik devices with NAND flash
-FEATURES += targz ramdisk
+BOARDNAME:=Mikrotik devices with NAND/NOR flash
+FEATURES += targz ramdisk minor
 
 define Target/Description
 	Build firmware images for Atheros AR71xx/AR913x based Mikrotik boards.
diff --git a/tools/Makefile b/tools/Makefile
index c3476cf..179306d 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -38,6 +38,7 @@ tools-$(CONFIG_TARGET_x86) += qemu
 tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
 tools-$(CONFIG_TARGET_brcm2708)$(CONFIG_TARGET_sunxi)$(CONFIG_TARGET_mxs)$(CONFIG_TARGET_omap) += mtools dosfstools
 tools-$(CONFIG_TARGET_ar71xx) += lzma-old squashfs
+tools-$(CONFIG_USES_MINOR) += kernel2minor
 tools-y += lzma squashfs4
 tools-$(BUILD_B43_TOOLS) += b43-tools
 tools-$(BUILD_PPL_CLOOG) += ppl cloog
diff --git a/tools/kernel2minor/Makefile b/tools/kernel2minor/Makefile
new file mode 100644
index 0000000..0db9959
--- /dev/null
+++ b/tools/kernel2minor/Makefile
@@ -0,0 +1,31 @@
+#
+# Copyright (C) 2016 adron at yapic.net
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=kernel2minor
+PKG_VERSION:=0.22
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/adron-s/kernel2minor.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=0587740de3e398dbe89d965334c492609cb9739d
+
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Install
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/kernel2minor $(STAGING_DIR_HOST)/bin/
+endef
+
+define Host/Clean
+	rm -f $(STAGING_DIR_HOST)/bin/kernel2minor
+endef
+
+$(eval $(call HostBuild))



More information about the lede-commits mailing list