home: hub: mkinitfs

Download patch

ref: 749899052a55a0000c217b6da648551a29c54bfe
parent: 384c6f27bb91b332c263de25a0a510507ed523a9
author: Natanael Copa <ncopa@alpinelinux.org>
date: Mon Oct 19 04:04:53 CDT 2015

nlplug-findfs: make sure we handle all events in queue

we want handle all the events in queue, even if we find the devices we
are looking for. This is so we load kernel module for framebuffer even
if the apkvol and bootrepo are found first.

This means that the only valid exit condition is a poll timeout and that
we can set the timeout to 0 once we found all the things we are looking
for.

--- a/nlplug-findfs.c
+++ b/nlplug-findfs.c
@@ -693,7 +693,7 @@
 	pthread_create(&tid, NULL, trigger_thread, &fds[1].fd);
 	trigger_running = 1;
 
-	while (trigger_running || !((found & FOUND_DEVICE) || ((found & FOUND_BOOTREPO) && (found & FOUND_APKOVL)))) {
+	while (1) {
 		size_t len;
 		struct iovec iov;
 		char cbuf[CMSG_SPACE(sizeof(struct ucred))];
@@ -754,6 +754,12 @@
 
 		event_count++;
 		found |= process_uevent(buf, len, &conf);
+
+		if ((found & FOUND_DEVICE)
+		    || ((found & FOUND_BOOTREPO) && (found & FOUND_APKOVL))) {
+			dbg("setting timeout to 0");
+			conf.timeout = 0;
+		}
 
 		if (fds[0].revents & POLLHUP) {
 			dbg("parent hung up\n");