Date: Thursday, January 5, 2023 @ 18:08:17
  Author: tpowa
Revision: 465988

archrelease: copy trunk to testing-x86_64

Added:
  btrfs-progs/repos/testing-x86_64/
  btrfs-progs/repos/testing-x86_64/PKGBUILD
    (from rev 465987, btrfs-progs/trunk/PKGBUILD)
  btrfs-progs/repos/testing-x86_64/btrfs-progs.install
    (from rev 465987, btrfs-progs/trunk/btrfs-progs.install)
  btrfs-progs/repos/testing-x86_64/[email protected]
    (from rev 465987, btrfs-progs/trunk/[email protected])
  btrfs-progs/repos/testing-x86_64/[email protected]
    (from rev 465987, btrfs-progs/trunk/[email protected])
  
btrfs-progs/repos/testing-x86_64/fd138f8678808717635a145832c1b13320ce6cd2.patch
    (from rev 465987, 
btrfs-progs/trunk/fd138f8678808717635a145832c1b13320ce6cd2.patch)
  btrfs-progs/repos/testing-x86_64/initcpio-hook-btrfs
    (from rev 465987, btrfs-progs/trunk/initcpio-hook-btrfs)
  btrfs-progs/repos/testing-x86_64/initcpio-install-btrfs
    (from rev 465987, btrfs-progs/trunk/initcpio-install-btrfs)
  btrfs-progs/repos/testing-x86_64/keys/

------------------------------------------------+
 PKGBUILD                                       |   77 +++++++++++++++++++++++
 btrfs-progs.install                            |   15 ++++
 [email protected]                           |   10 ++
 [email protected]                             |   11 +++
 fd138f8678808717635a145832c1b13320ce6cd2.patch |   70 ++++++++++++++++++++
 initcpio-hook-btrfs                            |    7 ++
 initcpio-install-btrfs                         |   17 +++++
 7 files changed, 207 insertions(+)

