summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2018-04-14 19:29:56 +0200
committerJonas Smedegaard <dr@jones.dk>2018-04-14 19:29:56 +0200
commit2112829edda610ba09db41b0a4886fbf88be16f2 (patch)
treee674717b99bfc48550e37ce244a2e1913968c1cd
parentaf7a76bffbbf5516681f1de0a352996c5fdeb05f (diff)
Add option linux.
-rw-r--r--Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 0d0b589..7913535 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@
# * fakeroot - command used for faked root (set empty to not fake root)
# * sudo - command used for real root (leave empty to not switch to root)
# * eatmydata - avoid fsync (set empty to not use)
+# * linux - custom kernel: colon-separated suite and version
-include local.mk
suites = stretch buster sid
@@ -28,6 +29,9 @@ info += content/index.html content/style.css
title := $(shell grep -Pom1 '^\# \K.*[^\# ]+' README)
+LINUX_SUITE = $(word 1,$(subst :, ,$(linux)))
+LINUX_VERSION = $(word 2,$(subst :, ,$(linux)))
+
#installsuite-stretch = $(if $(foobar),buster))
#installsuite-stretch-reason = $(if $(foobar),foobar broken with stretch))
@@ -357,6 +361,9 @@ partition/$(1)/$(2)/$(3)/rootfs.preseed.cfg: \
perl -i -0777 -p \
-e 's!\[\%(?:[^\n]+\n)+!!g' \
$$@)
+ $$(if $$(LINUX_VERSION),\
+ perl -i -pe 's/linux-image\K/-$$(LINUX_VERSION)/' \
+ $$@)
# Configure multistrap
# TODO: install libfakeroot only on alien arch
@@ -372,19 +379,27 @@ partition/$(1)/$(2)/$(3)/rootfs.multistrap.conf: \
-e 's/ \\\n / /;' \
-e 'print m,^d-i pkgsel/include string ([^\n]*),m;' \
< $$<)))
+ $$(eval kernelpackage = $$(strip \
+ $$(shell grep -Po \
+ 'linux-image-$$(LINUX_VERSION)\S+' \
+ $$<)))
$(if $(call this-snapshot,$(1)),\
$$(eval source = $(call this-repo,snapshot.debian.org,/archive/debian/$(call this-snapshot,$(1)))),
$$(eval source = $(call this-repo,httpredir.debian.org,/debian)))
perl -p \
-e 's!\@suite\@!$(1)!;' \
+ -e 's!\@kernelsuite\@!$(LINUX_SUITE)!g;' \
-e 's!\@arch\@!$(2)!;' \
-e 's!\@libdir\@!skel!;' \
-e 's!\@preseed\@!$$<!;' \
-e 's!\@packages\@!$$(packages)!;' \
+ -e 's!\@kernelpackage\@!$$(kernelpackage)!g;' \
-e 's!\@source\@!$$(source)!;' \
$(if $(time-$(1)),\
,\
-e 's!^hookdir=!#hookdir=!g;') \
+ $$(if $$(and $(LINUX_SUITE), $$(kernelpackage)),\
+ -e 's!^bootstrap=\K!Kernel-$(LINUX_SUITE) !;') \
< skel/multistrap.conf.in \
> $$@