Browse Source

Removed uboot-envtools and set libreCMC default version

risci_atom 9 years ago
parent
commit
095be00a37

+ 0 - 9
package/boot/uboot-envtools/Config.in

@@ -1,9 +0,0 @@
-config UBOOT_ENVTOOLS_UBI
-	bool "Support environment in UBI volume"
-	depends on PACKAGE_uboot-envtools
-	default n
-	help
-		Add support for reading and writing U-Boot environment
-		stored in UBI volume(s).
-
-		Increases binary size by about 8 kB

+ 0 - 110
package/boot/uboot-envtools/Makefile

@@ -1,110 +0,0 @@
-#
-# Copyright (C) 2006-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=uboot-envtools
-PKG_DISTNAME:=u-boot
-PKG_VERSION:=2014.10
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/u-boot-$(PKG_VERSION)
-PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=\
-	http://mirror2.openwrt.org/sources \
-	ftp://ftp.denx.de/pub/u-boot
-PKG_MD5SUM:=3ddcaee2f05b7c464778112ec83664b5
-
-PKG_BUILD_DEPENDS:=+fstools
-
-PKG_LICENSE:=GPL-2.0 GPL-2.0+
-PKG_LICENSE_FILES:=Licenses/README
-
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/uboot-envtools
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE:=read/modify U-Boot bootloader environment
-  URL:=http://www.denx.de/wiki/U-Boot
-endef
-
-define Package/uboot-envtools/description
- This package includes tools to read and modify U-Boot bootloader environment.
-endef
-
-define Package/uboot-envtools/config
-	source "$(SOURCE)/Config.in"
-endef
-
-define Build/Configure
-	touch $(PKG_BUILD_DIR)/include/config.mk
-	touch $(PKG_BUILD_DIR)/include/config.h
-endef
-
-TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR) \
-		CROSS_COMPILE="$(TARGET_CROSS)" \
-		TARGET_CFLAGS="$(TARGET_CFLAGS)" \
-		UBI="$(CONFIG_UBOOT_ENVTOOLS_UBI)" \
-		env
-endef
-
-define Package/uboot-envtools/conffiles
-/etc/config/ubootenv
-/etc/fw_env.config
-endef
-
-define Package/uboot-envtools/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin
-	ln -s fw_printenv $(1)/usr/sbin/fw_setenv
-	$(INSTALL_DIR) $(1)/lib
-	$(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
-ifneq ($(CONFIG_TARGET_ar71xx),)
-	$(INSTALL_DIR) $(1)/etc/uci-defaults
-	$(INSTALL_DATA) ./files/ar71xx $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_cns3xxx),)
-	$(INSTALL_DIR) $(1)/etc/uci-defaults
-	$(INSTALL_DATA) ./files/cns3xxx $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_imx6),)
-	$(INSTALL_DIR) $(1)/etc/uci-defaults
-	$(INSTALL_DATA) ./files/imx6 $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_kirkwood),)
-	$(INSTALL_DIR) $(1)/etc/uci-defaults
-	$(INSTALL_DATA) ./files/kirkwood $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_lantiq),)
-	$(INSTALL_DIR) $(1)/etc/uci-defaults
-	$(INSTALL_DATA) ./files/lantiq $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_mvebu),)
-	$(INSTALL_DIR) $(1)/etc/uci-defaults
-	$(INSTALL_BIN) ./files/mvebu $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_mxs),)
-	$(INSTALL_DIR) $(1)/etc/uci-defaults
-	$(INSTALL_BIN) ./files/mxs $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_oxnas),)
-	$(INSTALL_DIR) $(1)/etc/uci-defaults
-	$(INSTALL_BIN) ./files/oxnas $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-ifneq ($(CONFIG_TARGET_ramips),)
-	$(INSTALL_DIR) $(1)/etc/uci-defaults
-	$(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools
-endif
-endef
-
-$(eval $(call BuildPackage,uboot-envtools))

+ 0 - 55
package/boot/uboot-envtools/files/ar71xx

@@ -1,55 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2011-2014 OpenWrt.org
-#
-
-[ -e /etc/config/ubootenv ] && exit 0
-
-touch /etc/config/ubootenv
-
-. /lib/ar71xx.sh
-. /lib/uboot-envtools.sh
-. /lib/functions.sh
-
-board=$(ar71xx_board_name)
-
-case "$board" in
-all0258n | \
-cap4200ag | \
-carambola2 | \
-eap300v2 | \
-hornet-ub | \
-hornet-ub-x2 | \
-mr600 | \
-mr600v2 | \
-mr900 | \
-mr900v2 | \
-om5p | \
-tube2h | \
-wndr3700)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
-	;;
-nbg6716)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
-	;;
-alfa-ap96 | \
-all0315n | \
-om2p | \
-om2pv2 | \
-om2p-hs | \
-om2p-hsv2 | \
-om2p-lc)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000"
-	;;
-wzr-hp-ag300h)
-	ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000"
-	;;
-qihoo-c301)
-	ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000"
-	;;
-esac
-
-config_load ubootenv
-config_foreach ubootenv_add_app_config ubootenv
-
-exit 0

