Index: Makefile =================================================================== --- /dev/null +++ Makefile @@ -0,0 +1 @@ +include ../Makefile.common Index: abi_used_libs =================================================================== --- /dev/null +++ abi_used_libs @@ -0,0 +1,3 @@ +libblkid.so.1 +libc.so.6 +libuuid.so.1 Index: files/bcache-status-python3.patch =================================================================== --- /dev/null +++ files/bcache-status-python3.patch @@ -0,0 +1,8 @@ +--- bcache-tools-1.0.8/bcache-status.orig 2015-06-20 08:56:22.343589706 +0200 ++++ bcache-tools-1.0.8/bcache-status 2015-06-20 08:56:39.971692433 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + # Dumb script to dump (some) of bcache status + # Copyright 2014 Darrick J. Wong. All rights reserved. Index: files/bcache-status-rootgc.patch =================================================================== --- /dev/null +++ files/bcache-status-rootgc.patch @@ -0,0 +1,18 @@ +--- bcache-tools-1.0.8.bcache-status.orig 2016-08-04 15:03:50.095602401 +0200 ++++ bcache-tools-1.0.8/bcache-status 2016-08-04 14:31:24.507542579 +0200 +@@ -337,8 +337,12 @@ + continue + + if run_gc: +- with open('%s%s/internal/trigger_gc' % (SYSFS_BCACHE_PATH, cache), 'w') as fd: +- fd.write('1\n') ++ try: ++ with open('%s%s/internal/trigger_gc' % (SYSFS_BCACHE_PATH, cache), 'w') as fd: ++ fd.write('1\n') ++ except PermissionError as e: ++ print ('You need root permissions for the --gc option') ++ sys.exit(1) + + dump_bcache('%s%s' % (SYSFS_BCACHE_PATH, cache), stats, print_subdevices, uuid_map.get(cache, '?')) + + Index: files/bcache-tools-1.0.8-cmdline.patch =================================================================== --- /dev/null +++ files/bcache-tools-1.0.8-cmdline.patch @@ -0,0 +1,248 @@ +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 + .* Index: files/bcache-tools-1.0.8-crc64.patch =================================================================== --- /dev/null +++ files/bcache-tools-1.0.8-crc64.patch @@ -0,0 +1,12 @@ +--- a/bcache.c ++++ b/bcache.c +@@ -115,7 +115,7 @@ static const uint64_t crc_table[256] = { + 0x9AFCE626CE85B507ULL + }; + +-inline uint64_t crc64(const void *_data, size_t len) ++uint64_t crc64(const void *_data, size_t len) + { + uint64_t crc = 0xFFFFFFFFFFFFFFFFULL; + const unsigned char *data = _data; + Index: files/bcache-tools-1.0.8-makefile.patch =================================================================== --- /dev/null +++ files/bcache-tools-1.0.8-makefile.patch @@ -0,0 +1,33 @@ +--- a/Makefile 2014-12-04 23:51:24.000000000 +0100 ++++ b/Makefile 2017-05-25 10:54:29.740372569 +0200 +@@ -5,16 +5,17 @@ + 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) -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: make-bcache probe-bcache bcache-super-show bcache-register bcache-params ++ $(INSTALL) -m0755 make-bcache bcache-super-show $(DESTDIR)${PREFIX}/bin/ ++ $(INSTALL) -m0755 probe-bcache bcache-register bcache-params $(DESTDIR)${PREFIX}$(UDEVLIBDIR)/ ++ $(INSTALL) -m0644 69-bcache.rules $(DESTDIR)${PREFIX}$(UDEVLIBDIR)/rules.d/ + $(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 ++# Disable initramfs and initcpio. Solus runs dracut ++# $(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)${PREFIX}$(DRACUTLIBDIR)/modules.d/90bcache/module-setup.sh + # $(INSTALL) -m0755 bcache-test $(DESTDIR)${PREFIX}/sbin/ + + clean: +@@ -30,3 +31,4 @@ + bcache-super-show: CFLAGS += -std=gnu99 + bcache-super-show: bcache.o + bcache-register: bcache-register.o ++bcache-params: bcache-params.o Index: files/bcache-tools-1.0.8-noprobe.2.patch =================================================================== --- /dev/null +++ files/bcache-tools-1.0.8-noprobe.2.patch @@ -0,0 +1,30 @@ +--- bcache-tools-1.0.8/69-bcache.rules.noprobe 2015-02-04 21:24:06.000000000 +0100 ++++ bcache-tools-1.0.8/69-bcache.rules 2015-02-06 23:38:41.494507524 +0100 +@@ -7,17 +7,10 @@ + KERNEL=="fd*|sr*", GOTO="bcache_end" + + # blkid was run by the standard udev rules +-# It recognised bcache (util-linux 2.24+) +-ENV{ID_FS_TYPE}=="bcache", GOTO="bcache_backing_found" +-# It recognised something else; bail +-ENV{ID_FS_TYPE}=="?*", GOTO="bcache_backing_end" +- + # Backing devices: scan, symlink, register +-IMPORT{program}="probe-bcache -o udev $tempnode" + ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end" + 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" +--- bcache-tools-1.0.8/dracut/module-setup.sh.noprobe 2015-02-06 23:38:41.495507529 +0100 ++++ bcache-tools-1.0.8/dracut/module-setup.sh 2015-02-06 23:39:49.471863166 +0100 +@@ -30,7 +30,6 @@ + + install() { + inst_multiple \ +- ${udevdir}/probe-bcache \ + ${udevdir}/bcache-register \ + ${udevdir}/bcache-params + inst_rules 69-bcache.rules Index: files/bcache-tools-status-20160804-man.patch =================================================================== --- /dev/null +++ files/bcache-tools-status-20160804-man.patch @@ -0,0 +1,49 @@ +diff -ruN bcache-tools-20160804.orig/bcache-status.8 bcache-tools-20160804/bcache-status.8 +--- bcache-tools-20160804.orig/bcache-status.8 1970-01-01 01:00:00.000000000 +0100 ++++ bcache-tools-20160804/bcache-status.8 2016-08-04 15:12:15.378683562 +0200 +@@ -0,0 +1,45 @@ ++.TH bcache-status 8 ++.SH NAME ++bcache-status \- Display useful bcache statistics ++.SH SYNOPSIS ++.B bcache-status ++[\fB \--help\fR ] ++[\fB \-f\fR ] ++[\fB \-h\fR ] ++[\fB \-d\fR ] ++[\fB \-t\fR ] ++[\fB \-a\fR ] ++[\fB \-r\fR ] ++[\fB \-s\fR ] ++[\fB \-g\fR ] ++.SH DESCRIPTION ++This command displays useful bcache statistics in a convenient way. ++.SH OPTIONS ++.TP ++.BR \---help ++Print help message and exit. ++.TP ++.BR \-f,\ --five-minute ++Print the last five minutes of stats. ++.TP ++.BR \-h,\ --hour ++Print the last hour of stats. ++.TP ++.BR \-d,\ --day ++Print the last day of stats. ++.TP ++.BR \-t,\ --total ++Print total stats. ++.TP ++.BR \-a,\ --all ++Print all stats. ++.TP ++.BR \-r,\ --reset-stats ++Reset stats after printing them. ++.TP ++.BR \-s,\ --sub-status ++Print subdevice status. ++.TP ++.BR \-g,\ --gc ++Invoke GC before printing status (root only). ++ Index: package.yml =================================================================== --- /dev/null +++ package.yml @@ -0,0 +1,41 @@ +name : bcache-tools +version : 1.0.8 +release : 1 +source : + - https://github.com/g2p/bcache-tools/archive/v1.0.8.tar.gz : d56923936f37287efc57a46315679102ef2c86cd0be5874590320acd48c1201c + - http://pkgs.fedoraproject.org/repo/pkgs/bcache-tools/bcache-status-20140220.tar.gz/18fa816e496899ab59a9615d4a92bcde/bcache-status-20140220.tar.gz : 0d5296f3af83560caf391e5757195af2205a5237fbee4ecfcf5d8eb89a01bb2c +license : GPL-2.0 +component : system.utils +summary : Bcache is a Linux kernel block layer cache +description: | + Bcache is a Linux kernel block layer cache. It allows one or more fast disk drives such as flash-based solid state drives (SSDs) to act as a cache for one or more slower hard disk drives. +runddeps : + - util-linux + - python3 +setup : | + # Is there a better way doing this ? + tar -xf $sources/bcache-status-20140220.tar.gz -C $workdir + mv bcache-status-20140220/bcache-status $workdir + # patching + %patch -p1 < $pkgfiles/bcache-tools-status-20160804-man.patch + %patch -p1 < $pkgfiles/bcache-tools-1.0.8-cmdline.patch + %patch -p1 < $pkgfiles/bcache-tools-1.0.8-noprobe.2.patch + %patch -p1 < $pkgfiles/bcache-tools-1.0.8-crc64.patch + %patch -p1 < $pkgfiles/bcache-status-python3.patch + %patch -p1 < $pkgfiles/bcache-status-rootgc.patch + %patch -p1 < $pkgfiles/bcache-tools-1.0.8-makefile.patch + # making Directories + mkdir -p $installdir/usr/bin + mkdir -p $installdir/usr/share/man/man8 + mkdir -p $installdir/usr/lib/udev/ + mkdir -p $installdir/usr/lib/udev/rules.d + mkdir -p $installdir/usr/lib/dracut/modules.d/90bcache +build : | + %make +install : | + %make_install + # cleanup .eopkg + rm $installdir/usr/lib/udev/probe-bcache + rm $installdir/usr/share/man/man8/probe-bcache.8 + # install bcache-tools + install -p -m 755 $workdir/bcache-status $installdir/usr/bin Index: pspec_x86_64.xml =================================================================== --- /dev/null +++ pspec_x86_64.xml @@ -0,0 +1,39 @@ + + + bcache-tools + + Manuel Wassermann + manuel.wassermann97@gmail.com + + GPL-2.0 + system.utils + Bcache is a Linux kernel block layer cache + Bcache is a Linux kernel block layer cache. It allows one or more fast disk drives such as flash-based solid state drives (SSDs) to act as a cache for one or more slower hard disk drives. + + https://solus-project.com/sources/README.Solus + + + bcache-tools + Bcache is a Linux kernel block layer cache + Bcache is a Linux kernel block layer cache. It allows one or more fast disk drives such as flash-based solid state drives (SSDs) to act as a cache for one or more slower hard disk drives. + + system.utils + + /usr/bin + /usr/lib/dracut/modules.d/90bcache/module-setup.sh + /usr/lib/udev/bcache-params + /usr/lib/udev/bcache-register + /usr/lib/udev/rules.d/69-bcache.rules + /usr/share/man + + + + + 2017-05-25 + 1.0.8 + Packaging update + Manuel Wassermann + manuel.wassermann97@gmail.com + + + \ No newline at end of file