Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=setup.git;a=commitdiff;h=50c82c24effb8e8305ea0b8f7ffc884be126ca9c
commit 50c82c24effb8e8305ea0b8f7ffc884be126ca9c Author: Miklos Vajna <vmik...@frugalware.org> Date: Mon May 18 00:36:09 2009 +0200 libvolume_id -> libblkid diff --git a/src/plugins/Makefile b/src/plugins/Makefile index 0f05cbb..361d6fe 100644 --- a/src/plugins/Makefile +++ b/src/plugins/Makefile @@ -23,7 +23,9 @@ else CFLAGS ?= -g -Wall -Werror endif CFLAGS += -I.. -DARCH="\"$(shell arch)\"" -DARCH_$(shell arch|tr [a-z] [A-Z]) -LDFLAGS += -lparted -ldl -lpacman -lvolume_id +LDFLAGS += -lparted -ldl -lpacman +CFLAGS += $(shell pkg-config --cflags blkid) +LDFLAGS += $(shell pkg-config --libs blkid) ifeq ($(shell arch),x86_64) CFLAGS += -fPIC endif diff --git a/src/plugins/loadsource.c b/src/plugins/loadsource.c index 33cb2f3..84e142d 100644 --- a/src/plugins/loadsource.c +++ b/src/plugins/loadsource.c @@ -32,7 +32,7 @@ #include <gtk/gtk.h> #endif #include <sys/stat.h> -#include <libvolume_id.h> +#include <blkid.h> #include <sys/ioctl.h> #include <sys/types.h> #include <fcntl.h> @@ -117,10 +117,10 @@ int is_netinstall(char *path) return(ret); } -static char* get_volume_id(char *device) +static char* get_blkid(char *device) { int fd; - struct volume_id *vid = NULL; + blkid_probe pr = NULL; uint64_t size; const char *label; char *ret; @@ -134,12 +134,14 @@ static char* get_volume_id(char *device) fd = open(path, O_RDONLY); if(fd<0) return NULL; - vid = volume_id_open_fd(fd); + pr = blkid_new_probe (); + blkid_probe_set_request (pr, BLKID_PROBREQ_LABEL); ioctl(fd, BLKGETSIZE64, &size); - volume_id_probe_all(vid, 0, size); - volume_id_get_label(vid, &label); + blkid_probe_set_device (pr, fd, 0, size); + blkid_do_safeprobe (pr); + blkid_probe_lookup_value(pr, "LABEL", &label, NULL); ret = strdup(label); - volume_id_close(vid); + blkid_free_probe (pr); close(fd); return ret; } @@ -162,7 +164,7 @@ int run(GList **config) drives = grep_drives("/proc/sys/dev/cdrom/info"); for (i=0; i<g_list_length(drives); i++) { - ptr = get_volume_id((char*)g_list_nth_data(drives, i)); + ptr = get_blkid((char*)g_list_nth_data(drives, i)); if(ptr && !strcmp(ptr, "Frugalware Install")) { LOG("install medium found in %s", (char*)g_list_nth_data(drives, i)); _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git