--- uboot-envtools-20081215.orig/debian/compat
+++ uboot-envtools-20081215/debian/compat
@@ -0,0 +1 @@
+6
--- uboot-envtools-20081215.orig/debian/NEWS
+++ uboot-envtools-20081215/debian/NEWS
@@ -0,0 +1,8 @@
+uboot-envtools (20081215-1) unstable; urgency=low
+
+ [ Luca Capello ]
+ * With this release /etc/fw_env.config requires a fifth parameter
+ called "Number of sectors". For a better explanation, please
+ check /usr/share/doc/uboot-envtools/README.
+
+ -- Per Andersson <avtobiff@gmail.com> Sat, 07 Mar 2009 18:01:31 +0000
--- uboot-envtools-20081215.orig/debian/changelog
+++ uboot-envtools-20081215/debian/changelog
@@ -0,0 +1,74 @@
+uboot-envtools (20081215-2) unstable; urgency=low
+
+ * debian/control:
+ + Changed maintainer to pkg-fso-maint.
+ + Added myself as uploader.
+ + Bumped standards version to 3.8.1 (no changes necessary).
+ + Added Vcs-Git field (pkg-fso).
+ * debian/uboot-envtools-examples:
+ + Use debhelper to install examples.
+ * debian/uboot-envtools-examples/qnap_ts119-219.config:
+ + new file, thanks Martin Michlmayr (Closes: #529489).
+
+ -- Per Andersson <avtobiff@gmail.com> Mon, 27 Jul 2009 00:12:34 +0200
+
+uboot-envtools (20081215-1) unstable; urgency=low
+
+ [ Luca Capello ]
+ * New Git checkout (22525779cb51f1bbe4e96fea7b778de1935a5a69):
+ + add NAND support (Closes: #512589).
+ * debian/NEWS:
+ + explain the new parameter in /etc/fw_env.config.
+ * debian/uboot-envtools-examples/openmoko_gta01.config: new file.
+ * debian/uboot-envtools-examples/openmoko_gta02.config: new file.
+ * debian/uboot-envtools-examples/qnap_ts101.config:
+ + add newline at EOF.
+
+ -- Per Andersson <avtobiff@gmail.com> Sat, 07 Mar 2009 02:41:15 +0000
+
+uboot-envtools (20080520-5) unstable; urgency=low
+
+ * Added config file examples for QNAP TS-101 and TS-109/209, thanks to
+ Øyvind Repvik.
+ * Added config file examples for lsmipsel (LS2) and lsppchg.
+
+ -- Per Andersson <avtobiff@gmail.com> Sat, 16 Aug 2008 19:45:41 +0200
+
+uboot-envtools (20080520-4) unstable; urgency=low
+
+ * Changed the string "Das U-Boot" to simly "U-Boot" everywhere it existed,
+ this conforms to upstreams recommended naming policy.
+ * Removed config file from package and added it and example configuration
+ files in /usr/share/doc/uboot-envtools/examples/.
+
+ -- Per Andersson <avtobiff@gmail.com> Fri, 08 Aug 2008 02:20:03 +0200
+
+uboot-envtools (20080520-3) unstable; urgency=low
+
+ * Removed unnecessary version specification on build-dependencies.
+ * Changed the Homepage: entry in debian/control to point to Das U-Boot's
+ homepage.
+
+ -- Per Andersson <avtobiff@gmail.com> Thu, 07 Aug 2008 02:17:15 +0200
+
+uboot-envtools (20080520-2) unstable; urgency=low
+
+ * Uncommented dh_installman in debian/rules so man pages will be installed
+ and added dh_installchangelogs.
+ * Added formatting to n in section n-flag in fw_printenv.8 and removed note
+ about the man pages being written for Debian from the man pages.
+ * Changed Priority: to optional.
+ * Fixed typo of definitely in README.Debian.
+
+ -- Per Andersson <avtobiff@gmail.com> Wed, 06 Aug 2008 14:31:58 +0200
+
+uboot-envtools (20080520-1) unstable; urgency=low
+
+ * Initial release (Closes: #493716).
+ * Patched crc32.c, changed function signature of crc32() to comply with
+ definition in zlib.h.
+ * Patched Makefile to better suit Debian packaging.
+ * Added note about configuration file (/etc/fw_env.config) in README.Debian.
+ * Wrote man pages for fw_printenv(8) and fw_setenv(8).
+
+ -- Per Andersson <avtobiff@gmail.com> Mon, 04 Aug 2008 16:13:02 +0200
--- uboot-envtools-20081215.orig/debian/control
+++ uboot-envtools-20081215/debian/control
@@ -0,0 +1,17 @@
+Source: uboot-envtools
+Section: utils
+Priority: optional
+Maintainer: Debian freesmartphone.org Team <pkg-fso-maint@lists.alioth.debian.org>
+Uploaders: Per Andersson <avtobiff@gmail.com>
+Build-Depends: debhelper (>= 6), quilt, zlib1g-dev
+Standards-Version: 3.8.1
+Homepage: http://www.denx.de/wiki/U-Boot/WebHome
+Vcs-Git: git://git.debian.org/git/pkg-fso/uboot-envtools.git
+Vcs-Browser: http://git.debian.org/?p=pkg-fso/uboot-envtools.git;a=summary
+
+Package: uboot-envtools
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: read/modify the environment for the bootloader U-Boot
+ This package includes tools to read and modify the environment for the
+ bootloader U-Boot.
--- uboot-envtools-20081215.orig/debian/README.Debian
+++ uboot-envtools-20081215/debian/README.Debian
@@ -0,0 +1,16 @@
+uboot-envtools for Debian GNU/Linux
+-----------------------------------
+
+Configuration
+-------------
+The configuration file is /etc/fw_env.config. Since there are a lot of
+different configuration alternatives depending on device no configuration
+file is distributed.
+
+The default upstream configuration example file and example configuration
+files for different devices are found in
+/usr/share/doc/uboot-envtools/examples/.
+
+
+--
+Per Andersson <avtobiff@gmail.com> Fri, 08 Aug 2008 02:19:46 +0200
--- uboot-envtools-20081215.orig/debian/manpages
+++ uboot-envtools-20081215/debian/manpages
@@ -0,0 +1,2 @@
+debian/fw_printenv.8
+debian/fw_setenv.8
--- uboot-envtools-20081215.orig/debian/fw_setenv.8
+++ uboot-envtools-20081215/debian/fw_setenv.8
@@ -0,0 +1,27 @@
+.\" Copyright © 2008 Per Andersson <avtobiff@gmail.com>
+.\" This man page is covered by the GNU General Public License (GPLv2 or higher).
+.TH fw_setenv 8 "August 2008" "Debian Project" ""
+
+.SH NAME
+fw_setenv \- Tool for modifying the environment for the bootloader U\-Boot
+
+.SH SYNOPSIS
+fw_setenv \fIname\fP [ \fIvalue\fP ]
+
+.SH DESCRIPTION
+\fIfw_setenv\fP is a simple tool for modifying either the environment for the
+bootloader U-Boot. If the variable already is set in the environment it is
+updated, otherwise it is created and set. If only one argument is given,
+variable name, the corresponding variable is deleted.
+
+.SH FILES
+.IP \fB/etc/fw_env.config\fP
+Configuration file for fw_setenv.
+
+.SH SEE ALSO
+fw_printenv(8)
+
+.SH AUTHOR
+Wolfgang Denk <wd@denx.de>
+.PP
+This manual page was written by Per Andersson <avtobiff@gmail.com>
--- uboot-envtools-20081215.orig/debian/examples
+++ uboot-envtools-20081215/debian/examples
@@ -0,0 +1,2 @@
+fw_env.config
+debian/uboot-envtools-examples/*
--- uboot-envtools-20081215.orig/debian/copyright
+++ uboot-envtools-20081215/debian/copyright
@@ -0,0 +1,34 @@
+The upstream sources were downloaded from
+http://git.denx.de/?p=u-boot.git;a=tree;f=tools/env;hb=HEAD
+
+Files: crc32.c
+Copyright: © 1995-1998 Jean-loup Gailly and Mark Adler
+License: other
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+ .
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+ .
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+ .
+ Jean-loup Gailly Mark Adler
+ gzip@prep.ai.mit.edu madler@alumni.caltech.edu
+
+Files: fw_env.c, fw_env.h, fw_env_main.c
+Copyright: 2000-2008 Wolfgang Denk, DENX Software Engineering, wd@denx.de
+License: GPL-2+
+ On Debian systems, the complete text of the GPL can be found in
+ /usr/share/common-licenses/GPL.
+
+Files: debian/*
+Copyright: © 2008 Per Andersson <avtobiff@gmail.com>
+License: GPL-2+
--- uboot-envtools-20081215.orig/debian/dirs
+++ uboot-envtools-20081215/debian/dirs
@@ -0,0 +1,2 @@
+usr/sbin
+usr/share/doc/uboot-envtools/examples
--- uboot-envtools-20081215.orig/debian/rules
+++ uboot-envtools-20081215/debian/rules
@@ -0,0 +1,63 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+include /usr/share/quilt/quilt.make
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp $(QUILT_STAMPFN)
+ dh_testdir
+ $(MAKE)
+
+ touch $@
+
+clean: unpatch
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+ rm -f fw_printenv *.o
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+ # Make fw_setenv symlink
+ ln -fs fw_printenv debian/uboot-envtools/usr/sbin/fw_setenv
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs README
+ dh_installexamples
+ dh_install
+ dh_installman
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- uboot-envtools-20081215.orig/debian/fw_printenv.8
+++ uboot-envtools-20081215/debian/fw_printenv.8
@@ -0,0 +1,31 @@
+.\" Copyright © 2008 Per Andersson <avtobiff@gmail.com>
+.\" This man page is covered by the GNU General Public License (GPLv2 or higher).
+.TH fw_printenv 8 "August 2008" "Debian Project" ""
+
+.SH NAME
+fw_printenv \- Tool for printing environment for the bootloader U-Boot
+
+.SH SYNOPSIS
+fw_printenv [ \fB\-n\fP \fIname\fP ] [ \fIname\fP \fI...\fP ]
+
+.SH DESCRIPTION
+\fIfw_printenv\fP is a simple tool for printing the environment for the
+bootloader U-Boot. All environment variables matching the names given as
+arguments are shown. If \fIfw_printenv\fP is called without any arguments the
+entire environment is printed.
+
+.SH OPTIONS
+.IP \fB\-n\fP
+If the \fBn\fP flag is set \fIfw_printenv\fP only prints the value of the supplied variable \fIname\fP.
+
+.SH FILES
+.IP \fB/etc/fw_env.config\fP
+Configuration file for fw_printenv.
+
+.SH SEE ALSO
+fw_setenv(8)
+
+.SH AUTHOR
+Wolfgang Denk <wd@denx.de>
+.PP
+This manual page was written by Per Andersson <avtobiff@gmail.com>
--- uboot-envtools-20081215.orig/debian/install
+++ uboot-envtools-20081215/debian/install
@@ -0,0 +1 @@
+fw_printenv usr/sbin
--- uboot-envtools-20081215.orig/debian/TODO
+++ uboot-envtools-20081215/debian/TODO
@@ -0,0 +1,6 @@
+* Use debconf to select /etc/fw_env.config from examples.
+* Spawn editor to edit environment. (Avoids problem with escaping
+ characters on the commandline.)
+* Keep order of entries
+* Smash together with uboot-mkimage, possibly use crc32.c from zlib1g-dev.
+* change to correct priority (utils - optional?)
--- uboot-envtools-20081215.orig/debian/docs
+++ uboot-envtools-20081215/debian/docs
@@ -0,0 +1 @@
+README
--- uboot-envtools-20081215.orig/debian/patches/series
+++ uboot-envtools-20081215/debian/patches/series
@@ -0,0 +1,2 @@
+makefile.patch
+crc32-function-signature.patch
--- uboot-envtools-20081215.orig/debian/patches/makefile.patch
+++ uboot-envtools-20081215/debian/patches/makefile.patch
@@ -0,0 +1,33 @@
+Index: uboot-envtools-20080520/Makefile
+===================================================================
+--- uboot-envtools-20080520.orig/Makefile 2008-08-03 15:50:27.000000000 +0200
++++ uboot-envtools-20080520/Makefile 2008-08-03 15:51:59.000000000 +0200
+@@ -21,12 +21,10 @@
+ # MA 02111-1307 USA
+ #
+
+-include $(TOPDIR)/config.mk
+-
+ SRCS := $(obj)crc32.c fw_env.c fw_env_main.c
+ HEADERS := fw_env.h
+
+-CPPFLAGS := -Wall -DUSE_HOSTCC -I$(SRCTREE)/include
++CPPFLAGS := -Wall -DUSE_HOSTCC -I/usr/include
+
+ ifeq ($(MTD_VERSION),old)
+ CPPFLAGS += -DMTD_OLD
+@@ -39,14 +37,3 @@
+
+ clean:
+ rm -f $(obj)fw_printenv $(obj)crc32.c
+-
+-$(obj)crc32.c:
+- ln -s $(src)../../lib_generic/crc32.c $(obj)crc32.c
+-
+-#########################################################################
+-
+-include $(TOPDIR)/rules.mk
+-
+-sinclude $(obj).depend
+-
+-#########################################################################
--- uboot-envtools-20081215.orig/debian/patches/crc32-function-signature.patch
+++ uboot-envtools-20081215/debian/patches/crc32-function-signature.patch
@@ -0,0 +1,13 @@
+Index: uboot-envtools-20080520/crc32.c
+===================================================================
+--- uboot-envtools-20080520.orig/crc32.c 2008-08-03 16:02:43.000000000 +0200
++++ uboot-envtools-20080520/crc32.c 2008-08-03 16:03:25.000000000 +0200
+@@ -154,7 +154,7 @@
+ #define DO8(buf) DO4(buf); DO4(buf);
+
+ /* ========================================================================= */
+-uint32_t ZEXPORT crc32 (uint32_t crc, const Bytef *buf, uInt len)
++uLong ZEXPORT crc32 (uLong crc, const Bytef *buf, uInt len)
+ {
+ #ifdef DYNAMIC_CRC_TABLE
+ if (crc_table_empty)
--- uboot-envtools-20081215.orig/debian/uboot-envtools-examples/openmoko_gta01.config
+++ uboot-envtools-20081215/debian/uboot-envtools-examples/openmoko_gta01.config
@@ -0,0 +1,7 @@
+# Configuration file for fw_(printenv/saveenv) utility.
+# Up to two entries are valid, in this case the redundand
+# environment sector is assumed present.
+# Notice, that the "Number of sectors" is ignored on NOR.
+
+# MTD device name Device offset Env. size Flash sector size Number of sectors
+/dev/mtd1 0x0000 0x4000 0x4000 2
--- uboot-envtools-20081215.orig/debian/uboot-envtools-examples/kurobox_pro.config
+++ uboot-envtools-20081215/debian/uboot-envtools-examples/kurobox_pro.config
@@ -0,0 +1,6 @@
+# Configuration file for fw_(printenv/saveenv) utility.
+# Up to two entries are valid, in this case the redundant
+# environment sector is assumed present.
+
+# MTD device name Device offset Env. size Flash sector size
+/dev/mtd0 0x3F000 0x1000 0x1000
--- uboot-envtools-20081215.orig/debian/uboot-envtools-examples/qnap_ts101.config
+++ uboot-envtools-20081215/debian/uboot-envtools-examples/qnap_ts101.config
@@ -0,0 +1,15 @@
+# Configuration file for fw_(printenv/saveenv) utility.
+# Up to two entries are valid, in this case the redundand
+# environment sector is assumed present.
+
+# MTD device name Device offset Env. size Flash sector size
+
+# Primary U-Boot environment. You shouldn't need to touch this. If you touch this,
+# you should be *very* sure about what you're doing if you don't have a serial
+# cable attached!
+# /dev/mtd4 0x00000 0x20000 0x20000
+
+# Secondary U-Boot environment. This is a *bit* more safe to modify, but can easily
+# render your turbostation unbootable!
+
+/dev/mtd5 0x00000 0x20000 0x20000
--- uboot-envtools-20081215.orig/debian/uboot-envtools-examples/linkstation_pro_live.config
+++ uboot-envtools-20081215/debian/uboot-envtools-examples/linkstation_pro_live.config
@@ -0,0 +1,6 @@
+# Configuration file for fw_(printenv/saveenv) utility.
+# Up to two entries are valid, in this case the redundant
+# environment sector is assumed present.
+
+# MTD device name Device offset Env. size Flash sector size
+/dev/mtd0 0x3F000 0x1000 0x1000
--- uboot-envtools-20081215.orig/debian/uboot-envtools-examples/lsppchg.config
+++ uboot-envtools-20081215/debian/uboot-envtools-examples/lsppchg.config
@@ -0,0 +1,6 @@
+# Configuration file for fw_(printenv/saveenv) utility.
+# Up to two entries are valid, in this case the redundant
+# environment sector is assumed present.
+
+# MTD device name Device offset Env. size Flash sector size
+/dev/mtd4 0x360000 0x10000 0x10000
--- uboot-envtools-20081215.orig/debian/uboot-envtools-examples/lsmipsel.config
+++ uboot-envtools-20081215/debian/uboot-envtools-examples/lsmipsel.config
@@ -0,0 +1,6 @@
+# Configuration file for fw_(printenv/saveenv) utility.
+# Up to two entries are valid, in this case the redundant
+# environment sector is assumed present.
+
+# MTD device name Device offset Env. size Flash sector size
+/dev/mtd3 0x30000 0x10000 0x10000
--- uboot-envtools-20081215.orig/debian/uboot-envtools-examples/qnap_ts109-209.config
+++ uboot-envtools-20081215/debian/uboot-envtools-examples/qnap_ts109-209.config
@@ -0,0 +1,6 @@
+# Configuration file for fw_(printenv/saveenv) utility.
+# Up to two entries are valid, in this case the redundant
+# environment sector is assumed present.
+
+# MTD device name Device offset Env. size Flash sector size
+/dev/mtd4 0x0000 0x20000 0x20000
--- uboot-envtools-20081215.orig/debian/uboot-envtools-examples/qnap_ts119-219.config
+++ uboot-envtools-20081215/debian/uboot-envtools-examples/qnap_ts119-219.config
@@ -0,0 +1,5 @@
+# Configuration file for fw_(printenv/saveenv) utility for
+# QNAP TS-119, TS-219 and TS-219P.
+
+# MTD device name Device offset Env. size Flash sector size
+/dev/mtd4 0x0000 0x1000 0x40000
--- uboot-envtools-20081215.orig/debian/uboot-envtools-examples/openmoko_gta02.config
+++ uboot-envtools-20081215/debian/uboot-envtools-examples/openmoko_gta02.config
@@ -0,0 +1,7 @@
+# Configuration file for fw_(printenv/saveenv) utility.
+# Up to two entries are valid, in this case the redundand
+# environment sector is assumed present.
+# Notice, that the "Number of sectors" is ignored on NOR.
+
+# MTD device name Device offset Env. size Flash sector size Number of sectors
+/dev/mtd2 0x0000 0x40000 0x20000 2