+ 0 - 28
package/boot/uboot-envtools/files/cns3xxx

@@ -1,28 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2013 OpenWrt.org
-#
-
-[ -e /etc/config/ubootenv ] && exit 0
-
-touch /etc/config/ubootenv
-
-. /lib/cns3xxx.sh
-. /lib/uboot-envtools.sh
-. /lib/functions.sh
-
-board=$(cns3xxx_board_name)
-
-case "$board" in
-laguna)
-	# Laguna uboot env size/erasesize vary depending on NOR vs SPI FLASH
-	size=$(grep mtd1 /proc/mtd | awk '{print $2}')
-	erasesize=$(grep mtd1 /proc/mtd | awk '{print $3}')
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x$size" "0x$erasesize"
-	;;
-esac
-
-config_load ubootenv
-config_foreach ubootenv_add_app_config ubootenv
-
-exit 0

+ 0 - 25
package/boot/uboot-envtools/files/imx6

@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2013-2014 OpenWrt.org
-#
-
-[ -e /etc/config/ubootenv ] && exit 0
-
-touch /etc/config/ubootenv
-
-. /lib/imx6.sh
-. /lib/uboot-envtools.sh
-. /lib/functions.sh
-
-board=$(imx6_board_name)
-
-case "$board" in
-"wandboard")
-	ubootenv_add_uci_config "/dev/mmcblk0" "0x60000" "0x2000" "0x2000"
-	;;
-esac
-
-config_load ubootenv
-config_foreach ubootenv_add_app_config ubootenv
-
-exit 0

+ 0 - 28
package/boot/uboot-envtools/files/kirkwood

@@ -1,28 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2012-2014 OpenWrt.org
-#
-
-[ -e /etc/config/ubootenv ] && exit 0
-
-touch /etc/config/ubootenv
-
-. /lib/kirkwood.sh
-. /lib/uboot-envtools.sh
-. /lib/functions.sh
-
-board=$(kirkwood_board_name)
-
-case "$board" in
-"ea3500" | \
-"ea4500" | \
-"ib62x0" | \
-"pogo_e02")
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
-	;;
-esac
-
-config_load ubootenv
-config_foreach ubootenv_add_app_config ubootenv
-
-exit 0

+ 0 - 28
package/boot/uboot-envtools/files/lantiq

@@ -1,28 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2012 OpenWrt.org
-#
-
-[ -e /etc/config/ubootenv ] && exit 0
-
-touch /etc/config/ubootenv
-
-. /lib/functions/lantiq.sh
-. /lib/uboot-envtools.sh
-. /lib/functions.sh
-
-board=$(lantiq_board_name)
-
-case "$board" in
-GIGASX76X)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1"
-	;;
-BTHOMEHUBV2B)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1"
-	;;
-esac
-
-config_load ubootenv
-config_foreach ubootenv_add_app_config ubootenv
-
-exit 0

