diff --git a/.gitignore b/.gitignore index dd8cce8..c69f356 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /bcache-status-20140220.tar.gz /bcache-tools-0.9.tar.gz /bcache-tools-1.0.8.tar.gz +/bcache-tools-1.1.tar.gz diff --git a/bcache-tools-1.0.8-cmdline.patch b/bcache-tools-1.0.8-cmdline.patch deleted file mode 100644 index fd76ec1..0000000 --- a/bcache-tools-1.0.8-cmdline.patch +++ /dev/null @@ -1,271 +0,0 @@ -diff -ruN bcache-tools-1.0.8/69-bcache.rules bcache-tools-1.0.8.2/69-bcache.rules ---- bcache-tools-1.0.8/69-bcache.rules 2014-12-04 23:51:24.000000000 +0100 -+++ bcache-tools-1.0.8.2/69-bcache.rules 2015-02-07 22:32:35.000000000 +0100 -@@ -22,11 +22,14 @@ - 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}" -+# Handling of cached devices -+DRIVER!="bcache", GOTO="bcache_end" -+ -+# Apply kernel cmdline parameters -+RUN+="bcache-params $kernel" -+# Symlink -+ENV{CACHED_UUID}=="?*", SYMLINK+="bcache/by-uuid/$env{CACHED_UUID}" -+ENV{CACHED_LABEL}=="?*", SYMLINK+="bcache/by-label/$env{CACHED_LABEL}" - - LABEL="bcache_end" - -diff -ruN bcache-tools-1.0.8/bcache-params.c bcache-tools-1.0.8.2/bcache-params.c ---- bcache-tools-1.0.8/bcache-params.c 1970-01-01 01:00:00.000000000 +0100 -+++ bcache-tools-1.0.8.2/bcache-params.c 2015-02-07 22:32:35.000000000 +0100 -@@ -0,0 +1,196 @@ -+/* -+ * Author: Rolf Fokkens -+ * -+ * GPLv2 -+ * -+ * For experimenting (or production) it may be useful to set bcache -+ * parameters in an early stage during boot, for example to tune the -+ * boot performance when the root fs is on a bcache device. The best -+ * moment is right before the root fs is actually mounted, which means -+ * it may need to be done in the initramfs. -+ * -+ * The bcache kernel driver does not support passing kernel cmdline -+ * arguments to it. This udev helper can be excuted from udev rules to -+ * take care of cmdline arguments by changing bcache parameters using -+ * the /sys interface right after a bcache device is brought up. This -+ * works both in the initramfs and later. -+ * -+ * It recognizes cmdline arguments like these: -+ * bcache=sco:0,crdthr:0,cache/congested_write_threshold_us:0 -+ * This means: -+ * - for any bcache device set the following parameters: -+ * - sequential_cutoff (sco) is set to 0 -+ * - cache/congested_read_threshold_us (crdthr) is set to 0 -+ * - cache/congested_write_threshold_us (cwrthr) is set to 0 -+ * Both short aliases (for user convenience) and full parameters can be used, -+ * they are defined in the parm_map below. -+ * -+ * Other parameters are not accepted, because they're not useful or -+ * potentially harmful (e.g. changing the label, stopping bcache devices) -+ * -+ * Parsing of each kernel cmdline argument is done in a simple way: -+ * - does the argument start with "bcache="? If not: next argument. -+ * - for the rest of the argument, identify "subarguments": -+ * - is what follows of the form :? If not: next argument -+ * - is a know parameter name? If not: next subargument -+ * - process the subargument -+ * - next subargument -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#ifndef TESTING -+# define CMDLINE "/proc/cmdline" -+# define SYSPFX "/sys/block" -+#else -+# define CMDLINE "/tmp/cmdline" -+# define SYSPFX "/tmp" -+#endif -+ -+struct parm_map { -+ char *id; -+ char *full; -+}; -+ -+/* -+ * The list of kernel cmdline patameters that can be processed by -+ * bcache-patams. -+ */ -+struct parm_map parm_map[] = { -+ { "crdthr", "cache/congested_read_threshold_us" } -+, { "cwrthr", "cache/congested_write_threshold_us" } -+, { "rdahed", "readahead" } -+, { "sctoff", "sequential_cutoff" } -+, { "wrbdly", "writeback_delay" } -+, { "wrbpct", "writeback_percent" } -+, { "wrbupd", "writeback_rate_update_seconds" } -+, { NULL , NULL } -+}; -+ -+/* -+ * Read characters from fp (/proc/cmdline) into buf until maxlen characters are -+ * read or until a character is read that is in the list of terminators. -+ * -+ * lookaheadp points to the current lookahead symbol, and is returned as such to -+ * the caller. -+ * -+ * When a characters is read that is a terminator charachter, the lookehead is moved -+ * one character ahead and the encountered terminator is returned. -+ * -+ * If for another reason reading characters stops, 0 is returned. -+ */ -+int read_until (int *lookaheadp, FILE *fp, char *buf, int maxlen, char *terminators) -+{ -+ char *cp = buf, *ep = buf + maxlen; -+ int lookahead = *lookaheadp; -+ -+ while ( cp < ep -+ && lookahead != EOF -+ && isprint (lookahead) -+ && !strchr (terminators, lookahead)) { -+ *cp++ = lookahead; -+ lookahead = fgetc (fp); -+ } -+ -+ *lookaheadp = lookahead; -+ -+ *cp = '\0'; -+ -+ if (strchr (terminators, lookahead)) { -+ *lookaheadp = fgetc (fp); -+ return lookahead; -+ } -+ return 0; -+} -+ -+int main(int argc, char *argv[]) -+{ -+ char buf[256]; -+ int la, bufsz = sizeof (buf); -+ FILE *fp; -+ -+ if (argc != 2) { -+ fprintf (stderr, "bcache-params takes exactly one argument\n"); -+ return 1; -+ } -+ -+ fp = fopen (CMDLINE, "r"); -+ if (fp == NULL) { -+ perror ("Error opening /proc/cmdline"); -+ return 1; -+ } -+ /* la is our lookahead character */ -+ la = fgetc (fp); -+ -+ while (la != EOF) { -+ /* skip any spaces */ -+ while (la == ' ') { -+ la = fgetc (fp); -+ } -+ /* stop ehen end of the line */ -+ if (la == EOF) break; -+ -+ /* process until '=' */ -+ if (read_until (&la, fp, buf, bufsz, " =") != '=') goto nextarg; -+ /* did we get a "bcache=" prefix? */ -+ if (strcmp (buf, "bcache") != 0) goto nextarg; -+ -+ /* process subarguments */ -+ for (;;) { -+ struct parm_map *pmp; -+ char sysfile[256]; -+ int term, fd; -+ -+ /* all subargs start with ":" */ -+ if (read_until (&la, fp, buf, bufsz, " :") != ':') goto nextarg; -+ -+ /* now identify */ -+ for (pmp = parm_map; pmp->id != NULL; pmp++) { -+ if (strcmp (buf, pmp->id) == 0) break; -+ if (strcmp (buf, pmp->full) == 0) break; -+ } -+ /* no match for ? next subargument */ -+ if (pmp->id == NULL) { -+ error (0, 0, "Unknown bcache parameter %s", buf); -+ } else { -+ /* Now we know what /sys file to write to */ -+ sprintf (sysfile, "%s/%s/bcache/%s", SYSPFX, argv[1], pmp->full); -+ } -+ -+ /* What follows is the data to be written */ -+ term = read_until (&la, fp, buf, bufsz, " ,"); -+ -+ if (pmp->id == NULL) goto nextsubarg; -+ -+ /* no data identified? next subargument */ -+ if (buf[0] == '\0') { -+ error (0, 0, "Missing data for parameter %s(%s)", pmp->full, pmp->id); -+ goto nextsubarg; -+ } -+ /* we're ready to actually write the data */ -+ fd = open (sysfile, O_WRONLY); -+ if (fd < 0) { -+ error (0, errno, "Error opening %s", sysfile); -+ goto nextsubarg; -+ } -+ if (dprintf (fd, "%s\n", buf) < 0) { -+ error (0, errno, "Error writing %s to %s", buf, sysfile); -+ } -+ close (fd); -+ /* From here there's the hope for another subargument */ -+ nextsubarg: -+ if (term != ',') break; -+ } -+ nextarg: -+ while (la != EOF && la != ' ') la = fgetc (fp); -+ } -+ return 0; -+} -+ -diff -ruN bcache-tools-1.0.8/dracut/module-setup.sh bcache-tools-1.0.8.2/dracut/module-setup.sh ---- bcache-tools-1.0.8/dracut/module-setup.sh 2014-12-04 23:51:24.000000000 +0100 -+++ bcache-tools-1.0.8.2/dracut/module-setup.sh 2015-02-07 22:32:35.000000000 +0100 -@@ -29,6 +29,9 @@ - } - - install() { -- inst_multiple ${udevdir}/probe-bcache ${udevdir}/bcache-register -+ inst_multiple \ -+ ${udevdir}/probe-bcache \ -+ ${udevdir}/bcache-register \ -+ ${udevdir}/bcache-params - inst_rules 69-bcache.rules - } -diff -ruN bcache-tools-1.0.8/.gitignore bcache-tools-1.0.8.2/.gitignore ---- bcache-tools-1.0.8/.gitignore 2014-12-04 23:51:24.000000000 +0100 -+++ bcache-tools-1.0.8.2/.gitignore 2015-02-07 22:32:35.000000000 +0100 -@@ -1,6 +1,7 @@ - /bcache-super-show - /bcache-test - /bcache-register -+/bcache-params - /make-bcache - /probe-bcache - .* -diff -ruN bcache-tools-1.0.8/Makefile bcache-tools-1.0.8.2/Makefile ---- bcache-tools-1.0.8/Makefile 2014-12-04 23:51:24.000000000 +0100 -+++ bcache-tools-1.0.8.2/Makefile 2015-02-07 22:32:35.000000000 +0100 -@@ -5,11 +5,11 @@ - INSTALL=install - CFLAGS+=-O2 -Wall -g - --all: make-bcache probe-bcache bcache-super-show bcache-register -+all: make-bcache probe-bcache bcache-super-show bcache-register bcache-params - --install: make-bcache probe-bcache bcache-super-show -+install: make-bcache probe-bcache bcache-super-show bcache-register bcache-params - $(INSTALL) -m0755 make-bcache bcache-super-show $(DESTDIR)${PREFIX}/sbin/ -- $(INSTALL) -m0755 probe-bcache bcache-register $(DESTDIR)$(UDEVLIBDIR)/ -+ $(INSTALL) -m0755 probe-bcache bcache-register bcache-params $(DESTDIR)$(UDEVLIBDIR)/ - $(INSTALL) -m0644 69-bcache.rules $(DESTDIR)$(UDEVLIBDIR)/rules.d/ - $(INSTALL) -m0644 -- *.8 $(DESTDIR)${PREFIX}/share/man/man8/ - $(INSTALL) -D -m0755 initramfs/hook $(DESTDIR)/usr/share/initramfs-tools/hooks/bcache -@@ -30,3 +30,4 @@ - bcache-super-show: CFLAGS += -std=gnu99 - bcache-super-show: bcache.o - bcache-register: bcache-register.o -+bcache-params: bcache-params.o diff --git a/bcache-tools-1.0.8-crc64.patch b/bcache-tools-1.0.8-crc64.patch deleted file mode 100644 index 9b11d80..0000000 --- a/bcache-tools-1.0.8-crc64.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff -ruN bcache-tools-1.0.8.orig/bcache.c bcache-tools-1.0.8/bcache.c ---- bcache-tools-1.0.8.orig/bcache.c 2014-12-04 23:51:24.000000000 +0100 -+++ bcache-tools-1.0.8/bcache.c 2015-05-22 19:40:41.039355096 +0200 -@@ -26,7 +26,7 @@ - * x^7 + x^4 + x + 1 - */ - --static const uint64_t crc_table[256] = { -+const uint64_t crc_table[256] = { - 0x0000000000000000ULL, 0x42F0E1EBA9EA3693ULL, 0x85E1C3D753D46D26ULL, - 0xC711223CFA3E5BB5ULL, 0x493366450E42ECDFULL, 0x0BC387AEA7A8DA4CULL, - 0xCCD2A5925D9681F9ULL, 0x8E224479F47CB76AULL, 0x9266CC8A1C85D9BEULL, -@@ -114,16 +114,3 @@ - 0x5DEDC41A34BBEEB2ULL, 0x1F1D25F19D51D821ULL, 0xD80C07CD676F8394ULL, - 0x9AFCE626CE85B507ULL - }; -- --inline uint64_t crc64(const void *_data, size_t len) --{ -- uint64_t crc = 0xFFFFFFFFFFFFFFFFULL; -- const unsigned char *data = _data; -- -- while (len--) { -- int i = ((int) (crc >> 56) ^ *data++) & 0xFF; -- crc = crc_table[i] ^ (crc << 8); -- } -- -- return crc ^ 0xFFFFFFFFFFFFFFFFULL; --} -diff -ruN bcache-tools-1.0.8.orig/bcache.h bcache-tools-1.0.8/bcache.h ---- bcache-tools-1.0.8.orig/bcache.h 2014-12-04 23:51:24.000000000 +0100 -+++ bcache-tools-1.0.8/bcache.h 2015-05-22 19:40:34.924320569 +0200 -@@ -115,7 +115,20 @@ - #define BDEV_STATE_DIRTY 2U - #define BDEV_STATE_STALE 3U - --uint64_t crc64(const void *_data, size_t len); -+extern const uint64_t crc_table[]; -+ -+inline uint64_t crc64(const void *_data, size_t len) -+{ -+ uint64_t crc = 0xFFFFFFFFFFFFFFFFULL; -+ const unsigned char *data = _data; -+ -+ while (len--) { -+ int i = ((int) (crc >> 56) ^ *data++) & 0xFF; -+ crc = crc_table[i] ^ (crc << 8); -+ } -+ -+ return crc ^ 0xFFFFFFFFFFFFFFFFULL; -+} - - #define node(i, j) ((void *) ((i)->d + (j))) - #define end(i) node(i, (i)->keys) -Binary files bcache-tools-1.0.8.orig/bcache-register and bcache-tools-1.0.8/bcache-register differ diff --git a/bcache-tools-1.0.8-gcc10.patch b/bcache-tools-1.0.8-gcc10.patch deleted file mode 100644 index e821148..0000000 --- a/bcache-tools-1.0.8-gcc10.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nrup a/bcache.h b/bcache.h ---- a/bcache.h 2019-10-15 13:33:53.008004124 -0600 -+++ b/bcache.h 2019-10-15 13:34:58.322638870 -0600 -@@ -117,7 +117,7 @@ BITMASK(BDEV_STATE, struct cache_sb, fl - - extern const uint64_t crc_table[]; - --inline uint64_t crc64(const void *_data, size_t len) -+static inline uint64_t crc64(const void *_data, size_t len) - { - uint64_t crc = 0xFFFFFFFFFFFFFFFFULL; - const unsigned char *data = _data; diff --git a/bcache-tools-1.1-cmdline.patch b/bcache-tools-1.1-cmdline.patch new file mode 100644 index 0000000..eb8dc0e --- /dev/null +++ b/bcache-tools-1.1-cmdline.patch @@ -0,0 +1,275 @@ +diff -ruN bcache-tools-1.1.orig/69-bcache.rules bcache-tools-1.1/69-bcache.rules +--- bcache-tools-1.1.orig/69-bcache.rules 2019-12-12 13:51:01.000000000 +0100 ++++ bcache-tools-1.1/69-bcache.rules 2021-01-30 12:10:02.242616633 +0100 +@@ -22,11 +22,14 @@ + 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}" ++# Handling of cached devices ++DRIVER!="bcache", GOTO="bcache_end" ++ ++# Apply kernel cmdline parameters ++RUN+="bcache-params $kernel" ++# Symlink ++ENV{CACHED_UUID}=="?*", SYMLINK+="bcache/by-uuid/$env{CACHED_UUID}" ++ENV{CACHED_LABEL}=="?*", SYMLINK+="bcache/by-label/$env{CACHED_LABEL}" + + LABEL="bcache_end" + +diff -ruN bcache-tools-1.1.orig/bcache-params.c bcache-tools-1.1/bcache-params.c +--- bcache-tools-1.1.orig/bcache-params.c 1970-01-01 01:00:00.000000000 +0100 ++++ bcache-tools-1.1/bcache-params.c 2021-01-30 12:10:02.243616625 +0100 +@@ -0,0 +1,196 @@ ++/* ++ * Author: Rolf Fokkens ++ * ++ * GPLv2 ++ * ++ * For experimenting (or production) it may be useful to set bcache ++ * parameters in an early stage during boot, for example to tune the ++ * boot performance when the root fs is on a bcache device. The best ++ * moment is right before the root fs is actually mounted, which means ++ * it may need to be done in the initramfs. ++ * ++ * The bcache kernel driver does not support passing kernel cmdline ++ * arguments to it. This udev helper can be excuted from udev rules to ++ * take care of cmdline arguments by changing bcache parameters using ++ * the /sys interface right after a bcache device is brought up. This ++ * works both in the initramfs and later. ++ * ++ * It recognizes cmdline arguments like these: ++ * bcache=sco:0,crdthr:0,cache/congested_write_threshold_us:0 ++ * This means: ++ * - for any bcache device set the following parameters: ++ * - sequential_cutoff (sco) is set to 0 ++ * - cache/congested_read_threshold_us (crdthr) is set to 0 ++ * - cache/congested_write_threshold_us (cwrthr) is set to 0 ++ * Both short aliases (for user convenience) and full parameters can be used, ++ * they are defined in the parm_map below. ++ * ++ * Other parameters are not accepted, because they're not useful or ++ * potentially harmful (e.g. changing the label, stopping bcache devices) ++ * ++ * Parsing of each kernel cmdline argument is done in a simple way: ++ * - does the argument start with "bcache="? If not: next argument. ++ * - for the rest of the argument, identify "subarguments": ++ * - is what follows of the form :? If not: next argument ++ * - is a know parameter name? If not: next subargument ++ * - process the subargument ++ * - next subargument ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifndef TESTING ++# define CMDLINE "/proc/cmdline" ++# define SYSPFX "/sys/block" ++#else ++# define CMDLINE "/tmp/cmdline" ++# define SYSPFX "/tmp" ++#endif ++ ++struct parm_map { ++ char *id; ++ char *full; ++}; ++ ++/* ++ * The list of kernel cmdline patameters that can be processed by ++ * bcache-patams. ++ */ ++struct parm_map parm_map[] = { ++ { "crdthr", "cache/congested_read_threshold_us" } ++, { "cwrthr", "cache/congested_write_threshold_us" } ++, { "rdahed", "readahead" } ++, { "sctoff", "sequential_cutoff" } ++, { "wrbdly", "writeback_delay" } ++, { "wrbpct", "writeback_percent" } ++, { "wrbupd", "writeback_rate_update_seconds" } ++, { NULL , NULL } ++}; ++ ++/* ++ * Read characters from fp (/proc/cmdline) into buf until maxlen characters are ++ * read or until a character is read that is in the list of terminators. ++ * ++ * lookaheadp points to the current lookahead symbol, and is returned as such to ++ * the caller. ++ * ++ * When a characters is read that is a terminator charachter, the lookehead is moved ++ * one character ahead and the encountered terminator is returned. ++ * ++ * If for another reason reading characters stops, 0 is returned. ++ */ ++int read_until (int *lookaheadp, FILE *fp, char *buf, int maxlen, char *terminators) ++{ ++ char *cp = buf, *ep = buf + maxlen; ++ int lookahead = *lookaheadp; ++ ++ while ( cp < ep ++ && lookahead != EOF ++ && isprint (lookahead) ++ && !strchr (terminators, lookahead)) { ++ *cp++ = lookahead; ++ lookahead = fgetc (fp); ++ } ++ ++ *lookaheadp = lookahead; ++ ++ *cp = '\0'; ++ ++ if (strchr (terminators, lookahead)) { ++ *lookaheadp = fgetc (fp); ++ return lookahead; ++ } ++ return 0; ++} ++ ++int main(int argc, char *argv[]) ++{ ++ char buf[256]; ++ int la, bufsz = sizeof (buf); ++ FILE *fp; ++ ++ if (argc != 2) { ++ fprintf (stderr, "bcache-params takes exactly one argument\n"); ++ return 1; ++ } ++ ++ fp = fopen (CMDLINE, "r"); ++ if (fp == NULL) { ++ perror ("Error opening /proc/cmdline"); ++ return 1; ++ } ++ /* la is our lookahead character */ ++ la = fgetc (fp); ++ ++ while (la != EOF) { ++ /* skip any spaces */ ++ while (la == ' ') { ++ la = fgetc (fp); ++ } ++ /* stop ehen end of the line */ ++ if (la == EOF) break; ++ ++ /* process until '=' */ ++ if (read_until (&la, fp, buf, bufsz, " =") != '=') goto nextarg; ++ /* did we get a "bcache=" prefix? */ ++ if (strcmp (buf, "bcache") != 0) goto nextarg; ++ ++ /* process subarguments */ ++ for (;;) { ++ struct parm_map *pmp; ++ char sysfile[256]; ++ int term, fd; ++ ++ /* all subargs start with ":" */ ++ if (read_until (&la, fp, buf, bufsz, " :") != ':') goto nextarg; ++ ++ /* now identify */ ++ for (pmp = parm_map; pmp->id != NULL; pmp++) { ++ if (strcmp (buf, pmp->id) == 0) break; ++ if (strcmp (buf, pmp->full) == 0) break; ++ } ++ /* no match for ? next subargument */ ++ if (pmp->id == NULL) { ++ error (0, 0, "Unknown bcache parameter %s", buf); ++ } else { ++ /* Now we know what /sys file to write to */ ++ sprintf (sysfile, "%s/%s/bcache/%s", SYSPFX, argv[1], pmp->full); ++ } ++ ++ /* What follows is the data to be written */ ++ term = read_until (&la, fp, buf, bufsz, " ,"); ++ ++ if (pmp->id == NULL) goto nextsubarg; ++ ++ /* no data identified? next subargument */ ++ if (buf[0] == '\0') { ++ error (0, 0, "Missing data for parameter %s(%s)", pmp->full, pmp->id); ++ goto nextsubarg; ++ } ++ /* we're ready to actually write the data */ ++ fd = open (sysfile, O_WRONLY); ++ if (fd < 0) { ++ error (0, errno, "Error opening %s", sysfile); ++ goto nextsubarg; ++ } ++ if (dprintf (fd, "%s\n", buf) < 0) { ++ error (0, errno, "Error writing %s to %s", buf, sysfile); ++ } ++ close (fd); ++ /* From here there's the hope for another subargument */ ++ nextsubarg: ++ if (term != ',') break; ++ } ++ nextarg: ++ while (la != EOF && la != ' ') la = fgetc (fp); ++ } ++ return 0; ++} ++ +diff -ruN bcache-tools-1.1.orig/dracut/module-setup.sh bcache-tools-1.1/dracut/module-setup.sh +--- bcache-tools-1.1.orig/dracut/module-setup.sh 2019-12-12 13:51:01.000000000 +0100 ++++ bcache-tools-1.1/dracut/module-setup.sh 2021-01-30 12:10:02.243616625 +0100 +@@ -29,6 +29,9 @@ + } + + install() { +- inst_multiple ${udevdir}/probe-bcache ${udevdir}/bcache-register ++ inst_multiple \ ++ ${udevdir}/probe-bcache \ ++ ${udevdir}/bcache-register \ ++ ${udevdir}/bcache-params + inst_rules 69-bcache.rules + } +diff -ruN bcache-tools-1.1.orig/.gitignore.orig bcache-tools-1.1/.gitignore.orig +--- bcache-tools-1.1.orig/.gitignore.orig 1970-01-01 01:00:00.000000000 +0100 ++++ bcache-tools-1.1/.gitignore.orig 2019-12-12 13:51:01.000000000 +0100 +@@ -0,0 +1,8 @@ ++/bcache-super-show ++/bcache-test ++/bcache-register ++/make-bcache ++/probe-bcache ++/bcache ++.* ++/*.o +diff -ruN bcache-tools-1.1.orig/Makefile bcache-tools-1.1/Makefile +--- bcache-tools-1.1.orig/Makefile 2019-12-12 13:51:01.000000000 +0100 ++++ bcache-tools-1.1/Makefile 2021-01-30 12:12:34.126303769 +0100 +@@ -5,11 +5,11 @@ + INSTALL=install + CFLAGS+=-O2 -Wall -g + +-all: make-bcache probe-bcache bcache-super-show bcache-register bcache ++all: make-bcache probe-bcache bcache-super-show bcache-register bcache bcache-params + + install: make-bcache probe-bcache bcache-super-show + $(INSTALL) -m0755 make-bcache bcache-super-show bcache $(DESTDIR)${PREFIX}/sbin/ +- $(INSTALL) -m0755 probe-bcache bcache-register $(DESTDIR)$(UDEVLIBDIR)/ ++ $(INSTALL) -m0755 probe-bcache bcache-register bcache-params $(DESTDIR)$(UDEVLIBDIR)/ + $(INSTALL) -m0644 69-bcache.rules $(DESTDIR)$(UDEVLIBDIR)/rules.d/ + $(INSTALL) -m0644 -- *.8 $(DESTDIR)${PREFIX}/share/man/man8/ + $(INSTALL) -D -m0755 initramfs/hook $(DESTDIR)/usr/share/initramfs-tools/hooks/bcache +@@ -35,6 +35,8 @@ + + bcache-register: bcache-register.o + ++bcache-params: bcache-params.o ++ + bcache: CFLAGS += `pkg-config --cflags blkid uuid smartcols` + bcache: LDLIBS += `pkg-config --libs blkid uuid smartcols` + bcache: CFLAGS += -std=gnu99 diff --git a/bcache-tools-1.1-man.pach b/bcache-tools-1.1-man.pach new file mode 100644 index 0000000..ecf9d82 --- /dev/null +++ b/bcache-tools-1.1-man.pach @@ -0,0 +1,15 @@ +diff -ruN bcache-tools-1.1.orig/bcache.8 bcache-tools-1.1/bcache.8 +--- bcache-tools-1.1.orig/bcache.8 1970-01-01 01:00:00.000000000 +0100 ++++ bcache-tools-1.1/bcache.8 2021-01-30 12:49:17.199440242 +0100 +@@ -0,0 +1,11 @@ ++.TH bcache 8 ++.SH NAME ++bcache \- usefull bcache utility ++.SH SYNOPSIS ++.B bcache ++[\fB \-o\ \fIudev\fR ] ++.I device ++.SH USAGE ++Command explains itself when no arguments are passed, don't use in case of doubt. ++ ++This man page needs further work diff --git a/bcache-tools-1.1-util-linux-hdr.patch b/bcache-tools-1.1-util-linux-hdr.patch new file mode 100644 index 0000000..9d51307 --- /dev/null +++ b/bcache-tools-1.1-util-linux-hdr.patch @@ -0,0 +1,33 @@ +diff -ruN bcache-tools-1.1.orig/lib.c bcache-tools-1.1/lib.c +--- bcache-tools-1.1.orig/lib.c 2019-12-12 13:51:01.000000000 +0100 ++++ bcache-tools-1.1/lib.c 2021-01-30 12:34:09.882481894 +0100 +@@ -2,7 +2,7 @@ + // Author: Shaoxiong Li + + #include +-#include ++#include + #include + #include + #include +@@ -10,7 +10,7 @@ + #include + #include "bcache.h" + #include "lib.h" +-#include ++#include + #include + #include + #include +diff -ruN bcache-tools-1.1.orig/probe-bcache.c bcache-tools-1.1/probe-bcache.c +--- bcache-tools-1.1.orig/probe-bcache.c 2019-12-12 13:51:01.000000000 +0100 ++++ bcache-tools-1.1/probe-bcache.c 2021-01-30 12:33:46.338676440 +0100 +@@ -8,7 +8,7 @@ + #define __USE_FILE_OFFSET64 + #define _XOPEN_SOURCE 500 + +-#include ++#include + #include + #include + #include diff --git a/bcache-tools.spec b/bcache-tools.spec index b483286..993c7bb 100644 --- a/bcache-tools.spec +++ b/bcache-tools.spec @@ -1,15 +1,13 @@ -#global gitdate 20131018 - Summary: Tools for Linux kernel block layer cache Name: bcache-tools -Version: 1.0.8 -Release: 20%{?dist} +Version: 1.1 +Release: 0%{?dist} License: GPLv2 URL: http://bcache.evilpiepirate.org/ -VCS: https://github.com/g2p/bcache-tools.git -# git clone https://github.com/g2p/bcache-tools.git +VCS: git://git.kernel.org/pub/scm/linux/kernel/git/colyli/bcache-tools.git +# git clone git://git.kernel.org/pub/scm/linux/kernel/git/colyli/bcache-tools.git # cd bcache-tools/ -# git archive --format=tar --prefix=bcache-tools-1.0.8/ v1.0.8 | gzip > ../bcache-tools-1.0.8.tar.gz +# git archive --format=tar --prefix=bcache-tools-1.1/ bcache-tools-1.1 | gzip > ../bcache-tools-1.1.tar.gz Source0: %{name}-%{version}.tar.gz # This part is a prerelease version obtained by https://gist.github.com/djwong/6343451: # git clone https://gist.github.com/6343451.git @@ -22,30 +20,27 @@ Source1: bcache-status-20140220.tar.gz # http://article.gmane.org/gmane.linux.kernel.bcache.devel/1946 Patch0: %{name}-status-20160804-man.patch # Process commandline arguments -Patch1: %{name}-1.0.8-cmdline.patch +Patch1: %{name}-1.1-cmdline.patch # configure is not "Fedora compliant", do a small step in the # right direction Patch2: %{name}-20131018-fedconf.patch # util-linux takes care of bcache superblock identification so we remove # the probe-cache call (which is Fedora specific): Patch3: %{name}-1.0.8-noprobe.2.patch -# the following fix is pending upstream -# gcc 5.1.1 apparently is more picky than Fedora 21 gcc -Patch4: bcache-tools-1.0.8-crc64.patch +# proper include util-linux headers +Patch4: %{name}-1.1-util-linux-hdr.patch # Fedora 23 uses python3 by default Patch5: bcache-status-python3.patch # Fix BZ#1360951 - this fix is python 3 only Patch6: bcache-status-rootgc.patch -# GCC-10 fix as reported by law@redhat.com -Patch7: bcache-tools-1.0.8-gcc10.patch - +# Fedora packaging guidelines require man pages, none was provided for bcache. Add a placeholder +Patch7: bcache-tools-1.1-man.pach # 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 Conflicts: dracut < 034 -BuildRequires: libuuid-devel libblkid-devel systemd gcc -BuildRequires: make +BuildRequires: libuuid-devel libblkid-devel libsmartcols-devel systemd gcc %description Bcache is a Linux kernel block layer cache. It allows one or more fast disk @@ -64,11 +59,11 @@ tar xzf %{SOURCE1} --strip-components=1 %patch2 -p1 -b .fedconfmake chmod +x configure %patch3 -p1 -b .noprobe -%patch4 -p1 -b .crc64 +%patch4 -p1 -b .util-linux-hdr %patch5 -p1 -b .python3 %patch6 -p1 -b .rootgc -%patch7 -p1 -b .gcc10 +%patch7 -p1 -b .man %build %configure @@ -103,14 +98,16 @@ install -p -m 755 bcache-status %{buildroot}%{_sbindir}/bcache-status %{_mandir}/man8/* %{_udevlibdir}/bcache-register %{_udevlibdir}/bcache-params +%{_sbindir}/bcache %{_sbindir}/bcache-super-show %{_sbindir}/bcache-status %{_sbindir}/make-bcache %{dracutlibdir}/modules.d/90bcache %changelog -* Tue Jan 26 2021 Fedora Release Engineering - 1.0.8-20 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild +* Sat Jan 30 2021 Rolf Fokkens - 1.1-0 +- Changed upstream to git://git.kernel.org/pub/scm/linux/kernel/git/colyli/bcache-tools.git +- Updated to 1.1 * Mon Jul 27 2020 Fedora Release Engineering - 1.0.8-19 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index 6f9a650..4678ea5 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -18fa816e496899ab59a9615d4a92bcde bcache-status-20140220.tar.gz -8ab15ce3fd501b3e06d913cb40810c94 bcache-tools-1.0.8.tar.gz +SHA512 (bcache-status-20140220.tar.gz) = 4c37be57ba35a8ccb3b7458bf6b24323003b7bcb28fa51aee3e43017467a827f39329534142cd3d52a2d20c0f09123916301ef8c1d3f13fc207fc8d265a7bda6 +SHA512 (bcache-tools-1.1.tar.gz) = 4ccbef47255bf3644a50242a79951b1f3720e71a55eb1e07dc6b8486df0245da99a77bba751b50197d489b4c5d738e5284aabc014c2f7f44816ddf6a1bb807ca