diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-11-25 11:09:17 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-11-25 10:57:51 +0000 |
commit | e4af128b30855b2b29a27c2fd7580b62059bbe51 (patch) | |
tree | 8e43f89143ed1b5adb1285fa65e6fc8336f03389 /Makefile | |
parent | 63d9cbed3d73f9a9d88927440c098d127ebe2c92 (diff) | |
download | mkinitfs-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-- | Makefile | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 $< |