From 6379c9c24f026d40cca5518c7521b88b988e8660 Mon Sep 17 00:00:00 2001 From: Rolf Fokkens Date: Oct 08 2013 14:36:05 +0000 Subject: including dractut module previously part of dracut --- diff --git a/.gitignore b/.gitignore index 9d19586..30e9030 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /bcache-status-20130826.tar.gz /bcache-status-20130909.tar.gz +/bcache-tools-20130909.tar.gz +/bcache-tools-dracut-module.tgz diff --git a/bcache-tools-20130909-udev-dracut.patch b/bcache-tools-20130909-udev-dracut.patch new file mode 100644 index 0000000..457003e --- /dev/null +++ b/bcache-tools-20130909-udev-dracut.patch @@ -0,0 +1,33 @@ +diff -ruN bcache-tools-20130909.tmp/61-bcache.rules bcache-tools-20130909/61-bcache.rules +--- bcache-tools-20130909.tmp/61-bcache.rules 2013-09-01 12:38:11.000000000 +0200 ++++ bcache-tools-20130909/61-bcache.rules 2013-10-02 22:12:02.276806959 +0200 +@@ -4,12 +4,8 @@ + SUBSYSTEM!="block", GOTO="bcache_end" + ACTION=="remove", GOTO="bcache_end" + +-# Backing devices: scan, symlink, register +-IMPORT{program}="/sbin/blkid -o udev $tempnode" +-# blkid and probe-bcache can disagree, in which case don't register +-ENV{ID_FS_TYPE}=="?*", ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end" +- +-IMPORT{program}="/sbin/probe-bcache -o udev $tempnode" ++# Backing devices: symlink, register ++ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end" + ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" + SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="bcache", \ + RUN+="bcache-register $tempnode" +diff -ruN bcache-tools-20130909.tmp/Makefile bcache-tools-20130909/Makefile +--- bcache-tools-20130909.tmp/Makefile 2013-10-02 22:20:31.422049463 +0200 ++++ bcache-tools-20130909/Makefile 2013-10-02 22:34:37.266717269 +0200 +@@ -7,8 +7,10 @@ + install: make-bcache probe-bcache bcache-super-show + install -p -m0755 make-bcache bcache-super-show $(DESTDIR)$(SBINDIR) + install -p -m0755 probe-bcache $(DESTDIR)$(SBINDIR) +- install -p -m0644 61-bcache.rules $(DESTDIR)$(UDEVRULESDIR) ++ install -p -m0644 61-bcache.rules $(DESTDIR)$(UDEVRULESDIR)/69-bcache.rules + install -p -m0755 bcache-register $(DESTDIR)$(UDEVLIBDIR) ++ install -p -m0755 -d $(DESTDIR)$(DRACUTLIBDIR)/modules.d/90bcache ++ install -p -m0755 90bcache/module-setup.sh $(DESTDIR)$(DRACUTLIBDIR)/modules.d/90bcache/module-setup.sh + install -p -m0644 -- *.8 $(DESTDIR)${MANDIR}/man8 + # install -m0755 bcache-test $(DESTDIR)${PREFIX}/sbin/ + diff --git a/bcache-tools-20130909-udevfix-old.patch b/bcache-tools-20130909-udevfix-old.patch deleted file mode 100644 index 84bd836..0000000 --- a/bcache-tools-20130909-udevfix-old.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- bcache-tools-20130909/61-bcache.rules.udevfix-old 2013-09-01 12:38:11.000000000 +0200 -+++ bcache-tools-20130909/61-bcache.rules 2013-09-30 19:09:34.457450713 +0200 -@@ -4,14 +4,16 @@ - SUBSYSTEM!="block", GOTO="bcache_end" - ACTION=="remove", GOTO="bcache_end" - -+# There's no certainty that blkid was executed by any of the earlier rules -+# so to be sure it's executed here too -+IMPORT{builtin}="blkid" - # Backing devices: scan, symlink, register --IMPORT{program}="/sbin/blkid -o udev $tempnode" - # blkid and probe-bcache can disagree, in which case don't register - ENV{ID_FS_TYPE}=="?*", ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end" - - IMPORT{program}="/sbin/probe-bcache -o udev $tempnode" --ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" --SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="bcache", \ -+ENV{BCACHE_ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{BCACHE_ID_FS_UUID_ENC}" -+SUBSYSTEM=="block", ACTION=="add|change", ENV{BCACHE_ID_FS_TYPE}=="bcache", \ - RUN+="bcache-register $tempnode" - LABEL="bcache_backing_end" - ---- bcache-tools-20130909/probe-bcache.c.udevfix-old 2013-09-30 19:23:00.663897443 +0200 -+++ bcache-tools-20130909/probe-bcache.c 2013-09-30 19:24:13.260847312 +0200 -@@ -61,9 +61,9 @@ - uuid_unparse(sb.uuid, uuid); - - if (udev) -- printf("ID_FS_UUID=%s\n" -- "ID_FS_UUID_ENC=%s\n" -- "ID_FS_TYPE=bcache\n", -+ printf("BCACHE_ID_FS_UUID=%s\n" -+ "BCACHE_ID_FS_UUID_ENC=%s\n" -+ "BCACHE_ID_FS_TYPE=bcache\n", - uuid, uuid); - else - printf("%s: UUID=\"\" TYPE=\"bcache\"\n", uuid); diff --git a/bcache-tools-20130909-udevfix.patch b/bcache-tools-20130909-udevfix.patch deleted file mode 100644 index b22a5e2..0000000 --- a/bcache-tools-20130909-udevfix.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- bcache-tools-20130909/61-bcache.rules.udevfix 2013-09-01 12:38:11.000000000 +0200 -+++ bcache-tools-20130909/61-bcache.rules 2013-09-30 18:58:14.914729951 +0200 -@@ -4,12 +4,11 @@ - SUBSYSTEM!="block", GOTO="bcache_end" - ACTION=="remove", GOTO="bcache_end" - --# Backing devices: scan, symlink, register --IMPORT{program}="/sbin/blkid -o udev $tempnode" --# blkid and probe-bcache can disagree, in which case don't register --ENV{ID_FS_TYPE}=="?*", ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end" -- --IMPORT{program}="/sbin/probe-bcache -o udev $tempnode" -+# There's no certainty that blkid was executed by any of the earlier rules -+# so to be sure it's executed here too -+IMPORT{builtin}="blkid" -+# Backing devices: symlink, register -+ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end" - ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" - SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="bcache", \ - RUN+="bcache-register $tempnode" diff --git a/bcache-tools-20130909.tar.bz b/bcache-tools-20130909.tar.bz deleted file mode 100644 index 0816c7e..0000000 Binary files a/bcache-tools-20130909.tar.bz and /dev/null differ diff --git a/bcache-tools.spec b/bcache-tools.spec index 431e957..4e4de17 100644 --- a/bcache-tools.spec +++ b/bcache-tools.spec @@ -1,21 +1,9 @@ %global gitdate 20130909 -# blkid in util-linux v2.24 will be able to identify bcache superblocks which -# obsoletes probe-bcache. v2.24 rc is planned for F20: -# https://bugzilla.redhat.com/show_bug.cgi?id=1001120#c13 -# so for F20 blkid will be used, but not for older Fedora in case someone -# builds it -# -%if 0%{?fedora} > 19 -%global use_blkid 1 -%else -%global use_blkid 0 -%endif - Summary: Tools for Linux kernel block layer cache Name: bcache-tools Version: 0 -Release: 0.13.%{gitdate}git%{?dist} +Release: 0.14.%{gitdate}git%{?dist} License: GPLv2 Group: System Environment/Base URL: http://bcache.evilpiepirate.org/ @@ -23,14 +11,17 @@ VCS: http://evilpiepirate.org/git/bcache-tools.git # For now I am using a prerelease version obtained by: # git clone http://evilpiepirate.org/git/bcache-tools.git # cd bcache-tools/ -# git archive --format=tar --prefix=bcache-tools-20130909/ b15fb776c99fcab56fbbe295629749d307e2018d | gzip > ../bcache-tools-20130909.tar.bz -Source0: %{name}-%{gitdate}.tar.bz +# git archive --format=tar --prefix=bcache-tools-20130909/ b15fb776c99fcab56fbbe295629749d307e2018d | gzip > ../bcache-tools-20130909.tar.gz +Source0: %{name}-%{gitdate}.tar.gz # This part is also a prerelease version obtained by https://gist.github.com/djwong/6343451: # git clone https://gist.github.com/6343451.git # cd 6343451/ # git archive --format=tar --prefix=bcache-status-20130909/ 10282160ab880eab0d9b8d1e1590e477f1e76da2 | gzip > ../bcache-status-20130909.tar.gz # see also http://article.gmane.org/gmane.linux.kernel.bcache.devel/1951 Source1: bcache-status-20130909.tar.gz +# The dracut module originally resided in dracut, but it's now part of +# bcache-tools +Source2: bcache-tools-dracut-module.tgz # bcache status not provided as a true package, so this is a self maintained man page for it # http://article.gmane.org/gmane.linux.kernel.bcache.devel/1946 Patch0: %{name}-status-20130826-man.patch @@ -41,21 +32,16 @@ Patch1: %{name}-20130827-register.patch # configure and make install are not "Fedora compliant", do a small step in the # right direction Patch2: %{name}-20130827-fedconfmake.patch -# the udev interfacing is broken -# As long as util-linux (blkid) doesn't take care of bcache superblock -# identification we need this (which is temporary for Fedora): -Patch3: %{name}-20130909-udevfix-old.patch # When util-linux does take care of bcache superblock identification we remove # the probe-cache call (whichs is Fedora specific): -Patch4: %{name}-20130909-udevfix.patch +Patch3: %{name}-20130909-udev-dracut.patch Requires: python -%if %{use_blkid} # This is a kind of soft dependency: because we don't include probe-bcache # we have to make sure that libblkid is able to identify bcache. So this # is why it requires recent libblkid. Requires: libblkid >= 2.24 -%endif +Conflicts: dracut < 034 BuildRequires: libuuid-devel libblkid-devel systemd %description @@ -65,19 +51,17 @@ one or more slower hard disk drives. This package contains the utilities for manipulating bcache. %global _udevlibdir %{_prefix}/lib/udev +%global dracutlibdir %{_prefix}/lib/dracut %prep %setup -q -n bcache-tools-%{gitdate} tar xzf %{SOURCE1} --strip-components=1 +tar xzf %{SOURCE2} %patch0 -p1 -b .man %patch1 -p1 -b .register %patch2 -p1 -b .fedconfmake chmod +x configure -%if %{use_blkid} -%patch4 -p1 -b .udevfix -%else -%patch3 -p1 -b .udevfix-old -%endif +%patch3 -p1 -b .udevfix %build %configure @@ -88,19 +72,20 @@ mkdir -p \ %{buildroot}%{_sbindir} \ %{buildroot}%{_mandir}/man8 \ %{buildroot}%{_udevlibdir} \ - %{buildroot}%{_udevrulesdir} + %{buildroot}%{_udevrulesdir} \ + %{buildroot}%{dracutlibdir}/modules.d %make_install \ SBINDIR=%{_sbindir} \ UDEVRULESDIR=%{_udevrulesdir} \ UDEVLIBDIR=%{_udevlibdir} \ + DRACUTLIBDIR=%{dracutlibdir} \ MANDIR=%{_mandir} # prevent complaints when checking for unpackaged files -%if %{use_blkid} rm %{buildroot}%{_sbindir}/probe-bcache rm %{buildroot}%{_mandir}/man8/probe-bcache.8 -%endif + install -p -m 755 bcache-status %{buildroot}%{_sbindir}/bcache-status %files @@ -111,11 +96,15 @@ install -p -m 755 bcache-status %{buildroot}%{_sbindir}/bcache-status %{_sbindir}/bcache-super-show %{_sbindir}/bcache-status %{_sbindir}/make-bcache -%if !%{use_blkid} -%{_sbindir}/probe-bcache -%endif +%{dracutlibdir}/modules.d/90bcache %changelog +* Fri Oct 04 2013 Rolf Fokkens - 0-0.14.20130909git +- dropped pre F20 support; no use since deps on util-linux and dracut +- (#1004693) removed execute blkid in 61-bcache.rules +- (#1004693) moved 61-bcache.rules to 69-bcache.rules +- (#1004693) now inluding /usr/lib/dracut/modules.d/90bcache/... + * Mon Sep 30 2013 Rolf Fokkens - 0-0.13.20130909git - (#1004693) add execute blkid in 61-bcache.rules diff --git a/sources b/sources index 011abed..c03eb13 100644 --- a/sources +++ b/sources @@ -1 +1,3 @@ 827065118d59cb65d1355a04b3ea57d9 bcache-status-20130909.tar.gz +53d2e0f98932d32f87f274b5c77c48ce bcache-tools-20130909.tar.gz +e5ec2b71700ab30d20603b7d7faf929e bcache-tools-dracut-module.tgz