aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.deblob
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.deblob')
-rw-r--r--Makefile.deblob80
1 files changed, 80 insertions, 0 deletions
diff --git a/Makefile.deblob b/Makefile.deblob
new file mode 100644
index 000000000000..bd172144b388
--- /dev/null
+++ b/Makefile.deblob
@@ -0,0 +1,80 @@
+# Copyright (C) 2021 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+CURL ?= curl
+CURLOPTS ?= -L
+MIRROR ?= https://cdn.kernel.org/pub/linux/kernel/v5.x
+
+.PHONY: all deblob-check delete-linux-tree verify-linux-signature
+
+all: deblob-5.10
+ ./deblob-5.10
+
+delete-linux-tree:
+ # Delete current linux-libre source code to make sure that all the files
+ # that are there were processed by the deblob scripts.
+ rm -f \
+ COPYING \
+ CREDITS \
+ Kbuild \
+ Kconfig \
+ MAINTAINERS \
+ Makefile \
+ README
+ rm -rf \
+ arch/ \
+ block/ \
+ certs/ \
+ crypto/ \
+ Documentation/ \
+ drivers/ \
+ fs/ \
+ include/ \
+ init/ \
+ ipc/ \
+ kernel/ \
+ lib/ \
+ LICENSES/ \
+ mm/ \
+ net/ \
+ samples/ \
+ scripts/ \
+ security/ \
+ sound/ \
+ tools/ \
+ usr/ \
+ virt/
+
+verify-linux-signature: deblob/linux-5.10.72.tar deblob/linux-5.10.72.tar.sign
+ # Greg Kroah-Hartman
+ gpg --list-keys 647F28654894E3BD457199BE38DBBDC86092693E || \
+ gpg --import deblob/647F28654894E3BD457199BE38DBBDC86092693E.gpg
+ gpg --verify $<.sign $<
+
+deblob-check:
+ ln -sf deblob/$@ $@
+
+deblob-5.10: deblob/linux-5.10.72.tar deblob-check delete-linux-tree verify-linux-signature
+ tar x -f $< --strip=1
+ ln -sf deblob/$@ ./
+
+deblob/%.tar.sign:
+ $(CURL) $(CURLOPTS) $(MIRROR)/$(notdir $@) -o $@
+
+deblob/%.tar.xz:
+ $(CURL) $(CURLOPTS) $(MIRROR)/$(notdir $@) -o $@
+
+deblob/%.tar: deblob/%.tar.xz
+ unxz --verbose $<