summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2020-11-11 08:08:48 -0500
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2020-11-11 08:09:28 -0500
commit4eb0a578d5a950064b7b75ec26608f0f2687f2a5 (patch)
tree8442a1f40e26e08eb24b6cddfbbbd26e991fdd7b
parent3182b56e35e1a07c920ebded54fc55686ced99bf (diff)
downloadminitramfs-4eb0a578d5a950064b7b75ec26608f0f2687f2a5.tar.xz
minitramfs-4eb0a578d5a950064b7b75ec26608f0f2687f2a5.zip
use latest kernel version, fix awk $$
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 0efb2cf..746287f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,8 @@
MAKEFLAGS += -r
CFLAGS += -Wall -Wextra
-KERNVER ?= $(shell uname -r)
+null :=
+space := $(null) $(null)
+KERNVER ?= $(lastword $(subst /,$(space),$(wildcard /lib/modules/*/)))
all: initramfs.img
@@ -16,8 +18,8 @@ dropbear_ed25519_host_key:
modules.dep.ver: FORCE
if ! [ -f $@ ] || [ "$$(cat $@)" != "$(KERNVER)" ]; then echo $(KERNVER) > $@; fi
-modules.dep: modules /lib/modules/$(KERNVER)/modules.dep modules.dep.ver
- awk '!/^#/ { print $1 }' modules | xargs modinfo -F filename -k $(KERNVER) | sed -e 's:^/lib/modules/$(KERNVER)/:^:' | grep -f - /lib/modules/$(KERNVER)/modules.dep > $@
+modules.dep: modules modules.dep.ver /lib/modules/$(KERNVER)/modules.dep
+ awk '!/^#/ { print $$1 }' modules | xargs modinfo -F filename -k $(KERNVER) | sed -e 's:^/lib/modules/$(KERNVER)/:^:' | grep -f - /lib/modules/$(KERNVER)/modules.dep > $@
install: initramfs.img
rm -f /boot/initramfs.img.old /boot/initramfs.img.new