lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

bcache-tools: 1.0.8 -> 1.1 (#441847)

ofborg for x86_64-darwin has not made progress in 8 days, I'm going to merge.

authored by

Bjørn Forsman and committed by
GitHub
a80e12c2 e92111be

+72 -90
+1
nixos/tests/all-tests.nix
··· 254 254 ayatana-indicators = runTest ./ayatana-indicators.nix; 255 255 babeld = runTest ./babeld.nix; 256 256 bazarr = runTest ./bazarr.nix; 257 + bcache = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./bcache.nix; 257 258 bcachefs = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./bcachefs.nix; 258 259 beanstalkd = runTest ./beanstalkd.nix; 259 260 bees = runTest ./bees.nix;
+40
nixos/tests/bcache.nix
··· 1 + { pkgs, ... }: 2 + { 3 + name = "bcache"; 4 + meta.maintainers = with pkgs.lib.maintainers; [ pineapplehunter ]; 5 + 6 + nodes.machine = 7 + { pkgs, ... }: 8 + { 9 + virtualisation.emptyDiskImages = [ 4096 ]; 10 + networking.hostId = "deadbeef"; 11 + boot.supportedFilesystems = [ "ext4" ]; 12 + environment.systemPackages = [ pkgs.parted ]; 13 + }; 14 + 15 + testScript = '' 16 + machine.succeed("modprobe bcache") 17 + machine.succeed("bcache version") 18 + machine.succeed("ls /dev") 19 + 20 + machine.succeed( 21 + "mkdir /tmp/mnt", 22 + "udevadm settle", 23 + "parted --script /dev/vdb mklabel gpt", 24 + "parted --script /dev/vdb mkpart primary 0% 50% mkpart primary 50% 100%", 25 + "udevadm settle", 26 + "bcache make -C /dev/vdb1", 27 + "bcache make -B /dev/vdb2", 28 + "udevadm settle", 29 + "bcache attach /dev/vdb1 /dev/vdb2", 30 + "bcache set-cachemode /dev/vdb2 writeback", 31 + "udevadm settle", 32 + "bcache show", 33 + "ls /sys/fs/bcache", 34 + "mkfs.ext4 /dev/bcache0", 35 + "mount /dev/bcache0 /tmp/mnt", 36 + "umount /tmp/mnt", 37 + "udevadm settle", 38 + ) 39 + ''; 40 + }
-42
pkgs/by-name/bc/bcache-tools/bcache-udev-modern.patch
··· 1 - This patch does two things: 2 - 1) Drops probe-bcache, so now util-linux detecting functionality is used. 3 - 2) Drops bcache-register, moving registering device functionality into rule 4 - using 'sh'. 5 - This reduces things that need to be present in initrd, replacing them with 6 - already existing functionality and reducing overall initrd size. 7 - 8 - diff --git a/69-bcache.rules b/69-bcache.rules 9 - index 9cc7f0d..6a52893 100644 10 - --- a/69-bcache.rules 11 - +++ b/69-bcache.rules 12 - @@ -10,16 +10,11 @@ KERNEL=="fd*|sr*", GOTO="bcache_end" 13 - # It recognised bcache (util-linux 2.24+) 14 - ENV{ID_FS_TYPE}=="bcache", GOTO="bcache_backing_found" 15 - # It recognised something else; bail 16 - -ENV{ID_FS_TYPE}=="?*", GOTO="bcache_backing_end" 17 - - 18 - -# Backing devices: scan, symlink, register 19 - -IMPORT{program}="probe-bcache -o udev $tempnode" 20 - -ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end" 21 - -ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" 22 - +GOTO="bcache_backing_end" 23 - 24 - LABEL="bcache_backing_found" 25 - RUN{builtin}+="kmod load bcache" 26 - -RUN+="bcache-register $tempnode" 27 - +RUN+="@shell@ -c 'echo $tempnode > /sys/fs/bcache/register_quiet'" 28 - LABEL="bcache_backing_end" 29 - 30 - # Cached devices: symlink 31 - diff --git a/Makefile b/Makefile 32 - index c824ae3..c5f7309 100644 33 - --- a/Makefile 34 - +++ b/Makefile 35 - @@ -9,7 +9,6 @@ all: make-bcache probe-bcache bcache-super-show bcache-register 36 - 37 - install: make-bcache probe-bcache bcache-super-show 38 - $(INSTALL) -m0755 make-bcache bcache-super-show $(DESTDIR)${PREFIX}/sbin/ 39 - - $(INSTALL) -m0755 probe-bcache bcache-register $(DESTDIR)$(UDEVLIBDIR)/ 40 - $(INSTALL) -m0644 69-bcache.rules $(DESTDIR)$(UDEVLIBDIR)/rules.d/ 41 - $(INSTALL) -m0644 -- *.8 $(DESTDIR)${PREFIX}/share/man/man8/ 42 - $(INSTALL) -D -m0755 initramfs/hook $(DESTDIR)/usr/share/initramfs-tools/hooks/bcache
-22
pkgs/by-name/bc/bcache-tools/fix-static.patch
··· 1 - diff --git a/bcache.c b/bcache.c 2 - index 8f37445..79806d8 100644 3 - --- a/bcache.c 4 - +++ b/bcache.c 5 - @@ -26,7 +26,7 @@ 6 - * x^7 + x^4 + x + 1 7 - */ 8 - 9 - -static const uint64_t crc_table[256] = { 10 - +const uint64_t crc_table[256] = { 11 - 0x0000000000000000ULL, 0x42F0E1EBA9EA3693ULL, 0x85E1C3D753D46D26ULL, 12 - 0xC711223CFA3E5BB5ULL, 0x493366450E42ECDFULL, 0x0BC387AEA7A8DA4CULL, 13 - 0xCCD2A5925D9681F9ULL, 0x8E224479F47CB76AULL, 0x9266CC8A1C85D9BEULL, 14 - @@ -115,7 +115,7 @@ static const uint64_t crc_table[256] = { 15 - 0x9AFCE626CE85B507ULL 16 - }; 17 - 18 - -inline uint64_t crc64(const void *_data, size_t len) 19 - +uint64_t crc64(const void *_data, size_t len) 20 - { 21 - uint64_t crc = 0xFFFFFFFFFFFFFFFFULL; 22 - const unsigned char *data = _data;
+31 -26
pkgs/by-name/bc/bcache-tools/package.nix
··· 1 1 { 2 2 lib, 3 3 stdenv, 4 - fetchFromGitHub, 4 + fetchgit, 5 5 pkg-config, 6 6 util-linux, 7 7 bash, 8 - replaceVars, 9 8 udevCheckHook, 9 + nixosTests, 10 10 }: 11 11 12 12 stdenv.mkDerivation rec { 13 13 pname = "bcache-tools"; 14 - version = "1.0.8"; 14 + version = "1.1"; 15 15 16 - src = fetchFromGitHub { 17 - owner = "g2p"; 18 - repo = "bcache-tools"; 19 - rev = "v${version}"; 20 - hash = "sha256-6gy0ymecMgEHXbwp/nXHlrUEeDFnmFXWZZPlzP292g4="; 16 + src = fetchgit { 17 + url = "https://git.kernel.org/pub/scm/linux/kernel/git/colyli/bcache-tools.git"; 18 + rev = "bcache-tools-${version}"; 19 + hash = "sha256-8BiHC8qxk4otFPyKnvGNk57JSZytEOy51AGertWo2O0="; 21 20 }; 22 21 23 22 nativeBuildInputs = [ ··· 28 27 29 28 doInstallCheck = true; 30 29 31 - # * Remove broken install rules (they ignore $PREFIX) for stuff we don't need 32 - # anyway (it's distro specific stuff). 33 - # * Fixup absolute path to modprobe. 34 30 prePatch = '' 31 + # * Remove distro specific install rules which are not used in NixOS. 32 + # * Remove binaries for udev which are not needed on modern systems. 35 33 sed -e "/INSTALL.*initramfs\/hook/d" \ 36 34 -e "/INSTALL.*initcpio\/install/d" \ 37 35 -e "/INSTALL.*dracut\/module-setup.sh/d" \ 38 - -e "s/pkg-config/$PKG_CONFIG/" \ 36 + -e "/INSTALL.*probe-bcache/d" \ 39 37 -i Makefile 38 + # * Remove probe-bcache which is handled by util-linux 39 + sed -e "/probe-bcache/d" \ 40 + -i 69-bcache.rules 41 + # * Replace bcache-register binary with a write to sysfs 42 + substituteInPlace 69-bcache.rules \ 43 + --replace-fail "bcache-register \$tempnode" "${bash}/bin/sh -c 'echo \$tempnode > /sys/fs/bcache/register'" 40 44 ''; 41 45 42 - patches = [ 43 - (replaceVars ./bcache-udev-modern.patch { 44 - shell = "${bash}/bin/sh"; 45 - }) 46 - ./fix-static.patch 47 - ]; 48 - 49 46 makeFlags = [ 50 - "PREFIX=${placeholder "out"}" 51 - "UDEVLIBDIR=${placeholder "out"}/lib/udev/" 47 + "PREFIX=" 48 + "DESTDIR=$(out)" 52 49 ]; 53 50 54 51 preInstall = '' 55 52 mkdir -p "$out/sbin" "$out/lib/udev/rules.d" "$out/share/man/man8" 56 53 ''; 57 54 58 - meta = with lib; { 55 + passthru.tests = { 56 + inherit (nixosTests) bcache; 57 + }; 58 + 59 + meta = { 59 60 description = "User-space tools required for bcache (Linux block layer cache)"; 60 61 longDescription = '' 61 62 Bcache is a Linux kernel block layer cache. It allows one or more fast ··· 67 68 User documentation is in Documentation/bcache.txt in the Linux kernel 68 69 tree. 69 70 ''; 70 - homepage = "https://bcache.evilpiepirate.org/"; 71 - license = licenses.gpl2Only; 72 - platforms = platforms.linux; 73 - maintainers = [ maintainers.bjornfor ]; 71 + homepage = "https://www.kernel.org/doc/html/latest/admin-guide/bcache.html"; 72 + license = lib.licenses.gpl2Only; 73 + maintainers = with lib.maintainers; [ 74 + bjornfor 75 + pineapplehunter 76 + ]; 77 + mainProgram = "bcache-tools"; 78 + platforms = lib.platforms.linux; 74 79 }; 75 80 }