This patch contains the complete set of Debian changes.

See http://git.debian.org/?p=collab-maint/sunxi-tools.git for individual patches
and history.

--- sunxi-tools-1.2.orig/Makefile
+++ sunxi-tools-1.2/Makefile
@@ -1,3 +1,21 @@
+# Copyright (C) 2012       Alejandro Mery <amery@geeks.cl>
+# Copyright (C) 2012,2013  Henrik Nordstrom <henrik@henriknordstrom.net>
+# Copyright (C) 2013       Patrick Wood <patrickhwood@gmail.com>
+# Copyright (C) 2013       Pat Wood <Pat.Wood@efi.com>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
 CC = gcc
 CFLAGS = -g -O0 -Wall -Wextra
 CFLAGS += -std=c99 -D_POSIX_C_SOURCE=200112L
--- sunxi-tools-1.2.orig/adb-devprobe.sh
+++ sunxi-tools-1.2/adb-devprobe.sh
@@ -1,5 +1,25 @@
 #!/bin/bash
 
+# Copyright (C) 2012  Henrik Nordstrom <henrik@henriknordstrom.net>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
 adb shell insmod /vendor/modules/sunxi-dbgreg.ko >/dev/null
 
 dump_io()
--- sunxi-tools-1.2.orig/boot_head.lds
+++ sunxi-tools-1.2/boot_head.lds
@@ -1,3 +1,19 @@
+/*
+ * Copyright (C) 2012  Henrik Nordstrom <henrik@henriknordstrom.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
      SECTIONS
      {
        . = 0x40007000;
--- sunxi-tools-1.2.orig/fel-gpio
+++ sunxi-tools-1.2/fel-gpio
@@ -1,5 +1,25 @@
 #!/bin/sh -e
 
+# Copyright (C) 2012,2013  Henrik Nordstrom <henrik@henriknordstrom.net>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
 pio_to_sram=0x2000
 sram_to_pio=0x2004
 
--- sunxi-tools-1.2.orig/fel-pio.lds
+++ sunxi-tools-1.2/fel-pio.lds
@@ -1,3 +1,19 @@
+/*
+ * Copyright (C) 2012  Henrik Nordstrom <henrik@henriknordstrom.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
      SECTIONS
      {
        . = 0x2000;
--- sunxi-tools-1.2.orig/fel-sdboot.lds
+++ sunxi-tools-1.2/fel-sdboot.lds
@@ -1,3 +1,19 @@
+/*
+ * Copyright (C) 2012  Henrik Nordstrom <henrik@henriknordstrom.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
      SECTIONS
      {
        . = 0x0030;
--- sunxi-tools-1.2.orig/include/endian_compat.h
+++ sunxi-tools-1.2/include/endian_compat.h
@@ -1,7 +1,29 @@
+/*
+ * Copyright (C) 2012  Eric Molitor <eric@molitor.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
 #ifndef SUNXI_ENDIAN_COMPAT_H_
 #define SUNXI_ENDIAN_COMPAT_H_
 
-#ifdef __APPLE__ 
+#ifdef __APPLE__
 #include <CoreFoundation/CoreFoundation.h>
 #define htole32(x) CFSwapInt32HostToLittle(x)
 #define le32toh(x) CFSwapInt32LittleToHost(x)
--- sunxi-tools-1.2.orig/include/types.h
+++ sunxi-tools-1.2/include/types.h
@@ -1,3 +1,23 @@
+/*
+ * (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
+ * (C) Copyright 2012 Alejandro Mery <amery@geeks.cl>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
 #ifndef SUNXI_TYPES_H
 #define SUNXI_TYPES_H
 
--- sunxi-tools-1.2.orig/jtag-loop.lds
+++ sunxi-tools-1.2/jtag-loop.lds
@@ -1,3 +1,19 @@
+/*
+ * Copyright (C) 2012  Henrik Nordstrom <henrik@henriknordstrom.net>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
      SECTIONS
      {
        . = 0x0030;
--- sunxi-tools-1.2.orig/usb-boot
+++ sunxi-tools-1.2/usb-boot
@@ -1,15 +1,33 @@
 #!/bin/sh -e
-top=`dirname $0`
+
+# Copyright (C) 2013  Henrik Nordstrom <henrik@henriknordstrom.net>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+top=/usr/share/sunxi-tools/
 if [ $# -lt 2 ]; then
-	echo "Usage: $0 u-boot-spl.bin u-boot.bin [boot.scr] [kernel script.bin [initramfs]]"
+	echo "Usage: $0 u-boot-spl.bin|BOARD u-boot.bin|- [boot.scr] [kernel script.bin [initramfs]]"
 	exit 1
 fi
 board=$1; shift || (echo "ERROR: u-boot-spl.bin must be specified"; exit 1;)
 uboot=$1; shift || (echo "ERROR: u-boot.bin must be specified"; exit 1;)
-bootscr=$top/felboot/ramboot.scr
-if [ ! -f $bootscr ]; then
-	bootscr=$top/bin/ramboot.scr
-fi
+bootscr=$top/ramboot.scr
 case "$1" in
 *.scr)	bootscr="$1"; shift
 	;;
@@ -25,15 +43,15 @@ if [ $# -ge 1 ]; then
 fi
 fel() {
 	echo fel "$@"
-	$top/fel $@
+	/usr/bin/sunxi-fel $@
 }
 case $board in
 */*)	felboot=$board
 	;;
 *)
-	felboot=$top/felboot/fel-boot-${board}.bin
-	if [ ! -f $felboot ]; then
-		felboot=$top/bin/fel-boot-${board}.bin
+	felboot=/usr/lib/u-boot/${board}_FEL/u-boot-spl.bin
+	if [ x$uboot = x- ]; then
+	    uboot=/usr/lib/u-boot/${board}_FEL/u-boot.bin
 	fi
 	;;
 esac
