From 6f2dbe5532bee40b9366c96e43f315d4bf2f5d80 Mon Sep 17 00:00:00 2001
From: "Jeremiah C. Foster" <jeremiah.foster@puri.sm>
Date: Thu, 11 Jun 2020 17:33:33 -0400
Subject: [PATCH] Removing git-hooks in util/ and adding in debian dir.
 Removing util/getrevision.sh since Debian does't use it either Looks like we
 have to have util/getrevision.sh if we want a version from the binary.

---
 debian/.gitlab-ci.yml                         |  26 ++
 debian/.pc/.quilt_patches                     |   1 +
 debian/.pc/.quilt_series                      |   1 +
 debian/.pc/.version                           |   1 +
 debian/.pc/applied-patches                    |   1 +
 .../util/getrevision.sh                       |   0
 debian/README.Debian                          |  13 +
 debian/changelog                              | 423 ++++++++++++++++++
 debian/clean                                  |   2 +
 debian/compat                                 |   1 +
 debian/control                                | 122 +++++
 debian/copyright                              | 288 ++++++++++++
 debian/dirs                                   |   1 +
 debian/docs                                   |   2 +
 debian/flashrom.install                       |   2 +
 debian/flashrom.udev                          |  92 ++++
 debian/gbp.conf                               |   2 +
 debian/libflashrom-dev.install                |   3 +
 debian/libflashrom1.install                   |   1 +
 debian/manpages                               |   1 +
 debian/org.flashrom.flashrom.metainfo.xml     |  27 ++
 debian/rules                                  |  41 ++
 debian/shlibs.local                           |   1 +
 debian/source/format                          |   1 +
 debian/watch                                  |   5 +
 util/git-hooks/applypatch-msg                 |  15 -
 util/git-hooks/commit-msg                     | 220 ---------
 util/git-hooks/install.sh                     |  30 --
 util/git-hooks/pre-applypatch                 |  12 -
 util/git-hooks/pre-commit                     |   9 -
 util/git-hooks/pre-push                       |  75 ----
 util/git-hooks/wrapper.sh                     |  10 -
 32 files changed, 1058 insertions(+), 371 deletions(-)
 create mode 100644 debian/.gitlab-ci.yml
 create mode 100644 debian/.pc/.quilt_patches
 create mode 100644 debian/.pc/.quilt_series
 create mode 100644 debian/.pc/.version
 create mode 100644 debian/.pc/applied-patches
 create mode 100644 debian/.pc/getrevision.sh-executable-mode/util/getrevision.sh
 create mode 100644 debian/README.Debian
 create mode 100644 debian/changelog
 create mode 100644 debian/clean
 create mode 100644 debian/compat
 create mode 100644 debian/control
 create mode 100644 debian/copyright
 create mode 100644 debian/dirs
 create mode 100644 debian/docs
 create mode 100644 debian/flashrom.install
 create mode 100644 debian/flashrom.udev
 create mode 100644 debian/gbp.conf
 create mode 100644 debian/libflashrom-dev.install
 create mode 100644 debian/libflashrom1.install
 create mode 100644 debian/manpages
 create mode 100644 debian/org.flashrom.flashrom.metainfo.xml
 create mode 100755 debian/rules
 create mode 100644 debian/shlibs.local
 create mode 100644 debian/source/format
 create mode 100644 debian/watch
 delete mode 100755 util/git-hooks/applypatch-msg
 delete mode 100755 util/git-hooks/commit-msg
 delete mode 100755 util/git-hooks/install.sh
 delete mode 100755 util/git-hooks/pre-applypatch
 delete mode 100755 util/git-hooks/pre-commit
 delete mode 100755 util/git-hooks/pre-push
 delete mode 100755 util/git-hooks/wrapper.sh

