diff options
Diffstat (limited to 'package/uboot-envtools/patches')
4 files changed, 45 insertions, 34 deletions
diff --git a/package/uboot-envtools/patches/001-crc32_func_signature.patch b/package/uboot-envtools/patches/001-crc32_func_signature.patch index da9742f1b..f68f29ea0 100644 --- a/package/uboot-envtools/patches/001-crc32_func_signature.patch +++ b/package/uboot-envtools/patches/001-crc32_func_signature.patch @@ -84,7 +84,7 @@ #ifdef MTD_OLD # include <stdint.h> -@@ -210,13 +211,14 @@ static char default_environment[] = { +@@ -212,13 +213,14 @@ static char default_environment[] = { static int flash_io (int mode); static char *envmatch (char * s1, char * s2); static int parse_config (void); @@ -101,7 +101,7 @@ if (HaveRedundEnv) rc -= sizeof (char); -@@ -346,7 +348,7 @@ int fw_env_close(void) +@@ -348,7 +350,7 @@ int fw_env_close(void) /* * Update CRC */ @@ -110,16 +110,7 @@ /* write environment back to flash */ if (flash_io(O_RDWR)) { -@@ -802,7 +804,7 @@ static int flash_write_buf (int dev, int - data = malloc (erase_len); - if (!data) { - fprintf (stderr, -- "Cannot malloc %u bytes: %s\n", -+ "Cannot malloc %zu bytes: %s\n", - erase_len, strerror (errno)); - return -1; - } -@@ -1107,7 +1109,7 @@ int fw_env_open(void) +@@ -1116,7 +1118,7 @@ int fw_env_open(void) if (flash_io (O_RDONLY)) return -1; @@ -128,7 +119,7 @@ crc0_ok = (crc0 == *environment.crc); if (!HaveRedundEnv) { if (!crc0_ok) { -@@ -1151,7 +1153,7 @@ int fw_env_open(void) +@@ -1160,7 +1162,7 @@ int fw_env_open(void) return -1; } diff --git a/package/uboot-envtools/patches/002-makefile.patch b/package/uboot-envtools/patches/002-makefile.patch index ddd08e19d..b18bff6e7 100644 --- a/package/uboot-envtools/patches/002-makefile.patch +++ b/package/uboot-envtools/patches/002-makefile.patch @@ -1,13 +1,13 @@ --- a/Makefile +++ b/Makefile -@@ -21,37 +21,16 @@ +@@ -21,34 +21,17 @@ # MA 02111-1307 USA # -include $(TOPDIR)/config.mk - --HOSTSRCS := $(obj)crc32.c fw_env.c fw_env_main.c -+SRCS := crc32.c fw_env.c fw_env_main.c +-HOSTSRCS := $(SRCTREE)/lib/crc32.c fw_env.c fw_env_main.c ++SRCS := crc32.c fw_env.c fw_env_main.c HEADERS := fw_env.h -# Compile for a hosted environment on the target @@ -19,27 +19,26 @@ -ifeq ($(MTD_VERSION),old) -HOSTCPPFLAGS += -DMTD_OLD -endif -+CPPFLAGS := -Wall $(CFLAGS) - - all: $(obj)fw_printenv - - # Some files complain if compiled with -pedantic, use HOSTCFLAGS_NOPED +- +-all: $(obj)fw_printenv +- +-# Some files complain if compiled with -pedantic, use HOSTCFLAGS_NOPED -$(obj)fw_printenv: $(HOSTSRCS) $(HEADERS) - $(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTLDFLAGS) -o $@ $(HOSTSRCS) -+$(obj)fw_printenv: $(SRCS) $(HEADERS) -+ $(CC) $(CPPFLAGS) $(SRCS) -o $(obj)fw_printenv ++CPPFLAGS := -Wall $(CFLAGS) + +-clean: +- rm -f $(obj)fw_printenv ++all: fw_printenv - clean: -- rm -f $(obj)fw_printenv $(obj)crc32.c -- --$(obj)crc32.c: -- ln -s $(src)../../lib/crc32.c $(obj)crc32.c -- -######################################################################### -- ++fw_printenv: $(SRCS) $(HEADERS) ++ $(CC) $(CPPFLAGS) $(SRCS) -o fw_printenv + -include $(TOPDIR)/rules.mk - -sinclude $(obj).depend -- --######################################################################### -+ rm -f $(obj)fw_printenv ++clean: ++ rm -f fw_printenv + + ######################################################################### diff --git a/package/uboot-envtools/patches/003-nor-eraselen.patch b/package/uboot-envtools/patches/003-nor-eraselen.patch index fd10fecbe..c6eb59a72 100644 --- a/package/uboot-envtools/patches/003-nor-eraselen.patch +++ b/package/uboot-envtools/patches/003-nor-eraselen.patch @@ -1,6 +1,6 @@ --- a/fw_env.c +++ b/fw_env.c -@@ -779,7 +779,10 @@ static int flash_write_buf (int dev, int +@@ -790,7 +790,10 @@ static int flash_write_buf (int dev, int erase_offset = (offset / blocklen) * blocklen; /* Maximum area we may use */ diff --git a/package/uboot-envtools/patches/004-allow_mac_change.patch b/package/uboot-envtools/patches/004-allow_mac_change.patch new file mode 100644 index 000000000..b7d600b69 --- /dev/null +++ b/package/uboot-envtools/patches/004-allow_mac_change.patch @@ -0,0 +1,21 @@ +--- a/fw_env.c ++++ b/fw_env.c +@@ -46,8 +46,6 @@ + + #include "fw_env.h" + +-#include <config.h> +- + #define WHITESPACE(c) ((c == '\t') || (c == ' ')) + + #define min(x, y) ({ \ +@@ -401,9 +399,7 @@ int fw_env_write(char *name, char *value + if ( + (strcmp(name, "serial#") == 0) || + ((strcmp(name, "ethaddr") == 0) +-#if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR) + && (strcmp(oldval, MK_STR(CONFIG_ETHADDR)) != 0) +-#endif /* CONFIG_OVERWRITE_ETHADDR_ONCE && CONFIG_ETHADDR */ + ) ) { + fprintf (stderr, "Can't overwrite \"%s\"\n", name); + errno = EROFS; |