rd

tiny cpt ramdisk image generator meant for system rescue
git clone git://git.ckyln.com/rd
Log | Files | Refs | README | LICENSE

fsck-resolve-uuid.patch (1896B)


      1 From 2e673aac06d661038001286fd389d1b45c511c66 Mon Sep 17 00:00:00 2001
      2 From: Natanael Copa <ncopa@alpinelinux.org>
      3 Date: Tue, 28 Nov 2017 13:23:17 +0100
      4 Subject: [PATCH] fsck: resolve LABEL=.../UUID=... spec to device
      5 
      6 ---
      7  e2fsprogs/fsck.c | 10 +++++-----
      8  1 file changed, 5 insertions(+), 5 deletions(-)
      9 
     10 diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c
     11 index f5aa3dbe4..e2edc9747 100644
     12 --- a/e2fsprogs/fsck.c
     13 +++ b/e2fsprogs/fsck.c
     14 @@ -60,6 +60,7 @@
     15  //usage:     "\n	-t TYPE	List of filesystem types to check"
     16  
     17  #include "libbb.h"
     18 +#include "volume_id.h"
     19  #include "common_bufsiz.h"
     20  
     21  /* "progress indicator" code is somewhat buggy and ext[23] specific.
     22 @@ -524,12 +525,13 @@ static int wait_many(int flags)
     23   * Execute a particular fsck program, and link it into the list of
     24   * child processes we are waiting for.
     25   */
     26 -static void execute(const char *type, const char *device,
     27 +static void execute(const char *type, const char *spec,
     28  		const char *mntpt /*, int interactive */)
     29  {
     30  	int i;
     31  	struct fsck_instance *inst;
     32  	pid_t pid;
     33 +	char *device = (char *)spec;
     34  
     35  	G.args[0] = xasprintf("fsck.%s", type);
     36  
     37 @@ -544,7 +546,8 @@ static void execute(const char *type, const char *device,
     38  	}
     39  #endif
     40  
     41 -	G.args[G.num_args - 2] = (char*)device;
     42 +	resolve_mount_spec(&device);
     43 +	G.args[G.num_args - 2] = device;
     44  	/* G.args[G.num_args - 1] = NULL; - already is */
     45  
     46  	if (G.verbose || G.noexecute) {
     47 @@ -973,9 +976,6 @@ int fsck_main(int argc UNUSED_PARAM, char **argv)
     48  
     49  		/* "/dev/blk" or "/path" or "UUID=xxx" or "LABEL=xxx" */
     50  		if ((arg[0] == '/' && !opts_for_fsck) || strchr(arg, '=')) {
     51 -// FIXME: must check that arg is a blkdev, or resolve
     52 -// "/path", "UUID=xxx" or "LABEL=xxx" into block device name
     53 -// ("UUID=xxx"/"LABEL=xxx" can probably shifted to fsck.auto duties)
     54  			devices = xrealloc_vector(devices, 2, num_devices);
     55  			devices[num_devices++] = arg;
     56  			continue;