From 4630a329e29f3eb2b4eb5f9cf4205157c691729e Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Mon, 23 May 2011 15:03:15 +0000 Subject: [PATCH] - updated to 2.03.10 (the last 2nd generation cluster release) - added blkid patch (migrate from obsolete libvolume_id to libblkid) Changed files: gfs-blkid.patch -> 1.1 gfs.spec -> 1.14 --- gfs-blkid.patch | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ gfs.spec | 43 +++++++++++++++++++----------- 2 files changed, 97 insertions(+), 16 deletions(-) create mode 100644 gfs-blkid.patch diff --git a/gfs-blkid.patch b/gfs-blkid.patch new file mode 100644 index 0000000..6b559ad --- /dev/null +++ b/gfs-blkid.patch @@ -0,0 +1,70 @@ +--- cluster-2.03.10/gfs/gfs_mkfs/main.c.orig 2008-12-09 09:36:04.000000000 +0100 ++++ cluster-2.03.10/gfs/gfs_mkfs/main.c 2011-05-23 16:54:19.847098734 +0200 +@@ -10,11 +10,11 @@ + #include + #include + #include ++#include + + #include "global.h" + #include "gfs_ondisk.h" + #include "osi_list.h" +-#include "libvolume_id.h" + #include "libgfs.h" + #include "copyright.cf" + +@@ -207,34 +207,36 @@ static void decode_arguments(int argc, c + void are_you_sure(commandline_t *comline) + { + char input[32]; +- struct volume_id *vid = NULL; ++ blkid_probe pr; + int fd; + + fd = open(comline->device, O_RDONLY); + if (fd < 0) + die("Error: device %s not found.\n", comline->device); +- vid = volume_id_open_fd(fd); +- if (vid == NULL) { ++ pr = blkid_new_probe(); ++ if (pr == NULL) { + close(fd); + die("error identifying the contents of %s: %s\n", + comline->device, strerror(errno)); + } + printf("This will destroy any data on %s.\n", + comline->device); +- if (volume_id_probe_all(vid, 0, MKFS_DEFAULT_BSIZE) == 0) { ++ blkid_probe_set_request(pr, BLKID_PROBREQ_TYPE | BLKID_PROBREQ_USAGE); ++ if ((blkid_probe_set_device(pr, fd, 0, MKFS_DEFAULT_BSIZE) == 0) && ++ (blkid_do_safeprobe(pr) == 0)) { + const char *fstype, *fsusage; + int rc; + +- rc = volume_id_get_type(vid, &fstype); ++ rc = blkid_probe_lookup_value(pr, "TYPE", &fstype, NULL); + if (rc) { +- rc = volume_id_get_usage(vid, &fsusage); ++ rc = blkid_probe_lookup_value(pr, "USAGE", &fsusage, NULL); + if (!rc || strncmp(fsusage, "other", 5) == 0) + fsusage = "partition"; + printf(" It appears to contain a %s %s.\n", fstype, + fsusage); + } + } +- volume_id_close(vid); ++ blkid_free_probe(pr); + close(fd); + printf("\nAre you sure you want to proceed? [y/n] "); + if (fgets(input, 32, stdin) == NULL || input[0] != 'y') +--- cluster-2.03.10/gfs/gfs_mkfs/Makefile.orig 2008-12-09 09:36:04.000000000 +0100 ++++ cluster-2.03.10/gfs/gfs_mkfs/Makefile 2011-05-23 16:54:37.883766007 +0200 +@@ -24,7 +24,7 @@ CFLAGS += -I${gfskincdir} -I${volidincdi + CFLAGS += -I$(S)/../include -I$(S)/../libgfs + CFLAGS += -I${incdir} + +-LDFLAGS += -L${volidlibdir} -lvolume_id ++LDFLAGS += -L${volidlibdir} -lblkid + LDFLAGS += -L../libgfs -lgfs + + diff --git a/gfs.spec b/gfs.spec index d4656ec..1dfa089 100644 --- a/gfs.spec +++ b/gfs.spec @@ -1,17 +1,19 @@ Summary: Shared-disk cluster file system Summary(pl.UTF-8): Klastrowy system plików na współdzielonym dysku Name: gfs -Version: 2.00.00 +Version: 2.03.10 Release: 1 Epoch: 1 -License: GPL v2 +License: GPL v2+ Group: Applications/System Source0: ftp://sources.redhat.com/pub/cluster/releases/cluster-%{version}.tar.gz -# Source0-md5: 2ef3f4ba9d3c87b50adfc9b406171085 +# Source0-md5: 379b560096e315d4b52e238a5c72ba4a +Patch0: %{name}-blkid.patch URL: http://sources.redhat.com/cluster/gfs/ -BuildRequires: libvolume_id-devel +BuildRequires: libblkid-devel >= 2.16 BuildRequires: ncurses-devel BuildRequires: perl-base +Requires: libblkid >= 2.16 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _sbindir /sbin @@ -39,26 +41,29 @@ wszystkich innych maszynach w klastrze. %prep %setup -q -n cluster-%{version} -install %{name}-kernel/src/gfs/{gfs_ioctl.h,gfs_ondisk.h} %{name}/include -cd %{name} - -%{__perl} -pi -e 's,-Wall,%{rpmcflags} -I/usr/include/ncurses -Wall,' make/defines.mk.input -%{__perl} -pi -e 's/-O2 //' gfs_{mkfs,quota,tool}/Makefile +%patch0 -p1 %build -cd %{name} ./configure \ + --cc="%{__cc}" \ + --cflags="%{rpmcflags} -Wall" \ + --ldflags="%{rpmldflags}" \ + --incdir=%{_includedir} \ + --ncursesincdir=%{_includedir}/ncurses \ --libdir=%{_libdir} \ + --libexecdir=%{_libdir} \ --mandir=%{_mandir} \ --prefix=%{_prefix} \ - --sbindir=%{_sbindir} -%{__make} + --sbindir=%{_sbindir} \ + --without_gfs2 \ + --without_gnbd \ + --without_kernel_modules +%{__make} -C %{name} %install rm -rf $RPM_BUILD_ROOT -cd %{name} -%{__make} install \ +%{__make} -C %{name} install \ DESTDIR=$RPM_BUILD_ROOT %clean @@ -66,6 +71,12 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%attr(755,root,root) %{_sbindir}/* +%attr(755,root,root) %{_sbindir}/fsck.gfs +%attr(755,root,root) %{_sbindir}/gfs_* +%attr(755,root,root) %{_sbindir}/mkfs.gfs +%attr(755,root,root) %{_sbindir}/mount.gfs +%attr(755,root,root) %{_sbindir}/umount.gfs +# TODO: PLDify #%attr(754,root,root) /etc/rc.d/init.d/gfs -%{_mandir}/man?/* +%{_mandir}/man8/gfs.8* +%{_mandir}/man8/gfs_*.8* -- 2.43.0