Unverified Commit 22c9dea9 authored by K900's avatar K900 Committed by GitHub
Browse files

Merge pull request #240403 from K900/udisks-2.10.0

Udisks 2.10.0
parents 54769c6f 708b8c91
Loading
Loading
Loading
Loading
+6 −13
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, substituteAll, autoreconfHook, pkg-config, gtk-doc
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, gtk-doc
, docbook_xml_dtd_43, python3, gobject-introspection, glib, udev, kmod, parted
, cryptsetup, lvm2, dmraid, util-linux, libbytesize, libndctl, nss, volume_key
, libxslt, docbook_xsl, gptfdisk, libyaml, autoconf-archive
, thin-provisioning-tools, makeWrapper
, thin-provisioning-tools, makeWrapper, e2fsprogs, libnvme, keyutils
}:
stdenv.mkDerivation rec {
  pname = "libblockdev";
  version = "2.28";
  version = "3.0";

  src = fetchFromGitHub {
    owner = "storaged-project";
    repo = "libblockdev";
    rev = "${version}-1";
    sha256 = "sha256-6MrM3psLqMcpf4haaEHg3FwrhUDz5h/DeY1w96T0UlE=";
    sha256 = "sha256-pdS3rMqAgNdYSyXN2ItvOmDO9MEEiHTgPWFVc24N6VE=";
  };

  outputs = [ "out" "dev" "devdoc" ];

  patches = [
    (substituteAll {
      src = ./fix-paths.patch;
      sgdisk = "${gptfdisk}/bin/sgdisk";
    })
  ];

  postPatch = ''
    patchShebangs scripts
  '';
@@ -34,8 +27,8 @@ stdenv.mkDerivation rec {
  ];

  buildInputs = [
    glib udev kmod parted gptfdisk cryptsetup lvm2 dmraid util-linux libbytesize
    libndctl nss volume_key libyaml
    e2fsprogs glib udev keyutils kmod parted gptfdisk cryptsetup lvm2 util-linux libbytesize
    libndctl libnvme nss volume_key libyaml
  ];

  postInstall = ''
+0 −47
Original line number Diff line number Diff line
--- a/src/plugins/part.c
+++ b/src/plugins/part.c
@@ -146,7 +146,7 @@ static GMutex deps_check_lock;
 #define DEPS_LAST 2
 
 static const UtilDep deps[DEPS_LAST] = {
-    {"sgdisk", "0.8.6", NULL, "GPT fdisk \\(sgdisk\\) version ([\\d\\.]+)"},
+    {"@sgdisk@", "0.8.6", NULL, "GPT fdisk \\(sgdisk\\) version ([\\d\\.]+)"},
     {"sfdisk", NULL, NULL, NULL},
 };
 
@@ -355,7 +355,7 @@ gboolean bd_part_create_table (const gchar *disk, BDPartTableType type, gboolean
 }
 
 static gchar* get_part_type_guid_and_gpt_flags (const gchar *device, int part_num, guint64 *flags, GError **error) {
-    const gchar *args[4] = {"sgdisk", NULL, device, NULL};
+    const gchar *args[4] = {"@sgdisk@", NULL, device, NULL};
     gchar *output = NULL;
     gchar **lines = NULL;
     gchar **line_p = NULL;
@@ -1325,7 +1325,7 @@ gboolean bd_part_resize_part (const gchar *disk, const gchar *part, guint64 size
 
 
 static gboolean set_gpt_flag (const gchar *device, int part_num, BDPartFlag flag, gboolean state, GError **error) {
-    const gchar *args[5] = {"sgdisk", "--attributes", NULL, device, NULL};
+    const gchar *args[5] = {"@sgdisk@", "--attributes", NULL, device, NULL};
     int bit_num = 0;
     gboolean success = FALSE;
 
@@ -1351,7 +1351,7 @@ static gboolean set_gpt_flag (const gchar *device, int part_num, BDPartFlag flag
 }
 
 static gboolean set_gpt_flags (const gchar *device, int part_num, guint64 flags, GError **error) {
-    const gchar *args[5] = {"sgdisk", "--attributes", NULL, device, NULL};
+    const gchar *args[5] = {"@sgdisk@", "--attributes", NULL, device, NULL};
     guint64 real_flags = 0;
     gchar *mask_str = NULL;
     gboolean success = FALSE;
@@ -1791,7 +1791,7 @@ gboolean bd_part_set_part_name (const gchar *disk, const gchar *part, const gcha
  * Tech category: %BD_PART_TECH_GPT-%BD_PART_TECH_MODE_MODIFY_PART
  */
 gboolean bd_part_set_part_type (const gchar *disk, const gchar *part, const gchar *type_guid, GError **error) {
-    const gchar *args[5] = {"sgdisk", "--typecode", NULL, disk, NULL};
+    const gchar *args[5] = {"@sgdisk@", "--typecode", NULL, disk, NULL};
     const gchar *part_num_str = NULL;
     gboolean success = FALSE;
     guint64 progress_id = 0;
+3 −9
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, substituteAll, fetchpatch, pkg-config, gnused, autoreconfHook
{ lib, stdenv, fetchFromGitHub, substituteAll, pkg-config, gnused, autoreconfHook
, gtk-doc, acl, systemd, glib, libatasmart, polkit, coreutils, bash, which
, expat, libxslt, docbook_xsl, util-linux, mdadm, libgudev, libblockdev, parted
, gobject-introspection, docbook_xml_dtd_412, docbook_xml_dtd_43
@@ -8,13 +8,13 @@

stdenv.mkDerivation rec {
  pname = "udisks";
  version = "2.9.4";
  version = "2.10.0";

  src = fetchFromGitHub {
    owner = "storaged-project";
    repo = "udisks";
    rev = "${pname}-${version}";
    sha256 = "sha256-MYQztzIyp5kh9t1bCIlj08/gaOmZfuu/ZOwo3F+rZiw=";
    sha256 = "sha256-M0L2MjVKv7VmtML/JZx0I8vNj+m6KDWGezvcwFqoTNI=";
  };

  outputs = [ "out" "man" "dev" ] ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "devdoc";
@@ -23,7 +23,6 @@ stdenv.mkDerivation rec {
    (substituteAll {
      src = ./fix-paths.patch;
      bash = "${bash}/bin/bash";
      blkid = "${util-linux}/bin/blkid";
      false = "${coreutils}/bin/false";
      mdadm = "${mdadm}/bin/mdadm";
      mkswap = "${util-linux}/bin/mkswap";
@@ -40,11 +39,6 @@ stdenv.mkDerivation rec {
        xfsprogs ntfs3g parted util-linux
      ];
    })
    # Fix crash on exit, remove on upgrade to 2.10.
    (fetchpatch {
      url = "https://github.com/storaged-project/udisks/commit/6464e3083c27b9e4d97848b9e69e862f265511d5.patch";
      hash = "sha256-XGprXjJLIL8l4P5MRTHV8GOQR1hpaaFiLgexGnO9Lvg=";
    })
  ];

  strictDeps = true;
+9 −98
Original line number Diff line number Diff line
@@ -14,95 +14,6 @@ index ca802cce..bfd1c29e 100644

 LABEL="udisks_probe_end"

diff --git a/modules/zram/data/udisks2-zram-setup@.service.in b/modules/zram/data/udisks2-zram-setup@.service.in
index ac868e84..03fdd887 100644
--- a/modules/zram/data/udisks2-zram-setup@.service.in
+++ b/modules/zram/data/udisks2-zram-setup@.service.in
@@ -8,7 +8,7 @@ Requires=dev-%i.device
 Type=oneshot
 RemainAfterExit=no
 EnvironmentFile=-@zramconfdir@/%i
-ExecStart=-/bin/sh -c 'if [ -n "$ZRAM_NUM_STR" ]; then echo "$ZRAM_NUM_STR" > /sys/class/block/%i/max_comp_streams; fi'
-ExecStart=-/bin/sh -c 'if [ -n "$ZRAM_DEV_SIZE" ]; then echo "$ZRAM_DEV_SIZE" > /sys/class/block/%i/disksize; fi'
-ExecStart=-/bin/sh -c 'if [ "$SWAP" = "y" ]; then mkswap /dev/%i && swapon /dev/%i; fi'
-# ExecStop=-/bin/sh -c 'echo 1 > /sys/class/block/%i/reset'
+ExecStart=-@sh@ -c 'if [ -n "$ZRAM_NUM_STR" ]; then echo "$ZRAM_NUM_STR" > /sys/class/block/%i/max_comp_streams; fi'
+ExecStart=-@sh@ -c 'if [ -n "$ZRAM_DEV_SIZE" ]; then echo "$ZRAM_DEV_SIZE" > /sys/class/block/%i/disksize; fi'
+ExecStart=-@sh@ -c 'if [ "$SWAP" = "y" ]; then @mkswap@ /dev/%i && @swapon@ /dev/%i; fi'
+# ExecStop=-@sh@ -c 'echo 1 > /sys/class/block/%i/reset'
diff --git a/modules/zram/udiskslinuxmanagerzram.c b/modules/zram/udiskslinuxmanagerzram.c
index f647f653..df81e910 100644
--- a/modules/zram/udiskslinuxmanagerzram.c
+++ b/modules/zram/udiskslinuxmanagerzram.c
@@ -243,7 +243,7 @@ create_conf_files (guint64   num_devices,
 
       g_snprintf (tmp, 255, "zram%" G_GUINT64_FORMAT, i);
       filename = g_build_filename (PACKAGE_ZRAMCONF_DIR, tmp, NULL);
-      contents = g_strdup_printf ("#!/bin/bash\n"
+      contents = g_strdup_printf ("#!@bash@\n"
                                   "# UDisks2 managed ZRAM configuration\n\n"
                                   "ZRAM_NUM_STR=%" G_GUINT64_FORMAT "\n"
                                   "ZRAM_DEV_SIZE=%" G_GUINT64_FORMAT "\n"
diff --git a/src/tests/install-udisks/runtest.sh b/src/tests/install-udisks/runtest.sh
index e7df4ed2..ab4356d9 100644
--- a/src/tests/install-udisks/runtest.sh
+++ b/src/tests/install-udisks/runtest.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@bash@
 # vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
diff --git a/src/tests/integration-test b/src/tests/integration-test
index 07e4e029..3bd8ec51 100755
--- a/src/tests/integration-test
+++ b/src/tests/integration-test
@@ -299,7 +299,7 @@ class UDisksTestCase(unittest.TestCase):
         if not device:
             device = cls.devname(partition)
         result = {}
-        cmd = subprocess.Popen(['blkid', '-p', '-o', 'udev', device], stdout=subprocess.PIPE)
+        cmd = subprocess.Popen(['@blkid@', '-p', '-o', 'udev', device], stdout=subprocess.PIPE)
         for l in cmd.stdout:
             (key, value) = l.decode('UTF-8').split('=', 1)
             result[key] = value.strip()
@@ -437,7 +437,7 @@ class UDisksTestCase(unittest.TestCase):
                 f.write('KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", '
                         'ATTRS{model}=="scsi_debug*", '
                         'ENV{ID_CDROM_MEDIA}=="?*", '
-                        'IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"\n')
+                        'IMPORT{program}="@blkid@ -o udev -p -u noraid $tempnode"\n')
             # reload udev
             subprocess.call('sync; pkill --signal HUP udevd || '
                             'pkill --signal HUP systemd-udevd',
@@ -1142,7 +1142,7 @@ class FS(UDisksTestCase):
         self.assertFalse(os.access(f, os.X_OK))
 
         f = os.path.join(mount_point, 'simple.exe')
-        shutil.copy('/bin/bash', f)
+        shutil.copy('@bash@', f)
         self.assertTrue(os.access(f, os.R_OK))
         self.assertTrue(os.access(f, os.W_OK))
         self.assertTrue(os.access(f, os.X_OK))
@@ -1155,7 +1155,7 @@ class FS(UDisksTestCase):
         self.assertFalse(os.access(f, os.X_OK))
 
         f = os.path.join(mount_point, 'subdir', 'subdir.exe')
-        shutil.copy('/bin/bash', f)
+        shutil.copy('@bash@', f)
         self.assertTrue(os.access(f, os.R_OK))
         self.assertTrue(os.access(f, os.W_OK))
         self.assertTrue(os.access(f, os.X_OK))
diff --git a/src/tests/storadectl/runtest.sh b/src/tests/storadectl/runtest.sh
index f03885f9..baca6a93 100644
--- a/src/tests/storadectl/runtest.sh
+++ b/src/tests/storadectl/runtest.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!@bash@
 # vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
diff --git a/src/tests/test.c b/src/tests/test.c
index 3ddbdf2c..a87f960a 100644
--- a/src/tests/test.c