Date: Wednesday, March 7, 2018 @ 23:46:07
  Author: heftig
Revision: 318013

Replace ad-hoc sed'ing with a real patch

Added:
  systemd/trunk/0001-Use-Arch-Linux-device-access-groups.patch
Modified:
  systemd/trunk/PKGBUILD

------------------------------------------------+
 0001-Use-Arch-Linux-device-access-groups.patch |   75 +++++++++++++++++++++++
 PKGBUILD                                       |   13 +--
 2 files changed, 80 insertions(+), 8 deletions(-)

Added: 0001-Use-Arch-Linux-device-access-groups.patch
===================================================================
--- 0001-Use-Arch-Linux-device-access-groups.patch                              
(rev 0)
+++ 0001-Use-Arch-Linux-device-access-groups.patch      2018-03-07 23:46:07 UTC 
(rev 318013)
@@ -0,0 +1,75 @@
+From 34e4b4953cb99642e9144d97823edf32b06ffe93 Mon Sep 17 00:00:00 2001
+Message-Id: 
<34e4b4953cb99642e9144d97823edf32b06ffe93.1520376078.git.jan.steff...@gmail.com>
+From: "Jan Alexander Steffens (heftig)" <jan.steff...@gmail.com>
+Date: Tue, 6 Mar 2018 23:39:47 +0100
+Subject: [PATCH] Use Arch Linux' device access groups
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+  cdrom   → optical
+  dialout → uucp
+  tape    → storage
+---
+ rules/50-udev-default.rules.in | 14 +++++++-------
+ sysusers.d/basic.conf.in       |  6 +++---
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/rules/50-udev-default.rules.in b/rules/50-udev-default.rules.in
+index 191f56f42..f81c4d0fc 100644
+--- a/rules/50-udev-default.rules.in
++++ b/rules/50-udev-default.rules.in
+@@ -22,7 +22,7 @@ SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", 
MODE="0620"
+ SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620"
+ SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620"
+ SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty"
+-KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*",
 GROUP="dialout"
++KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*",
 GROUP="uucp"
+ 
+ SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640"
+ 
+@@ -57,13 +57,13 @@ KERNEL=="irlpt[0-9]*", GROUP="lp"
+ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", 
ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp"
+ 
+ SUBSYSTEM=="block", GROUP="disk"
+-SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="cdrom"
+-SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", 
GROUP="cdrom"
+-KERNEL=="sch[0-9]*", GROUP="cdrom"
+-KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
+-KERNEL=="pktcdvd", GROUP="cdrom"
++SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="optical"
++SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", 
GROUP="optical"
++KERNEL=="sch[0-9]*", GROUP="optical"
++KERNEL=="pktcdvd[0-9]*", GROUP="optical"
++KERNEL=="pktcdvd", GROUP="optical"
+ 
+-SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", 
GROUP="tape"
++SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", 
GROUP="storage"
+ SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk"
+ 
KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*",
 GROUP="disk"
+ KERNEL=="loop-control", GROUP="disk", OPTIONS+="static_node=loop-control"
+diff --git a/sysusers.d/basic.conf.in b/sysusers.d/basic.conf.in
+index 8e358c02d..33e513a36 100644
+--- a/sysusers.d/basic.conf.in
++++ b/sysusers.d/basic.conf.in
+@@ -24,14 +24,14 @@ g utmp    -     -            -
+ 
+ # Hardware access groups
+ g audio   -     -            -
+-g cdrom   -     -            -
+-g dialout -     -            -
+ g disk    -     -            -
+ g input   -     -            -
+ g kvm     -     -            -
+ g lp      -     -            -
++g optical -     -            -
+ g render  -     -            -
+-g tape    -     -            -
++g storage -     -            -
++g uucp    -     -            -
+ g video   -     -            -
+ 
+ # Default group for normal users
+-- 
+2.16.2
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2018-03-07 23:45:58 UTC (rev 318012)
+++ PKGBUILD    2018-03-07 23:46:07 UTC (rev 318013)
@@ -23,6 +23,7 @@
               '5C251B5FC54EB2F80F407AAAC54CA336CFEB557E') # Zbigniew 
Jędrzejewski-Szmek <zbys...@in.waw.pl>
 source=('git+https://github.com/systemd/systemd-stable'
         'git+https://github.com/systemd/systemd'
+        '0001-Use-Arch-Linux-device-access-groups.patch'
         'initcpio-hook-udev'
         'initcpio-install-systemd'
         'initcpio-install-udev'
@@ -42,6 +43,7 @@
         'systemd-update.hook')
 sha512sums=('SKIP'
             'SKIP'
+            
'9348683829190628e25b7b3300fd880c426d555bde330d5fc5150a9a54b3ad9d4d1f2e69ea1dc6d6f086693dacc53c5af30f1fa7ad9b479791fd77bcdafa430e'
             
'f0d933e8c6064ed830dec54049b0a01e27be87203208f6ae982f10fb4eddc7258cb2919d594cbfb9a33e74c3510cfd682f3416ba8e804387ab87d1a217eb4b73'
             
'86d7cacd7536b1069c82bbbb08de7ec81e7f0f18a19fc2b06fabe90db4700623eb3540b75121080d325672d92e26912632ae4f93fd3c0bb48eb3e5eedd88352c'
             
'a25b28af2e8c516c3a2eec4e64b8c7f70c21f974af4a955a4a9d45fd3e3ff0d2a98b4419fe425d47152d5acae77d64e69d8d014a7209524b75a81b0edb10bf3a'
@@ -118,6 +120,9 @@
   for c in "${_reverts[@]}"; do
     git revert -n "$c"
   done
+
+  # Replace cdrom/dialout/tape groups with optical/uucp/storage
+  patch -Np1 -i ../0001-Use-Arch-Linux-device-access-groups.patch
 }
 
 build() {
@@ -203,14 +208,6 @@
   # add back tmpfiles.d/legacy.conf, normally omitted without sysv-compat
   install -m644 $pkgbase-stable/tmpfiles.d/legacy.conf 
"$pkgdir"/usr/lib/tmpfiles.d
 
-  # Replace dialout/tape/cdrom group in rules with uucp/storage/optical group
-  sed -i 's#GROUP="dialout"#GROUP="uucp"#g;
-          s#GROUP="tape"#GROUP="storage"#g;
-          s#GROUP="cdrom"#GROUP="optical"#g' 
"$pkgdir"/usr/lib/udev/rules.d/*.rules
-  sed -i 's/dialout/uucp/g;
-          s/tape/storage/g;
-          s/cdrom/optical/g' "$pkgdir"/usr/lib/sysusers.d/basic.conf
-
   # ship default policy to leave services disabled
   echo 'disable *' >"$pkgdir"/usr/lib/systemd/system-preset/99-default.preset
 

Reply via email to