summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMikhail Kobuk <m.kobuk@ispras.ru>2024-04-06 16:00:01 +0300
committerMikhail Kobuk <m.kobuk@ispras.ru>2024-04-06 16:00:01 +0300
commit232c1cb726c809599ce69dbeda7f7f716f106801 (patch)
tree56d7b3f0222f24086bc968dd7d8ee0a4e59b4b7d /Makefile
downloadlinux-232c1cb726c809599ce69dbeda7f7f716f106801.tar.gz
Pre-EUPM build draft
TODO: convert to fakeroot TODO: separate most modules TODO: revise config TODO: adjust logging TODO: rework patch listing TODO: update patch selection
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile99
1 files changed, 99 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..35920e4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,99 @@
+VERSION=linux-6.8.4
+VERSION_DISTR = $(VERSION)-vmkos
+VERSION_BUILD = $(VERSION_DISTR)=-night
+
+TRUSTED_KEYS = ABAF11C65A2970B130ABE3C479BE3E4300411886 # Linus Torvalds
+TRUSTED_KEYS += 647F28654894E3BD457199BE38DBBDC86092693E # Greg Kroah-Hartman
+
+SRC_URL = https://cdn.kernel.org/pub/linux/kernel/v6.x/$(VERSION).tar.xz
+# PGP_SGN_URL = https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.8.4.tar.sign
+
+CFLAGS = -std=gnu2x -Wall -Werror -Wno-pointer-sign -Werror=vla
+
+ifdef ONELINE_OUTPUT
+ # SED_SUBST = | stdbuf --output=L sed 's/^/\\e[0A\\e[K3<>/gi'
+ SED_SUBST = | stdbuf --output=L ./interliner
+else
+SED_SUBST=
+endif
+
+SILENCE=
+ifdef QUIET
+SILENCE += >all.log
+endif
+
+ifdef SILENT
+SILENCE += 2>err.log
+endif
+
+OUT_FMT = $(SED_SUBST) $(SILENCE)
+
+default: all
+
+all: pre_install install post_install clean clean_misc
+
+pre_install: interliner $(VERSION).tar
+ # rm -f linux-6.8.4.tar.xz
+ @printf "> MAKING::$@\n"
+ tar --skip-old-files -xvf linux-6.8.4.tar.xz 2>tar.err.log | grep -v "skipping existing file" | sed 's/^/\t=> /g' $(OUT_FMT)
+ @printf "> MAKING::$@::DONE\n"
+
+install: interliner $(VERSION) clear.ok patch patch.ok build build.ok
+ # @printf "> MAKING::$@\n"
+ @printf "> MAKING::$@::DONE\n"
+
+
+post_install: interliner
+ # @printf "> MAKING::$@\n"
+ @printf "> MAKING::$@::DONE\n"
+
+.PHONY: pre_install install post_install
+
+$(VERSION).tar: $(VERSION).tar.xz $(VERSION).tar.sign
+ @printf "\t> MAKING::$@\n"
+
+ xz -kd $(VERSION).tar.xz | sed 's/^/\t==> /g' $(OUT_FMT)
+
+ifdef NO_VERIFY
+ @printf "\t==> Will not verify\n"
+else ifdef SKIP_VERIFY
+ @printf "\t==> Will not verify\n"
+else
+ @printf "\t==> Verifying...\n"
+
+ gpg2 --recv-keys $(TRUSTED_KEYS) $(OUT_FMT)
+ if [ "$$(gpg2 --logger-fd 1 --verify $(VERSION).tar.sign | grep 'Good signature')" == "" ]; then false; fi
+endif
+
+ @printf "\t> MAKING::$@::DONE\n"
+
+$(VERSION).tar.xz:
+ @printf "\t> MAKING::$@\n"
+ wget https://cdn.kernel.org/pub/linux/kernel/v6.x/$(VERSION).tar.xz | sed 's/^/\t==> /g' $(OUT_FMT)
+ @printf "\t> MAKING::$@::DONE\n"
+
+$(VERSION).tar.sign:
+ @printf "\t> MAKING::$@\n"
+ wget https://cdn.kernel.org/pub/linux/kernel/v6.x/$(VERSION).tar.sign | sed 's/^/\t==> /g' $(OUT_FMT)
+ @printf "\t> MAKING::$@::DONE\n"
+
+patch: ./patch.sh
+ @printf "\t> MAKING::$@\n"
+ ./patch.sh $(VERSION) skip | sed 's/^/\t==> /g' $(SED_SUBST) $(OUT_FMT)
+ @printf "\t> MAKING::$@::DONE\n"
+
+build: ./build.sh
+ @printf "\t> MAKING::$@\n"
+ ./build.sh $(VERSION) $(VERSION_BUILD) | sed 's/^/\t==> /g' $(SED_SUBST) $(OUT_FMT)
+ @printf "\t> MAKING::$@::DONE\n"
+
+interliner: interliner.c
+
+clean: interliner
+ rm -f *.tar *.sign *.sign?? *.xz $(OUT_FMT)
+
+clean_misc: interliner
+ rm -f *.tar *.sign *.sign?? $(OUT_FMT)
+
+clear.ok:
+ rm -f *.ok