From 4eb0a578d5a950064b7b75ec26608f0f2687f2a5 Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Wed, 11 Nov 2020 08:08:48 -0500 Subject: use latest kernel version, fix awk $$ --- Makefile | 8 +++++--- 1 file 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 -- cgit v1.2.3-70-g09d2