Copied: btrfs-progs/repos/testing-x86_64/PKGBUILD (from rev 465987, 
btrfs-progs/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD                             (rev 0)
+++ testing-x86_64/PKGBUILD     2023-01-05 18:08:17 UTC (rev 465988)
@@ -0,0 +1,77 @@
+# Maintainer: Sébastien "Seblu" Luttringer <[email protected]>
+# Contributor: Tom Gundersen <[email protected]>
+# Contributor: Tobias Powalowski <[email protected]>
+
+pkgname=btrfs-progs
+pkgver=6.1.1
+pkgrel=1
+pkgdesc='Btrfs filesystem utilities'
+arch=('x86_64')
+makedepends=('git' 'asciidoc' 'xmlto' 'systemd' 'python' 'python-setuptools' 
'e2fsprogs' 'reiserfsprogs' 'python-sphinx')
+depends=('glibc' 'util-linux-libs' 'lzo' 'zlib' 'zstd' 'libgcrypt')
+optdepends=('python: libbtrfsutil python bindings'
+            'e2fsprogs: btrfs-convert'
+            'reiserfsprogs: btrfs-convert')
+url='https://btrfs.wiki.kernel.org'
+replaces=('btrfs-progs-unstable')
+conflicts=('btrfs-progs-unstable')
+provides=('btrfs-progs-unstable')
+license=('GPL2')
+validpgpkeys=('F2B41200C54EFB30380C1756C565D5F9D76D583B')
+source=("https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v$pkgver.tar."{sign,xz}
+        'initcpio-install-btrfs'
+        'initcpio-hook-btrfs'
+        '[email protected]'
+        '[email protected]'
+      )
+install=btrfs-progs.install
+options=(!staticlibs debug)
+sha256sums=('SKIP'
+            'ca3a465d87200206e3a41d0f434f93cd222ca5325a2099a634dbdd23faeb6769'
+            'bbe60b35d1b1e2efc1308a8f54f1fdc6808240a81c5f5b4d75321b7ee86e41f4'
+            '35efeee8590d6d60c711ae9cdc918e4841ab61d10cb02359e65e36ebff95ffc5'
+            'eaa7af92d28bfa8940bb551560fd7be777f9f175292eaa72b5f6ef00fb240252'
+            '9a0b6cc23f7bd97b83b6c38dd2b4e4373fead8bd3ccfb82a47c72971e9d6f8ad')
+
+prepare() {
+  cd $pkgname-v$pkgver
+  # apply patch from the source array (should be a pacman feature)
+  local src
+  for src in "${source[@]}"; do
+    src="${src%%::*}"
+    src="${src##*/}"
+    [[ $src = *.patch ]] || continue
+    echo "Applying patch $src..."
+    patch -Np1 < "../$src"
+  done
+}
+
+build() {
+  cd $pkgname-v$pkgver
+  ./configure --prefix=/usr --with-crypto=libgcrypt
+  make
+}
+
+check() {
+  cd $pkgname-v$pkgver
+ ./btrfs filesystem show
+}
+
+package() {
+  cd $pkgname-v$pkgver
+  make DESTDIR="$pkgdir" install install_python
+
+  # install bash completion (FS#44618)
+  install -Dm644 btrfs-completion 
"$pkgdir/usr/share/bash-completion/completions/btrfs"
+
+  # install mkinitcpio hooks
+  cd "$srcdir"
+  install -Dm644 initcpio-install-btrfs 
"$pkgdir/usr/lib/initcpio/install/btrfs"
+  install -Dm644 initcpio-hook-btrfs "$pkgdir/usr/lib/initcpio/hooks/btrfs"
+
+  # install scrub service/timer
+  install -Dm644 [email protected] 
"$pkgdir/usr/lib/systemd/system/[email protected]"
+  install -Dm644 [email protected] 
"$pkgdir/usr/lib/systemd/system/[email protected]"
+}
+
+# vim:set ts=2 sw=2 ft=sh et:

Copied: btrfs-progs/repos/testing-x86_64/btrfs-progs.install (from rev 465987, 
btrfs-progs/trunk/btrfs-progs.install)
===================================================================
--- testing-x86_64/btrfs-progs.install                          (rev 0)
+++ testing-x86_64/btrfs-progs.install  2023-01-05 18:08:17 UTC (rev 465988)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+## arg 1:  the new package version
+## arg 2:  the old package version
+post_upgrade() {
+  if (( "$(vercmp "$2" 0.19.20121005)" < 0 )); then
+    echo 'btrfs multi-device support now relies on linux 3.6 or later'
+  elif (( "$(vercmp "$2" 4.3.1-2)" < 0 )); then
+    echo '[email protected] instance names must not be prefix by dash anymore'
+    echo 'use [email protected] to scrub / monthly'
+    echo '    [email protected] to scrub /home monthly.'
+  fi
+}
+
+# vim:set ts=2 sw=2 et:

Copied: btrfs-progs/repos/testing-x86_64/[email protected] (from rev 465987, 
btrfs-progs/trunk/[email protected])
===================================================================
--- testing-x86_64/[email protected]                         (rev 0)
+++ testing-x86_64/[email protected] 2023-01-05 18:08:17 UTC (rev 465988)
@@ -0,0 +1,10 @@
+[Unit]
+Description=Btrfs scrub on %f
+ConditionPathIsMountPoint=%f
+RequiresMountsFor=%f
+
+[Service]
+Nice=19
+IOSchedulingClass=idle
+KillSignal=SIGINT
+ExecStart=/usr/bin/btrfs scrub start -B %f

Copied: btrfs-progs/repos/testing-x86_64/[email protected] (from rev 465987, 
btrfs-progs/trunk/[email protected])
===================================================================
--- testing-x86_64/[email protected]                           (rev 0)
+++ testing-x86_64/[email protected]   2023-01-05 18:08:17 UTC (rev 465988)
@@ -0,0 +1,11 @@
+[Unit]
+Description=Monthly Btrfs scrub on %f
+
+[Timer]
+OnCalendar=monthly
+AccuracySec=1d
+RandomizedDelaySec=1w
+Persistent=true
+
+[Install]
+WantedBy=timers.target

Copied: 
btrfs-progs/repos/testing-x86_64/fd138f8678808717635a145832c1b13320ce6cd2.patch 
(from rev 465987, 
btrfs-progs/trunk/fd138f8678808717635a145832c1b13320ce6cd2.patch)
===================================================================
--- testing-x86_64/fd138f8678808717635a145832c1b13320ce6cd2.patch               
                (rev 0)
+++ testing-x86_64/fd138f8678808717635a145832c1b13320ce6cd2.patch       
2023-01-05 18:08:17 UTC (rev 465988)
@@ -0,0 +1,70 @@
+From fd138f8678808717635a145832c1b13320ce6cd2 Mon Sep 17 00:00:00 2001
+From: Qu Wenruo <[email protected]>
+Date: Tue, 27 Dec 2022 13:25:12 +0800
+Subject: [PATCH] btrfs-progs: fix the wrong timestamp and UUID check for root
+ items
+
+[BUG]
+Since commit d729048be6ef ("btrfs-progs: stop using
+btrfs_root_item_v0"), "btrfs subvolume list" not longer correctly report
+UUID nor timestamp, while older (btrfs-progs v6.0.2) still works
+correct:
+
+ v6.0.2:
+ # btrfs subv list -u  /mnt/btrfs/
+ ID 256 gen 12 top level 5 uuid ed4af580-d512-2644-b392-2a71aaeeb99e path subv1
+ ID 257 gen 13 top level 5 uuid a22ccba7-0a0a-a94f-af4b-5116ab58bb61 path subv2
+
+ v6.1:
+ # ./btrfs subv list -u /mnt/btrfs/
+ ID 256 gen 12 top level 5 uuid -                                    path subv1
+ ID 257 gen 13 top level 5 uuid -                                    path subv2
+
+[CAUSE]
+Commit d729048be6ef ("btrfs-progs: stop using btrfs_root_item_v0")
+removed old btrfs_root_item_v0, but incorrectly changed the check for
+v0 root item.
+
+Now we will treat v0 root items as latest root items, causing possible
+out-of-bound access. while treat current root items as older v0 root
+items, ignoring the UUID nor timestamp.
+
+[FIX]
+Fix the bug by using correct checks, and add extra comments on the
+branches.
+
+Issue: #562
+Fixes: d729048be6ef ("btrfs-progs: stop using btrfs_root_item_v0")
+Signed-off-by: Qu Wenruo <[email protected]>
+---
+ cmds/subvolume-list.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/cmds/subvolume-list.c b/cmds/subvolume-list.c
+index 6d5ef509a..7cdb0402b 100644
+--- a/cmds/subvolume-list.c
++++ b/cmds/subvolume-list.c
+@@ -870,14 +870,21 @@ static int list_subvol_search(int fd, struct rb_root 
*root_lookup)
+                               ri = (struct btrfs_root_item *)(args.buf + off);
+                               gen = btrfs_root_generation(ri);
+                               flags = btrfs_root_flags(ri);
+-                              if(sh.len <
+-                                 sizeof(struct btrfs_root_item)) {
++                              if(sh.len >= sizeof(struct btrfs_root_item)) {
++                                      /*
++                                       * The new full btrfs_root_item with
++                                       * timestamp and UUID.
++                                       */
+                                       otime = 
btrfs_stack_timespec_sec(&ri->otime);
+                                       ogen = btrfs_root_otransid(ri);
+                                       memcpy(uuid, ri->uuid, BTRFS_UUID_SIZE);
+                                       memcpy(puuid, ri->parent_uuid, 
BTRFS_UUID_SIZE);
+                                       memcpy(ruuid, ri->received_uuid, 
BTRFS_UUID_SIZE);
+                               } else {
++                                      /*
++                                       * The old v0 root item, which doesn't
++                                       * has timestamp nor UUID.
++                                       */
+                                       otime = 0;
+                                       ogen = 0;
+                                       memset(uuid, 0, BTRFS_UUID_SIZE);

Copied: btrfs-progs/repos/testing-x86_64/initcpio-hook-btrfs (from rev 465987, 
btrfs-progs/trunk/initcpio-hook-btrfs)
===================================================================
--- testing-x86_64/initcpio-hook-btrfs                          (rev 0)
+++ testing-x86_64/initcpio-hook-btrfs  2023-01-05 18:08:17 UTC (rev 465988)
@@ -0,0 +1,7 @@
+#!/usr/bin/ash
+
+run_hook() {
+    btrfs device scan
+}
+
+# vim: set ft=sh ts=4 sw=4 et:

Copied: btrfs-progs/repos/testing-x86_64/initcpio-install-btrfs (from rev 
465987, btrfs-progs/trunk/initcpio-install-btrfs)
===================================================================
--- testing-x86_64/initcpio-install-btrfs                               (rev 0)
+++ testing-x86_64/initcpio-install-btrfs       2023-01-05 18:08:17 UTC (rev 
465988)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+build() {
+    add_module btrfs
+    add_binary btrfs
+    add_binary btrfsck
+    add_runscript
+}
+
+help() {
+    cat <<HELPEOF
+This hook provides support for multi-device btrfs volumes. This hook
+is only needed for initramfs images which do not use udev.
+HELPEOF
+}
+
+# vim: set ft=sh ts=4 sw=4 et:

Reply via email to