aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-09-23 11:29:22 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-09-23 11:41:02 +0200
commitc77a1e252be396d8f47d80608dc0123cb370ed9e (patch)
treec5b1897bfa0d08ba7280634495b2dfd765a4e609 /Makefile
parent24a662087135196fe58ac85265c5d1b9840c5a3b (diff)
downloadmkinitfs-c77a1e252be396d8f47d80608dc0123cb370ed9e.tar.bz2
mkinitfs-c77a1e252be396d8f47d80608dc0123cb370ed9e.tar.xz
add new tool nlplug-findfs
nlplug-findfs is a tool that will help us to find a given filesystem using coldplug. The only reason that initramfs exist in first place is to set up a rootfs and switch to it. The nlplug-findfs will handle coldplug events til a given filesystem/device is found and then mount it.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 22 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 383027d..a62c294 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ sysconfdir ?= /etc/mkinitfs
datarootdir ?= /usr/share
datadir ?= $(datarootdir)/mkinitfs
-SBIN_FILES := mkinitfs bootchartd
+SBIN_FILES := mkinitfs bootchartd nlplug-findfs
SHARE_FILES := initramfs-init fstab passwd group
CONF_FILES := mkinitfs.conf \
features.d/ata.modules \
@@ -42,7 +42,7 @@ CONF_FILES := mkinitfs.conf \
features.d/virtio.modules \
features.d/xfs.modules
-SCRIPTS := $(SBIN_FILES) initramfs-init
+SCRIPTS := mkinitfs bootchartd initramfs-init
IN_FILES := $(addsuffix .in,$(SCRIPTS))
GIT_REV := $(shell test -d .git && git describe || echo exported)
@@ -63,7 +63,8 @@ SED_REPLACE := -e 's:@VERSION@:$(FULL_VERSION):g' \
-e 's:@datadir@:$(datadir):g'
-all: $(SCRIPTS)
+
+all: $(SBIN_FILES) $(SCRIPTS)
clean:
rm -f $(SCRIPTS)
@@ -72,6 +73,24 @@ help:
@echo mkinitfs $(VERSION)
@echo "usage: make install [DESTDIR=]"
+CFLAGS ?= -Wall -Werror -g
+CFLAGS += -D_GNU_SOURCE -DDEBUG
+
+PKGCONF ?= pkg-config
+BLKID_CFLAGS := $(shell $(PKGCONF) --cflags blkid)
+BLKID_LIBS := $(shell $(PKGCONF) --libs blkid)
+LIBKMOD_CFLAGS := $(shell $(PKGCONF) --cflags libkmod)
+LIBKMOD_LIBS := $(shell $(PKGCONF) --libs libkmod)
+
+CFLAGS += $(BLKID_CFLAGS) $(LIBKMOD_CFLAGS)
+LIBS = $(BLKID_LIBS) $(LIBKMOD_LIBS)
+
+%.o: %.c
+ $(CC) $(CFLAGS) -o $@ -c $<
+
+nlplug-findfs: nlplug-findfs.o
+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
.SUFFIXES: .in
.in:
${SED} ${SED_REPLACE} ${SED_EXTRA} $< > $@