home: hub: mkinitfs

Download patch

ref: 68f3f4c54fca41b2e59a82ec6e21d12d6d4e9648
parent: 7406c21a7a7c662d283bead6e594e3efb176c1c6
author: Natanael Copa <ncopa@alpinelinux.org>
date: Thu Oct 8 05:31:22 CDT 2015

nlplug-findfs: remove mountdir option

We will need set optional mount options, so we better do the mount from
script.

--- a/nlplug-findfs.c
+++ b/nlplug-findfs.c
@@ -78,7 +78,6 @@
 	char *search_device;
 	char *crypt_device;
 	char *crypt_name;
-	char *mountpoint;
 	char *subsystem_filter;
 	int modalias_count;
 	int fork_count;
@@ -386,8 +385,8 @@
 	return rc;
 }
 
-int searchdev(char *devname, const char *searchdev, const char *mountpoint,
-	      char *bootrepos, const char *apkovls)
+int searchdev(char *devname, const char *searchdev, char *bootrepos,
+	      const char *apkovls)
 {
 	static blkid_cache cache = NULL;
 	char *type = NULL, *label = NULL, *uuid = NULL;
@@ -439,10 +438,6 @@
 		}
 	}
 
-	if (rc && type && mountpoint)
-		if (mount(devnode, mountpoint, type, MS_RDONLY, NULL))
-			err(1, "mount %s on %s", devnode, mountpoint);
-
 	if (type)
 		free(type);
 	if (label)
@@ -482,13 +477,12 @@
 			snprintf(ev->devnode, sizeof(ev->devnode), "/dev/%s",
 				 ev->devname);
 			rc = searchdev(ev->devname, conf->search_device,
-				       conf->mountpoint, conf->bootrepos,
-				       conf->apkovls);
+				       conf->bootrepos, conf->apkovls);
 			if (rc)
 				return rc;
 
-			if (searchdev(ev->devname, conf->crypt_device,
-				      NULL, NULL, 0))
+			if (searchdev(ev->devname, conf->crypt_device, NULL,
+				      NULL))
 				start_cryptsetup(ev->devnode, conf->crypt_name);
 		}
 	}
@@ -572,10 +566,8 @@
 void usage(int rc)
 {
 	printf("coldplug system til given device is found\n"
-	"usage: %s [options] DEVICE [DIR]\n"
+	"usage: %s [options] DEVICE\n"
 	"\n"
-	"If DIR is specified the found DEVICE will be mounted on DIR\n"
-	"\n"
 	"options:\n"
 	" -a OUTFILE      add paths to found apkovls to OUTFILE\n"
 	" -b OUTFILE      add found boot repositories to OUTFILE\n"
@@ -639,9 +631,6 @@
 
 	if (argc > 0)
 		conf.search_device = argv[0];
-
-	if (argc > 1)
-		conf.mountpoint = argv[1];
 
 	initsignals();