From: Arkadiusz Miƛkiewicz Date: Mon, 4 Jun 2001 04:27:39 +0000 (+0000) Subject: ee07072e6cc4fd151649dece99d5aa7b e2fsprogs-1.20.tar.gz X-Git-Tag: e2fsprogs-1_20-1~1 X-Git-Url: http://git.pld-linux.org/?a=commitdiff_plain;h=89b68b163599ac22dc873ba2dd45cc6d91bfd498;p=packages%2Fe2fsprogs.git ee07072e6cc4fd151649dece99d5aa7b e2fsprogs-1.20.tar.gz Changed files: e2fsprogs-LDLIBS.patch -> 1.5 e2fsprogs-mountlabel.patch -> 1.2 --- diff --git a/e2fsprogs-LDLIBS.patch b/e2fsprogs-LDLIBS.patch deleted file mode 100644 index a8dbdaa..0000000 --- a/e2fsprogs-LDLIBS.patch +++ /dev/null @@ -1,86 +0,0 @@ -diff -Nur --exclude *~ e2fsprogs-1.19/e2fsck/Makefile.in e2fsprogs-1.19.new/e2fsck/Makefile.in ---- e2fsprogs-1.19/e2fsck/Makefile.in Fri Jul 7 06:35:44 2000 -+++ e2fsprogs-1.19.new/e2fsck/Makefile.in Mon May 14 02:33:43 2001 -@@ -95,7 +95,7 @@ - $(STATIC_LIBS) - - e2fsck.shared: $(OBJS) $(DEPLIBS) -- $(LD) $(ALL_LDFLAGS) -o e2fsck.shared $(OBJS) $(LIBS) -+ $(LD) $(ALL_LDFLAGS) -o e2fsck.shared $(OBJS) $(LIBS) $(LDLIBS) - - e2fsck.profiled: $(PROFILED_OBJS) $(PROFILED_DEPLIBS) - $(LD) $(ALL_LDFLAGS) -g -pg -o e2fsck.profiled $(PROFILED_OBJS) \ -diff -Nur --exclude *~ e2fsprogs-1.19/misc/Makefile.in e2fsprogs-1.19.new/misc/Makefile.in ---- e2fsprogs-1.19/misc/Makefile.in Tue Jan 18 17:30:26 2000 -+++ e2fsprogs-1.19.new/misc/Makefile.in Mon May 14 02:32:28 2001 -@@ -49,44 +49,44 @@ - all:: $(SPROGS) $(UPROGS) $(USPROGS) $(SMANPAGES) $(UMANPAGES) - - findsuper: findsuper.o -- $(CC) $(ALL_LDFLAGS) -o findsuper findsuper.o -+ $(CC) $(ALL_LDFLAGS) -o findsuper findsuper.o $(LDLIBS) - --tune2fs: $(TUNE2FS_OBJS) $(DEPLIBS_E2P) $(DEPLIBUUID) -- $(CC) $(ALL_LDFLAGS) -o tune2fs $(TUNE2FS_OBJS) $(LIBS_E2P) $(LIBUUID) -+tune2fs: $(TUNE2FS_OBJS) $(DEPLIBS_E2P) $(DEPLIBUUID) -+ $(CC) $(ALL_LDFLAGS) -o tune2fs $(TUNE2FS_OBJS) $(LIBS_E2P) $(LIBUUID) $(LDLIBS) - - e2label: $(E2LABEL_OBJS) -- $(CC) $(ALL_LDFLAGS) -o e2label $(E2LABEL_OBJS) -+ $(CC) $(ALL_LDFLAGS) -o e2label $(E2LABEL_OBJS) $(LDLIBS) - - mklost+found: $(MKLPF_OBJS) -- $(CC) $(ALL_LDFLAGS) -o mklost+found $(MKLPF_OBJS) -+ $(CC) $(ALL_LDFLAGS) -o mklost+found $(MKLPF_OBJS) $(LDLIBS) - - mke2fs: $(MKE2FS_OBJS) $(DEPLIBS) $(LIBE2P) $(DEPLIBUUID) -- $(CC) $(ALL_LDFLAGS) -o mke2fs $(MKE2FS_OBJS) $(LIBS) $(LIBE2P) $(LIBUUID) -+ $(CC) $(ALL_LDFLAGS) -o mke2fs $(MKE2FS_OBJS) $(LIBS) $(LIBE2P) $(LIBUUID) $(LDLIBS) - - mke2fs.static: $(MKE2FS_OBJS) $(STATIC_DEPLIBS) $(STATIC_LIBE2P) $(DEPSTATIC_LIBUUID) - $(CC) $(ALL_LDFLAGS) -static -o mke2fs.static $(MKE2FS_OBJS) \ -- $(STATIC_LIBS) $(STATIC_LIBE2P) $(STATIC_LIBUUID) -+ $(STATIC_LIBS) $(STATIC_LIBE2P) $(STATIC_LIBUUID) $(LDLIBS) - - resize2fs: resize2fs.o $(DEPLIBS) -- $(CC) $(ALL_LDFLAGS) -o resize2fs resize2fs.o $(LIBS) -+ $(CC) $(ALL_LDFLAGS) -o resize2fs resize2fs.o $(LIBS) $(LDLIBS) - - chattr: $(CHATTR_OBJS) $(DEPLIBS_E2P) -- $(CC) $(ALL_LDFLAGS) -o chattr $(CHATTR_OBJS) $(LIBS_E2P) -+ $(CC) $(ALL_LDFLAGS) -o chattr $(CHATTR_OBJS) $(LIBS_E2P) $(LDLIBS) - - lsattr: $(LSATTR_OBJS) $(DEPLIBS_E2P) -- $(CC) $(ALL_LDFLAGS) -o lsattr $(LSATTR_OBJS) $(LIBS_E2P) -+ $(CC) $(ALL_LDFLAGS) -o lsattr $(LSATTR_OBJS) $(LIBS_E2P) $(LDLIBS) - - uuidgen: $(UUIDGEN_OBJS) $(DEPLIBUUID) -- $(CC) $(ALL_LDFLAGS) -o uuidgen $(UUIDGEN_OBJS) $(LIBUUID) -+ $(CC) $(ALL_LDFLAGS) -o uuidgen $(UUIDGEN_OBJS) $(LIBUUID) $(LDLIBS) - --dumpe2fs: $(DUMPE2FS_OBJS) $(DEPLIBS_E2P) -+dumpe2fs: $(DUMPE2FS_OBJS) $(DEPLIBS_E2P) $(LDLIBS) - $(CC) $(ALL_LDFLAGS) -o dumpe2fs $(DUMPE2FS_OBJS) $(LIBS_E2P) - - fsck: $(FSCK_OBJS) -- $(CC) $(ALL_LDFLAGS) -o fsck $(FSCK_OBJS) -+ $(CC) $(ALL_LDFLAGS) -o fsck $(FSCK_OBJS) $(LDLIBS) - - badblocks: $(BADBLOCKS_OBJS) $(DEPLIBS) -- $(CC) $(ALL_LDFLAGS) -o badblocks $(BADBLOCKS_OBJS) $(LIBS) -+ $(CC) $(ALL_LDFLAGS) -o badblocks $(BADBLOCKS_OBJS) $(LIBS) $(LDLIBS) - - tune2fs.8: $(DEP_SUBSTITUTE) $(srcdir)/tune2fs.8.in - $(SUBSTITUTE) $(srcdir)/tune2fs.8.in tune2fs.8 -diff -Nur --exclude *~ e2fsprogs-1.19/util/Makefile.in e2fsprogs-1.19.new/util/Makefile.in ---- e2fsprogs-1.19/util/Makefile.in Fri Nov 19 19:42:30 1999 -+++ e2fsprogs-1.19.new/util/Makefile.in Mon May 14 02:56:26 2001 -@@ -21,7 +21,7 @@ - all:: $(PROGS) - - subst: subst.o -- $(BUILD_CC) $(ALL_LDFLAGS) -o subst subst.o -+ $(BUILD_CC) $(ALL_LDFLAGS) -o subst subst.o $(LDLIBS) - - clean: - $(RM) -f $(PROGS) \#* *.s *.o *.a *~ core diff --git a/e2fsprogs-mountlabel.patch b/e2fsprogs-mountlabel.patch deleted file mode 100644 index d3256e2..0000000 --- a/e2fsprogs-mountlabel.patch +++ /dev/null @@ -1,277 +0,0 @@ ---- e2fsprogs-1.19/misc/get_device_by_label.c.mountlabel Mon Feb 7 19:47:54 2000 -+++ e2fsprogs-1.19/misc/get_device_by_label.c Wed Aug 9 13:01:21 2000 -@@ -7,6 +7,7 @@ - * License. - * - * Taken from aeb's mount, 990619 -+ * Updated from aeb's mount, 20000725 - */ - - #include -@@ -14,7 +15,6 @@ - #include - #include - #include --#include "nls-enable.h" - #include "get_device_by_label.h" - - #define PROC_PARTITIONS "/proc/partitions" -@@ -30,104 +30,147 @@ - }; - #define ext2magic(s) ((unsigned int) s.s_magic[0] + (((unsigned int) s.s_magic[1]) << 8)) - -- --static FILE *procpt; -- --static void --procptclose(void) { -- if (procpt) -- fclose (procpt); -- procpt = 0; --} -- --static int --procptopen(void) { -- return ((procpt = fopen(PROC_PARTITIONS, "r")) != NULL); --} -- --static char * --procptnext(void) { -- char line[100]; -- char *s; -- int ma, mi, sz; -- static char ptname[100]; -- -- while (fgets(line, sizeof(line), procpt)) { -- if (sscanf (line, " %d %d %d %[^\n]\n", &ma, &mi, &sz, ptname) != 4) -- continue; -- -- /* skip extended partitions (heuristic: size 1) */ -- if (sz == 1) -- continue; -- -- /* skip entire disk (minor 0, 64, ... on ide; 0, 16, ... on sd) */ -- /* heuristic: partition name ends in a digit */ -- for(s = ptname; *s; s++); -- if (isdigit(s[-1])) -- return ptname; -- } -- return 0; --} -- --#define UUID 1 --#define VOL 2 -+static struct uuidCache_s { -+ struct uuidCache_s *next; -+ char uuid[16]; -+ char *label; -+ char *device; -+} *uuidCache = NULL; - - /* for now, only ext2 is supported */ - static int --has_right_label(const char *device, int n, const void *label) { -+get_label_uuid(const char *device, char **label, char *uuid) { - - /* start with a test for ext2, taken from mount_guess_fstype */ -+ /* should merge these later */ - int fd; - struct ext2_super_block e2sb; - - fd = open(device, O_RDONLY); - if (fd < 0) -- return 0; -+ return 1; - - if (lseek(fd, 1024, SEEK_SET) != 1024 - || read(fd, (char *) &e2sb, sizeof(e2sb)) != sizeof(e2sb) - || (ext2magic(e2sb) != EXT2_SUPER_MAGIC)) { - close(fd); -- return 0; -+ return 1; - } - - close(fd); - - /* superblock is ext2 - now what is its label? */ -- if (n == UUID) -- return (memcmp(e2sb.s_uuid, label, 16) == 0); -- else -- return (strncmp(e2sb.s_volume_name, -- (const char *) label, 16) == 0); -+ memcpy(uuid, e2sb.s_uuid, sizeof(e2sb.s_uuid)); -+ *label = strdup(e2sb.s_volume_name); -+ -+ return 0; - } - --static char * --get_spec_by_x(int n, const void *t) { -- char *pt; -+static void -+uuidcache_addentry(char *device, char *label, char *uuid) { -+ struct uuidCache_s *last; -+ -+ if (!uuidCache) { -+ last = uuidCache = malloc(sizeof(*uuidCache)); -+ } else { -+ for (last = uuidCache; last->next; last = last->next) ; -+ last->next = malloc(sizeof(*uuidCache)); -+ last = last->next; -+ } -+ last->next = NULL; -+ last->device = device; -+ last->label = label; -+ memcpy(last->uuid, uuid, sizeof(last->uuid)); -+} -+ -+static void -+uuidcache_init(void) { -+ char line[100]; -+ char *s; -+ int ma, mi, sz; -+ static char ptname[100]; -+ FILE *procpt; -+ char uuid[16], *label; - char device[110]; -+ int firstPass; -+ int handleOnFirst; -+ -+ if (uuidCache) -+ return; - -- if(!procptopen()) -- return NULL; -- while((pt = procptnext()) != NULL) { -- /* Note: this is a heuristic only - there is no reason -- why these devices should live in /dev. -- Perhaps this directory should be specifiable by option. -- One might for example have /devlabel with links to /dev -- for the devices that may be accessed in this way. -- (This is useful, if the cdrom on /dev/hdc must not -- be accessed.) -- */ -- sprintf(device, "%s/%s", DEVLABELDIR, pt); -- if (has_right_label(device, n, t)) { -- procptclose(); -- return strdup(device); -+ procpt = fopen(PROC_PARTITIONS, "r"); -+ if (!procpt) -+ return; -+ -+ for (firstPass = 1; firstPass >= 0; firstPass--) { -+ fseek(procpt, 0, SEEK_SET); -+ -+ while (fgets(line, sizeof(line), procpt)) { -+ if (sscanf (line, " %d %d %d %[^\n ]", -+ &ma, &mi, &sz, ptname) != 4) -+ continue; -+ -+ /* skip extended partitions (heuristic: size 1) */ -+ if (sz == 1) -+ continue; -+ -+ /* look only at md devices on first pass */ -+ handleOnFirst = !strncmp(ptname, "md", 2); -+ if (firstPass != handleOnFirst) -+ continue; -+ -+ /* skip entire disk (minor 0, 64, ... on ide; -+ 0, 16, ... on sd) */ -+ /* heuristic: partition name ends in a digit */ -+ -+ for(s = ptname; *s; s++); -+ if (isdigit(s[-1])) { -+ /* -+ * Note: this is a heuristic only - there is no reason -+ * why these devices should live in /dev. -+ * Perhaps this directory should be specifiable by option. -+ * One might for example have /devlabel with links to /dev -+ * for the devices that may be accessed in this way. -+ * (This is useful, if the cdrom on /dev/hdc must not -+ * be accessed.) -+ */ -+ sprintf(device, "%s/%s", DEVLABELDIR, ptname); -+ if (!get_label_uuid(device, &label, uuid)) -+ uuidcache_addentry(strdup(device), label, uuid); - } -+ } -+ } -+ -+ fclose(procpt); -+} -+ -+#define UUID 1 -+#define VOL 2 -+ -+static char * -+get_spec_by_x(int n, const char *t) { -+ struct uuidCache_s *uc; -+ -+ uuidcache_init(); -+ uc = uuidCache; -+ -+ while(uc) { -+ switch (n) { -+ case UUID: -+ if (!memcmp(t, uc->uuid, sizeof(uc->uuid))) -+ return strdup(uc->device); -+ break; -+ case VOL: -+ if (!strcmp(t, uc->label)) -+ return strdup(uc->device); -+ break; -+ } -+ uc = uc->next; - } -- procptclose(); - return NULL; - } - --static unsigned char -+static u_char - fromhex(char c) { - if (isdigit(c)) - return (c - '0'); -@@ -138,10 +181,9 @@ - } - - char * --get_spec_by_uuid(const char *s0) { -- unsigned char uuid[16]; -+get_spec_by_uuid(const char *s) { -+ u_char uuid[16]; - int i; -- const char *s = s0; - - if (strlen(s) != 36 || - s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-') -@@ -156,11 +198,26 @@ - return get_spec_by_x(UUID, uuid); - - bad_uuid: -- fprintf(stderr, _("WARNING: %s: bad UUID"), s0); -- return NULL; -+ fprintf(stderr, ("WARNING: bad UUID")); -+ return NULL; /* just for gcc */ - } - - char * - get_spec_by_volume_label(const char *s) { - return get_spec_by_x(VOL, s); -+} -+ -+const char * -+get_volume_label_by_spec(const char *spec) { -+ struct uuidCache_s *uc; -+ -+ uuidcache_init(); -+ uc = uuidCache; -+ -+ while(uc) { -+ if (!strcmp(spec, uc->device)) -+ return uc->label; -+ uc = uc->next; -+ } -+ return NULL; - }