From 77fd830778118ea8454d86c736b94543b65badd0 Mon Sep 17 00:00:00 2001 From: Marco Schuster Date: Mon, 30 Nov 2015 01:26:45 +0000 Subject: [PATCH 1/3] Add debian packaging stuff for RPis --- debian/README.Debian | 6 + debian/README.source | 8 + debian/changelog | 16 ++ debian/compat | 1 + debian/control | 21 +++ debian/copyright | 411 ++++++++++++++++++++++++++++++++++++++++++ debian/docs | 1 + debian/mkknlimg | 244 +++++++++++++++++++++++++ debian/postinst | 45 +++++ debian/postrm | 40 ++++ debian/rules | 55 ++++++ debian/source/format | 1 + debian/u-boot.hook | 18 ++ debian/u-boot.install | 8 + debian/uboot.env | Bin 0 -> 16384 bytes 15 files changed, 875 insertions(+) create mode 100644 debian/README.Debian create mode 100644 debian/README.source create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/docs create mode 100755 debian/mkknlimg create mode 100644 debian/postinst create mode 100644 debian/postrm create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100755 debian/u-boot.hook create mode 100644 debian/u-boot.install create mode 100755 debian/uboot.env diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000000..779d1a2915 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,6 @@ +u-boot for Debian +----------------- + +Only build this package using debian/rules binary. + + -- Marco Schuster Sun, 29 Nov 2015 19:52:59 +0000 diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000000..8be9ace8f8 --- /dev/null +++ b/debian/README.source @@ -0,0 +1,8 @@ +u-boot for Debian +----------------- + +This is the latest u-boot, compiled and packaged into a special package for +Raspberry Pi, supporting both Pi1 and Pi2 with a single package. + + -- Marco Schuster Sun, 29 Nov 2015 19:52:59 +0000 + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000000..c01db0442d --- /dev/null +++ b/debian/changelog @@ -0,0 +1,16 @@ +u-boot (2016.01-rpi2-4) UNRELEASED; urgency=medium + + [ Marco Schuster ] + * Non-maintainer upload. + * fix build + * add postrm + * add kernel/postinst hook + * proper dch + + -- Marco Schuster Sun, 29 Nov 2015 23:40:27 +0000 + +u-boot (2016.01-rpi2-1) unstable; urgency=low + + * Initial release (Closes: #nnnn) + + -- Marco Schuster Sun, 29 Nov 2015 19:52:59 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000000..ec635144f6 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000000..db95c48104 --- /dev/null +++ b/debian/control @@ -0,0 +1,21 @@ +Source: u-boot +Section: main +Priority: optional +Maintainer: Marco Schuster +Build-Depends: debhelper (>= 9), bc, device-tree-compiler, dpkg-dev (>= 1.17.0) +Standards-Version: 3.9.6 +Homepage: http://www.denx.de/wiki/U-Boot/ +Vcs-Git: git://anonscm.debian.org/collab-maint/u-boot.git +Vcs-Browser: +http://anonscm.debian.org/gitweb/?p=collab-maint/u-boot.git;a=summary + +Package: u-boot +Architecture: armhf +Depends: ${misc:Depends} +Description: A boot loader for embedded systems + Das U-Boot is a cross-platform bootloader for embedded systems, + used as the default boot loader by several board vendors. It is + intended to be easy to port and to debug, and runs on many + supported architectures, including PPC, ARM, MIPS, x86, m68k, + NIOS, and Microblaze. + ${uboot:platforms} diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000000..df7eb425a8 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,411 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Das U-Boot +Source: ftp://ftp.denx.de/pub/u-boot/ +Files-Excluded: *fpgadata* + arch/powerpc/cpu/mpc8xx/upatch.c + drivers/dma/MCD_tasks.c + +Files: * +Copyright: 2000-2013 Wolfgang Denk + 1995-2002 Russell King + 1996-1998 Russell King + 1996-1999 Russell King + 1996-2000 Russell King + 1996 Russell King + 1997-1999 Russell King + 1999-2002 Vojtech Pavlik + 1999 Linus Torvalds / 2000-2002 Transmeta Corporation + 1999 Russell King + 2000-2002 Russell King + 2000-2010 David Woodhouse + 2000 Steven J. Hill (sjhill@realitydiluted.com) + 2001, 2002, 2003 / 2004 Gary Jennejohn garyj@denx.de + 2002-2007 Aleph One Ltd + 2002-2011 Aleph One Ltd + 2002 Thomas Gleixner (tglx@linutronix.de) + 2003 Kai-Uwe Bloem / 2000-2002 Transmeta Corporation / 1999 Linus Torvalds + 2004 by David Brownell + 2004 Nokia Corporation + 2004 Thomas Gleixner (tglx@linutronix.de) + 2005-2006 by Texas Instruments + 2005-2006 by Texas Instruments / 2005 Mentor Graphics Corporation / 2006-2007 Nokia Corporation + 2005-2007 Samsung Electronics + 2005-2007 Samsung Electronics / Samsung Electronics, 2009 / Nokia Corporation, 2007 + 2005-2008 Samsung Electronics + 2005 Mentor Graphics Corporation / 2005-2006 by Texas Instruments / 2006-2007 Nokia Corporation + 2005 Mentor Graphics Corporation / 2005-2006 by Texas Instruments / 2008-2009 MontaVista Software, Inc. / 2006-2007 Nokia Corporation + 2005, Seagate Technology LLC / 2008 Stefan Roese , DENX Software Engineering + 2006-2007 Nokia Corporation / 2005-2006 by Texas Instruments / 2005 Mentor Graphics Corporation + 2006-2007 Nokia Corporation / 2005 Mentor Graphics Corporation / 2005-2006 by Texas Instruments + 2006-2007 Nokia Corporation / 2005 Mentor Graphics Corporation / 2005-2006 by Texas Instruments / 2008-2009 MontaVista Software, Inc. + 2006, 2007 University of Szeged, Hungary / 2006-2008 Nokia Corporation + 2006-2008 Nokia Corporation + 2006,2009 Freescale Semiconductor, Inc + 2006-2009 Solarflare Communications Inc + 2006 Freescale Semiconductor, Inc + 2006 Nokia Corporation / 2005-2007 by Texas Instruments + 2006 Pavel Pisa, PiKRON / 2008 Sascha Hauer, Pengutronix / 2009 Ilya Yanok, + 2006 Thomas Gleixner + 2007-2011 Freescale Semiconductor, Inc + 2007 Freescale Semiconductor, Inc + 2008-2009 / 2006-2008 Nokia Corporation + 2008-2009 Freescale Semiconductor, Inc + 2008-2009, MontaVista Software, Inc. / 2010, by Texas Instruments + 2008,2009 STMicroelectronics / 2010 Joakim Axelsson / 2009 Alessandro Rubini + 2008-2010 / 2006-2008 Nokia Corporation + 2008-2011 Freescale Semiconductor, Inc + 2008, 2011 Freescale Semiconductor, Inc + 2008,2011 Freescale Semiconductor, Inc + 2008-2012 Freescale Semiconductor, Inc + 2008 Altera Corporation / 2010 Thomas Chou + 2008 Atmel Corporation / 2013 Jagannadha Sutradharudu Teki, Xilinx Inc + 2008 by Texas Instruments / 2008 Mentor Graphics Corporation + 2008 Dave S.r.l. + 2008 Extreme Engineering Solutions, Inc + 2008 Freescale Semiconductor, Inc + 2008 Jean-Christophe PLAGNIOL-VILLARD / 2004-2007 ARM Limited + 2008 Kim B. Heino / 2009 + 2008 Qstreams Networks, Inc + 2008 Samsung Electronics / 2008-2009 Stefan Roese , DENX Software Engineering + 2008 STMicroelectronics / 2010 Joakim Axelsson / 2009 Alessandro Rubini + 2008 Yoshihiro Shimoda + 2009-2010 eXMeritus, A Boeing Company / 2008-2009 Freescale Semiconductor, Inc + 2009-2010 Freescale Semiconductor, Inc + 2009-2010 Texas Instruments, Inc + 2009-2011 Freescale Semiconductor, Inc + 2009 coresystems GmbH + 2009 Freescale Semiconductor, Inc + 2009 Micrel Inc / 2011 Bticino s.p.a, Roberto Cerati + 2009 MontaVista Software, Inc. / 2006-2007 Nokia Corporation / 2005-2006 by Texas Instruments / 2005 Mentor Graphics Corporation + 2010-2011 Freescale Semiconductor, Inc + 2010-2011 NVIDIA Corporation + 2010-2012 NVIDIA Corporation + 2010-2013 NVIDIA Corporation + 2010 Broadcom / 2012 Oleksandr Tymoshenko / 2012 Stephen Warren + 2010 NISHIMOTO Hiroki / 2010 Renesas Solutions Corp + 2010 Thomas Chou + 2010, Thomas Chou + 2010 Thomas Chou / 2008-2009 Avionic Design GmbH / 2007-2008 Avionic Design Development GmbH + 2010 Thomas Chou / 2008 Altera Corporation + 2011-2012 Renesas Solutions Corp + 2011 - 2012 Samsung Electronics / 2003-2006, Cluster File Systems, Inc, info@clusterfs.com + 2011 Analog Devices Inc + 2011 Freescale Semiconductor, Inc + 2011 Infineon Technologies + 2011 Ivan Djelic + 2011 Macpaul Lin (macpaul@andestech.com) / 2011 Andes Technology Corporation / 1995-2002 Russell King / 2010 Shawn Lin (nobuhiro@andestech.com) + 2011 Macpaul Lin (macpaul@andestech.com) / 2011 Andes Technology Corporation / 1996-1998 Russell King / 2010 Shawn Lin (nobuhiro@andestech.com) + 2011 Macpaul Lin (macpaul@andestech.com) / 2011 Andes Technology Corporation / 2010 Shawn Lin (nobuhiro@andestech.com) + 2011 Maxim Integrated Products + 2011 Parrot S.A + 2011 Renesas Solutions Corp + 2011 Renesas Solutions Corp / 2011 Kuninori Morimoto + 2011 The ChromiumOS Authors. All rights reserved + 2012-2013 Stephen Warren + 2012, by Texas Instruments + 2012, Google Inc + 2012 Renesas Solutions Corp + 2012 Samsung Electronics Co., Ltd + 2012 Stephen Warren + 2012 Texas Instruments Incorporated - http://www.ti.com/ + 2013 Synopsys, Inc. (www.synopsys.com) +License: GPL-2 + +Files: + drivers/tpm/tpm_atmel_twi.c + drivers/gpio/tca642x.c + include/splash.h + include/fdt.h + include/libfdt.h + include/configs/controlcenterd.h + include/configs/mxs.h + include/configs/T1040QDS.h + include/tca642x.h + board/gdsys/p1022/tlb.c + board/gdsys/p1022/sdhc_boot.c + board/gdsys/p1022/ddr.c + board/gdsys/p1022/controlcenterd-id.c + board/gdsys/p1022/diu.c + board/gdsys/p1022/controlcenterd-id.h + board/gdsys/p1022/controlcenterd.c + board/gdsys/p1022/law.c + board/gdsys/common/dp501.h + common/splash.c + fs/jffs2/compr_lzo.c + arch/arm/include/asm/arch-am33xx/hardware_ti816x.h + arch/arm/mach-exynos/dmc_init_exynos4.c + arch/arm/mach-exynos/lowlevel_init.c + arch/arm/mach-exynos/clock_init_exynos4.c + arch/arm/mach-exynos/common_setup.h + arch/arm/cpu/armv7/am33xx/clock_ti816x.c +Copyright: + 2013 Texas Instruments, Inc + 2013, Boundary Devices + 2006 David Gibson, IBM Corporation + 2012 Kim Phillips, Freescale Semiconductor + 2010-2013 Freescale Semiconductor, Inc + 2013 Marek Vasut + 2010-2011 Freescale Semiconductor, Inc + 2004 Patrik Kluba + 1996-2002 Markus Franz Xaver Johannes Oberhumer + 2013 NVIDIA Corporation + 2011 The Chromium OS Authors + 2013 Samsung Electronics + 2013, Adeneo Embedded + 2009, Texas Instruments, Incorporated +License: GPL-2+ + +Files: debian/* +Copyright: Clint Adams + Joey Hess + Marc Singer + Per Andersson + Vagrant Cascadian + Loïc Minier +License: GPL-2+ + +Files: fs/yaffs2/yaffs_allocator.h + fs/yaffs2/yaffs_verify.h + fs/yaffs2/yaffs_packedtags1.h + fs/yaffs2/yaffs_yaffs1.h + fs/yaffs2/ydirectenv.h + fs/yaffs2/yaffs_yaffs2.h + fs/yaffs2/yaffsfs.h + fs/yaffs2/yaffs_osglue.h + fs/yaffs2/yaffs_flashif.h + fs/yaffs2/yaffs_nand.h + fs/yaffs2/yportenv.h + fs/yaffs2/yaffs_packedtags2.h + fs/yaffs2/yaffs_attribs.h + fs/yaffs2/yaffs_ecc.h + fs/yaffs2/yaffs_trace.h + fs/yaffs2/yaffs_guts.h + fs/yaffs2/yaffs_getblockinfo.h + fs/yaffs2/yaffs_bitmap.h + fs/yaffs2/yaffs_nameval.h + fs/yaffs2/yaffscfg.h + fs/yaffs2/yaffs_nandemul2k.h + fs/yaffs2/yaffs_mtdif2.h + fs/yaffs2/yaffs_flashif2.h + fs/yaffs2/yaffs_checkptrw.h + fs/yaffs2/yaffs_tagscompat.h + fs/yaffs2/yaffs_nandif.h + fs/yaffs2/yaffs_summary.h + fs/yaffs2/yaffs_mtdif.h +Copyright: Copyright (C) 2002-2011 Aleph One Ltd. +License: LGPL-2.1 + +Files: lib/sha1.c +Copyright: Copyright (C) 2003-2006 Christophe Devine +License: LGPL-2.1 + +Files: include/bzlib.h + lib/bzip2/* +Copyright: Copyright (C) 1996-2002 Julian R Seward. All rights reserved. +License: bzlib-BSD-3 + +Files: drivers/usb/musb-new/musb_host.h + drivers/usb/musb-new/musb_core.h + drivers/usb/musb-new/musb_core.c + drivers/usb/musb-new/musb_gadget.c + drivers/usb/musb-new/musb_gadget.h + drivers/usb/musb-new/musb_dma.h + drivers/usb/musb-new/musb_regs.h + drivers/usb/musb-new/musb_debug.h + drivers/usb/musb-new/musb_host.c + drivers/usb/musb-new/musb_gadget_ep0.c + drivers/usb/musb-new/musb_io.h +Copyright: Copyright 2005 Mentor Graphics Corporation + Copyright (C) 2005-2006 by Texas Instruments + Copyright (C) 2006-2007 Nokia Corporation + Copyright (C) 2008-2009 MontaVista Software, Inc. +License: GPL-2 + +Files: net/dns.c + include/slre.h + lib/slre.c +Copyright: 2008 Pieter Voorthuijsen + 2004-2005 Sergey Lyubka + 2009 Robin Getz ] +License: Beerware + +Files: include/libfdt.h + include/fdt.h +Copyright: 2006 David Gibson, IBM Corporation + 2012 Kim Phillips, Freescale Semiconductor +License: libfdt-BSD-GPL + +Files: include/pcmcia/yenta.h +Copyright: 1999 David A. Hinds. All Rights Reserved +License: MPL-GPL + +License: MPL-GPL + * The contents of this file are subject to the Mozilla Public License + * Version 1.1 (the "License"); you may not use this file except in + * compliance with the License. You may obtain a copy of the License + * at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + * the License for the specific language governing rights and + * limitations under the License. + * + * The initial developer of the original code is David A. Hinds + * . Portions created by David A. Hinds + * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. + * + * Alternatively, the contents of this file may be used under the + * terms of the GNU General Public License version 2 (the "GPL"), in + * which case the provisions of the GPL are applicable instead of the + * above. If you wish to allow the use of your version of this file + * only under the terms of the GPL and not to allow others to use + * your version of this file under the MPL, indicate your decision by + * deleting the provisions above and replace them with the notice and + * other provisions required by the GPL. If you do not delete the + * provisions above, a recipient may use your version of this file + * under either the MPL or the GPL. + +License: libfdt-BSD-GPL + * libfdt is dual licensed: you can use it either under the terms of + * the GPL, or the BSD license, at your option. + * + * a) This library 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 library 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 library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * Alternatively, + * + * b) Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * 1. Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: Beerware + "THE BEER-WARE LICENSE" (Revision 42): + Sergey Lyubka wrote this file. As long as you retain this notice you + can do whatever you want with this stuff. If we meet some day, and you think + this stuff is worth it, you can buy me a beer in return. + +License: GPL-2 + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as published by the Free Software Foundation. + . + 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., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301 USA + . + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file + `/usr/share/common-licenses/GPL-2'. + +License: bzlib-BSD-3 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + 2. 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. + . + 3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + . + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + . + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: GPL-2+ + 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 package; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301 USA + . + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file + `/usr/share/common-licenses/GPL-2'. + +License: LGPL-2.1 + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License version 2.1 as + published by the Free Software Foundation. + . + This library 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 + Lesser General Public License for more details. + . + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301 USA + . + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file + `/usr/share/common-licenses/LGPL-2.1'. diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000000..e845566c06 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README diff --git a/debian/mkknlimg b/debian/mkknlimg new file mode 100755 index 0000000000..3998d43b69 --- /dev/null +++ b/debian/mkknlimg @@ -0,0 +1,244 @@ +#!/usr/bin/env perl +# ---------------------------------------------------------------------- +# mkknlimg by Phil Elwell for Raspberry Pi +# based on extract-ikconfig by Dick Streefland +# +# (c) 2009,2010 Dick Streefland +# (c) 2014,2015 Raspberry Pi (Trading) Limited +# +# Licensed under the terms of the GNU General Public License. +# ---------------------------------------------------------------------- + +use strict; +use warnings; +use integer; + +my $trailer_magic = 'RPTL'; + +my $tmpfile1 = "/tmp/mkknlimg_$$.1"; +my $tmpfile2 = "/tmp/mkknlimg_$$.2"; + +my $dtok = 0; +my $is_283x = 0; + +while (@ARGV && ($ARGV[0] =~ /^-/)) +{ + my $arg = shift(@ARGV); + if ($arg eq '--dtok') + { + $dtok = 1; + } + elsif ($arg eq '--283x') + { + $is_283x = 1; + } + else + { + print ("* Unknown option '$arg'\n"); + usage(); + } +} + +usage() if (@ARGV != 2); + +my $kernel_file = $ARGV[0]; +my $out_file = $ARGV[1]; + +if (! -r $kernel_file) +{ + print ("* File '$kernel_file' not found\n"); + usage(); +} + +my @wanted_strings = +( + 'bcm2708_fb', + 'brcm,bcm2835-mmc', + 'brcm,bcm2835-sdhost', + 'brcm,bcm2708-pinctrl', + 'brcm,bcm2835-gpio', + 'brcm,bcm2835', + 'brcm,bcm2836' +); + +my $res = try_extract($kernel_file, $tmpfile1); +$res = try_decompress('\037\213\010', 'xy', 'gunzip', 0, + $kernel_file, $tmpfile1, $tmpfile2) if (!$res); +$res = try_decompress('\3757zXZ\000', 'abcde', 'unxz --single-stream', -1, + $kernel_file, $tmpfile1, $tmpfile2) if (!$res); +$res = try_decompress('BZh', 'xy', 'bunzip2', 0, + $kernel_file, $tmpfile1, $tmpfile2) if (!$res); +$res = try_decompress('\135\0\0\0', 'xxx', 'unlzma', 0, + $kernel_file, $tmpfile1, $tmpfile2) if (!$res); +$res = try_decompress('\211\114\132', 'xy', 'lzop -d', 0, + $kernel_file, $tmpfile1, $tmpfile2) if (!$res); +$res = try_decompress('\002\041\114\030', 'xy', 'lz4 -d', 1, + $kernel_file, $tmpfile1, $tmpfile2) if (!$res); + +my $append_trailer; +my $trailer; +my $kver = '?'; + +$append_trailer = $dtok; + +if ($res) +{ + $kver = $res->{''} || '?'; + print("Version: $kver\n"); + + $append_trailer = $dtok; + if (!$dtok) + { + if (config_bool($res, 'bcm2708_fb') || + config_bool($res, 'brcm,bcm2835-mmc') || + config_bool($res, 'brcm,bcm2835-sdhost')) + { + $dtok ||= config_bool($res, 'brcm,bcm2708-pinctrl'); + $dtok ||= config_bool($res, 'brcm,bcm2835-gpio'); + $is_283x ||= config_bool($res, 'brcm,bcm2835'); + $is_283x ||= config_bool($res, 'brcm,bcm2836'); + $dtok ||= $is_283x; + $append_trailer = 1; + } + else + { + print ("* This doesn't look like a Raspberry Pi kernel. In pass-through mode.\n"); + } + } +} +elsif (!$dtok) +{ + print ("* Is this a valid kernel? In pass-through mode.\n"); +} + +if ($append_trailer) +{ + printf("DT: %s\n", $dtok ? "y" : "n"); + printf("283x: %s\n", $is_283x ? "y" : "n"); + + my @atoms; + + push @atoms, [ $trailer_magic, pack('V', 0) ]; + push @atoms, [ 'KVer', $kver ]; + push @atoms, [ 'DTOK', pack('V', $dtok) ]; + push @atoms, [ '283x', pack('V', $is_283x) ]; + + $trailer = pack_trailer(\@atoms); + $atoms[0]->[1] = pack('V', length($trailer)); + + $trailer = pack_trailer(\@atoms); +} + +my $ofh; +my $total_len = 0; + +if ($out_file eq $kernel_file) +{ + die "* Failed to open '$out_file' for append\n" + if (!open($ofh, '>>', $out_file)); + $total_len = tell($ofh); +} +else +{ + die "* Failed to open '$kernel_file'\n" + if (!open(my $ifh, '<', $kernel_file)); + die "* Failed to create '$out_file'\n" + if (!open($ofh, '>', $out_file)); + + my $copybuf; + while (1) + { + my $bytes = sysread($ifh, $copybuf, 64*1024); + last if (!$bytes); + syswrite($ofh, $copybuf, $bytes); + $total_len += $bytes; + } + close($ifh); +} + +if ($trailer) +{ + # Pad to word-alignment + syswrite($ofh, "\x000\x000\x000", (-$total_len & 0x3)); + syswrite($ofh, $trailer); +} + +close($ofh); + +exit($trailer ? 0 : 1); + +END { + unlink($tmpfile1) if ($tmpfile1); + unlink($tmpfile2) if ($tmpfile2); +} + + +sub usage +{ + print ("Usage: mkknlimg [--dtok] [--283x] \n"); + exit(1); +} + +sub try_extract +{ + my ($knl, $tmp) = @_; + + my $ver = `strings "$knl" | grep -a -E "^Linux version [1-9]"`; + + return undef if (!$ver); + + chomp($ver); + + my $res = { ''=>$ver }; + my $string_pattern = '^('.join('|', @wanted_strings).')$'; + + my @matches = `strings \"$knl\" | grep -E \"$string_pattern\"`; + foreach my $match (@matches) + { + chomp($match); + $res->{$match} = 1; + } + + return $res; +} + + +sub try_decompress +{ + my ($magic, $subst, $zcat, $idx, $knl, $tmp1, $tmp2) = @_; + + my $pos = `tr "$magic\n$subst" "\n$subst=" < "$knl" | grep -abo "^$subst"`; + if ($pos) + { + chomp($pos); + $pos = (split(/[\r\n]+/, $pos))[$idx]; + return undef if (!defined($pos)); + $pos =~ s/:.*[\r\n]*$//s; + my $cmd = "tail -c+$pos \"$knl\" | $zcat > $tmp2 2> /dev/null"; + my $err = (system($cmd) >> 8); + return undef if (($err != 0) && ($err != 2)); + + return try_extract($tmp2, $tmp1); + } + + return undef; +} + +sub pack_trailer +{ + my ($atoms) = @_; + my $trailer = pack('VV', 0, 0); + for (my $i = $#$atoms; $i>=0; $i--) + { + my $atom = $atoms->[$i]; + $trailer .= pack('a*x!4Va4', $atom->[1], length($atom->[1]), $atom->[0]); + } + return $trailer; +} + +sub config_bool +{ + my ($configs, $wanted) = @_; + my $val = $configs->{$wanted} || 'n'; + return (($val eq 'y') || ($val eq '1')); +} diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000000..5dae4933ca --- /dev/null +++ b/debian/postinst @@ -0,0 +1,45 @@ +#!/bin/sh +# postinst script for u-boot +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + echo "#UBOOT_BEGIN" >> /boot/config.txt + echo "[pi1]" >> /boot/config.txt + echo "kernel=u-boot.bin" >> /boot/config.txt + echo "[pi2]" >> /boot/config.txt + echo "kernel=u-boot7.bin" >> /boot/config.txt + echo "#UBOOT_END" >> /boot/config.txt + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000000..b24ac5aa69 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,40 @@ +#!/bin/sh +# postrm script for u-boot +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see https://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + +purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + sed -i '/#UBOOT_BEGIN/,/#UBOOT_END/d' /boot/config.txt + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000000..86247ac717 --- /dev/null +++ b/debian/rules @@ -0,0 +1,55 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +export DH_VERBOSE = 1 + +# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +# main packaging script based on dh7 syntax +%: + dh $@ --parallel + +override_dh_auto_configure: + mkdir -p debian/build/pi1 + mkdir -p debian/build/pi2 + make O=debian/build/pi2 rpi_2_defconfig -j6 + make O=debian/build/pi1 rpi_defconfig -j6 + +override_dh_auto_clean: + rm -rf debian/build + dh_auto_clean + +override_dh_install: + mkdir -p debian/tmp/boot + mkdir -p debian/tmp/usr/bin + mkdir -p debian/tmp/etc/kernel/postinst.d + mkdir -p debian/tmp/etc/kernel/postrm.d + debian/mkknlimg --dtok debian/build/pi1/u-boot.bin debian/tmp/boot/u-boot.bin + debian/mkknlimg --dtok debian/build/pi2/u-boot.bin debian/tmp/boot/u-boot7.bin + cp debian/build/pi1/tools/env/fw_printenv debian/tmp/usr/bin/fw_printenv + cp debian/build/pi1/tools/env/fw_printenv debian/tmp/usr/bin/fw_setenv + cp debian/uboot.env debian/tmp/boot/uboot.env + cp debian/u-boot.hook debian/tmp/etc/kernel/postinst.d/u-boot + cp debian/u-boot.hook debian/tmp/etc/kernel/postrm.d/u-boot + echo "/boot/uboot.env 0x0 0x4000 0x4000 1" > debian/tmp/etc/fw_env.config + dh_install + +override_dh_auto_build: + make O=debian/build/pi2 -j6 + make O=debian/build/pi1 -j6 + make O=debian/build/pi1 env -j6 + +override_dh_auto_test: + #skip diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000000..163aaf8d82 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/u-boot.hook b/debian/u-boot.hook new file mode 100755 index 0000000000..b7de0672c5 --- /dev/null +++ b/debian/u-boot.hook @@ -0,0 +1,18 @@ +#!/bin/bash +CURRENT_PI1=`find /boot/ -regextype sed -regex '.*/vmlinuz-.*-rpi$' -printf '%f\n'|sort -V|tail -n1` +CURRENT_PI2=`find /boot/ -regextype sed -regex '.*/vmlinuz-.*-rpi2$' -printf '%f\n'|sort -V|tail -n1` + +if [ -n "${CURRENT_PI1}" ]; then + echo "Current pi1 kernel: $CURRENT_PI1" + fw_setenv kernel $CURRENT_PI1 +else + echo "No valid pi1 kernel found" + fw_setenv kernel +fi +if [ -n "${CURRENT_PI2}" ]; then + echo "Current pi2 kernel: $CURRENT_PI2" + fw_setenv kernel7 $CURRENT_PI2 +else + echo "No valid pi2 kernel found" + fw_setenv kernel7 +fi diff --git a/debian/u-boot.install b/debian/u-boot.install new file mode 100644 index 0000000000..75dcbc63e7 --- /dev/null +++ b/debian/u-boot.install @@ -0,0 +1,8 @@ +boot/u-boot.bin +boot/u-boot7.bin +boot/uboot.env +etc/fw_env.config +etc/kernel/postinst.d/u-boot +etc/kernel/postrm.d/u-boot +usr/bin/fw_printenv +usr/bin/fw_setenv diff --git a/debian/uboot.env b/debian/uboot.env new file mode 100755 index 0000000000000000000000000000000000000000..e4b698fcfd16369475929e66af26b8279825e2f9 GIT binary patch literal 16384 zcmeIwv2NQi5C&j9%0b9h+mW0WC~9y>_RJj(T0Gf=B~qX$Lr$TW?%1IyDaEzwbWE4x z=f>mlNPfrX?>~O-WT%|;Eb{!*I?IxswO(;0&mzx~Qu(b^%59y<`Yet-q#W59u4W4% z7{_Iy)D??UU1`(3EFV_+=T)}!t~1A_YxFv4dX5>h{jqA?--eT&6D>O}t3_3)7}4e? zU^_pL#0yLBxo&(bru!EME{-9`bKf|cC(zxu`E;NUl+%WENuFCz>CJLVf*!)UKd>P# z4wlld(iv^`i?M8BJL8G_f?2UjLnc=(zh*v#i%ki-y*)RkmYOyrw{-hf6xOshxOsnm ze16OpQ#;6oBH~{0>AtRuU3JWw^%yH#e{NWC?>~}ZztW|VHD3T?#jSOE|9)jFE7jC^ zQA!_Y6mCS>mpr`fj~_8y1F_FTQrPA^s>gT6u9(x*lraBIe!20GjwbQ*^djzhxt5#0 z;y}v~x_-@J+)&g?gg-VG9{azcIGvvz%wy>KlGi{yWjrrQ;>Ug){afs!@izNk^CTD$ zfB*y_009U<00Izz00bZa0SG_<0uX=z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U< i00Izz00bZa0SG_<0uX=z1Rwwb2tWV=5P-mcDDVsTF;X)C literal 0 HcmV?d00001 From d589c74b32ac23aa3e5288dd4c5013ac247afa60 Mon Sep 17 00:00:00 2001 From: Marco Schuster Date: Mon, 30 Nov 2015 01:41:42 +0000 Subject: [PATCH 2/3] debian/control: fix wrapped line --- debian/control | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/control b/debian/control index db95c48104..ab2344710b 100644 --- a/debian/control +++ b/debian/control @@ -6,8 +6,7 @@ Build-Depends: debhelper (>= 9), bc, device-tree-compiler, dpkg-dev (>= 1.17.0) Standards-Version: 3.9.6 Homepage: http://www.denx.de/wiki/U-Boot/ Vcs-Git: git://anonscm.debian.org/collab-maint/u-boot.git -Vcs-Browser: -http://anonscm.debian.org/gitweb/?p=collab-maint/u-boot.git;a=summary +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/u-boot.git;a=summary Package: u-boot Architecture: armhf From 18adf1f695d0af06ee73723eb906938df16b2c47 Mon Sep 17 00:00:00 2001 From: Marco Schuster Date: Mon, 30 Nov 2015 02:00:30 +0000 Subject: [PATCH 3/3] Fix more errors in the debian/ stuff --- debian/changelog | 2 +- debian/source/include-binaries | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 debian/source/include-binaries diff --git a/debian/changelog b/debian/changelog index c01db0442d..03977c8fc6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -u-boot (2016.01-rpi2-4) UNRELEASED; urgency=medium +u-boot (2016.01-rpi2-5) testing; urgency=medium [ Marco Schuster ] * Non-maintainer upload. diff --git a/debian/source/include-binaries b/debian/source/include-binaries new file mode 100644 index 0000000000..4f5643be5c --- /dev/null +++ b/debian/source/include-binaries @@ -0,0 +1 @@ +debian/uboot.env \ No newline at end of file