+ 0 - 25
package/boot/uboot-envtools/files/mvebu

@@ -1,25 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-
-[ -e /etc/config/ubootenv ] && exit 0
-
-touch /etc/config/ubootenv
-
-. /lib/mvebu.sh
-. /lib/uboot-envtools.sh
-. /lib/functions.sh
-
-board=$(mvebu_board_name)
-
-case "$board" in
-"armada-xp-mamba")
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
-	;;
-esac
-
-config_load ubootenv
-config_foreach ubootenv_add_app_config ubootenv
-
-exit 0

+ 0 - 26
package/boot/uboot-envtools/files/mxs

@@ -1,26 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2013 OpenWrt.org
-#
-
-[ -e /etc/config/ubootenv ] && exit 0
-
-touch /etc/config/ubootenv
-
-. /lib/mxs.sh
-. /lib/uboot-envtools.sh
-. /lib/functions.sh
-
-board=$(mxs_board_name)
-
-case "$board" in
-duckbill)
-	ubootenv_add_uci_config "/dev/mmcblk0" "0x20000" "0x20000"
-	ubootenv_add_uci_config "/dev/mmcblk0" "0x40000" "0x20000"
-	;;
-esac
-
-config_load ubootenv
-config_foreach ubootenv_add_app_config ubootenv
-
-exit 0

+ 0 - 27
package/boot/uboot-envtools/files/oxnas

@@ -1,27 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2013 OpenWrt.org
-#
-
-[ -e /etc/config/ubootenv ] && exit 0
-
-touch /etc/config/ubootenv
-
-. /lib/oxnas.sh
-. /lib/uboot-envtools.sh
-. /lib/functions.sh
-
-board=$(oxnas_board_name)
-
-case "$board" in
-stg212 | \
-kd20)
-	ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x4000" "0x1F000" "1"
-	ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x4000" "0x1F000" "1"
-	;;
-esac
-
-config_load ubootenv
-config_foreach ubootenv_add_app_config ubootenv
-
-exit 0

+ 0 - 30
package/boot/uboot-envtools/files/ramips

@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2011-2012 OpenWrt.org
-#
-
-[ -e /etc/config/ubootenv ] && exit 0
-
-touch /etc/config/ubootenv
-
-. /lib/ramips.sh
-. /lib/uboot-envtools.sh
-. /lib/functions.sh
-
-board=$(ramips_board_name)
-
-case "$board" in
-all0239-3g | \
-all0256n | \
-all5002)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
-	;;
-br6425)
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
-	;;
-esac
-
-config_load ubootenv
-config_foreach ubootenv_add_app_config ubootenv
-
-exit 0

+ 0 - 36
package/boot/uboot-envtools/files/uboot-envtools.sh

@@ -1,36 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2011-2012 OpenWrt.org
-#
-
-ubootenv_add_uci_config() {
-	local dev=$1
-	local offset=$2
-	local envsize=$3
-	local secsize=$4
-	local numsec=$5
-	uci batch <<EOF
-add ubootenv ubootenv
-set ubootenv.@ubootenv[-1].dev='$dev'
-set ubootenv.@ubootenv[-1].offset='$offset'
-set ubootenv.@ubootenv[-1].envsize='$envsize'
-set ubootenv.@ubootenv[-1].secsize='$secsize'
-set ubootenv.@ubootenv[-1].numsec='$numsec'
-EOF
-	uci commit ubootenv
-}
-
-ubootenv_add_app_config() {
-	local dev
-	local offset
-	local envsize
-	local secsize
-	local numsec
-	config_get dev "$1" dev
-	config_get offset "$1" offset
-	config_get envsize "$1" envsize
-	config_get secsize "$1" secsize
-	config_get numsec "$1" numsec
-	echo "$dev $offset $envsize $secsize $numsec" >>/etc/fw_env.config
-}
-

