aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-11-25 11:09:17 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2015-11-25 10:57:51 +0000
commite4af128b30855b2b29a27c2fd7580b62059bbe51 (patch)
tree8e43f89143ed1b5adb1285fa65e6fc8336f03389 /Makefile
parent63d9cbed3d73f9a9d88927440c098d127ebe2c92 (diff)
downloadmkinitfs-e4af128b30855b2b29a27c2fd7580b62059bbe51.tar.bz2
mkinitfs-e4af128b30855b2b29a27c2fd7580b62059bbe51.tar.xz
nlplug-findfs: fix cryptsetup race condition
We need run cryptsetup in parallel so that keyboard drivers are loaded while waiting for password input. But cryptsetup will recreate the device which means that the uevent for new device node will first be added then changed and finally will it create the /dev/mapper/* device node. We handle the first generated uevent and while handling, the device node might have disappeared causeing blkid not find any UUID, and the /dev/mapper/* does not yet exist. This means that we need to: - handle uevents in parallel while waiting for password input - block uevent handling while actually setting up the crypt device So we use libcryptsetup and add a mutex while setting up the crypt device.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a62c294..11c5546 100644
--- a/Makefile
+++ b/Makefile
@@ -81,9 +81,11 @@ BLKID_CFLAGS := $(shell $(PKGCONF) --cflags blkid)
BLKID_LIBS := $(shell $(PKGCONF) --libs blkid)
LIBKMOD_CFLAGS := $(shell $(PKGCONF) --cflags libkmod)
LIBKMOD_LIBS := $(shell $(PKGCONF) --libs libkmod)
+CRYPTSETUP_CFLAGS := $(shell $(PKGCONF) --cflags libcryptsetup)
+CRYPTSETUP_LIBS := $(shell $(PKGCONF) --libs libcryptsetup)
-CFLAGS += $(BLKID_CFLAGS) $(LIBKMOD_CFLAGS)
-LIBS = $(BLKID_LIBS) $(LIBKMOD_LIBS)
+CFLAGS += $(BLKID_CFLAGS) $(LIBKMOD_CFLAGS) $(CRYPTSETUP_CFLAGS)
+LIBS = $(BLKID_LIBS) $(LIBKMOD_LIBS) $(CRYPTSETUP_LIBS)
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<