Changeset 28566


Ignore:
Timestamp:
2011-10-24T23:49:24+02:00 (6 years ago)
Author:
juhosg
Message:

package/u-boot-envtools: update to version 2011.06.

This updates uboot-envtools to the version which comes with U-Boot 2011.06.
The important novelity is that fw_setenv now supports batch processing, which
greatly improves sysupgrade of the ALL0258N as otherwise we would have to
overwrite uboot-env up to 8x in a single firmware upgrade.
Unfortunately, no newer version of the sources is available from Debian, so we
got to take it from the u-boot source which is kinda ugly...

Signed-off-by: Daniel Golle <dgolle@…>

Location:
trunk/package/uboot-envtools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/uboot-envtools/Makefile

    r21956 r28566  
    11# 
    2 # Copyright (C) 2006-2010 OpenWrt.org 
     2# Copyright (C) 2006-2011 OpenWrt.org 
    33# 
    44# This is free software, licensed under the GNU General Public License v2. 
     
    99 
    1010PKG_NAME:=uboot-envtools 
    11 PKG_VERSION:=20081215 
    12 PKG_RELEASE:=2 
     11PKG_DISTNAME:=u-boot 
     12PKG_VERSION:=2011.06 
     13PKG_RELEASE:=1 
    1314 
    14 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz 
    15 PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/u/uboot-envtools/ 
     15PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 
     16PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot 
     17PKG_MD5SUM:= 
    1618 
    1719include $(INCLUDE_DIR)/package.mk 
     20 
     21TAR_OPTIONS+= --strip-components=3 -C $(PKG_BUILD_DIR) $(PKG_DISTNAME)-$(PKG_VERSION)/tools/env 
    1822 
    1923define Package/uboot-envtools 
     
    3539endef 
    3640 
     41define Build/Prepare 
     42        mkdir -p $(PKG_BUILD_DIR) 
     43        tar xvjf $(DL_DIR)/$(PKG_SOURCE) --strip-components=2 -C $(PKG_BUILD_DIR) $(PKG_DISTNAME)-$(PKG_VERSION)/lib/crc32.c 
     44        $(call Build/Prepare/Default) 
     45endef 
     46 
    3747$(eval $(call BuildPackage,uboot-envtools)) 
  • trunk/package/uboot-envtools/patches/001-crc32_func_signature.patch

    r19999 r28566  
    11--- a/crc32.c 
    22+++ b/crc32.c 
    3 @@ -8,11 +8,7 @@ 
     3@@ -8,21 +8,16 @@ 
    44  * For conditions of distribution and use, see copyright notice in zlib.h 
    55  */ 
    66  
    7 -#ifndef USE_HOSTCC     /* Shut down "ANSI does not permit..." warnings */ 
     7-#ifndef USE_HOSTCC 
    88-#include <common.h> 
    9 -#else 
    10  #include <stdint.h> 
    119-#endif 
     10-#include <compiler.h> 
     11-#include <u-boot/crc.h> 
     12+#include <stdint.h> 
     13+#include <asm/byteorder.h> 
     14+ 
     15+#include "zlib.h" 
    1216  
    13  #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) 
    14  #include <watchdog.h> 
    15 @@ -136,7 +132,7 @@ local const uint32_t crc_table[256] = { 
     17-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) 
     18-#include <watchdog.h> 
     19-#endif 
     20-#include "u-boot/zlib.h" 
     21  
     22 #define local static 
     23 #define ZEXPORT        /* empty */ 
     24  
     25-#define tole(x) cpu_to_le32(x) 
     26+#define tole(x) __constant_cpu_to_le32(x) 
     27  
     28 #ifdef DYNAMIC_CRC_TABLE 
     29  
     30@@ -151,7 +146,7 @@ tole(0xb40bbe37L), tole(0xc30c8ea1L), to 
    1631  
    1732 #if 0 
     
    2237 const uint32_t * ZEXPORT get_crc_table() 
    2338 { 
    24 @@ -154,7 +150,7 @@ const uint32_t * ZEXPORT get_crc_table() 
    25  #define DO8(buf)  DO4(buf); DO4(buf); 
     39@@ -183,7 +178,7 @@ uint32_t ZEXPORT crc32_no_comp(uint32_t 
     40     if (crc_table_empty) 
     41       make_crc_table(); 
     42 #endif 
     43-    crc = cpu_to_le32(crc); 
     44+    crc = __cpu_to_le32(crc); 
     45     /* Align it */ 
     46     if (((long)b) & 3 && len) { 
     47         uint8_t *p = (uint8_t *)b; 
     48@@ -212,11 +207,11 @@ uint32_t ZEXPORT crc32_no_comp(uint32_t 
     49         } while (--len); 
     50     } 
    2651  
    27  /* ========================================================================= */ 
    28 -uint32_t ZEXPORT crc32 (uint32_t crc, const Bytef *buf, uInt len) 
    29 +uint32_t ZEXPORT uboot_crc32 (uint32_t crc, const Bytef *buf, uInt len) 
     52-    return le32_to_cpu(crc); 
     53+    return __le32_to_cpu(crc); 
     54 } 
     55 #undef DO_CRC 
     56  
     57-uint32_t ZEXPORT crc32 (uint32_t crc, const Bytef *p, uInt len) 
     58+uint32_t ZEXPORT uboot_crc32 (uint32_t crc, const Bytef *p, uInt len) 
    3059 { 
    31  #ifdef DYNAMIC_CRC_TABLE 
    32      if (crc_table_empty) 
    33 @@ -217,12 +213,12 @@ uint32_t ZEXPORT crc32_wd (uint32_t crc, 
     60      return crc32_no_comp(crc ^ 0xffffffffL, p, len) ^ 0xffffffffL; 
     61 } 
     62@@ -239,12 +234,12 @@ uint32_t ZEXPORT crc32_wd (uint32_t crc, 
    3463                chunk = end - curr; 
    3564                if (chunk > chunk_sz) 
     
    4877--- a/fw_env.c 
    4978+++ b/fw_env.c 
    50 @@ -216,9 +216,9 @@ static int parse_config (void); 
     79@@ -34,6 +34,7 @@ 
     80 #include <sys/ioctl.h> 
     81 #include <sys/stat.h> 
     82 #include <unistd.h> 
     83+#include <zlib.h> 
     84  
     85 #ifdef MTD_OLD 
     86 # include <stdint.h> 
     87@@ -210,13 +211,14 @@ static char default_environment[] = { 
     88 static int flash_io (int mode); 
     89 static char *envmatch (char * s1, char * s2); 
     90 static int parse_config (void); 
     91+uint32_t uboot_crc32 (uint32_t crc, const Bytef *p, uInt len); 
     92  
    5193 #if defined(CONFIG_FILE) 
    5294 static int get_config (char *); 
     
    60102        if (HaveRedundEnv) 
    61103                rc -= sizeof (char); 
    62 @@ -437,7 +437,7 @@ int fw_setenv (int argc, char *argv[]) 
     104@@ -346,7 +348,7 @@ int fw_env_close(void) 
    63105        /* 
    64106         * Update CRC 
    65107         */ 
    66 -       *environment.crc = crc32 (0, (uint8_t *) environment.data, ENV_SIZE); 
    67 +       *environment.crc = uboot_crc32 (0, (uint8_t *) environment.data, ENV_SIZE); 
     108-       *environment.crc = crc32(0, (uint8_t *) environment.data, ENV_SIZE); 
     109+       *environment.crc = uboot_crc32(0, (uint8_t *) environment.data, ENV_SIZE); 
    68110  
    69111        /* write environment back to flash */ 
    70         if (flash_io (O_RDWR)) { 
    71 @@ -627,7 +627,7 @@ static int flash_write_buf (int dev, int 
     112        if (flash_io(O_RDWR)) { 
     113@@ -802,7 +804,7 @@ static int flash_write_buf (int dev, int 
    72114                data = malloc (erase_len); 
    73115                if (!data) { 
     
    78120                        return -1; 
    79121                } 
    80 @@ -883,11 +883,11 @@ static char *envmatch (char * s1, char * 
    81  static int env_init (void) 
    82  { 
    83         int crc0, crc0_ok; 
    84 -       char flag0; 
    85 +       unsigned char flag0; 
    86         void *addr0; 
    87   
    88         int crc1, crc1_ok; 
    89 -       char flag1; 
    90 +       unsigned char flag1; 
    91         void *addr1; 
    92   
    93         struct env_image_single *single; 
    94 @@ -923,7 +923,7 @@ static int env_init (void) 
     122@@ -1107,7 +1109,7 @@ int fw_env_open(void) 
    95123        if (flash_io (O_RDONLY)) 
    96124                return -1; 
     
    101129        if (!HaveRedundEnv) { 
    102130                if (!crc0_ok) { 
    103 @@ -964,7 +964,7 @@ static int env_init (void) 
     131@@ -1151,7 +1153,7 @@ int fw_env_open(void) 
    104132                        return -1; 
    105133                } 
     
    110138                flag1 = redundant->flags; 
    111139  
    112 --- a/fw_env.h 
    113 +++ b/fw_env.h 
    114 @@ -47,8 +47,10 @@ 
    115         "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; "   \ 
    116         "bootm" 
    117   
    118 +# include <stdint.h> 
    119 + 
    120  extern int   fw_printenv(int argc, char *argv[]); 
    121  extern char *fw_getenv  (char *name); 
    122  extern int fw_setenv  (int argc, char *argv[]); 
    123   
    124 -extern unsigned        long  crc32      (unsigned long, const unsigned char *, unsigned); 
    125 +extern uint32_t  uboot_crc32 (uint32_t, const unsigned char *, unsigned); 
  • trunk/package/uboot-envtools/patches/002-makefile.patch

    r19999 r28566  
    11--- a/Makefile 
    22+++ b/Makefile 
    3 @@ -21,12 +21,10 @@ 
     3@@ -21,37 +21,16 @@ 
    44 # MA 02111-1307 USA 
    55 # 
     
    77-include $(TOPDIR)/config.mk 
    88- 
    9  SRCS   := $(obj)crc32.c  fw_env.c  fw_env_main.c 
     9-HOSTSRCS := $(obj)crc32.c  fw_env.c  fw_env_main.c 
     10+SRCS := crc32.c  fw_env.c  fw_env_main.c 
    1011 HEADERS        := fw_env.h 
    1112  
    12 -CPPFLAGS := -Wall -DUSE_HOSTCC -I$(SRCTREE)/include 
     13-# Compile for a hosted environment on the target 
     14-HOSTCPPFLAGS  = -idirafter $(SRCTREE)/include \ 
     15-               -idirafter $(OBJTREE)/include2 \ 
     16-               -idirafter $(OBJTREE)/include \ 
     17-               -DUSE_HOSTCC 
     18- 
     19-ifeq ($(MTD_VERSION),old) 
     20-HOSTCPPFLAGS += -DMTD_OLD 
     21-endif 
    1322+CPPFLAGS := -Wall $(CFLAGS) 
    1423  
    15  ifeq ($(MTD_VERSION),old) 
    16  CPPFLAGS += -DMTD_OLD 
    17 @@ -35,18 +33,7 @@ endif 
    1824 all:   $(obj)fw_printenv 
    1925  
    20  $(obj)fw_printenv:     $(SRCS) $(HEADERS) 
    21 -       $(CROSS_COMPILE)gcc $(CPPFLAGS) $(SRCS) -o $(obj)fw_printenv 
     26 # Some files complain if compiled with -pedantic, use HOSTCFLAGS_NOPED 
     27-$(obj)fw_printenv:     $(HOSTSRCS) $(HEADERS) 
     28-       $(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTLDFLAGS) -o $@ $(HOSTSRCS) 
     29+$(obj)fw_printenv:     $(SRCS) $(HEADERS) 
    2230+       $(CC) $(CPPFLAGS) $(SRCS) -o $(obj)fw_printenv 
    2331  
    2432 clean: 
    25         rm -f $(obj)fw_printenv $(obj)crc32.c 
     33-       rm -f $(obj)fw_printenv $(obj)crc32.c 
    2634- 
    2735-$(obj)crc32.c: 
    28 -       ln -s $(src)../../lib_generic/crc32.c $(obj)crc32.c 
     36-       ln -s $(src)../../lib/crc32.c $(obj)crc32.c 
    2937- 
    3038-######################################################################### 
     
    3543- 
    3644-######################################################################### 
     45+       rm -f $(obj)fw_printenv 
  • trunk/package/uboot-envtools/patches/003-nor-eraselen.patch

    r20062 r28566  
    11--- a/fw_env.c 
    22+++ b/fw_env.c 
    3 @@ -605,7 +605,10 @@ static int flash_write_buf (int dev, int 
    4         erase_offset = offset & ~(blocklen - 1); 
     3@@ -779,7 +779,10 @@ static int flash_write_buf (int dev, int 
     4        erase_offset = (offset / blocklen) * blocklen; 
    55  
    66        /* Maximum area we may use */ 
Note: See TracChangeset for help on using the changeset viewer.