+ 0 - 13
package/boot/uboot-envtools/patches/001-compile.patch

@@ -1,13 +0,0 @@
---- a/tools/env/Makefile
-+++ b/tools/env/Makefile
-@@ -10,6 +10,10 @@
- # with "CC" here for the maximum code reuse of scripts/Makefile.host.
- HOSTCC = $(CC)
- 
-+ifneq ($(TARGET_CFLAGS),)
-+HOSTCFLAGS = $(TARGET_CFLAGS)
-+endif
-+
- # Compile for a hosted environment on the target
- HOST_EXTRACFLAGS  = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
- 		-idirafter $(srctree)/tools/env \

+ 0 - 10
package/boot/uboot-envtools/patches/100-fw_env_gnu_source.patch

@@ -1,10 +0,0 @@
---- a/tools/env/fw_env.c
-+++ b/tools/env/fw_env.c
-@@ -8,6 +8,7 @@
-  * SPDX-License-Identifier:	GPL-2.0+
-  */
- 
-+#define _GNU_SOURCE
- #include <errno.h>
- #include <env_flags.h>
- #include <fcntl.h>

+ 0 - 161
package/boot/uboot-envtools/patches/300-support-env-in-ubivol-chardev.patch

@@ -1,161 +0,0 @@
-From 6e2630a0fc872d0db34157972f6dc3941f6d66dd Mon Sep 17 00:00:00 2001
-From: Daniel Golle <daniel@makrotopia.org>
-Date: Mon, 19 May 2014 21:38:01 +0200
-Subject: [PATCH] tools/env: add support for env in ubi volume chardev
-
-Signed-off-by: Daniel Golle <daniel@makrotopia.org>
----
- tools/env/Makefile |  5 ++++
- tools/env/fw_env.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++-------
- 2 files changed, 71 insertions(+), 10 deletions(-)
-
---- a/tools/env/Makefile
-+++ b/tools/env/Makefile
-@@ -24,6 +24,11 @@ ifeq ($(MTD_VERSION),old)
- HOST_EXTRACFLAGS += -DMTD_OLD
- endif
- 
-+ifeq ($(UBI),y)
-+HOST_EXTRACFLAGS += -DUBI
-+HOST_LOADLIBES = "-Wl,--gc-sections,-lubi-utils"
-+endif
-+
- always := fw_printenv
- hostprogs-y := fw_printenv
- 
---- a/tools/env/fw_env.c
-+++ b/tools/env/fw_env.c
-@@ -30,6 +30,9 @@
- # include <mtd/mtd-user.h>
- #endif
- 
-+#ifdef UBI
-+# include <libubi.h>
-+#endif
- #include "fw_env.h"
- 
- #include <aes.h>
-@@ -810,6 +813,11 @@ static int flash_write_buf (int dev, int
- 	off_t top_of_range;	/* end of the last block we may use */
- 	loff_t blockstart;	/* running start of the current block -
- 				   MEMGETBADBLOCK needs 64 bits */
-+#ifdef UBI
-+	libubi_t *libubi = NULL;/* pointer to libubi struct */
-+#else
-+	void *libubi = NULL;
-+#endif
- 	int rc;
- 
- 	/*
-@@ -915,7 +923,30 @@ static int flash_write_buf (int dev, int
- 			continue;
- 		}
- 
--		if (mtd_type != MTD_ABSENT) {
-+#ifdef UBI
-+		if (mtd_type == MTD_UBIVOLUME) {
-+			struct ubi_vol_info volinfo;
-+			libubi = libubi_open();
-+			if (libubi)
-+				rc = ubi_get_vol_info(libubi,
-+					DEVNAME(dev_current), &volinfo);
-+			if (libubi && !rc) {
-+				erasesize = volinfo.leb_size;
-+				int leb = blockstart / erasesize;
-+				if (volinfo.type != UBI_STATIC_VOLUME)
-+					rc = ubi_leb_change_start(libubi, fd,
-+						leb, erasesize);
-+				else
-+					rc = ubi_update_start(libubi, fd,
-+						erasesize);
-+			}
-+			if (libubi && rc) {
-+				libubi_close(libubi);
-+				libubi = NULL;
-+			}
-+		}
-+#endif
-+		if (!libubi && mtd_type != MTD_ABSENT) {
- 			erase.start = blockstart;
- 			ioctl(fd, MEMUNLOCK, &erase);
- 			/* These do not need an explicit erase cycle */
-@@ -932,7 +963,8 @@ static int flash_write_buf (int dev, int
- 			fprintf (stderr,
- 				 "Seek error on %s: %s\n",
- 				 DEVNAME (dev), strerror (errno));
--			return -1;
-+			processed = -1;
-+			goto out;
- 		}
- 
- #ifdef DEBUG
-@@ -942,10 +974,11 @@ static int flash_write_buf (int dev, int
- 		if (write (fd, data + processed, erasesize) != erasesize) {
- 			fprintf (stderr, "Write error on %s: %s\n",
- 				 DEVNAME (dev), strerror (errno));
--			return -1;
-+			processed = -1;
-+			goto out;
- 		}
- 
--		if (mtd_type != MTD_ABSENT)
-+		if (!libubi && mtd_type != MTD_ABSENT)
- 			ioctl(fd, MEMLOCK, &erase);
- 
- 		processed  += erasesize;
-@@ -956,6 +989,11 @@ static int flash_write_buf (int dev, int
- 	if (write_total > count)
- 		free (data);
- 
-+out:
-+#ifdef UBI
-+	if (libubi)
-+		libubi_close(libubi);
-+#endif
- 	return processed;
- }
- 
-@@ -1067,12 +1105,8 @@ static int flash_read (int fd)
- 
- 	if (S_ISCHR(st.st_mode)) {
- 		rc = ioctl(fd, MEMGETINFO, &mtdinfo);
--		if (rc < 0) {
--			fprintf(stderr, "Cannot get MTD information for %s\n",
--				DEVNAME(dev_current));
--			return -1;
--		}
--		if (mtdinfo.type != MTD_NORFLASH &&
-+		if (!rc &&
-+		    mtdinfo.type != MTD_NORFLASH &&
- 		    mtdinfo.type != MTD_NANDFLASH &&
- 		    mtdinfo.type != MTD_DATAFLASH &&
- 		    mtdinfo.type != MTD_UBIVOLUME) {
-@@ -1080,6 +1114,28 @@ static int flash_read (int fd)
- 				 mtdinfo.type, DEVNAME(dev_current));
- 			return -1;
- 		}
-+#ifdef UBI
-+		if (rc) {
-+			libubi_t *libubi;
-+			struct ubi_vol_info volinfo;
-+			libubi = libubi_open();
-+			if (!libubi)
-+				return -ENOMEM;
-+
-+			rc = ubi_get_vol_info(libubi, DEVNAME(dev_current),
-+						&volinfo);
-+			if (rc) {
-+				libubi_close(libubi);
-+				return -ENODEV;
-+			}
-+			memset(&mtdinfo, 0, sizeof(mtdinfo));
-+			mtdinfo.type = MTD_UBIVOLUME;
-+			mtdinfo.size = volinfo.data_bytes;
-+			mtdinfo.erasesize = volinfo.leb_size;
-+			mtdinfo.writesize = volinfo.leb_size;
-+			libubi_close(libubi);
-+		}
-+#endif
- 	} else {
- 		memset(&mtdinfo, 0, sizeof(mtdinfo));
- 		mtdinfo.type = MTD_ABSENT;