diff --git a/debian/.gitlab-ci.yml b/debian/.gitlab-ci.yml
new file mode 100644
index 00000000..80474799
--- /dev/null
+++ b/debian/.gitlab-ci.yml
@@ -0,0 +1,26 @@
+variables:
+  GIT_DEPTH: 1
+  DEBFULLNAME: "PureOS Pipeline"
+  DEBEMAIL: "pureos-projects@lists.puri.sm"
+  DEBIAN_FRONTEND: noninteractive
+#  WORKING_DIR: $CI_PROJECT_DIR/debian/output
+
+# build on PureOS Amber
+default:
+  image: pureos/amber:latest
+
+# Update packages
+before_script:  
+  - apt -yqq update
+  - apt -y install build-essential devscripts pristine-tar
+  - apt -y install pkg-config libpci-dev libusb-1.0-0-dev libftdi1-dev meson
+  - apt -y install git-buildpackage --no-install-recommends
+  
+amber-build:
+  script:
+    - ls -lha
+    - pwd
+  tags:
+    - amber
+
+    
diff --git a/debian/.pc/.quilt_patches b/debian/.pc/.quilt_patches
new file mode 100644
index 00000000..6857a8d4
--- /dev/null
+++ b/debian/.pc/.quilt_patches
@@ -0,0 +1 @@
+debian/patches
diff --git a/debian/.pc/.quilt_series b/debian/.pc/.quilt_series
new file mode 100644
index 00000000..c2067066
--- /dev/null
+++ b/debian/.pc/.quilt_series
@@ -0,0 +1 @@
+series
diff --git a/debian/.pc/.version b/debian/.pc/.version
new file mode 100644
index 00000000..0cfbf088
--- /dev/null
+++ b/debian/.pc/.version
@@ -0,0 +1 @@
+2
diff --git a/debian/.pc/applied-patches b/debian/.pc/applied-patches
new file mode 100644
index 00000000..017347ca
--- /dev/null
+++ b/debian/.pc/applied-patches
@@ -0,0 +1 @@
+getrevision.sh-executable-mode
diff --git a/debian/.pc/getrevision.sh-executable-mode/util/getrevision.sh b/debian/.pc/getrevision.sh-executable-mode/util/getrevision.sh
new file mode 100644
index 00000000..e69de29b
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 00000000..5dd82d97
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,13 @@
+flashrom for Debian
+-------------------
+
+WARNING: Be careful with the write and erase operations (-w and -E)! If you
+         accidentally overwrite the BIOS of your computer with a broken
+         or incorrect BIOS, your computer will be broken and cannot be
+         easily recovered! You have been warned!
+
+In case this _does_ happen to you, DO NOT REBOOT! The flashrom developers
+might be able to help you recover. They can be contacted either via IRC
+(#flashrom on irc.freenode.net) or via email (http://flashrom.org/Mailinglist).
+
+ -- Uwe Hermann <uwe@debian.org>  Sat, 05 Dec 2009 18:12:05 +0100
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 00000000..2c6c166c
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,423 @@
+flashrom (1.2.0-0pureos7) amber-updates; urgency=medium
+
+  * Found a cleaner way to remove git-hooks directory
+  * Bringing back in version information
+
+ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Thu, 11 Jun 2020 17:36:46 -0400
+
+flashrom (1.2.0-0pureos6) amber-updates; urgency=medium
+
+  * Bringing the packaging version up-to-date
+  * Trying to fix getversion.sh failure
+
+ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Thu, 11 Jun 2020 16:05:34 -0400
+
+flashrom (1.2.0-0pureos5) amber-updates; urgency=medium
+
+  * Removing -DSTANDALONE for logging
+  * Sent request to bring in upstream patch to Debian via reportbug
+
+ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Thu, 11 Jun 2020 14:20:16 -0400
+
+flashrom (1.2.0-0pureos4) amber-updates; urgency=medium
+
+  * Clean-up
+
+ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Tue, 19 May 2020 15:21:56 -0400
+
+flashrom (1.2.0-0pureos3) amber-updates; urgency=medium
+
+  * Adding in metadata
+
+ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Mon, 18 May 2020 17:16:25 -0400
+
+flashrom (1.2.0-0pureos2) amber; urgency=medium
+
+  * Brought in Debian's control file to build libflashrom1 which fwupd needs
+
+ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Thu, 14 May 2020 17:01:20 -0400
+
+flashrom (1.2.0-0pureos1) landing; urgency=medium
+
+  * New upstream version
+
+ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Tue, 05 May 2020 17:08:46 -0400
+
+flashrom (1.1.0-0pureos1) green; urgency=medium
+
+  * New upstream version
+  * Changed maintainers to PureOS maintainers
+
+ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Wed, 07 Aug 2019 14:35:31 -0400
+
+flashrom (1.0.0-0pureos2) green; urgency=medium
+
+  * New compat version, updated standards version
+
+ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Thu, 24 Jan 2019 13:44:18 -0500
+
+flashrom (1.0.0-0pureos1) green; urgency=medium
+
+  * New upstream version
+
+ -- Jeremiah C. Foster <jeremiah.foster@puri.sm>  Thu, 24 Jan 2019 13:41:34 -0500
+
+flashrom (0.9.9+r1954-1pureos1) green; urgency=medium
+
+  * Fork for PureOS:
+    + Set dev@puri.sm as maintainer, prefixing original XSBC-Original-.
+    + Set myself as uploader, dropping original.
+  * Suppress building *-dbgsym packages, to avoid NEW queue.
+  * No-change rebuild to fix segfault on PureOS.
+
+ -- Jonas Smedegaard <jonas.smedegaard@puri.sm>  Wed, 15 Nov 2017 13:34:32 +0100
+
+flashrom (0.9.9+r1954-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Don't build-depend on libftdi1-dev on Hurd, it's not available.
+
+ -- Uwe Hermann <uwe@debian.org>  Sun, 13 Mar 2016 20:41:00 +0100
+
+flashrom (0.9.9~rc1+r1946-1) unstable; urgency=medium
+
+  * New upstream release (Closes: #788426, #802342).
+      + Partial support for alpha, hppa, m68k, sh, and s390 (Closes: 774405).
+  * debian/control:
+      + On kFreeBSD only build-depend on libusb-1.0-0-dev, that
+        package also includes the old libusb 0.1 API (Closes: #815947).
+        Thanks Steven Chamberlain for the patch!
+      + Don't build-depend on libusb-1.0-0-dev on Hurd, it's not available.
+      + Add pkg-config to build-depends, since it is used by the upstream
+        Makefile. Otherwise the Makefile uses hardcoded guesses, which
+        are not always correct.
+      + Drop "Recommends: dmidecode [any-i386 any-amd64 ia64 armhf]".
+        Upstream has its own code now, no longer uses dmidecode by default.
+  * debian/rules: Add "export DEB_BUILD_MAINT_OPTIONS = hardening=+all".
+  * Standards-Version: 3.9.7 (no changes required).
+  * Package description: Update list of supported devices.
+
+ -- Uwe Hermann <uwe@debian.org>  Tue, 01 Mar 2016 00:07:45 +0100
+
+flashrom (0.9.9~rc1+r1942-1) unstable; urgency=medium
+
+  * Acknowledge NMU, thanks Anibal Monsalve Salazar! (Closes: #775428).
+  * New upstream release (Closes: #786917).
+      + Dediprog SF100 support is now enabled by default (Closes: #639957).
+      + debian/patches/20_svn_version.patch: Drop, no longer needed (if the
+        tarball is generated via 'make tarball' from svn checkout).
+      + debian/patches/mips-fix-internal.patch: Drop, fixed upstream.
+  * New build-depends: libusb-1.0-0-dev (in addition to libusb-dev).
+  * Updated build-depends: libftdi-dev -> libftdi1-dev (Closes: #810372).
+
+ -- Uwe Hermann <uwe@debian.org>  Tue, 23 Feb 2016 19:34:07 +0100
+
+flashrom (0.9.7+r1852-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTBFS on mipsel.
+    Patch by Dejan Latinovic <Dejan.Latinovic@imgtec.com>.
+    Add mips-fix-internal.patch.
+    Closes: #775428.
+
+ -- Anibal Monsalve Salazar <anibal@debian.org>  Wed, 14 Oct 2015 09:21:36 +0100
+
+flashrom (0.9.7+r1852-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Standards-Version: 3.9.6 (no changes required).
+  * Use 'Architecture: any', flashrom should build/work pretty much everywhere.
+  * debian/patches:
+      + 10_disable_linuxspi.patch: Drop.
+      + 20_svn_version.patch: Update.
+  * Shorten dmidecode 'Recommends' to [any-i386 any-amd64 ia64 armhf].
+  * Add missing upstream ChangeLog file (via "svn log").
+
+ -- Uwe Hermann <uwe@debian.org>  Mon, 27 Oct 2014 21:20:52 +0100
+
+flashrom (0.9.7+r1782-1) unstable; urgency=high
+
+  * New upstream release (Closes: #746734, #690478).
+  * debian/compat: Upgrade from 5 to 9.
+  * Standards-Version: 3.9.5 (no changes required).
+
+ -- Uwe Hermann <uwe@debian.org>  Sat, 03 May 2014 17:39:35 +0200
+
+flashrom (0.9.6.1+r1563-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Uwe Hermann <uwe@debian.org>  Wed, 08 Aug 2012 23:39:15 +0200
+
+flashrom (0.9.5.2+r1546-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Uwe Hermann <uwe@debian.org>  Fri, 29 Jun 2012 20:49:55 +0200
+
+flashrom (0.9.5.2+r1517-1) unstable; urgency=low
+
+  * New upstream release.
+  * Standards-Version: 3.9.3 (no changes required).
+
+ -- Uwe Hermann <uwe@debian.org>  Sat, 07 Apr 2012 23:27:50 +0200
+
+flashrom (0.9.5.1+r1508-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Uwe Hermann <uwe@debian.org>  Sun, 26 Feb 2012 15:44:49 +0100
+
+flashrom (0.9.5+r1503-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/docs: Add mysteries_intel.txt.
+
+ -- Uwe Hermann <uwe@debian.org>  Mon, 20 Feb 2012 11:54:48 +0100
+
+flashrom (0.9.4+r1394-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/patches/10_svnversion.patch: Drop, no longer needed.
+
+ -- Uwe Hermann <uwe@debian.org>  Thu, 28 Jul 2011 21:29:32 +0200
+
+flashrom (0.9.3+r1323-1) unstable; urgency=low
+
+  * New upstream release.
+  * Standards-Version: 3.9.2 (no changes required).
+  * debian/rules: Delete .libdeps file in 'clean' target.
+
+ -- Uwe Hermann <uwe@debian.org>  Fri, 03 Jun 2011 16:53:47 +0200
+
+flashrom (0.9.2+r1141-2) unstable; urgency=high
+
+  * Drop alpha and netbsd-alpha from the arch list for now (builds fail).
+    + Keeping "urgency=high" due to high-priority fixes in the last upload,
+      in order to allow those fixes to migrate to testing.
+    + It's unclear how well alpha (if at all) is supported upstream at this
+      point. There's a compile-time #error in the upstream code breaking
+      the build intentionally on alpha right now.
+      Alpha support will be re-enabled as soon as this has been sorted out
+      upstream, but it may take quite a while.
+
+ -- Uwe Hermann <uwe@debian.org>  Tue, 17 Aug 2010 00:50:27 +0200
+
+flashrom (0.9.2+r1141-1) unstable; urgency=high
+
+  * New upstream release. Urgency high due to multiple critical bugfixes that
+    could potentially brick the PC (or worse: laptop) of users.
+    Other important fixes include:
+    + Properly writing Atmel AT25 chips would fail on some SPI controllers.
+    + Fix breakage with brick-potential on various non-x86 architectures.
+    + Fix broken reads on Winbond W25x16, especially on some ICH SPI chipsets.
+    + Fix write failure on 3COM NICs with parallel flash.
+    + Fix "byte merge" related corruption on some VIA chipsets.
+    + Fix some format string bugs.
+    + Fix hard hang on some recent (e.g. QM57) Intel chipsets.
+  * Install new upstream udev rules file to allow users to use flashrom
+    without root permissions on some (USB-based) programmers.
+  * Standards-Version: 3.9.1 (no changes required).
+  * debian/copyright: Updates.
+
+ -- Uwe Hermann <uwe@debian.org>  Sun, 15 Aug 2010 19:07:19 +0200
+
+flashrom (0.9.2+r1028-1) unstable; urgency=low
+
+  * New upstream release.
+  * Add dmidecode as Recommends on architectures where it's available.
+  * debian/README.Debian: Fix typo.
+  * debian/copyright: Update upstream svn URL.
+
+ -- Uwe Hermann <uwe@debian.org>  Fri, 04 Jun 2010 18:13:52 +0200
+
+flashrom (0.9.1+r946-1) unstable; urgency=high
+
+  * New upstream release.
+     + Urgency high, as it fixes multiple important bugs, including such bugs
+       which can potentially "brick" a user's mainboard. Details at
+       http://www.flashrom.org/pipermail/flashrom/2010-March/002507.html.
+     + This build should have a non-truncated manpage (Closes: #566217).
+  * Standards-Version: 3.8.4 (no changes required).
+
+ -- Uwe Hermann <uwe@debian.org>  Wed, 17 Mar 2010 09:50:05 +0100
+
+flashrom (0.9.1+r873-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Uwe Hermann <uwe@debian.org>  Wed, 20 Jan 2010 15:18:23 +0100
+
+flashrom (0.9.1+r792-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/control, debian/copyright: Update upstream website to flashrom.org.
+
+ -- Uwe Hermann <uwe@debian.org>  Tue, 08 Dec 2009 10:13:35 +0100
+
+flashrom (0.9.1+r736-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Uwe Hermann <uwe@debian.org>  Tue, 29 Sep 2009 13:09:58 +0200
+
+flashrom (0.9.1+r706-1) unstable; urgency=low
+
+  * New upstream release.
+  * Standards-Version: 3.8.3 (no changes required).
+  * debian/copyright: Update.
+
+ -- Uwe Hermann <uwe@debian.org>  Mon, 31 Aug 2009 18:32:13 +0200
+
+flashrom (0.9+r631-1) unstable; urgency=low
+
+  * New upstream release.
+     + The command line usage has changed a bit in this release:
+        + Combined operations like -wv or -Ewv are no longer allowed.
+        + The -w option automatically does an auto-verify after writing
+          (but you can also explicitly do it via 'flashrom -v file').
+        + The -E option is also automatically verified per default.
+     + Support for external programmers was added (-p), see manpage.
+     + Acer Aspire One is now marked unsupported upstream (Closes: #528308).
+  * Add build-dependency on libftdi-dev, flashrom now supports an
+    external libftdi-based programmer (ft2232spi).
+  * debian/patches/20_drop_svndef.patch: Drop, we use 'make tarball' now,
+    which properly handles svn version printing in flashrom.
+  * Standards-Version: 3.8.2 (no changes required).
+  * debian/copyright: Update.
+
+ -- Uwe Hermann <uwe@debian.org>  Thu, 25 Jun 2009 14:18:53 +0200
+
+flashrom (0.9+r544-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/patches/10_makefile.patch: Drop, no longer needed.
+  * debian/copyright: Update.
+
+ -- Uwe Hermann <uwe@debian.org>  Thu, 21 May 2009 21:34:03 +0200
+
+flashrom (0.9+r446-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Uwe Hermann <uwe@debian.org>  Sat, 11 Apr 2009 16:28:33 +0200
+
+flashrom (0.0+r3844-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Uwe Hermann <uwe@debian.org>  Sat, 27 Dec 2008 09:05:27 +0100
+
+flashrom (0.0+r3734-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Uwe Hermann <uwe@debian.org>  Sat, 08 Nov 2008 01:38:08 +0100
+
+flashrom (0.0+r3613-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/watch: Add dummy file to silence lintian (we track svn revisions).
+
+ -- Uwe Hermann <uwe@debian.org>  Sat, 27 Sep 2008 19:28:36 +0200
+
+flashrom (0.0+r3397-1) unstable; urgency=low
+
+  * New upstream release.
+  * Standards-Version: 3.8.0 (no changes required).
+
+ -- Uwe Hermann <uwe@debian.org>  Mon, 30 Jun 2008 17:11:25 +0200
+
+flashrom (0.0+r3274-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/control:
+    + pciutils-dev was renamed to libpci-dev (Closes: #478379).
+    + Drop ia64 from architectures list for now, unlikely to work.
+    + Don't link with -lz anymore, don't build-depend on zlib1g-dev.
+      We don't explicitly need zlib, libpci-dev now properly depends on it.
+  * Add upstream changelog ('svn log' output) to the package (Closes: #467398).
+
+ -- Uwe Hermann <uwe@debian.org>  Sun, 04 May 2008 00:34:44 +0200
+
+flashrom (0.0+r3112-2) unstable; urgency=low
+
+  * Fix debian/rules to make it work on Ubuntu, too (Closes: #466994).
+
+ -- Uwe Hermann <uwe@debian.org>  Sat, 23 Feb 2008 21:17:09 +0100
+
+flashrom (0.0+r3112-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Uwe Hermann <uwe@debian.org>  Thu, 21 Feb 2008 00:11:54 +0100
+
+flashrom (0.0+r3073-1) unstable; urgency=low
+
+  * New upstream release (Closes: #462248).
+    + Flashrom is now installed in /usr/sbin instead of /usr/bin.
+    + The manpage is now in section 8 (not 1).
+    + Fix broken references to old bug tracker URL (Closes: #460554).
+  * Restrict list of architectures to the known-working ones for now.
+    More architectures will gradually be re-added if we're sure they work.
+    + These are known to work: amd64, i386, kfreebsd-amd64, kfreebsd-i386
+    + These should work (untested, though): alpha, hurd-i386, ia64,
+      netbsd-alpha, netbsd-i386
+    + These are disabled for now, as flashrom will very likely not work: arm,
+      armel, armeb, hppa, m32r, m68k, mips, mipsel, powerpc, sh, sparc, s390
+  * Standards-Version: 3.7.3 (no changes required).
+  * debian/control:
+     + Add Homepage field.
+     + Update package description.
+  * debian/copyright: Update URLs and list of authors.
+  * Simplified packaging a bit.
+
+ -- Uwe Hermann <uwe@debian.org>  Thu, 24 Jan 2008 13:47:48 +0100
+
+flashrom (0.0+r2769-1) unstable; urgency=low
+
+  * New upstream release.
+  * Do not attempt to build flashrom on S/390, as it doesn't build
+    and is not useful there anyway (Closes: #404342, #418712).
+    It is yet to be determined on which other architectures flashrom can
+    work and on which not.
+  * Honour DEB_BUILD_OPTIONS=nostrip variable by removing hardcoded 'strip'
+    invocation in the Makefile and letting cdbs handle it (Closes: #436850).
+
+ -- Uwe Hermann <uwe@debian.org>  Tue, 11 Sep 2007 17:54:11 +0200
+
+flashrom (0.0+r2739-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Uwe Hermann <uwe@debian.org>  Sun, 15 Jul 2007 15:23:51 +0200
+
+flashrom (0.0+r2601-1) unstable; urgency=low
+
+  * New upstream release.
+  * Drop a few patches which are now merged upstream.
+
+ -- Uwe Hermann <uwe@debian.org>  Tue, 10 Apr 2007 12:38:58 +0200
+
+flashrom (0.0+r2526-2) unstable; urgency=medium
+
+  * Add missing build dependency on zlib1g-dev (Closes: #403322).
+    Thanks Julien Danjou <acid@debian.org> and
+    Alex de Oliveira Silva <enerv@host.sk>.
+  * Standards-Version: 3.7.2.2 (no changes required).
+
+ -- Uwe Hermann <uwe@debian.org>  Tue, 19 Dec 2006 10:36:04 +0100
+
+flashrom (0.0+r2526-1) unstable; urgency=low
+
+  * New upstream release.
+  * Do not compile in DoC support (it's considered unsupported upstream).
+    This will also make the flash part identification process a lot faster.
+
+ -- Uwe Hermann <uwe@debian.org>  Thu, 14 Dec 2006 18:37:07 +0100
+
+flashrom (0.0+r2504-1) unstable; urgency=low
+
+  * Initial release (Closes: #399893).
+
+ -- Uwe Hermann <uwe@debian.org>  Thu, 14 Dec 2006 16:56:49 +0100
diff --git a/debian/clean b/debian/clean
new file mode 100644
index 00000000..e4e16486
--- /dev/null
+++ b/debian/clean
@@ -0,0 +1,2 @@
+build_details.txt
+obj-*/
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 00000000..b1bd38b6
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+13
diff --git a/debian/control b/debian/control
new file mode 100644
index 00000000..ea845aaf
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,122 @@
+Source: flashrom
+Section: electronics
+Priority: optional
+Maintainer: PureOS Maintainers <pureos-project@lists.puri.sm>
+Uploaders: Jeremiah C. Foster <jeremiah.foster@puri.sm>
+XSBC-Original-Maintainer: Jonas Smedegaard <jonas.smedegaard@puri.sm>
+Build-Depends: debhelper (>= 11), pkg-config, libpci-dev, libusb-1.0-0-dev [!hurd-i386], libftdi1-dev [!hurd-i386], meson
+Standards-Version: 4.5.0
+Vcs-Git: https://source.puri.sm/pureos/core/flashrom.git
+Vcs-Browser: https://source.puri.sm/pureos/core/flashrom
+Homepage: http://www.flashrom.org
+
+Package: flashrom
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Identify, read, write, erase, and verify BIOS/ROM/flash chips
+ flashrom is a tool for identifying, reading, writing, verifying and erasing
+ flash chips. It's often used to flash BIOS/EFI/coreboot/firmware/optionROM
+ images in-system using a supported mainboard, but it also supports flashing of
+ network cards (NICs), SATA controller cards, and other external devices which
+ can program flash chips.
+ .
+ It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32/40/48,
+ and BGA chips, which use various protocols such as LPC, FWH, parallel
+ flash, or SPI.
+ .
+ The tool can be used to flash BIOS/firmware images for example -- be it
+ proprietary BIOS images or coreboot (previously known as LinuxBIOS) images.
+ .
+ It can also be used to read the current existing BIOS/firmware from a
+ flash chip.
+ .
+ Currently supported programmers include:
+ .
+   * internal (for in-system flashing in the mainboard)
+   * dummy (virtual programmer for testing flashrom)
+   * nic3com (for flash ROMs on 3COM network cards)
+   * nicrealtek (for flash ROMs on Realtek and SMC 1211 network cards)
+   * nicnatsemi (for flash ROMs on National Semiconductor DP838* network cards)
+   * nicintel (for parallel flash ROMs on Intel 10/100Mbit network cards)
+   * gfxnvidia (for flash ROMs on NVIDIA graphics cards)
+   * drkaiser (for flash ROMs on Dr. Kaiser PC-Waechter PCI cards)
+   * satasii (for flash ROMs on Silicon Image SATA/IDE controllers)
+   * satamv (for flash ROMs on Marvell SATA controllers)
+   * atahpt (for flash ROMs on Highpoint ATA/RAID controllers)
+   * atavia (for flash ROMs on VIA VT6421A SATA controllers)
+   * atapromise (for flash ROMs on Promise PDC2026x ATA/RAID controllers)
+   * it8212 (for flash ROMs on ITE IT8212F ATA/RAID controller)
+   * ft2232_spi (for SPI flash ROMs attached to an FT2232/FT4232H/FT232H family
+     based USB SPI programmer), including the DLP Design DLP-USB1232H,
+     FTDI FT2232H Mini-Module, FTDI FT4232H Mini-Module, openbiosprog-spi,
+     Amontec JTAGkey/JTAGkey-tiny/JTAGkey-2, Dangerous Prototypes Bus Blaster,
+     Olimex ARM-USB-TINY/-H, Olimex ARM-USB-OCD/-H, TIAO/DIYGADGET USB
+     Multi-Protocol Adapter (TUMPA), TUMPA Lite, GOEPEL PicoTAP,
+     Google Servo v1/v2, and FIC OpenMoko Neo1973 Debug board.
+   * serprog (for flash ROMs attached to a programmer speaking serprog),
+     including AVR flasher by Urja Rannikko, AVR flasher by eightdot,
+     Arduino Mega flasher by fritz, InSystemFlasher by Juhana Helovuo,
+     and atmegaXXu2-flasher by Stefan Tauner.
+   * buspirate_spi (for SPI flash ROMs attached to a Bus Pirate)
+   * dediprog (for SPI flash ROMs attached to a Dediprog SF100)
+   * rayer_spi (for SPI flash ROMs attached to a RayeR parport based programmer)
+   * pony_spi (for SPI flash ROMs attached to a SI-Prog serial port
+     bitbanging adapter)
+   * nicintel_spi (for SPI flash ROMs on Intel Gigabit network cards)
+   * ogp_spi (for SPI flash ROMs on Open Graphics Project graphics card)
+   * linux_spi (for SPI flash ROMs accessible via /dev/spidevX.Y on Linux)
+   * usbblaster_spi (for SPI flash ROMs attached to an Altera USB-Blaster)
+   * nicintel_eeprom (for SPI EEPROMs on Intel Gigabit network cards)
+   * mstarddc_spi (for SPI flash ROMs accessible through DDC in MSTAR-equipped
+     displays)
+   * pickit2_spi (for SPI flash ROMs accessible via Microchip PICkit2)
+   * ch341a_spi (for SPI flash ROMs attached to WCH CH341A)
+
+Package: libflashrom-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Depends: libflashrom1 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Description: BIOS/ROM/flash chips - development files
+ flashrom is a tool for identifying, reading, writing, verifying and erasing
+ flash chips. It's often used to flash BIOS/EFI/coreboot/firmware/optionROM
+ images in-system using a supported mainboard, but it also supports flashing of
+ network cards (NICs), SATA controller cards, and other external devices which
+ can program flash chips.
+ .
+ It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32/40/48,
+ and BGA chips, which use various protocols such as LPC, FWH, parallel
+ flash, or SPI.
+ .
+ The tool can be used to flash BIOS/firmware images for example -- be it
+ proprietary BIOS images or coreboot (previously known as LinuxBIOS) images.
+ .
+ It can also be used to read the current existing BIOS/firmware from a
+ flash chip.
+ .
+ This package provides flashrom header development files.
+
+Package: libflashrom1
+Section: libs
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Identify, read, write, erase, and verify BIOS/ROM/flash chips - library
+ flashrom is a tool for identifying, reading, writing, verifying and erasing
+ flash chips. It's often used to flash BIOS/EFI/coreboot/firmware/optionROM
+ images in-system using a supported mainboard, but it also supports flashing of
+ network cards (NICs), SATA controller cards, and other external devices which
+ can program flash chips.
+ .
+ It supports a wide range of DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32/40/48,
+ and BGA chips, which use various protocols such as LPC, FWH, parallel
+ flash, or SPI.
+ .
+ The tool can be used to flash BIOS/firmware images for example -- be it
+ proprietary BIOS images or coreboot (previously known as LinuxBIOS) images.
+ .
+ It can also be used to read the current existing BIOS/firmware from a
+ flash chip.
+ .
+ This package provides flashrom library development files.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 00000000..0acee4f0
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,288 @@
+This package was debianized by Uwe Hermann <uwe@debian.org> on
+Thu, 23 Nov 2006 14:48:04 +0100.
+
+It was downloaded from:
+
+   https://review.coreboot.org/cgit/flashrom.git
+
+Upstream Authors:
+
+   Various flashrom developers
+
+-------------------------------------------------------------------------------
+
+Files: *
+Copyright: © 2000 Silicon Integrated System Corporation
+License: GPL-2+
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL-2'.
+
+-------------------------------------------------------------------------------
+
+Files: atahpt.c, gfxnvidia.c, nic3com.c, pcidev.c, util/z60_flashrom.rules
+Copyright: © 2009-2010 Uwe Hermann <uwe@hermann-uwe.de>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: bitbang_spi.c, buspirate_spi.c, dediprog.c, processor_enable.c, rayer_spi.c, chipdrivers.h, hwaccess.h, spi.h, mcp6x_spi.c
+Copyright: © 2009-2010 Carl-Daniel Hailfinger
+License: GPL-2
+
+-------------------------------------------------------------------------------
+
+Files: board_enable.c
+Copyright: © 2005-2007 coresystems GmbH <stepan@coresystems.de>
+           © 2006 Uwe Hermann <uwe@hermann-uwe.de>
+           © 2007-2009 Luc Verhaegen <libv@skynet.be>
+           © 2007 Carl-Daniel Hailfinger
+License: GPL-2
+
+-------------------------------------------------------------------------------
+
+Files: cbtable.c
+Copyright: © 2002 Steven James <pyro@linuxlabs.com>
+           © 2002 Linux Networx
+           © 2006-2009 coresystems GmbH
+           © 2010 Carl-Daniel Hailfinger
+License: GPL-2
+
+-------------------------------------------------------------------------------
+
+Files: chipset_enable.c
+Copyright: © 2000 Silicon Integrated System Corporation
+           © 2005-2009 coresystems GmbH <stepan@coresystems.de>
+           © 2006 Uwe Hermann <uwe@hermann-uwe.de>
+           © 2007-2009 Carl-Daniel Hailfinger
+           © 2009 Kontron Modular Computers GmbH
+License: GPL-2
+
+-------------------------------------------------------------------------------
+
+Files: cli_classic.c
+Copyright: © 2000 Silicon Integrated System Corporation
+           © 2004 Tyan Corp <yhlu@tyan.com>
+           © 2005-2008 coresystems GmbH
+           © 2008-2010 Carl-Daniel Hailfinger
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: cli_output.c
+Copyright: © 2009 Sean Nelson <audiohacked@gmail.com>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: dmi.c
+Copyright: © 2009-2010 Michael Karcher
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: drkaiser.c, nicrealtek.c
+Copyright: © 2009 Joerg Fischer <turboj@web.de>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: dummyflasher.c, hwaccess.c, internal.c, programmer.c, programmer.h
+Copyright: © 2007-2010 Carl-Daniel Hailfinger
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: coreboot_tables.h
+Copyright: © 2002 Linux Networx
+           © 2005-2007 coresystems GmbH
+License: GPL-2
+
+-------------------------------------------------------------------------------
+
+Files: flashchips.c
+Copyright: © 2000 Silicon Integrated System Corporation
+           © 2004 Tyan Corp
+           © 2005-2008 coresystems GmbH <stepan@openbios.org>
+           © 2006-2009 Carl-Daniel Hailfinger
+           © 2009 Sean Nelson <audiohacked@gmail.com>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: flashchips.h, flash.h
+Copyright: © 2000 Silicon Integrated System Corporation
+           © 2000 Ronald G. Minnich <rminnich@gmail.com>
+           © 2005-2009 coresystems GmbH <stepan@openbios.org>
+           © 2006-2009 Carl-Daniel Hailfinger
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: flashrom.c
+Copyright: © 2000 Silicon Integrated System Corporation
+           © 2004 Tyan Corp <yhlu@tyan.com>
+           © 2005-2008 coresystems GmbH
+	   © 2008,2009 Carl-Daniel Hailfinger
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: ft2232_spi.c
+Copyright: © 2009 Paul Fox <pgf@laptop.org>
+           © 2009-2010 Carl-Daniel Hailfinger
+License: GPL-2
+
+-------------------------------------------------------------------------------
+
+Files: ichspi.c
+Copyright: © 2008 Stefan Wildemann <stefan.wildemann@kontron.com>
+           © 2008 Claus Gindhart <claus.gindhart@kontron.com>
+           © 2008 Dominik Geyer <dominik.geyer@kontron.com>
+           © 2008 coresystems GmbH <info@coresystems.de>
+           © 2009-2010 Carl-Daniel Hailfinger
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: it87spi.c
+Copyright: © 2007-2009 Carl-Daniel Hailfinger
+           © 2008 Ronald Hoogenboom <ronald@zonnet.nl>
+           © 2008 coresystems GmbH
+License: GPL-2
+
+-------------------------------------------------------------------------------
+
+Files: jedec.c
+Copyright: © 2000 Silicon Integrated System Corporation
+           © 2006 Giampiero Giancipoli <gianci@email.it>
+           © 2006 coresystems GmbH <info@coresystems.de>
+           © 2007 Carl-Daniel Hailfinger
+           © 2009 Sean Nelson <audiohacked@gmail.com>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: layout.c, w39v080fa.c
+Copyright: © 2005-2008 coresystems GmbH
+License: GPL-2
+
+-------------------------------------------------------------------------------
+
+Files: Makefile, spi25.c, spi.c
+Copyright: © 2005-2008 coresystems GmbH
+           © 2007-2010 Carl-Daniel Hailfinger
+License: GPL-2
+
+-------------------------------------------------------------------------------
+
+Files: nicnatsemi.c
+Copyright: © 2010 Andrew Morgan <ziltro@ziltro.com>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: physmap.c
+Copyright: © 2008-2009 Peter Stuge <peter@stuge.se>
+           © 2009 coresystems GmbH
+           © 2010 Carl-Daniel Hailfinger
+           © 2010 Rudolf Marek <r.marek@assembler.cz>
+License: GPL-2
+
+-------------------------------------------------------------------------------
+
+Files: pm49fl00x.c
+Copyright: © 2004 Tyan Corporation
+           © 2007 Nikolay Petukhov <nikolay.petukhov@gmail.com>
+           © 2007 Reinder E.N. de Haan <lb_reha@mveas.com>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: print.c, print_wiki.c
+Copyright: © 2009 Uwe Hermann <uwe@hermann-uwe.de>
+           © 2009 Carl-Daniel Hailfinger
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: satasii.c
+Copyright: © 2009 Rudolf Marek <r.marek@assembler.cz>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: sb600spi.c
+Copyright: © 2008 Wang Qingpei <Qingpei.Wang@amd.com>
+           © 2008 Joe Bao <Zheng.Bao@amd.com>
+           © 2008 Advanced Micro Devices, Inc
+           © 2009-2010 Carl-Daniel Hailfinger
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: serial.c, serprog.c
+Copyright: © 2009 Urja Rannikko <urjaman@gmail.com>
+           © 2009-2010 Carl-Daniel Hailfinger
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: sst28sf040.c, sst49lfxxxc.c
+Copyright: © 2000 Silicon Integrated System Corporation
+           © 2005-2007 coresystems GmbH <stepan@openbios.org>
+           © 2009 Sean Nelson <audiohacked@gmail.com>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: sst_fwhub.c
+Copyright: © 2000 Silicon Integrated System Corporation
+           © 2009 Kontron Modular Computers
+           © 2009 Sean Nelson <audiohacked@gmail.com>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: stm50flw0x0x.c
+Copyright: © 2008 Claus Gindhart <claus.gindhart@kontron.com>
+           © 2009 Sean Nelson <audiohacked@gmail.com>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: udelay.c
+Copyright: © 2000 Silicon Integrated System Corporation
+           © 2009-2010 Carl-Daniel Hailfinger
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: w29ee011.c
+Copyright: © 2007 Markus Boas <ryven@ryven.de>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: w39v040c.c
+Copyright: © 2008-2009 Peter Stuge <peter@stuge.se>
+License: GPL-2+
+
+-------------------------------------------------------------------------------
+
+Files: wbsio_spi.c
+Copyright: © 2008 Peter Stuge <peter@stuge.se>
+Copyright: © 2009-2010 Carl-Daniel Hailfinger
+License: GPL-2
+
+-------------------------------------------------------------------------------
+
+Files: debian/*
+Copyright: © 2006-2014 Uwe Hermann <uwe@debian.org>
+License: PD
+   The packaging done by Uwe Hermann <uwe@debian.org> is hereby
+   released as public domain.
+
+Files: debian/changelog, rules
+Copyright: © 2006-2014 Uwe Hermann <uwe@debian.org>
+	   © 2020 Purism Spc <pureos-project@lists.puri.sm>
diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 00000000..236670a2
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1 @@
+usr/sbin
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 00000000..d00c3e5c
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,2 @@
+Documentation/serprog-protocol.txt
+Documentation/mysteries_intel.txt
diff --git a/debian/flashrom.install b/debian/flashrom.install
new file mode 100644
index 00000000..9bb37e4c
--- /dev/null
+++ b/debian/flashrom.install
@@ -0,0 +1,2 @@
+usr/sbin
+debian/org.flashrom.flashrom.metainfo.xml usr/share/metainfo
diff --git a/debian/flashrom.udev b/debian/flashrom.udev
new file mode 100644
index 00000000..59de68be
--- /dev/null
+++ b/debian/flashrom.udev
@@ -0,0 +1,92 @@
+##
+## This file is part of the flashrom project.
+##
+## Copyright (C) 2010 Uwe Hermann <uwe@hermann-uwe.de>
+##
+## 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.
+##
+
+##
+## Please keep this list sorted alphabetically by vendor/device name.
+##
+
+##
+## This is tested on udev version 154, other versions may need small fixes.
+##
+## Note that you might want to change the "plugdev" group to whatever is
+## suitable for your respective distribution.
+##
+
+ACTION!="add|change", GOTO="flashrom_rules_end"
+SUBSYSTEM!="usb|usb_device", GOTO="flashrom_rules_end"
+
+# Amontec JTAGkey(2)
+# http://www.amontec.com/jtagkey.shtml
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="664", GROUP="plugdev"
+
+# Buspirate
+# http://dangerousprototypes.com/2009/10/08/bus-pirate-raw-spi-mode/
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="664", GROUP="plugdev"
+
+# Dediprog SF100
+# http://www.dediprog.com/SPI-flash-in-circuit-programming/SF100
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="dada", MODE="664", GROUP="plugdev"
+
+# DLP Design DLP-USB1232H
+# http://www.dlpdesign.com/usb/usb1232h.shtml
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="664", GROUP="plugdev"
+
+# FIC OpenMoko Neo1973 Debug board (V2+)
+# http://wiki.openmoko.org/wiki/Neo1973_Debug_Board_v2
+ATTRS{idVendor}=="1457", ATTRS{idProduct}=="5118", MODE="664", GROUP="plugdev"
+
+# FTDI FT4232H Mini-Module
+# http://www.ftdichip.com/Products/EvaluationKits/FT4232H_MiniModule.htm
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE="664", GROUP="plugdev"
+
+# GOEPEL PicoTAP
+# http://www.goepel.com/jtagboundary-scan/hardware/picotap.html
+ATTRS{idVendor}=="096c", ATTRS{idProduct}=="1449", MODE="664", GROUP="plugdev"
+
+# Google servo debug board
+# https://www.chromium.org/chromium-os/servo
+ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="5001", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="5002", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="5003", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-USB-OCD
+# http://olimex.com/dev/arm-usb-ocd.html
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0003", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-USB-OCD-H
+# http://olimex.com/dev/arm-usb-ocd-h.html
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002b", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-USB-TINY
+# http://olimex.com/dev/arm-usb-tiny.html
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0004", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-USB-TINY-H
+# http://olimex.com/dev/arm-usb-tiny-h.html
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002a", MODE="664", GROUP="plugdev"
+
+# TIAO/DIYGADGET USB Multi-Protocol Adapter (TUMPA)
+# http://www.diygadget.com/tiao-usb-multi-protocol-adapter-jtag-spi-i2c-serial.html
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a98", MODE="664", GROUP="plugdev"
+
+# TIAO/DIYGADGET USB Multi-Protocol Adapter (TUMPA) Lite
+# http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_Lite_User's_Manual
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a99", MODE="664", GROUP="plugdev"
+
+# Winchiphead (WCH) CH341a based programmer
+ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5512", MODE="664", GROUP="plugdev"
+
+LABEL="flashrom_rules_end"
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 00000000..4e94eb41
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,2 @@
+[DEFAULT]
+upstream-tag = v%(version)s
diff --git a/debian/libflashrom-dev.install b/debian/libflashrom-dev.install
new file mode 100644
index 00000000..92ecfa5c
--- /dev/null
+++ b/debian/libflashrom-dev.install
@@ -0,0 +1,3 @@
+usr/include
+usr/lib/*/pkgconfig
+usr/lib/*/libflashrom*.so
diff --git a/debian/libflashrom1.install b/debian/libflashrom1.install
new file mode 100644
index 00000000..b8b2e1c4
--- /dev/null
+++ b/debian/libflashrom1.install
@@ -0,0 +1 @@
+usr/lib/*/libflashrom.so.*
diff --git a/debian/manpages b/debian/manpages
new file mode 100644
index 00000000..042fa119
--- /dev/null
+++ b/debian/manpages
@@ -0,0 +1 @@
+flashrom.8
diff --git a/debian/org.flashrom.flashrom.metainfo.xml b/debian/org.flashrom.flashrom.metainfo.xml
new file mode 100644
index 00000000..8b2ba9f6
--- /dev/null
+++ b/debian/org.flashrom.flashrom.metainfo.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component type="console-application">
+  <id>org.flashrom.flashrom</id>
+  
+  <name>flashrom</name>
+  <summary>Identify, read, write, erase, and verify BIOS/ROM/flash chips</summary>
+  
+  <metadata_license>CC-BY-SA-4.0</metadata_license>
+  <project_license>GPL-2.0-or-later and GPL-2.0-only</project_license>
+  
+  <description>
+    <p>
+      flashrom is a tool for identifying, reading, writing, verifying and erasing  flash chips. It&apos;s often used to flash BIOS/EFI/coreboot/firmware/optionROM  images in-system using a supported mainboard, but it also supports flashing of  network cards (NICs), SATA controller cards, and other external devices which  can program flash chips.
+    </p>
+  </description>
+  
+  <icon type="stock">flashrom</icon>
+  
+  <categories>
+    <category>System</category>
+    <category>Electronics</category>
+  </categories>
+  
+  <provides>
+    <binary>flashrom</binary>
+  </provides>
+</component>
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 00000000..60363b17
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,41 @@
+#!/usr/bin/make -f
+
+#include /usr/share/cdbs/1/rules/debhelper.mk
+#include /usr/share/cdbs/1/rules/utils.mk
+#include /usr/share/cdbs/1/class/makefile.mk
+
+DEB_MAKE_INSTALL_TARGET := install PREFIX=$(CURDIR)/debian/flashrom/usr
+
+# Reduce the number of unneeded dependencies with --as-needed.
+LDFLAGS += "-Wl,--as-needed"
+
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DH_VERBOSE = 1
+export BUILD=
+
+%:
+	dh $@
+
+override_dh_auto_configure:
+	dh_auto_configure -Smeson -- $$BUILD
+override_dh_auto_build:
+	dh_auto_build -Smeson
+	make flashrom.8
+override_dh_auto_install:
+	dh_auto_install -Smeson
+
+# avoid NEW queue in PureOS
+# export DH_OPTIONS += --no-automatic-dbgsym
+
+# DEB_MAKE_INSTALL_TARGET := install PREFIX=$(CURDIR)/debian/flashrom/usr
+
+
+# post-patches::
+# 	@# Copy udev rules file into debian/ so that dh_installudev finds it.
+# 	cp util/z60_flashrom.rules debian/flashrom.udev
+
+# clean::
+# 	rm -f .dependencies .features .libdeps
+# 	rm -f debian/flashrom.udev
+
+# common-binary-post-install-arch:: list-missing
diff --git a/debian/shlibs.local b/debian/shlibs.local
new file mode 100644
index 00000000..dbf499ef
--- /dev/null
+++ b/debian/shlibs.local
@@ -0,0 +1 @@
+libflashrom 1.2 libflashrom (>> 1.2-0), libflashrom (<< 1.2-99)
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 00000000..163aaf8d
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 00000000..7c3dd399
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,5 @@
+version=4
+# GitHub hosted projects
+opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%$1.tar.gz%" \
+https://github.com/flashrom/flashrom/tags \
+(?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate
diff --git a/util/git-hooks/applypatch-msg b/util/git-hooks/applypatch-msg
deleted file mode 100755
index 32ff6c70..00000000
--- a/util/git-hooks/applypatch-msg
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-#
-# A hook script to check the commit log message taken by
-# applypatch from an e-mail message (via git-am).
-# We simply do the same as for other commit messages
-#
-# The hook should exit with non-zero status after issuing an
-# appropriate message if it wants to stop the commit.  The hook is
-# allowed to edit the commit message file.
-#
-
-. git-sh-setup
-test -x "$GIT_DIR/hooks/commit-msg" &&
-	exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"}
-:
diff --git a/util/git-hooks/commit-msg b/util/git-hooks/commit-msg
deleted file mode 100755
index d43eb452..00000000
--- a/util/git-hooks/commit-msg
+++ /dev/null
@@ -1,220 +0,0 @@
-#!/bin/sh
-#
-# Change-ID amending from Gerrit Code Review 2.14.2
-#
-# Part of Gerrit Code Review (https://www.gerritcodereview.com/)
-#
-# Copyright (C) 2009 The Android Open Source Project
-#
-# Any other changes including test_duplicate_signoffs_acks
-#
-# Copyright (C) 2017 Stefan Tauner
-#
-# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-unset GREP_OPTIONS
-
-CHANGE_ID_AFTER="Bug|Depends-On|Issue|Test|Feature|Fixes|Fixed|Staging-ID"
-MSG="$1"
-
-DEV_GUIDELINES_URL="https://www.flashrom.org/Development_Guidelines"
-
-# Check for, and add if missing, a unique Change-Id
-#
-add_ChangeId() {
-	clean_message=`sed -e '
-		/^diff --git .*/{
-			s///
-			q
-		}
-		/^Signed-off-by:/d
-		/^#/d
-	' "$MSG" | git stripspace`
-	if test -z "$clean_message"
-	then
-		return
-	fi
-
-	# *Do* add Change-Id to temp commits (original code bails out here)
-	# if echo "$clean_message" | head -1 | grep -q '^\(fixup\|squash\)!'
-	# then
-	#	return
-	# fi
-
-	if test "false" = "`git config --bool --get gerrit.createChangeId`"
-	then
-		return
-	fi
-
-	# Does Change-Id: already exist? if so, exit (no change).
-	if grep -i '^Change-Id:' "$MSG" >/dev/null
-	then
-		return
-	fi
-
-	id=`_gen_ChangeId`
-	T="$MSG.tmp.$$"
-	AWK=awk
-	if [ -x /usr/xpg4/bin/awk ]; then
-		# Solaris AWK is just too broken
-		AWK=/usr/xpg4/bin/awk
-	fi
-
-	# Get core.commentChar from git config or use default symbol
-	commentChar=`git config --get core.commentChar`
-	commentChar=${commentChar:-#}
-
-	# How this works:
-	# - parse the commit message as (textLine+ blankLine*)*
-	# - assume textLine+ to be a footer until proven otherwise
-	# - exception: the first block is not footer (as it is the title)
-	# - read textLine+ into a variable
-	# - then count blankLines
-	# - once the next textLine appears, print textLine+ blankLine* as these
-	#   aren't footer
-	# - in END, the last textLine+ block is available for footer parsing
-	$AWK '
-	BEGIN {
-		# while we start with the assumption that textLine+
-		# is a footer, the first block is not.
-		isFooter = 0
-		footerComment = 0
-		blankLines = 0
-	}
-
-	# Skip lines starting with commentChar without any spaces before it.
-	/^'"$commentChar"'/ { next }
-
-	# Skip the line starting with the diff command and everything after it,
-	# up to the end of the file, assuming it is only patch data.
-	# If more than one line before the diff was empty, strip all but one.
-	/^diff --git / {
-		blankLines = 0
-		while (getline) { }
-		next
-	}
-
-	# Count blank lines outside footer comments
-	/^$/ && (footerComment == 0) {
-		blankLines++
-		next
-	}
-
-	# Catch footer comment
-	/^\[[a-zA-Z0-9-]+:/ && (isFooter == 1) {
-		footerComment = 1
-	}
-
-	/]$/ && (footerComment == 1) {
-		footerComment = 2
-	}
-
-	# We have a non-blank line after blank lines. Handle this.
-	(blankLines > 0) {
-		print lines
-		for (i = 0; i < blankLines; i++) {
-			print ""
-		}
-
-		lines = ""
-		blankLines = 0
-		isFooter = 1
-		footerComment = 0
-	}
-
-	# Detect that the current block is not the footer
-	(footerComment == 0) && (!/^\[?[a-zA-Z0-9-]+:/ || /^[a-zA-Z0-9-]+:\/\//) {
-		isFooter = 0
-	}
-
-	{
-		# We need this information about the current last comment line
-		if (footerComment == 2) {
-			footerComment = 0
-		}
-		if (lines != "") {
-			lines = lines "\n";
-		}
-		lines = lines $0
-	}
-
-	# Footer handling:
-	# If the last block is considered a footer, splice in the Change-Id at the
-	# right place.
-	# Look for the right place to inject Change-Id by considering
-	# CHANGE_ID_AFTER. Keys listed in it (case insensitive) come first,
-	# then Change-Id, then everything else (eg. Signed-off-by:).
-	#
-	# Otherwise just print the last block, a new line and the Change-Id as a
-	# block of its own.
-	END {
-		unprinted = 1
-		if (isFooter == 0) {
-			print lines "\n"
-			lines = ""
-		}
-		changeIdAfter = "^(" tolower("'"$CHANGE_ID_AFTER"'") "):"
-		numlines = split(lines, footer, "\n")
-		for (line = 1; line <= numlines; line++) {
-			if (unprinted && match(tolower(footer[line]), changeIdAfter) != 1) {
-				unprinted = 0
-				print "Change-Id: I'"$id"'"
-			}
-			print footer[line]
-		}
-		if (unprinted) {
-			print "Change-Id: I'"$id"'"
-		}
-	}' "$MSG" > "$T" && mv "$T" "$MSG" || rm -f "$T"
-}
-_gen_ChangeIdInput() {
-	echo "tree `git write-tree`"
-	if parent=`git rev-parse "HEAD^0" 2>/dev/null`
-	then
-		echo "parent $parent"
-	fi
-	echo "author `git var GIT_AUTHOR_IDENT`"
-	echo "committer `git var GIT_COMMITTER_IDENT`"
-	echo
-	printf '%s' "$clean_message"
-}
-_gen_ChangeId() {
-	_gen_ChangeIdInput |
-	git hash-object -t commit --stdin
-}
-
-test_signoff() {
-	if ! grep -qi '^[[:space:]]*\+Signed-off-by:' "$MSG"; then
-		printf "\nError: No Signed-off-by line in the commit message.\n"
-		printf "See: ${DEV_GUIDELINES_URL}\n"
-		exit 1
-	fi
-}
-
-# Test for duplicate signoffs/acks
-test_duplicate_signoffs_acks() {
-	test "" = "$(grep -i '^(Signed-off-by|Acked-by): ' "$MSG" |
-		 sort | uniq -c | sed -e '/^[[:space:]]*1[[:space:]]/d')" || {
-		echo "Duplicate Signed-off-by or Acked-by lines." >&2
-		exit 1
-	}
-}
-
-main() {
-	test_signoff
-	test_duplicate_signoffs_acks
-	add_ChangeId
-}
-
-main
diff --git a/util/git-hooks/install.sh b/util/git-hooks/install.sh
deleted file mode 100755
index fda0098f..00000000
--- a/util/git-hooks/install.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh -e
-
-root=$(git rev-parse --show-cdup 2>/dev/null) || \
-     { echo "Not under git control. Cannot install git hooks." >&2 ; exit 0 ; }
-
-[ -z "${root}" ] || \
-     { echo "Not in root directory. Can only run from git root." >&2 ; exit 1 ; }
-
-src=util/git-hooks/ # relative to root
-hooks=$(cd "${src}" && git ls-files -c | grep -Ev 'install.sh|wrapper.sh')
-
-if [ "$(git rev-parse --git-path 2>/dev/null)" = "--git-path" ]; then
-	# very old git, we have to guess
-	dst=".git/hooks/"
-	rel="../../"
-else
-	dst=$(git rev-parse --git-path hooks/)
-	rel=$(git rev-parse --prefix "${dst}" --show-cdup)
-fi
-
-for h in $hooks; do
-	# Test if hook is not already installed, i.e. doesn't point at the wrapper
-	if [ ! "${dst}$h" -ef "${src}wrapper.sh" ]; then
-		# preserve custom hooks if any
-		if [ -e "${dst}$h" ]; then
-			mv "${dst}$h" "${dst}$h.local"
-		fi
-		ln -s "${rel}${src}wrapper.sh" "${dst}$h"
-	fi
-done
diff --git a/util/git-hooks/pre-applypatch b/util/git-hooks/pre-applypatch
deleted file mode 100755
index 2ed28f71..00000000
--- a/util/git-hooks/pre-applypatch
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to verify what is about to be committed
-# by applypatch from an e-mail message.
-#
-# The hook should exit with non-zero status after issuing an
-# appropriate message if it wants to stop the commit.
-
-. git-sh-setup
-test -x "$GIT_DIR/hooks/pre-commit" &&
-	exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"}
-:
diff --git a/util/git-hooks/pre-commit b/util/git-hooks/pre-commit
deleted file mode 100755
index dbccb9e2..00000000
--- a/util/git-hooks/pre-commit
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-#
-# A hook script to verify what is about to be committed.
-# Called by "git commit" with no arguments.  The hook should
-# exit with non-zero status after issuing an appropriate message if
-# it wants to stop the commit.
-
-# Check for whitespace errors
-git diff-index --check --cached HEAD -- || exit 1
diff --git a/util/git-hooks/pre-push b/util/git-hooks/pre-push
deleted file mode 100755
index b5f4620e..00000000
--- a/util/git-hooks/pre-push
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-
-# A hook script to verify what is about to be pushed.  Called by "git
-# push" after it has checked the remote status, but before anything has been
-# pushed.  If this script exits with a non-zero status nothing will be pushed.
-#
-# This hook is called with the following parameters:
-#
-# $1 -- Name of the remote to which the push is being done
-# $2 -- URL to which the push is being done
-#
-# If pushing without using a named remote those arguments will be equal.
-#
-# Information about the commits which are being pushed is supplied as lines to
-# the standard input in the form:
-#
-#   <local ref> <local sha1> <remote ref> <remote sha1>
-
-remote="$1"
-url="$2"
-
-zero=0000000000000000000000000000000000000000
-
-upstream_pattern="github\.com.flashrom/flashrom(\.git)?|flashrom\.org.git/flashrom(\.git)?"
-
-# Only care about the upstream repositories
-if echo "$url" | grep -q -v -E "$upstream_pattern" ; then
-	exit 0
-fi
-
-while read local_ref local_sha remote_ref remote_sha ; do
-
-	# Only allow the stable and staging branches as well as versioned stable branches (e.g., 0.0.x).
-	# The matching expression's RE is always anchored to the first character (^ is undefined).
-	# The outer parentheses are needed to print out the whole matched string.
-	version=$(expr ${remote_ref#*refs/heads/} : '\(\([0-9]\+\.\)\{2,\}x\)$')
-	if [ "$remote_ref" != "refs/heads/staging" ] && \
-	   [ "$remote_ref" != "refs/heads/stable" ] && \
-	   [ -z "$version" ]; then
-		echo "Feature branches not allowed ($remote_ref)." >&2
-		exit 1
-	fi
-
-	if [ "$local_sha" = $zero ]; then
-		echo "Deletion of branches is prohibited." >&2
-		exit 1
-	fi
-
-	# Check for Signed-off-by and Acked-by
-	commit=$(git rev-list -n 1 --all-match --invert-grep -E \
-		--grep '^Signed-off-by: .+ <.+@.+\..+>$' \
-		--grep '^Acked-by: .+ <.+@.+\..+>$' \
-		"$remote_sha..$local_sha")
-	if [ -n "$commit" ]; then
-		echo "Commit $local_sha in $local_ref is missing either \"Signed-off-by\"" \
-			" or \"Acked-by\" lines, not pushing." >&2
-		exit 1
-	fi
-
-	# Make _really_ sure we do not rewrite history of any head/branch
-	if [ "${remote_ref#*refs/heads/}" != "$remote_ref" ]; then
-		nonreachable=$(git rev-list $remote_sha ^$local_sha | head -1)
-		if [ -n "$nonreachable" ]; then
-			echo "Only fast-forward pushes are allowed on branches." >&2
-			echo "At least $nonreachable is not included in $remote_sha while pushing to " \
-			     "$remote_ref" >&2
-			exit 1
-		fi
-	fi
-
-	# FIXME: check commit log format (subject without full stop at the end etc).
-	# FIXME: do buildbot checks if authorized?
-done
-
-exit 0
diff --git a/util/git-hooks/wrapper.sh b/util/git-hooks/wrapper.sh
deleted file mode 100755
index 3fc3e05c..00000000
--- a/util/git-hooks/wrapper.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-if [ -x $0.local ]; then
-	$0.local "$@" || exit $?
-fi
-
-hook=$(git rev-parse --show-toplevel)"/util/git-hooks/"$(basename $0)
-if [ -x $hook ]; then
-	$hook "$@" || exit $?
-fi
-- 
GitLab