commit bcache-tools for openSUSE:Factory
Hello community, here is the log from the commit of package bcache-tools for openSUSE:Factory checked in at 2015-03-30 19:33:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/bcache-tools (Old) and /work/SRC/openSUSE:Factory/.bcache-tools.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "bcache-tools" Changes: -------- --- /work/SRC/openSUSE:Factory/bcache-tools/bcache-tools.changes 2014-08-20 10:51:24.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.bcache-tools.new/bcache-tools.changes 2015-03-30 19:33:28.000000000 +0200 @@ -1,0 +2,9 @@ +Fri Mar 27 18:02:05 UTC 2015 - jengelh@inai.de + +- Update to new upstream release 1.0.8 +* bcache-register is now a C program +- Add 0001-udev-do-not-rely-on-DRIVER-variable.patch to entirely + disable /dev/bcache symlinks for now, rather than have it + half-working [bnc#880858] + +------------------------------------------------------------------- Old: ---- bcache-tools-0.9.tar.xz New: ---- 0001-udev-do-not-rely-on-DRIVER-variable.patch bcache-tools-1.0.8.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ bcache-tools.spec ++++++ --- /var/tmp/diff_new_pack.vUDo0m/_old 2015-03-30 19:33:29.000000000 +0200 +++ /var/tmp/diff_new_pack.vUDo0m/_new 2015-03-30 19:33:29.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package bcache-tools # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,14 +20,14 @@ Summary: Configuration utilities for bcache License: GPL-2.0 Group: System/Base -Version: 0.9 +Version: 1.0.8 Release: 0 -#Git-Snapshot: v0.9 Url: http://bcache.evilpiepirate.org/ #Git-Clone: http://evilpiepirate.org/git/bcache-tools.git Source: %name-%version.tar.xz Patch1: 0001-build-remove-inline-keyword-from-crc64.patch +Patch2: 0001-udev-do-not-rely-on-DRIVER-variable.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: libblkid-devel BuildRequires: libuuid-devel @@ -39,7 +39,7 @@ %prep %setup -qn %name -%patch -P 1 -p1 +%patch -P 1 -P 2 -p1 %build export SUSE_ASNEEDED=0 @@ -52,8 +52,10 @@ mkdir -p "$b"/{sbin,%_sbindir,%_mandir/man8,/lib/udev/rules.d} mkdir -p "$b/%_sysconfdir/initramfs-tools/scripts/init-premount" mkdir -p "$b/%_sysconfdir/initramfs-tools/hooks" -make install DESTDIR="$b" -rm -Rf "$b/%_sysconfdir/initramfs-tools" +make install DESTDIR="$b" DRACUTLIBDIR="%_libexecdir/dracut" +# Not used in openSUSE +rm -Rf "$b/%_sysconfdir/initramfs-tools" "$b/%_prefix/lib/initcpio" \ + "$b/%_datadir/initramfs-tools" mkdir -p "$b/%_prefix/lib" mv "$b/lib/udev" "$b/%_prefix/lib/" @@ -62,6 +64,7 @@ %_sbindir/bcache-super-show %_sbindir/make-bcache %_prefix/lib/udev +%_libexecdir/dracut/ %_mandir/man8/*.8* %doc COPYING ++++++ 0001-udev-do-not-rely-on-DRIVER-variable.patch ++++++
From b48c30983b1510d94745bd07494fa81a68a5896e Mon Sep 17 00:00:00 2001 From: Jan Engelhardt <jengelh@inai.de> Date: Sat, 28 Mar 2015 10:50:57 +0100 Subject: [PATCH] udev: do not rely on DRIVER variable
The DRIVER variable will only be set on a single event (when the module creates the first instance?). Any subsequent udev event, e.g. a change event for bcache0, does not have the DRIVER tag set. In fact, most events don't. (This can be reproduced with `udevadm trigger`.) This leads to a change in the contents of the SYMLINK variable which leads to removal of /dev/bcache/, since DRIVER is not set. Don't even bother to create such a volatile /dev/bcache/ in the first place so users don't go chasing after it. References: https://bugzilla.opensuse.org/880858 --- 69-bcache.rules | 6 ------ 1 file changed, 6 deletions(-) diff --git a/69-bcache.rules b/69-bcache.rules index 9cc7f0d..096fde6 100644 --- a/69-bcache.rules +++ b/69-bcache.rules @@ -22,11 +22,5 @@ RUN{builtin}+="kmod load bcache" RUN+="bcache-register $tempnode" LABEL="bcache_backing_end" -# Cached devices: symlink -DRIVER=="bcache", ENV{CACHED_UUID}=="?*", \ - SYMLINK+="bcache/by-uuid/$env{CACHED_UUID}" -DRIVER=="bcache", ENV{CACHED_LABEL}=="?*", \ - SYMLINK+="bcache/by-label/$env{CACHED_LABEL}" - LABEL="bcache_end" -- 2.1.4 ++++++ bcache-tools-0.9.tar.xz -> bcache-tools-1.0.8.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bcache-tools/.gitignore new/bcache-tools/.gitignore --- old/bcache-tools/.gitignore 2014-04-04 09:56:32.000000000 +0200 +++ new/bcache-tools/.gitignore 2015-03-27 18:41:23.000000000 +0100 @@ -1,5 +1,7 @@ -bcache-super-show -make-bcache -probe-bcache +/bcache-super-show +/bcache-test +/bcache-register +/make-bcache +/probe-bcache .* -*.o +/*.o diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bcache-tools/69-bcache.rules new/bcache-tools/69-bcache.rules --- old/bcache-tools/69-bcache.rules 2014-04-04 09:56:32.000000000 +0200 +++ new/bcache-tools/69-bcache.rules 2015-03-27 18:41:23.000000000 +0100 @@ -3,6 +3,8 @@ SUBSYSTEM!="block", GOTO="bcache_end" ACTION=="remove", GOTO="bcache_end" +ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="bcache_end" +KERNEL=="fd*|sr*", GOTO="bcache_end" # blkid was run by the standard udev rules # It recognised bcache (util-linux 2.24+) @@ -16,6 +18,7 @@ ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" LABEL="bcache_backing_found" +RUN{builtin}+="kmod load bcache" RUN+="bcache-register $tempnode" LABEL="bcache_backing_end" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bcache-tools/Makefile new/bcache-tools/Makefile --- old/bcache-tools/Makefile 2014-04-04 09:56:32.000000000 +0200 +++ new/bcache-tools/Makefile 2015-03-27 18:41:23.000000000 +0100 @@ -5,23 +5,22 @@ INSTALL=install CFLAGS+=-O2 -Wall -g -all: make-bcache probe-bcache bcache-super-show +all: make-bcache probe-bcache bcache-super-show bcache-register install: make-bcache probe-bcache bcache-super-show $(INSTALL) -m0755 make-bcache bcache-super-show $(DESTDIR)${PREFIX}/sbin/ $(INSTALL) -m0755 probe-bcache bcache-register $(DESTDIR)$(UDEVLIBDIR)/ $(INSTALL) -m0644 69-bcache.rules $(DESTDIR)$(UDEVLIBDIR)/rules.d/ - -$(INSTALL) -T -m0755 initramfs/hook $(DESTDIR)/usr/share/initramfs-tools/hooks/bcache - if [ -d $(DESTDIR)$(DRACUTLIBDIR)/modules.d ]; \ - then $(INSTALL) -D -m0755 dracut/module-setup.sh $(DESTDIR)$(DRACUTLIBDIR)/modules.d/90bcache/module-setup.sh; \ - fi $(INSTALL) -m0644 -- *.8 $(DESTDIR)${PREFIX}/share/man/man8/ + $(INSTALL) -D -m0755 initramfs/hook $(DESTDIR)/usr/share/initramfs-tools/hooks/bcache + $(INSTALL) -D -m0755 initcpio/install $(DESTDIR)/usr/lib/initcpio/install/bcache + $(INSTALL) -D -m0755 dracut/module-setup.sh $(DESTDIR)$(DRACUTLIBDIR)/modules.d/90bcache/module-setup.sh # $(INSTALL) -m0755 bcache-test $(DESTDIR)${PREFIX}/sbin/ clean: - $(RM) -f make-bcache probe-bcache bcache-super-show bcache-test *.o + $(RM) -f make-bcache probe-bcache bcache-super-show bcache-test -- *.o -bcache-test: LDLIBS += `pkg-config --libs openssl` +bcache-test: LDLIBS += `pkg-config --libs openssl` -lm make-bcache: LDLIBS += `pkg-config --libs uuid blkid` make-bcache: CFLAGS += `pkg-config --cflags uuid blkid` make-bcache: bcache.o @@ -30,3 +29,4 @@ bcache-super-show: LDLIBS += `pkg-config --libs uuid` bcache-super-show: CFLAGS += -std=gnu99 bcache-super-show: bcache.o +bcache-register: bcache-register.o diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bcache-tools/README new/bcache-tools/README --- old/bcache-tools/README 2014-04-04 09:56:32.000000000 +0200 +++ new/bcache-tools/README 2015-03-27 18:41:23.000000000 +0100 @@ -3,9 +3,9 @@ Bcache is a patch for the Linux kernel to use SSDs to cache other block devices. For more information, see http://bcache.evilpiepirate.org. Documentation for the run time interface is included in the kernel tree, in -Documentantion/bcache.txt. +Documentation/bcache.txt. -Included tools: +Included: make-bcache Formats a block device for use with bcache. A device can be formatted for use @@ -17,11 +17,22 @@ erase blocks, which seems to be 128k-512k for most SSDs; feel free to experiment. -probe-bcache -Only necessary until support for the bcache superblock is included -in blkid; in the meantime, provides just enough functionality for a udev script -to create the /dev/disk/by-uuid symlink. The arguments it does support are the -same as for blkid. - bcache-super-show Prints the bcache superblock of a cache device or a backing device. + + +Udev rules +The first half of the rules do auto-assembly and add uuid symlinks +to cache and backing devices. If util-linux's libblkid is +sufficiently recent (2.24) the rules will take advantage of +the fact that bcache has already been detected. Otherwise +they call a small probe-bcache program that imitates blkid. + +The second half of the rules add symlinks to cached devices, +which are the devices created by the bcache kernel module. + + +Initramfs support +Currently initramfs-tools, mkinitcpio and dracut are supported. + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bcache-tools/bcache-register new/bcache-tools/bcache-register --- old/bcache-tools/bcache-register 2014-04-04 09:56:32.000000000 +0200 +++ new/bcache-tools/bcache-register 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -#!/bin/sh -/sbin/modprobe -qba bcache -test -f /sys/fs/bcache/register_quiet && echo "$1" > /sys/fs/bcache/register_quiet - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bcache-tools/bcache-register.c new/bcache-tools/bcache-register.c --- old/bcache-tools/bcache-register.c 1970-01-01 01:00:00.000000000 +0100 +++ new/bcache-tools/bcache-register.c 2015-03-27 18:41:23.000000000 +0100 @@ -0,0 +1,37 @@ +/* + * Author: Simon Gomizelj <simongmzlj@gmail.com> + * + * GPLv2 + */ + +#include <stdio.h> +#include <unistd.h> +#include <fcntl.h> + +int main(int argc, char *argv[]) +{ + int fd; + + if (argc != 2) + { + fprintf(stderr, "bcache-register takes exactly one argument\n"); + return 1; + } + + fd = open("/sys/fs/bcache/register", O_WRONLY); + if (fd < 0) + { + perror("Error opening /sys/fs/bcache/register"); + fprintf(stderr, "The bcache kernel module must be loaded\n"); + return 1; + } + + if (dprintf(fd, "%s\n", argv[1]) < 0) + { + fprintf(stderr, "Error registering %s with bcache: %m\n", argv[1]); + return 1; + } + + return 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bcache-tools/initcpio/install new/bcache-tools/initcpio/install --- old/bcache-tools/initcpio/install 1970-01-01 01:00:00.000000000 +0100 +++ new/bcache-tools/initcpio/install 2015-03-27 18:41:23.000000000 +0100 @@ -0,0 +1,14 @@ +#!/bin/bash +build() { + add_module bcache + add_binary /usr/lib/udev/bcache-register + add_binary /usr/lib/udev/probe-bcache + add_file /usr/lib/udev/rules.d/69-bcache.rules +} +help() { + cat <<HELPEOF +This hook will auto-assemble bcache devices. +Requires the udev hook. +HELPEOF +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bcache-tools/initramfs/hook new/bcache-tools/initramfs/hook --- old/bcache-tools/initramfs/hook 2014-04-04 09:56:32.000000000 +0200 +++ new/bcache-tools/initramfs/hook 2015-03-27 18:41:23.000000000 +0100 @@ -16,7 +16,12 @@ . /usr/share/initramfs-tools/hook-functions -cp -pt "${DESTDIR}/lib/udev/rules.d" /lib/udev/rules.d/69-bcache.rules +if [ -e /etc/udev/rules.d/69-bcache.rules ]; then + cp -pt "${DESTDIR}/lib/udev/rules.d" /etc/udev/rules.d/69-bcache.rules +elif [ -e /lib/udev/rules.d/69-bcache.rules ]; then + cp -pt "${DESTDIR}/lib/udev/rules.d" /lib/udev/rules.d/69-bcache.rules +fi + copy_exec /lib/udev/bcache-register copy_exec /lib/udev/probe-bcache manual_add_modules bcache diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bcache-tools/make-bcache.8 new/bcache-tools/make-bcache.8 --- old/bcache-tools/make-bcache.8 2014-04-04 09:56:32.000000000 +0200 +++ new/bcache-tools/make-bcache.8 2015-03-27 18:41:23.000000000 +0100 @@ -18,7 +18,7 @@ Create a cache device with the specified UUID .TP .BR \-b\ \fIbucket-size -Spcifies the bucket size. Allocation is done in terms of buckets, and cache +Specifies the bucket size. Allocation is done in terms of buckets, and cache hits are counted per bucket; thus a smaller bucket size will give better cache utilization, but poorer write performance. The bucket size is intended to be equal to the size of your SSD's erase blocks, which seems to be 128k-512k for diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bcache-tools/make-bcache.c new/bcache-tools/make-bcache.c --- old/bcache-tools/make-bcache.c 2014-04-04 09:56:32.000000000 +0200 +++ new/bcache-tools/make-bcache.c 2015-03-27 18:41:23.000000000 +0100 @@ -359,14 +359,16 @@ { "wipe-bcache", 0, &wipe_bcache, 1 }, { "discard", 0, &discard, 1 }, { "cache_replacement_policy", 1, NULL, 'p' }, + { "cache-replacement-policy", 1, NULL, 'p' }, { "data_offset", 1, NULL, 'o' }, + { "data-offset", 1, NULL, 'o' }, { "cset-uuid", 1, NULL, 'u' }, { "help", 0, NULL, 'h' }, { NULL, 0, NULL, 0 }, }; while ((c = getopt_long(argc, argv, - "-hCBU:w:b:", + "-hCBUo:w:b:", opts, NULL)) != -1) switch (c) { case 'C':
participants (1)
-
root@hilbert.suse.de