diffstat for systemd-204 systemd-204 changelog | 1066 ++++++++ control | 40 extra/60-keyboard.hwdb | 1213 ++++++++++ extra/README-etc-rules.d | 24 extra/README-lib-rules.d | 40 extra/dbus.service | 7 extra/initramfs.bottom | 12 extra/initramfs.hook | 7 extra/initramfs.top | 14 extra/rules/40-hyperv-hotadd.rules | 11 extra/rules/50-udev-default.rules | 12 extra/rules/60-persistent-storage-tape.rules | 41 extra/rules/60-persistent-storage.rules | 163 - extra/rules/62-google-cloudimg.rules | 3 extra/rules/73-idrac.rules | 4 extra/rules/75-cd-aliases-generator.rules | 11 extra/rules/75-persistent-net-generator.rules | 23 extra/rules/78-graphics-card.rules | 30 extra/rules/80-drivers.rules | 44 extra/rules/80-networking.rules | 4 extra/rules/91-permissions.rules | 126 - extra/udev.py | 19 extra/udev.startup | 18 extra/write_net_rules | 11 libpam-systemd.postinst | 7 libpam-systemd.prerm | 2 libpam-systemd.systemd-logind.upstart | 35 patches/0001-libudev-util-change-util_replace_whitespace-to-retur.patch | 34 patches/0001-udev-build-by-path-identifiers-for-ATA-devices.patch | 68 patches/0002-udev-event-add-replace_whitespace-param-to-udev_even.patch | 300 ++ patches/0003-udev-rules-perform-whitespace-replacement-for-symlin.patch | 37 patches/Advertise-hibernation-only-if-there-s-enough-free-sw.patch | 289 ++ patches/CVE-2018-1049.patch | 81 patches/CVE-2019-3842.patch | 25 patches/ProLiant-power-button.patch | 18 patches/add-cgmanager-support | 981 ++++++++ patches/block-polling.patch | 16 patches/deputy_cgroup.patch | 150 + patches/deputy_shutdown.patch | 48 patches/deputy_unit_path.patch | 40 patches/disable-failing-buildd-tests.patch | 36 patches/do-not-create-run-nologin.patch | 15 patches/env-variable-for-machine-ID-path.patch | 40 patches/fix-ftbfs.patch | 13 patches/fix-race-condition-of-serio-driver-module-not-loading.patch | 16 patches/ignore-omap-vsync.patch | 77 patches/load-fbcon.patch | 17 patches/load-modules-for-bound-devices.patch | 39 patches/login-monitor-no-machine.patch | 22 patches/logind-fix-small-memleaks.patch | 42 patches/pam-check-runtime-dir-user.patch | 57 patches/persistent-storage-rule-mmc-partname.patch | 23 patches/private-bus-for-nonpid1.patch | 50 patches/rules-add-NVMe-rules-3136.patch | 38 patches/rules-introduce-disk-by-id-model_serial-symlinks-for.patch | 37 patches/series | 42 patches/support-phablet-etc-writable.patch | 175 + patches/ubuntu-logind-controllers.patch | 34 patches/upstream-hwdb-keyboard.patch | 320 ++ patches/upstream-hwdb-updates.patch | 410 +++ patches/upstream-ignore-mmcrpmb.patch | 31 patches/upstream-reboot-polkit-permissions.patch | 21 patches/upstream-uaccess-Add-new-DRM-render-nodes.patch | 25 rules | 115 shlibs.local | 1 source/git-patches | 2 source/options | 1 systemd-services.install | 46 systemd-services.maintscript | 1 systemd.install | 33 systemd.links | 4 systemd.postinst | 6 systemd.preinst | 15 systemd.prerm | 13 systemd.upstart | 10 tests/api | 39 tests/control | 7 tests/hostnamed | 23 tests/localed-locale | 24 tests/localed-x11-keymap | 25 tests/logind | 69 tests/timedated | 20 udev-udeb.install | 7 udev.NEWS | 9 udev.dirs | 2 udev.install | 7 udev.maintscript | 1 udev.postinst | 207 - udev.postrm | 69 udev.preinst | 296 -- udev.prerm | 33 udev.templates | 59 udev.udev-fallback-graphics.upstart | 2 udev.udev-finish.upstart | 2 udev.upstart | 2 units/systemd-fsck@.service | 17 96 files changed, 6764 insertions(+), 1057 deletions(-) diff -Nru systemd-204/debian/changelog systemd-204/debian/changelog --- systemd-204/debian/changelog 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/changelog 2019-03-07 16:30:13.000000000 +0000 @@ -1,3 +1,564 @@ +systemd (204-5ubuntu20.31) trusty-security; urgency=medium + + * SECURITY UDPATE: Unsafe environment usage in pam_systemd.so leads to + incorrect Policykit authorization + - debian/patches/CVE-2019-3842.patch: Use secure_getenv() rather than + getenv() in pam_systemd.c + - CVE-2019-3842 + + -- Chris Coulson Thu, 07 Mar 2019 16:30:13 +0000 + +systemd (204-5ubuntu20.29) trusty; urgency=medium + + * d/p/0001-udev-build-by-path-identifiers-for-ATA-devices.patch + create /dev/disk/by-path/ symlinks for (s)ata disks + (LP: #1802525) + + -- Dan Streetman Fri, 09 Nov 2018 10:16:27 -0500 + +systemd (204-5ubuntu20.28) trusty; urgency=medium + + * logind: fix memleaks in session's free path and cgmanager glue code + (LP: #1750013) + + -- Guilherme G. Piccoli Tue, 03 Apr 2018 13:38:08 +0000 + +systemd (204-5ubuntu20.26) trusty-security; urgency=medium + + * SECURITY UPDATE: access to automounted volumes can lock up + (LP: #1709649) + - debian/patches/CVE-2018-1049.patch: ack automount requests even when + already mounted in src/core/automount.c. + - CVE-2018-1049 + + -- Marc Deslauriers Thu, 01 Feb 2018 07:52:32 -0500 + +systemd (204-5ubuntu20.25) trusty; urgency=medium + + * rules: introduce fsck@.service for snappy (LP: #1718966) + + -- Rafael David Tinoco Mon, 02 Oct 2017 21:39:38 +0000 + +systemd (204-5ubuntu20.24) trusty; urgency=medium + + [ Thomas Voß ] + * Do not create /run/nologin, and thus make sure deputy systemd does not + prevent system logins. LP: #1660573. + + -- Dimitri John Ledkov Thu, 02 Feb 2017 10:29:19 +0000 + +systemd (204-5ubuntu20.23) trusty; urgency=medium + + * d/p/0001-libudev-util-change-util_replace_whitespace-to-retur.patch, + d/p/0002-udev-event-add-replace_whitespace-param-to-udev_even.patch, + d/p/0003-udev-rules-perform-whitespace-replacement-for-symlin.patch: + Cherry-pick upstream fixes from Dan Streetman to + fix by-id symlinks for devices whose IDs contain whitespace. + LP: #1647485. + + -- Dimitri John Ledkov Wed, 01 Feb 2017 10:59:36 +0000 + +systemd (204-5ubuntu20.22) trusty; urgency=medium + + * Add support for installing deputy systemd for snapd on Ubuntu + Desktop 14.04.5 (LP: #1656280) + + [ Dimitri John Ledkov ] + * debian/patches/deputy_shutdown.patch: Use system poweroff, halt, + reboot, pm-suspend, pm-hibernate commands in the systemd units for + power management via systemd/systemctl. Use /bin/false for kexec. + * debian/systemd.postinst: Drop restaring systemd-initctl.socket and + systemd-logind.service, as neither are supposed to be managed by + deputy systemd. + * debian/patches/deputy_cgroup.patch: Make deputy systemd use + alternative dsystemd cgroups path and nonpid1 systemd should setup + these mountpoints. + * debian/patches/private-bus-for-nonpid1.patch: Make deputy systemd not + connect to system D-Bus, to avoid conflict with systemd-shim. + * debian/control: remove conflicts with systemd-shim + + [ Thomas Voß ] + * debian/patches/add-cgmanager-support: Only free result if != NULL, + preventing crash in the error handling code-path. + + -- Dimitri John Ledkov Tue, 17 Jan 2017 10:43:30 +0000 + +systemd (204-5ubuntu20.21) trusty; urgency=medium + + [ Dan Streetman ] + * rules: introduce disk/by-id (wwid and model_serial) symlinks + for NVMe drives (LP: #1642903) + + [ Yu Ning ] + * keymap: Some HP refactoring, add Probook 440 G3 keys (LP: #1562344) + + -- Steve Langasek Thu, 15 Dec 2016 19:46:52 -0800 + +systemd (204-5ubuntu20.20) trusty-proposed; urgency=medium + + * Build systemd binary package. + Drop installation of /etc/* aside from systemd's own config files. This + avoids a package conflict with systemd-services and we don't want to + support the full feature set anyway. (LP: #1616422) + * Disable SysV init support. + This just gets in the way when running systemd as a "deputy init". + * systemd: Add Conflicts: to systemd-shim + * Create/use private D-Bus socket also for systemd --system. + Without this we cannot use systemctl as root or when D-Bus is not running. + * Do not read units from /lib/systemd/system, but from /lib/systemd/upstart/ + In Ubuntu 14.04 there are a lot of packages which ship a systemd system unit, + but almost all of these must not run for running systemd's service manager as a + "deputy" init alongside upstart. We do need some of them though, so read units + from /lib/systemd/upstart. + Only install the system units that we actually need for a deputy init (journal + and all targets). + * Add Breaks: to init-system-helpers that does not yet have a disabled + deb-systemd-invoke, to complete the previous change. + * Add upstart job for deputy systemd init. + We also need to clean up /run/systemd/system after stop, so that things which + check if systemd is running don't get confused. + * Add dummy D-Bus units. + These are built in for exposing systemd itself onto the system bus. + * Drop LSB init hook. + We must not redirect SysV init scripts to systemd when running as deputy init. + * Stop systemd deputy upstart job on dist-upgrades. + Also drop the removal guard as we do want to be able to remove the systemd + package while it's only running the deputy init. + * Update Vcs-Git: for new trusty git branch. + + -- Martin Pitt Thu, 10 Nov 2016 15:14:54 +0100 + +systemd (204-5ubuntu20.19) trusty-proposed; urgency=medium + + * Add upstream-uaccess-Add-new-DRM-render-nodes.patch: Add uaccess tag for + "renderD*" devices for AMD GPUs. (LP: #1536438) + * libpam-systemd: Don't restart logind on upgrades, this confuses too many + clients and causes effects like screen blanking. (LP: #1473800) + * debian/extra/initramfs.hook: Fix typo in path of udevadm.upgrade : The + binary is /bin/udevadm.upgrade while udev is unpacked and not configured + (see debian/udev.{pre,post}inst. (LP: #1535255) + + -- Martin Pitt Thu, 25 Feb 2016 16:49:20 +0100 + +systemd (204-5ubuntu20.18) trusty-proposed; urgency=medium + + * debian/udev-udeb.install: Ship persistent net generator rules, so that the + naming from the d-i environment gets copied into the installed system (via + base-installer.d/05udev d-i hook, which already is shipped). With that a + d-i generated /etc/network/interfaces will still be valid in the installed + system. (LP: #1537136) + + -- Martin Pitt Mon, 25 Jan 2016 15:03:51 +0100 + +systemd (204-5ubuntu20.15) trusty; urgency=medium + + * Avoid writing duplicate entries in 70-persistent-net.rules by double + checking if the new udev rule has already been written for the given + interface. This happens if multiple add events are generated before + the write_net_rules script returns and udevd renames the interface. + * write_net_rules: Escape '{' and '}' characters as well, to make this work + with busybox grep. (LP: #1470399) + + -- Louis Bouchard Mon, 05 Oct 2015 12:34:41 +0200 + +systemd (204-5ubuntu20.14) trusty; urgency=medium + + * debian/extra/60-keyboard.hwdb: Update to current version, as per standing + SRU exception: + - Fix wireless switch on Dell Latitudes. (LP: #1441849) + - Fix Microphone mute hotkey for Dell Precision series. (LP: #1494135) + + -- Martin Pitt Thu, 10 Sep 2015 09:35:27 +0200 + +systemd (204-5ubuntu20.13) trusty; urgency=medium + + * debian/patches/ibmveth_persistent_mac.patch: fix the exception to locally + administered MAC addresses for ibmveth; use DRIVERS rather than SUBSYSTEMS + to point to ibmveth. (LP: #1437375) + + -- Mathieu Trudel-Lapierre Wed, 08 Jul 2015 13:34:18 -0400 + +systemd (204-5ubuntu20.12) trusty; urgency=medium + + * Add support for HP ProLiant m400 Server Cartridge soft powerdown on the + hwe kernel (utopic). (LP: #1428811) + + -- Craig Magina Thu, 05 Mar 2015 16:29:35 -0500 + +systemd (204-5ubuntu20.11) trusty; urgency=medium + + [ Ben Howard ] + * Add debian/extra/rules/62-google-cloudimg.rules: Use "noop" scheduler for + Google virtio drives. (LP: #1420544) + + [ Martin Pitt ] + * Add upstream-ignore-mmcrpmb.patch: Fix /dev/disk/by-path/ symlink of mmc + RPMB partitions and don't blkid them to avoid kernel buffer I/O errors and + timeouts. (LP: #1333140) + + -- Martin Pitt Wed, 18 Feb 2015 12:11:49 +0100 + +systemd (204-5ubuntu20.10) trusty; urgency=medium + + * Replace our always-probe-cpu-support-drivers.patch (which is specific to + the "cpu" subsystem) with the more generic upstream fix which also applies + to other subsystems. Fixes some modules not loading automatically when + using kernel backports > 3.11. (LP: #1404509) + + -- Martin Pitt Fri, 23 Jan 2015 08:18:59 +0100 + +systemd (204-5ubuntu20.9) trusty; urgency=medium + + * Pull latest keymaps from trunk, as per standing microrelease exception. + Amongst others, this also fixes the "micmute" key on Dell Latitudes. + (LP: #1339998) + + -- Martin Pitt Wed, 12 Nov 2014 11:16:26 +0100 + +systemd (204-5ubuntu20.8) trusty; urgency=medium + + [ Ben Howard ] + * 75-persistent-net-generator.rules: Add new Microsoft net rule + (LP: #1367883) + + [ Martin Pitt ] + * debian/libpam-systemd.systemd-logind.upstart: Fix "PAM module installed" + check for the case when there is more than one library installed, which + can happen on multi-arch systems. Thanks Grzegorz Gutowski! (LP: #1382510) + + -- Martin Pitt Wed, 29 Oct 2014 08:05:16 +0100 + +systemd (204-5ubuntu20.7) trusty; urgency=medium + + * udev-fallback-graphics.conf: Avoid failure if vesafb module is compiled + in. (LP: #1367241). + + -- Dariusz Gadomski Fri, 12 Sep 2014 13:31:52 +0200 + +systemd (204-5ubuntu20.6) trusty; urgency=medium + + * Fix syntax of HyperV net rules (LP: #1361272). + + -- Ben Howard Mon, 25 Aug 2014 11:02:20 -0600 + +systemd (204-5ubuntu20.5) trusty; urgency=medium + + * Add support for HP ProLiant m400 Server Cartridge soft powerdown + (LP: #1354306) + + -- dann frazier Fri, 08 Aug 2014 13:45:25 +0200 + +systemd (204-5ubuntu20.4) trusty-proposed; urgency=medium + + * Add HP ProLiant m800 Server Cartridge power control support. The cartridge + uses gpio_keys.12 to emulate shutdown. (LP: #1347776) + + -- Manoj Iyer Mon, 21 Jul 2014 17:58:06 -0500 + +systemd (204-5ubuntu20.3) trusty; urgency=medium + + * Fix various issues with the cgmanager integration (LP: #1309025): + - Always return false on connection failure. + - Always nih_free variables that were potentially nih allocated. + - Always initialize the children listings to NULL. + - Always initialize the list iterator to 0. + + -- Stéphane Graber Wed, 18 Jun 2014 23:37:50 -0400 + +systemd (204-5ubuntu20.2) trusty; urgency=medium + + * Update Enable-all-cgroup-controllers-in-logind.patch to also include + net_cls and net_prio. That should cover all existing cgroups. + (LP: #1317179) + + -- Stéphane Graber Thu, 08 May 2014 18:32:05 -0500 + +systemd (204-5ubuntu20.1) trusty-proposed; urgency=medium + + [Martin Pitt] + * Advertise hibernation only if there's enough free swap. Patches backported + from current upstream. (LP: #1313522) + + -- Yu Ning Wed, 07 May 2014 19:41:29 +0800 + +systemd (204-5ubuntu20) trusty; urgency=medium + + * systemd-logind.conf: Don't use the limit stanza which fails the + whole job when failing to set the ulimit. Instead call ulimit itself + from the job and ignore its return code. This allow systemd-logind to + start in unprivileged LXC containers. (LP: #1307595) + + -- Stéphane Graber Mon, 14 Apr 2014 12:20:33 -0400 + +systemd (204-5ubuntu19) trusty; urgency=medium + + * cgmanager: don't call nih_dbus_setup() since we won't use the + nih_mainloop(). (LP: #1303649) + + -- Serge Hallyn Fri, 11 Apr 2014 10:17:04 -0500 + +systemd (204-5ubuntu18) trusty; urgency=medium + + * Revert "Do not restart logind on package upgrades" change from + 204-0ubuntu1. This is obsolete now, as we only ever shipped version 204 in + stable releases. This was an intra-development release upgrade fix only, + and it did not even work properly. This fixes logind not getting started + on package install. (LP: #1305395) + * Update 60-keyboard.hwdb from upstream git. Adds Samsung Series 7 Ultra. + * debian/libpam-systemd.systemd-logind.upstart: Don't try to mount + /sys/fs/cgroup/systemd in a container, as that will fail. cgmanager will + be used for these cases. + + -- Martin Pitt Thu, 10 Apr 2014 15:46:51 +0200 + +systemd (204-5ubuntu17) trusty; urgency=medium + + * Fix crash on systems without cgmanager. (LP: #1302264) + + -- Stéphane Graber Fri, 04 Apr 2014 00:17:14 -0400 + +systemd (204-5ubuntu16) trusty; urgency=medium + + [ Stéphane Graber ] + * Never call normalize_controller when controll is NULL as this + triggers an assert... (LP: #1301846) + + [ Serge Hallyn ] + * d/p/add-cgmanager-support: make sure connections are closed (LP: #1301882) + + -- Stéphane Graber Thu, 03 Apr 2014 13:53:09 -0400 + +systemd (204-5ubuntu15) trusty; urgency=medium + + * Pass --disable-cgmanager in the udeb build pass, d-i doesn't need it. + + -- Adam Conrad Wed, 02 Apr 2014 22:01:55 -0600 + +systemd (204-5ubuntu14) trusty; urgency=medium + + [ Steve Langasek ] + * Do proper refcounting of the PAM module package on prerm, so that we + don't drop the module from the PAM config when uninstalling a + foreign-arch package. Related to Ubuntu bug #1295521. + + [ Stéphane Graber ] + * Add cgmanager support to logind. This will use the cgmanager socket + instead of cgroupfs when cgmanager is available. Otherwise it'll simply + fallback on the cgroupfs code. (LP: #1297363) + + -- Stéphane Graber Tue, 01 Apr 2014 20:02:35 -0400 + +systemd (204-5ubuntu13) trusty; urgency=medium + + * Fix FTBFS against recent kernels & glibc. + + -- Dimitri John Ledkov Fri, 28 Feb 2014 23:54:54 +0000 + +systemd (204-5ubuntu12) trusty; urgency=medium + + * Mark autopkgtest with "isolation-machine" as this test can't run in + schroot or LXC. + * Import latest keymaps from upstream git. + + -- Martin Pitt Fri, 28 Feb 2014 11:55:09 +0100 + +systemd (204-5ubuntu11) trusty; urgency=medium + + [ Ben Howard ] + * debian/extra/rules/75-persistent-net-generator.rules: Add new block of + Windows Azure ethernet hardware address to ignore persistent naming + (LP: #1274348). + + [ Stefan Bader ] + * Modify debian/extra/rules/78-graphics-card.rules to match for + "efi-framebuffer" in addition to "efifb" (LP: #1277006) + + [ Martin Pitt ] + * debian/extra/rules/78-graphics-card.rules: Add vesa-framebuffer as well, + thanks to Andy Whitcroft for pointing out. + + -- Martin Pitt Thu, 06 Feb 2014 12:42:39 +0100 + +systemd (204-5ubuntu10) trusty; urgency=medium + + * Add debian/extra/rules/73-idrac.rules: On Dell PowerEdge systems, the + iDRAC7 and later support a USB Virtual NIC for management. Name this + interface "idrac" to avoid confusion with "real" network interfaces. + * Pull latest keymaps from upstream git: + - Acer Aspire One A110 Fn+F5 Key release (LP: #1272658) + - Sony Vaio VGN-FW250 (LP: #1271163) + + -- Martin Pitt Wed, 29 Jan 2014 17:51:14 +0100 + +systemd (204-5ubuntu9) trusty; urgency=medium + + [ Chris Wayne ] + * support-phablet-etc-writable.patch: Allow writing to /etc/hostname and + /etc/machine-info as symlinks. + + -- Martin Pitt Mon, 20 Jan 2014 10:03:39 +0100 + +systemd (204-5ubuntu8) trusty; urgency=low + + * pam-check-runtime-dir-user.patch: Make "not owned by the target uid" log + message only appear in debug mode, as it's a normal operation. + * Respect DEB_BUILD_OPTIONS=nocheck. + * Update 60-keyboard.hwdb from upstream git. + + -- Martin Pitt Fri, 10 Jan 2014 08:18:59 +0100 + +systemd (204-5ubuntu7) trusty; urgency=medium + + * Enable all cgroup controllers in logind.conf. This is needed so that + unprivileged LXC may work. + + -- Stéphane Graber Thu, 09 Jan 2014 11:16:57 -0500 + +systemd (204-5ubuntu6) trusty; urgency=low + + * Add pam-check-runtime-dir-user.patch: Don't set an existing + $XDG_RUNTIME_DIR in the PAM module if it isn't owned by the session user. + Otherwise su sessions get a runtime dir from a different user which leads + to either permission errors or scribbling over the other user's files. + (LP: #1197395) + * Update debian/extra/60-keyboard.hwdb from current upstream trunk: + - Fix Lenovo Z370 (LP: #1245189) + + -- Martin Pitt Wed, 13 Nov 2013 14:00:55 +0100 + +systemd (204-5ubuntu5) trusty; urgency=low + + * Remove Debian's customized 80-drivers.rules, use (patched) upstream's as + we always did. + + -- Martin Pitt Mon, 11 Nov 2013 07:06:47 +0100 + +systemd (204-5ubuntu4) trusty; urgency=low + + * Remove Debian's customized persistent storage rules, use upstream's as we + always used to do. + + -- Martin Pitt Mon, 11 Nov 2013 06:59:42 +0100 + +systemd (204-5ubuntu3) trusty; urgency=low + + * Re-add login-monitor-no-machine.patch to quilt series. + + -- Martin Pitt Thu, 07 Nov 2013 10:05:33 +0100 + +systemd (204-5ubuntu2) trusty; urgency=low + + * debian/udev.install: Drop duplicate installation of net generator, reduces + Debian delta. + * Drop debian/extra/firmware.agent and its invocation in 80-drivers.rules; + we do not install this anyway, firmware is loaded by the udev builtin (and + the kernel). + * 0020-persistent-storage-rule-mmc-partname.patch: Create symlinks for MMC + partitions with a "PARTNAME" property (Android specific patch) in + /dev/disks/by-partlabel/ for consistency with GUID partitions, not in + /dev/disks/by-name/. + * Add magically generated debian patches from the source package + (v204..upstream-fixes_204-5 and debian-changes), and drop our patches + which are contained in that: + - 0000-upstream-CVE-2013-4327.patch + - 0010-Add-back-support-for-Debian-specific-config-files.patch + - 0012-Make-logind-hostnamed-localed-timedated-D-Bus-activa.patch + - 0017-Clean-up-empty-sessions-when-not-running-under-syste.patch + - 0024-hwdb-in-lib.patch + - 0030-revert-removal-of-rename_netif-functionality.patch + * Drop prefix from our remaining patches, and sort quilt series into + categories. + * Drop "Breaks: consolekit (<< 0.4.6-1)" (slipped in with the merge), we + don't depend on consolekit providing udev-acl as we only support logind's + ACLs. + + -- Martin Pitt Thu, 07 Nov 2013 06:13:20 +0100 + +systemd (204-5ubuntu1) trusty; urgency=low + + * Merge packaging with current Debian unstable, to greatly reduce the diff + noise. Ubuntu changes: + Permanently Ubuntu specific: + - debian/control, debian/rules, debian/systemd.install, + debian/systemd-services.install: Split out systemd-services package with + logind, timedated, hostnamed, and localed. Add + libpam-systemd.systemd-logind.upstart to bring up logind at boot. + - debian/rules: Don't build systemd and systemd-sysv packages, not + approved for universe for now. + - debian/udev.templates, Drop debconfiscation of udev, not necessary for + Ubuntu. + - debian/extra/initramfs.top: Drop $ROOTDELAY, we do that in a more + sensible way with wait-for-root. (Will get applicable to Debian once + Debian gets wait-for-root in initramfs-tools.) + - Add debian/extra/rules/78-graphics-card.rules: Mark graphics devices as + PRIMARY_DEVICE_FOR_DISPLAY so that we can wait for those in plymouth. + - Drop debian/extra/{50-udev-default.rules,75-cd-aliases-generator.rules, + 80-networking.rules,91-permissions.rules}, we don't want these in + Ubuntu. + - Add debian/extra/udev.py: Apport hook. + - debian/extra/udev.startup, debian/rules: Don't install/support + /etc/udev/links.conf, that's a hack (if you want links, create udev + rules). + - Various debian/patches/*, see patch headers (unmergeable with Debian). + - Drop debian/source/{git-patches,options}, we use proper patches. + - debian/rules: We continue to use the old net iface naming schema for the + time being. Install old udev rule generator in debian/udev.install. + (Reconsider post-LTS) + - debian/rules: Don't install init.d scripts, only the upstart jobs. + - debian/rules: Add an epoch to libgudev. + - Drop debian/udev.dirs, not necessary. + - Drop debian/udev.NEWS, debian/udev.maintscript: Not applicable to + Ubuntu. + - debian/udev.{postinst,postrm,preinst,prerm}: Keep our much simpler + versions (all platforms must support udev, no debconf). + - debian/libgudev-1.0-0.install: Install into /lib/ (Debian has a patch + for this to go into /usr/lib/). + - debian/rules: Drop doc dir symlinking. It creates havoc with dpkg + upgrades, and we already have the automatic per-file symlinking. + + Applicable to Debian: + - debian/control, debian/tests/: Add autopkgtest. + - debian/extra/initramfs.hook, debian/udev.*{pre,post}inst: Divert udevadm + to udevadm.upgrade during upgrades while udev is unconfigured. + - Add debian/extra/60-keyboard.hwdb: Latest upstream keymaps, for easy + backporting. + - debian/extra/initramfs.bottom: If LVM is installed, settle udev, + otherwise we get missing LV symlinks. (LP #1185394) + - debian/extra/rules/75-persistent-net-generator.rules: Add Ravello + systems (LP #1099278) + - Add debian/extra/README-{etc,lib}-rules.d documentation, install into + udev. + - debian/rules: Run tests during package build. + - debian/udev.udev-finish.upstart: Fix path to tmp-rules, + debian/extra/rule_generator.functions creates them in /run/udev/. + - debian/udev.upstart: Fix path to udevd. + - debian/shlibs.local: Drop libudev; this unnecessarily generates overly + strict dependencies, and even wrong ones for our epoched libgudev. + - debian/udev-udeb.install: Add 64-btrfs.rules and 75-probe_mtd.rules, + they are potentially useful in a d-i environment. + + Will go away eventually: + - Add debian/extra/rules/40-hyperv-hotadd.rules: Workaround for LP #1233466 + - Keep debian/extra/firmware.agent and rule in + debian/extra/rules/80-drivers.rules until this has been tested to not be + necessary under Ubuntu kernels any more. + + Upgrade fixes, keep until 14.04 LTS release: + - debian/control: Conflicts/Replaces libpam-xdg-support. + - debian/libpam-systemd.postinst: Trigger reboot notification for upgrade + from < 204, due to changed cgroup layout. + - debian/systemd-services.maintscript: Clean up obsolete + /etc/init/systemd-logind.conf on upgrades. + + * Promote "systemd | systemd-shim" to Depends. (LP: #1221809) + * 0000-upstream-hwdb-keyboard.patch: udev-builtin-keyboard: Fix large scan + codes on 32 bit architectures. (side issue in LP #1247676) + * Drop systemd init specific Debian patches which we don't need in Ubuntu; + The Debian package does not track proper patches any more, so it doesn't + help us keeping the patches around for merging. + + -- Martin Pitt Wed, 06 Nov 2013 14:01:26 +0100 + systemd (204-5) unstable; urgency=high * Cherry-pick 72fd713 from upstream which fixes insecure calling of polkit @@ -163,6 +724,511 @@ -- Michael Biebl Fri, 19 Jul 2013 00:32:36 +0200 +systemd (204-0ubuntu19) saucy; urgency=low + + * Add 0031-ignore-omap-vsync.patch: Gross, but effective hack to ignore + VSYNC change uevents from omapfb, as they happen at each vsync and thus + keep waking up udevd (including rules processing), upstart, and other + parts of the system 60 times a second. (LP: #1234743) + + -- Martin Pitt Thu, 17 Oct 2013 12:01:42 +0200 + +systemd (204-0ubuntu18) saucy; urgency=low + + * Configure with --disable-silent-rules, as per request from Matthias. + * Add debian/extra/rules/40-hyperv-hotadd.rules: On Hyper-V VMs, bring new + CPU and memory devices online as soon as they appear. This is not quite an + ideal solution, but an unintrusive compromise for Saucy. (LP: #1233466) + + -- Martin Pitt Sat, 12 Oct 2013 12:16:29 +0200 + +systemd (204-0ubuntu17) saucy; urgency=low + + * Mount devpts with the correct permissions to avoid needing pt_chown. + + -- Adam Conrad Fri, 11 Oct 2013 00:46:12 -0600 + +systemd (204-0ubuntu16) saucy; urgency=low + + [ TJ ] + * Add 0030-revert-removal-of-rename_netif-functionality.patch: Return the + previous ability to postpone renaming until the target interface name + is free. (LP: #1235162) + + [ Martin Pitt ] + * Refresh debian/extra/60-keyboard.hwdb to fix Samsung models. + + -- Martin Pitt Wed, 09 Oct 2013 16:16:50 +0200 + +systemd (204-0ubuntu15) saucy; urgency=low + + * 0029-Support-phablet-etc-writable.patch: Update patch to also work for + relative symlinks to /etc/writable, as livecd-rootfs 2.191 creates them + relative now. (LP: #1227520) + + -- Martin Pitt Tue, 01 Oct 2013 17:53:13 +0200 + +systemd (204-0ubuntu14) saucy; urgency=low + + * Add 0029-Support-phablet-etc-writable.patch: On Ubuntu Phone with readonly + /etc we symlink /etc/{adjtime,localtime,timezone} to /etc/writable/, so we + need to update those files instead if the original files are symlinks into + /etc/writable/. (LP: #1227520) + * Refresh debian/extra/60-keyboard.hwdb with latest keymaps from upstream. + Among others, this fixes Samsung Ativ 9 Plus. (LP: #1229936) + * Rename 0027-CVE-2013-4327.patch and + 0028-fix-reboot-polkit-permissions.patch to 0000-upstream-* as they are in + upstream git. + * Ship {ata,cdrom,scsi}_id in udev-udeb. (LP: #1231230) + * Drop 60-persistent-v4l.rules and 61-accelerometer.rules from udev-udeb, we + don't need these in the installer. + + -- Martin Pitt Mon, 30 Sep 2013 13:34:06 +0200 + +systemd (204-0ubuntu13) saucy; urgency=low + + * debian/patches/0028-fix-reboot-polkit-permissions.patch: make + reboot-multiple-sessions polkit permissions consistent with + power-off-multiple-sessions in + src/login/org.freedesktop.login1.policy.in. (LP: #1226509) + + -- Marc Deslauriers Thu, 26 Sep 2013 14:49:51 -0400 + +systemd (204-0ubuntu12) saucy; urgency=low + + * SECURITY UPDATE: possible privilege escalation via policykit UID lookup + race. + - debian/patches/0027-CVE-2013-4327.patch: pass system-bus-name as a + subject instead of pid so policykit can get the information from the + system bus in src/shared/polkit.c. + - CVE-2013-4327 + + -- Marc Deslauriers Wed, 18 Sep 2013 13:19:40 -0400 + +systemd (204-0ubuntu11) saucy; urgency=low + + * Refresh debian/extra/60-keyboard.hwdb from upstream. Fixes keymap + regressions on Dell and Samsung models. (LP: #1218433) + + -- Martin Pitt Fri, 06 Sep 2013 15:24:02 +0200 + +systemd (204-0ubuntu10) saucy; urgency=low + + * debian/systemd-services.install: Install systemd-multi-seat-x + (LP: #1214146) + * debian/local/78-graphics-card.rules: Also recognize vmwgfx driver. Thanks + Reagan Sanders! (LP: #1208024) + * Add 0000-upstream-hwdb-updates.patch: Update to latest upstream fixes of + hwdb, to get proper keyboard support. + * Move to hwdb keymap database to be able to continue to sync to upstream, + and benefit from the improved speed and eased maintenance: + - Drop 0000-upstream-keymaps.patch. + - Add 0000-upstream-hwdb-keyboard.patch to backport the "keymap" builtin. + - Add debian/extra/60-keyboard.hwdb (straight copy from upstream master), + install in debian/udev.install. + - debian/rules: Configure with --disable-keymap to not build/install the + old keymap stuff any more. + - Adds keymap for Samsung NP53U3C (LP: #1203853) + + -- Martin Pitt Tue, 27 Aug 2013 13:09:08 +0200 + +systemd (204-0ubuntu9) saucy; urgency=low + + * debian/udev.install: re-add installing /lib/udev/hotplug.functions, + since it's still being used by the inputattach, bluez, and usb_modeswitch + scripts. + + -- Mathieu Trudel-Lapierre Thu, 08 Aug 2013 10:42:38 -0400 + +systemd (204-0ubuntu8) saucy; urgency=low + + * rules/80-drivers.rules: trigger the cpu helper modules regardless of + whether the kernel already has a driver loaded for the CPU components. + (LP: #1207705) + + -- Andy Whitcroft Fri, 02 Aug 2013 10:34:17 +0100 + +systemd (204-0ubuntu7) saucy; urgency=low + + * debian/tests/control: Add missing pkg-config test dependency, drop + unnecessary python3 dependency. + + -- Martin Pitt Fri, 19 Jul 2013 11:38:40 +0200 + +systemd (204-0ubuntu6) saucy; urgency=low + + * debian/rules: Drop /system/firmware and /vendor/firmware paths again, we + don't currently need them. + * debian/extra/initramfs.top: Drop the $ROOTDELAY sleep, we already do that + in a more sensible way in wait-for-root. (LP: #1202700) + * Add debian/tests/api: Add check for sd_login_monitor_*(), to reproduce + LP #1201180. + * Add 0025-login-monitor-no-machine.patch: Fix sd_login_monitor_new() to not + fail if there is no /sys/fs/cgroup/systemd/machine; that only exists when + running with systemd as PID 1. (LP: #1201180) + * debian/tests/logind: Create /run/udev/rules.d if it does not exist. + * Switch from pre-generated hwdb database to shipping the source files + (/lib/udev/hwdb.d/) and building hwdb.bin in postinst and with a trigger. + Upstream software like libgphoto, libsane, and media-player-info will ship + their own hwdb files soon, so be prepared for that. + + -- Martin Pitt Fri, 19 Jul 2013 09:45:54 +0200 + +systemd (204-0ubuntu5) saucy; urgency=low + + * Add 0000-upstream-keymaps.patch: Backport latest keymap fixes from + upstream, as we won't be able to update to newer upstream releases anytime + soon. (LP: #1193147, #1157334, #1152377, #1012365, #727139) + * Refresh our patches to apply cleanly. + + -- Martin Pitt Fri, 05 Jul 2013 08:54:06 +0200 + +systemd (204-0ubuntu4) saucy; urgency=low + + * Properly integrate hwdb, to get back vendor/product names in the udev db: + - Add 0024-hwdb-in-lib.patch: udev hwdb: Store binary database in libdir, + not in /etc. + - debian/rules: Build and ship pre-generated hwdb; do not ship the source + files, they are quite big and for now we do not have other packages + which want to add files there. + - LP: #1190947 + + -- Martin Pitt Fri, 14 Jun 2013 12:59:10 +0200 + +systemd (204-0ubuntu3) saucy; urgency=low + + * debian/extra/udev.startup: Restore devpts mounting, dropped in + 202-0ubuntu10. The justification for dropping it was that it's already + done by /usr/share/initramfs-tools/init, but this script is only used in + d-i and d-i does not use /usr/share/initramfs-tools/init (LP: #1188864). + + -- Colin Watson Sat, 08 Jun 2013 00:32:53 +0100 + +systemd (204-0ubuntu2) saucy; urgency=low + + * debian/rules: Add /system/firmware and /vendor/firmware to firmware search + paths. (LP: #1187616) + * debian/libpam-systemd.postinst: Notify about required reboot when + upgrading from < 204, as due to changed cgroup layout restarting logind + after the upgrade would lose all existing sessions. (LP: #1187579) + + -- Martin Pitt Wed, 05 Jun 2013 11:07:38 +0200 + +systemd (204-0ubuntu1) saucy; urgency=low + + * New upstream release. + * debian/rules: Do not restart logind on package upgrades, as the cgroup + organization changed in this version. + + -- Martin Pitt Tue, 04 Jun 2013 10:46:58 +0200 + +systemd (202-0ubuntu12) saucy; urgency=low + + * Rename debian/tests/localed to locale-locale, as we are going to add more + tests for localed. + * Add debian/tests/localed-x11-keymap: Test "localectl set-x11-keymap". + * Put back 0010-Add-back-support-for-Debian-specific-config-files.patch to + re-fix timedated, and add Steve's fix for /etc/default/keymap. Re-drop + 0025-Adjust-localed-to-use-the-Debian-locations-of-etc-de.patch. + * debian/extra/initramfs.bottom: We cannot properly synthesize LVM LV change + events with udevadm trigger during boot, so if we use LVM, we need to let + udev finish all the pending events in the initramfs. The + 0024-avoid-exit-deadlock-for-dm_cookie.patch approach was + inherently racy, as it still left vgchange subprocesses running from + watershed (which then run into a non-existing /dev), so disable that + patch. (LP: #1185394) + + -- Martin Pitt Mon, 03 Jun 2013 14:41:20 +0200 + +systemd (202-0ubuntu11) saucy; urgency=low + + * Drop 0010-Add-back-support-for-Debian-specific-config-files.patch in + favor of 0025-Adjust-localed-to-use-the-Debian-locations-of-etc-de.patch, + the more complete fix for Debian/Ubuntu configuration paths that was + silently dropped from the Ubuntu package when updating to 198. + + -- Steve Langasek Thu, 30 May 2013 13:56:41 -0700 + +systemd (202-0ubuntu10) saucy; urgency=low + + * debian/extra/initramfs.bottom: Drop reading of /etc/udev/udev.conf, the + location of /dev hasn't been configurable for ages. + * debian/extra/initramfs.top: Drop obsolete "scsi_wait_scan" modprobing here + as well. + * all_generic_ide blacklist: Depend on "all_generic_ide blacklist", as in + previous udev. + * debian/extra/initramfs.top: Drop unnecessary "udevadm settle". + * debian/extra/initramfs.hook: Put back ata_id and scsi_id, these were + overzealously removed with the bits that are built in now (like blkid and + usb_id). LP: #1185060 + * debian/extra/udev.startup: Drop devpts mounting again, already done by + /usr/share/initramfs-tools/init. + * debian/extra/initramfs.hook: Install udevadm.upgrade when updating the + initramfs while udev is unconfigured. + * debian/extra/initramfs.hook: Remove duplicate copying of + 70-persistent-net.rules. + * debian/extra/initramfs.hook: Don't install the dmsetup and md rules. This + is already done by dmsetup's and mdadm's initramfs hooks. + + -- Martin Pitt Wed, 29 May 2013 08:12:35 +0200 + +systemd (202-0ubuntu9) saucy; urgency=low + + * debian/udev-udeb.links: Add /sbin/udevadm backwards compat symlink, too. + * debian/extra/udev.startup: Mount devtmpfs, not tmpfs with the manual + make_extra_nodes(). + * debian/extra/udev.startup: Mount devpts. + * debian/extra/udev.startup: Drop obsolete "scsi_wait_scan" modprobing. + + -- Martin Pitt Tue, 28 May 2013 17:29:08 +0200 + +systemd (202-0ubuntu8) saucy; urgency=low + + * debian/udev.{preinst,postinst,postrm}: Disable udevadm trigger during + upgrades, to cause installation failures of packages which call udevadm + trigger without depending on udev. (LP: #1182948) + * debian/extra/initramfs.hook: Copy /sbin/udevadm compatibility symlink into + initramfs. (LP: #1184066) + + -- Martin Pitt Tue, 28 May 2013 13:13:42 +0200 + +systemd (202-0ubuntu7) saucy; urgency=low + + [ Martin Pitt ] + * debian/*: Replace remaining "udevadm info --run" invocations with + /run/udev/. (LP: #1182788) + * Add 0020-persistent-storage-rule-mmc-partname.patch: Create disk/by-name + links for mmcblk partitions if they have a PARTNAME property. Patch by + Ricardo Salveti de Araujo, taken from udev 175-0ubuntu29. + + [ Andy Whitcroft ] + * debian/extra/rules/78-graphics-card.rules -- demote efifb to a secondary + display adaptor as in the majority of cases this will be replaced by + a DRM driver. (LP: #1100386) + + -- Martin Pitt Wed, 22 May 2013 12:09:59 +0200 + +systemd (202-0ubuntu6) saucy; urgency=low + + * Build udev from this source package: + - Unblacklist udev and udev-udeb packages. + - Drop 70-power-switch.rules from systemd-services (shipped in udev). + - Port patches from old udev source package which are still relevant: + + 0021-block-polling.patch + + 0022-fix-race-condition-of-serio-driver-module-not-loading.patch + + 0023-load-fbcon.patch + + 0024-avoid-exit-deadlock-for-dm_cookie.patch + + 75-persistent-net-generator.rules: Do not create persistent net rules + for Ravello Systems MAC addresses. Now apply inline in + debian/extra/rules, as upstream dropped these. (LP #1099278) + - Add debian/extra/rules/78-graphics-card.rules (taken from old udev + package) + - Add debian/*.upstart from old udev package, and adjust dh_installinit + calls accordingly. + - Add Apport package hook. + - Add READMEs for /lib/udev/rules.d/ and /etc/udev/rules.d/. + - Add debian/udev.postinst for restarting udev and rebuilding initramfs. + - Drop 0020-uaccess-rule-with-old-udev.patch, not necessary any more with + current udev. + * debian/extra/initramfs.hook: Adjust for changed paths and rules files. + * debian/extra/initramfs.bottom: Replace undefined "nuke" with "rm -rf". + * Install udev rules into udev-udeb. + * Ship README.keymap.txt in udev, not in systemd. + * Copy persistent net/cd rules generator scripts from udev 175 to + debian/extra/, and adjust for dropped "udevadm info --run". We continue to + use the old naming schema for the time being, Don't install + 80-net-name-slot.rules for now. + * debian/extra/initramfs.bottom: Ignore timeout errors from udevadm we + expect (and indeed requested) in certain failure modes. If we do not we + will bail out early and not transfer /dev into /root which is always fatal + leading to unbootable machines. (Taken from old udev package) (LP #818177) + * Configure with correct --with-firmware-path. + * Show test logs if running the test suite fails. + * Disable test-sched-prio and test-util, they don't work in PPA buildds. + + -- Martin Pitt Tue, 21 May 2013 08:11:30 +0200 + +systemd (202-0ubuntu5) saucy; urgency=low + + * Drop 0016-Add-poweroff-reboot-suspend-hibernate-fallback.patch. + systemd-shim 3 has a much better implementation of pm-utils fallback. + Recommend systemd or systemd-shim >= 3 for that. + * Ship 70-power-switch.rules. (LP: #1160995) + + -- Martin Pitt Thu, 02 May 2013 11:19:42 -0700 + +systemd (202-0ubuntu4) saucy; urgency=low + + * 0010-Add-back-support-for-Debian-specific-config-files.patch: Re-apply + parts that use /etc/default/locale, which accidentally got dropped in + 202-0ubuntu1. (LP: #1175065) + + -- Martin Pitt Wed, 01 May 2013 11:35:55 -0700 + +systemd (202-0ubuntu3) saucy; urgency=low + + * Disable journal-stream test case, which fails on powerpc. + + -- Martin Pitt Tue, 30 Apr 2013 11:31:39 -0700 + +systemd (202-0ubuntu2) saucy; urgency=low + + * Merge 0019-disable-unit-name-test.patch and + 0021-disable-catalog-test.patch to + 0019-disable-failing-buildd-tests.patch, and disable the cgroup-util as + well (which fails on the buildds, too). + + -- Martin Pitt Tue, 30 Apr 2013 08:40:07 -0700 + +systemd (202-0ubuntu1) saucy; urgency=low + + * New upstream release. + * Drop patches applied/superseded upstream: + - 0011-Don-t-strip-rc.-from-sysv-init-scripts.patch + - 0013-build-sys-don-t-hard-code-binary-paths-in-initrd-.se.patch + - 0014-Move-udevadm-to-rootbindir.patch + - 0015-Strip-Date-from-man-pages.patch + * Update *.symbols for new release. + * Add 0021-disable-catalog-test.patch: Disable catalog test for now, fails + at the moment + * Disable 0004-Don-t-run-systemd-udev-rules-if-systemd-is-not-activ.patch. + We'll drop udev-acl and use uaccess exclusively. + + -- Martin Pitt Mon, 29 Apr 2013 17:15:47 -0700 + +systemd (198-0ubuntu12) saucy; urgency=low + + [ Martin Pitt ] + * debian/rules: Don't build ddebs for blacklisted binary packages. + * debian/systemd-services.install: Put back logind D-BUS activation file, + now that we will use logind by default. + + [ Iain Lane ] + * Use the shutdown fallback for "poweroff.target" too; this is invoked by + org.freedesktop.login1.Manager.PowerOff (LP: #1171504) + + -- Martin Pitt Sun, 28 Apr 2013 06:34:43 -0700 + +systemd (198-0ubuntu11) raring; urgency=low + + * debian/libpam-systemd.systemd-logind.upstart: Don't start if + libpam-systemd is removed but not purged. (LP: #1171691) + + -- Martin Pitt Tue, 23 Apr 2013 07:38:20 +0200 + +systemd (198-0ubuntu10) raring; urgency=low + + * debian/systemd-services.install: Don't install the D-BUS activation file + for logind. Without libpam-systemd's upstart job (which sets up the + cgroups) it does not work anyway, and with the upstart job it is already + running anyway. We'll put that back in raring+1 to respawn after crashes, + but for raring we do not want to run logind by default. (LP: #1167642) + + -- Martin Pitt Fri, 12 Apr 2013 06:44:27 +0200 + +systemd (198-0ubuntu9) raring; urgency=low + + * debian/tests/control: Add libpam-systemd dependency for logind test, as + it checks for the mounted cgroup. Mounting that moved into libpam-systemd, + see 198-0ubuntu7. + * Drop usr/lib/systemd/ from systemd-services, this doesn't belong there and + is already installed into systemd. + * 0016-Add-poweroff-reboot-suspend-hibernate-fallback.patch: Send + PrepareFor{Sleep,Shutdown}() signals with "false" after the operation + finished. Thanks to Iain Lane for the initial patch! (LP: #1157122) + + -- Martin Pitt Tue, 26 Mar 2013 11:08:39 +0100 + +systemd (198-0ubuntu8) raring; urgency=low + + * Add gir addon, to call dh_girepository to get the gir:Depends + dependency. (LP: #1159997) + + -- Dmitrijs Ledkovs Tue, 26 Mar 2013 09:24:38 +0000 + +systemd (198-0ubuntu7) raring; urgency=low + + * Make systemd-services installable without forcing the usage of logind, so + that we can install it by default for the other D-BUS services: + - Move systemd-logind upstart job into libpam-systemd. + - Drop systemd-services' Recommends: to libpam-systemd. + - LP: #1156074 + + -- Martin Pitt Tue, 19 Mar 2013 13:14:33 +0100 + +systemd (198-0ubuntu6) raring; urgency=low + + * Fix logind autopkgtest when there are no seats (as in Jenkins). + + -- Martin Pitt Mon, 18 Mar 2013 09:49:55 +0100 + +systemd (198-0ubuntu5) raring; urgency=low + + * Mark systemd-services as Multi-Arch: foreign. + * Add autopkgtest for logind. Note that in Jenkins this will only have very + light coverage as there it does not have a seat. When run locally, it will + also cover hotplug and coldplug ACLs. + * Add 0020-uaccess-rule-with-old-udev.patch: Our old udev does not yet + understand RUN{builtin}, use IMPORT. This can be dropped when moving to a + recent udev. Depend on the udev version with the uaccess builtin backport, + so that applying ACLs on hotplugged devices actually works. + + -- Martin Pitt Fri, 15 Mar 2013 19:15:32 +0100 + +systemd (198-0ubuntu4) raring; urgency=low + + * Add 0019-disable-unit-name-test.patch: Disable test-unit-name for now, as + it fails on the buildds, presumably because of a missing /etc/hostname. + + -- Martin Pitt Fri, 15 Mar 2013 11:55:21 +0100 + +systemd (198-0ubuntu3) raring; urgency=low + + * Add 0018-Add-env-variable-for-machine-ID-path.patch: During package build, + in minimal chroots, or other systems which do not already have an + /etc/machine-id we get six test failures. Introduce a + $SYSTEMD_MACHINE_ID_PATH environment variable which can specify a location + other than /etc/machine-id, so that the unit tests are independent from + the environment. + * debian/rules: Re-enable unit tests. Don't run them under fakeroot as that + hangs some tests, and supply a local machine id file. + * Add autopkgtests for hostnamed, localed, and timedated. + * 0010-Add-back-support-for-Debian-specific-config-files.patch: Update patch + for localed to use /etc/default/locale instead of /etc/locale.conf. + * Rename udev-gtk-udeb to libudev1-udeb, and build it for Ubuntu. + + -- Martin Pitt Fri, 15 Mar 2013 11:37:45 +0100 + +systemd (198-0ubuntu2) raring; urgency=low + + * libgudev-1.0-dev: Don't depend on exact binary version of + gir1.2-gudev-1.0, as libgudev-* have an epoch. + + -- Martin Pitt Wed, 13 Mar 2013 13:45:13 +0100 + +systemd (198-0ubuntu1) raring; urgency=low + + FFE for new version and libudev1 soname bump: LP #1153224 + + [ Michael Biebl ] + * New upstream release with merged udev+systemd code bases. + + [ Martin Pitt ] + * Split off new systemd-services binary package with logind, timedated, + hostnamed, and localed. These can be used without the systemd init parts. + * Add fallback to poweroff/reboot/pm-suspend/pm-hibernate if logind is + running without systemd. + * Clean up empty sessions when not running under systemd. + * Add upstart job for logind. + * Add Conflicts/Replaces/Provides for libpam-xdg-support and logind. + * Disable udev and systemd packages for Ubuntu. udev (and its udebs) will be + re-enabled once we apply our customizations from the standalone package, + and the packages are confirmed to work. For systemd{,-sysv}, we need to + decide whether or not we want these in universe. + * Add epoch to libgudev packages for Ubuntu, as we had in udev. + + -- Martin Pitt Wed, 13 Mar 2013 10:46:40 +0100 + systemd (44-12) unstable; urgency=low * Cherry-pick e17187 from upstream to fix build failures with newer glibc diff -Nru systemd-204/debian/control systemd-204/debian/control --- systemd-204/debian/control 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/control 2017-01-16 13:51:03.000000000 +0000 @@ -1,13 +1,14 @@ Source: systemd Section: admin Priority: optional -Maintainer: Debian systemd Maintainers +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian systemd Maintainers Uploaders: Tollef Fog Heen , Michael Biebl , Marco d'Itri Standards-Version: 3.9.4 -Vcs-Git: git://anonscm.debian.org/pkg-systemd/systemd.git -b debian -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-systemd/systemd.git;a=summary +Vcs-Git: https://git.launchpad.net/~ubuntu-core-dev/+git/systemd-trusty X-Python-Version: >= 2.7 Homepage: http://www.freedesktop.org/wiki/Software/systemd +XS-Testsuite: autopkgtest Build-Depends: debhelper (>= 9), pkg-config, xsltproc, @@ -21,6 +22,7 @@ intltool, gperf, libcap-dev, + libcgmanager-dev, libpam0g-dev, libaudit-dev, libdbus-1-dev (>= 1.3.2), @@ -51,8 +53,10 @@ libsystemd-login0 (= ${binary:Version}), util-linux (>= 2.19.1-2), initscripts (>= 2.88dsf-17), + systemd-services, udev Breaks: lvm2 (<< 2.02.84-1), + init-system-helpers (<< 1.14ubuntu1), lsb-base (<< 4.1+Debian4) Conflicts: klogd Description: system and service manager @@ -87,6 +91,26 @@ This package provides the manual pages and links needed for systemd to replace sysvinit. +Package: systemd-services +Architecture: linux-any +Section: admin +Priority: optional +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, + ${misc:Depends}, + udev (>= 175-0ubuntu23), + dbus, + systemd-shim (>= 3), +Replaces: systemd (<< 198-1), logind, ubuntu-system-service +Breaks: systemd (<< 198-1) +Conflicts: logind +Provides: logind +Suggests: cgmanager +Multi-Arch: foreign +Description: systemd runtime services + This package contains the logind and D-BUS services (localed, hostname, + timedated) from systemd. + Package: libpam-systemd Architecture: linux-any Multi-Arch: same @@ -95,8 +119,12 @@ Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, - systemd (= ${binary:Version}), + systemd-services (= ${binary:Version}), libpam-runtime (>= 1.0.1-6) +Conflicts: libpam-xdg-support +Replaces: libpam-xdg-support, systemd-services (<< 198-0ubuntu7) +Breaks: systemd-services (<< 198-0ubuntu7) +Provides: libpam-xdg-support Description: system and service manager - PAM module systemd is a replacement for sysvinit. It is dependency-based and able to read the LSB init script headers in addition to parsing rcN.d @@ -215,7 +243,7 @@ Priority: important Architecture: linux-any Multi-Arch: foreign -Pre-Depends: debconf (>= 1.4.69) | debconf-2.0 +Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends}, libudev1 (= ${binary:Version}), @@ -223,7 +251,7 @@ util-linux (>= 2.16), s390-tools (>> 1.6.2) [s390], procps -Breaks: consolekit (<< 0.4.6-1) +Replaces: systemd-services (<< 202-0ubuntu6) Description: /dev/ and hotplug management daemon udev is a daemon which dynamically creates and removes device nodes from /dev/, handles hotplug events and loads drivers at boot time. diff -Nru systemd-204/debian/extra/60-keyboard.hwdb systemd-204/debian/extra/60-keyboard.hwdb --- systemd-204/debian/extra/60-keyboard.hwdb 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/extra/60-keyboard.hwdb 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,1213 @@ +# This file is part of systemd. +# +# Keyboard mapping of scan codes to key codes, and +# scan codes to add to the AT keyboard's 'force-release' list. +# +# The lookup keys are composed in: +# 60-keyboard.rules +# +# Note: The format of the "keyboard:" prefix match key is a +# contract between the rules file and the hardware data, it might +# change in later revisions to support more or better matches, it +# is not necessarily expected to be a stable ABI. +# +# Supported hardware matches are: +# - USB keyboards identified by the usb kernel modalias: +# keyboard:usb:vXXXXpYYYY* +# XXXX is the 4-digit hex uppercase vendor, and YYYY +# the 4-digit hex uppercase product. +# +# - AT keyboard DMI data matches: +# keyboard:dmi:bvn*:bvr*:bd*:svn:pn:pvr* +# and are the firmware-provided strings +# exported by the kernel DMI modalias. +# +# - Platform driver device name and DMI data match: +# keyboard:name::dmi:bvn*:bvr*:bd*:svn:pn* +# is the name device specified by the +# driver, is the firmware-provided string exported +# by the kernel DMI modalias. +# +# Scan codes are specified as: +# KEYBOARD_KEY_= +# The scan code should be expressed in hex lowercase. The key codes +# are retrieved and normalized from the kernel input API header. +# +# An '!' as the first character of the key identifier string +# will add the scan code to the AT keyboard's list of scan codes +# where the driver will synthesize a release event and not expect +# it to be generated by the hardware. +# +# To debug key presses and access scan code mapping data of +# an input device use the commonly available tool: evtest(1). +# +# To update this file, create a new file +# /etc/udev/hwdb.d/70-keyboad.hwdb +# and add your rules there. To load the new rules execute (as root): +# udevadm hwdb --update +# udevadm trigger /dev/input/eventXX +# where /dev/input/eventXX is the keyboard in question. If in +# doubt, simply use /dev/input/event* to reload all input rules. +# +# If your changes are generally applicable, open a bug report on +# http://bugs.freedesktop.org/enter_bug.cgi?product=systemd +# and include your new rules, a description of the device, and the +# output of +# udevadm info /dev/input/eventXX +# (or /dev/input/event*). + +########################################## +# Acer +########################################## + +# common keys +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pn* +keyboard:dmi:bvn*:bvr*:bd*:svnGateway*:pnA0A1*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svneMachines:pneMachines*E725:pvr* + KEYBOARD_KEY_a5=help # Fn+F1 + KEYBOARD_KEY_a6=setup # Fn+F2 Acer eSettings + KEYBOARD_KEY_a7=battery # Fn+F3 Power Management + KEYBOARD_KEY_a9=switchvideomode # Fn+F5 + KEYBOARD_KEY_b2=www + KEYBOARD_KEY_b3=euro + KEYBOARD_KEY_b4=dollar + KEYBOARD_KEY_ce=brightnessup # Fn+Right + KEYBOARD_KEY_d4=bluetooth # (toggle) off-to-on + KEYBOARD_KEY_d5=wlan # (toggle) on-to-off + KEYBOARD_KEY_d6=wlan # (toggle) off-to-on + KEYBOARD_KEY_d7=bluetooth # (toggle) on-to-off + KEYBOARD_KEY_d8=bluetooth # (toggle) off-to-on + KEYBOARD_KEY_d9=brightnessup # Fn+Right + KEYBOARD_KEY_ee=brightnessup # Fn+Right + KEYBOARD_KEY_ef=brightnessdown # Fn+Left + KEYBOARD_KEY_f1=f22 # Fn+F7 Touchpad toggle (off-to-on) + KEYBOARD_KEY_f2=f23 # Fn+F7 Touchpad toggle (on-to-off) + KEYBOARD_KEY_f3=prog2 # "P2" programmable button + KEYBOARD_KEY_f4=prog1 # "P1" programmable button + KEYBOARD_KEY_f5=presentation + KEYBOARD_KEY_f8=fn + KEYBOARD_KEY_f9=prog1 # Launch NTI shadow + +# Acer kernel driver +keyboard:name:Acer WMI hotkeys:dmi:bvn*:bvr*:bd*:svn*:pnAcer*:pvr* + KEYBOARD_KEY_82=f21 # Touchpad toggle + +# Aspire models +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pnAspire*:pvr* + KEYBOARD_KEY_84=bluetooth # sent when bluetooth module missing, and key pressed + KEYBOARD_KEY_d9=bluetooth # Bluetooth off + KEYBOARD_KEY_92=media # Acer arcade + +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pnAspire*5720*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pnZG8*:pvr* + KEYBOARD_KEY_f4=prog3 # e-key + +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pnAspire*5920G:* + KEYBOARD_KEY_8a=media + KEYBOARD_KEY_a6=setup + +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pnAspire*6920:* +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pnAspire*8930:* + KEYBOARD_KEY_ca=prog3 # key 'HOLD' on CineDash Media Console + KEYBOARD_KEY_83=rewind + KEYBOARD_KEY_89=fastforward + KEYBOARD_KEY_9e=back + +# Travelmate C300 +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pnTravelMate*C3[01]0*:pvr* + KEYBOARD_KEY_67=f24 # FIXME: rotate screen + KEYBOARD_KEY_68=up + KEYBOARD_KEY_69=down + KEYBOARD_KEY_6b=fn + KEYBOARD_KEY_6c=screenlock # FIXME: lock tablet device/buttons + +# on some models this isn't brightnessup +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pn*5210*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pn*5220*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pn*5610*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pn*5620*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pn*5720*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pnTravelMate*4720*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pnTravelMate*6593:* +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pnAspire*1640:* + KEYBOARD_KEY_ee=screenlock + +keyboard:dmi:bvn*:bvr*:bd*:svnAcer*:pnAOA*:pvr* + KEYBOARD_KEY_a9=!switchvideomode # Fn+F5 + +########################################################### +# Alienware +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svnAlienware*:pn* + KEYBOARD_KEY_8a=ejectcd + +# Alienware/Dell reserves these keys; safe to apply on all their devices +keyboard:dmi:bvn*:bvr*:bd*:svnAlienware*:pn*:pvr* + KEYBOARD_KEY_bf=!prog1 #graphics amplifier, cable plug-in event + KEYBOARD_KEY_c1=!prog2 #graphics amplifier, undock-button event + KEYBOARD_KEY_c2=!power #graphics amplifier, surprise undock event + +########################################################### +# Asus +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svnASUS:pn* + KEYBOARD_KEY_ed=volumeup + KEYBOARD_KEY_ee=volumedown + KEYBOARD_KEY_ef=mute + +keyboard:name:Asus WMI hotkeys:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:pvr* +keyboard:name:Eee PC WMI hotkeys:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:pvr* +keyboard:name:Asus Laptop extra buttons:dmi:bvn*:bvr*:bd*:svnASUS*:pn*:pvr* + KEYBOARD_KEY_6b=f21 # Touchpad Toggle + +########################################################### +# BenQ +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svn*BenQ*:pn*Joybook*R22*:pvr* + KEYBOARD_KEY_6e=wlan + +########################################################### +# Compal +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svnCOMPAL:pnHEL80I:* + KEYBOARD_KEY_84=wlan + +########################################################### +# COMPAQ +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svnCompaq*:pn*E500*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnCompaq*:pn*Evo*N*:pvr* + KEYBOARD_KEY_a3=www # I key + KEYBOARD_KEY_9a=search + KEYBOARD_KEY_9e=email + KEYBOARD_KEY_9f=homepage + +keyboard:usb:b0003v049Fp0051* + KEYBOARD_KEY_0c0011=presentation + KEYBOARD_KEY_0c0012=addressbook + KEYBOARD_KEY_0c0013=info + KEYBOARD_KEY_0c0014=prog1 + KEYBOARD_KEY_0c0015=messenger + +########################################################### +# Dell +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pn* + KEYBOARD_KEY_81=playpause # Play/Pause + KEYBOARD_KEY_82=stopcd # Stop + KEYBOARD_KEY_83=previoussong # Previous song + KEYBOARD_KEY_84=nextsong # Next song + KEYBOARD_KEY_85=brightnessdown # Fn+Down Brightness Down + KEYBOARD_KEY_86=brightnessup # Fn+Up Brightness Up + KEYBOARD_KEY_87=battery # Fn+F3 battery icon + KEYBOARD_KEY_88=unknown # Fn+F2 Turn On/Off Wireless - handled in hardware + KEYBOARD_KEY_89=ejectclosecd # Fn+F10 Eject CD + KEYBOARD_KEY_8a=suspend # Fn+F1 hibernate + KEYBOARD_KEY_8b=switchvideomode # Fn+F8 CRT/LCD (high keycode: "displaytoggle") + KEYBOARD_KEY_8c=unknown # Fn+Right Auto Brightness + KEYBOARD_KEY_8F=switchvideomode # Fn+F7 aspect ratio + KEYBOARD_KEY_90=previoussong # Front panel previous song + KEYBOARD_KEY_91=prog1 # Wi-Fi Catcher (Dell-specific) + KEYBOARD_KEY_92=media # MediaDirect button (house icon) + KEYBOARD_KEY_93=unknown # FIXME Fn+Left Auto Brightness + KEYBOARD_KEY_95=camera # Shutter button - Takes a picture if optional camera available + KEYBOARD_KEY_97=email # Tablet email button + KEYBOARD_KEY_98=f21 # FIXME: Tablet screen rotation + KEYBOARD_KEY_99=nextsong # Front panel next song + KEYBOARD_KEY_9a=setup # Tablet tools button + KEYBOARD_KEY_9b=switchvideomode # Display toggle button + KEYBOARD_KEY_9e=f21 # Touchpad toggle + KEYBOARD_KEY_a2=playpause # Front panel play/pause + KEYBOARD_KEY_a4=stopcd # Front panel stop + KEYBOARD_KEY_ed=media # MediaDirect button + KEYBOARD_KEY_d8=screenlock # FIXME: Tablet lock button + KEYBOARD_KEY_d9=f21 # Touchpad toggle + +# +keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnInspiron*910:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnInspiron*101[012]:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnInspiron*1110:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnInspiron*1210:pvr* + KEYBOARD_KEY_84=wlan + +# Dell Inspiron 1520 +keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnInspiron*1520:pvr* + KEYBOARD_KEY_85=unknown # Brightness Down, also emitted by acpi-video, ignore + KEYBOARD_KEY_86=unknown # Brightness Up, also emitted by acpi-video, ignore + +# Latitude XT2 +keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnLatitude*XT2:pvr* + KEYBOARD_KEY_9b=up # tablet rocker up + KEYBOARD_KEY_9e=enter # tablet rocker press + KEYBOARD_KEY_9f=back # tablet back + KEYBOARD_KEY_a3=down # tablet rocker down + +keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnStudio*155[78]:pvr* + KEYBOARD_KEY_a0=! # mute + KEYBOARD_KEY_ae=! # volume down + KEYBOARD_KEY_b0=! # volume up + +# Dell Touchpad +keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnLatitude*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnPrecision*:pvr* + KEYBOARD_KEY_88=! # wireless switch + KEYBOARD_KEY_9e=!f21 + +# Dell XPS +keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnXPS*:pvr* + KEYBOARD_KEY_8c=!unknown + +# Dell XPS12 9Q33 +keyboard:dmi:bvn*:bvr*:bd*:svnDell*:pnXPS12-9Q33*:pvr* + KEYBOARD_KEY_88=wlan + KEYBOARD_KEY_65=direction # Screen Rotate + +# Dell Latitude microphone mute +keyboard:name:Dell WMI hotkeys:dmi:bvn*:bvr*:bd*:svnDell*:pnLatitude* +# Dell Precision microphone mute +keyboard:name:Dell WMI hotkeys:dmi:bvn*:bvr*:bd*:svnDell*:pnPrecision* + KEYBOARD_KEY_150=f20 # Mic mute toggle, should be micmute + +########################################################### +# Everex +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svnEverex:pnXT5000*:pvr* + KEYBOARD_KEY_5c=media + KEYBOARD_KEY_65=f21 # Fn+F5 Touchpad toggle + KEYBOARD_KEY_67=prog3 # Fan speed control button + KEYBOARD_KEY_6f=brightnessup + KEYBOARD_KEY_7f=brightnessdown + KEYBOARD_KEY_b2=www + KEYBOARD_KEY_ec=mail + +########################################## +# Fujitsu +########################################## + +keyboard:dmi:bvn*:bvr*:bd*:svnFUJITSU*:pnAMILO*M*:pvr* + KEYBOARD_KEY_97=prog2 + KEYBOARD_KEY_9f=prog1 + +keyboard:dmi:bvn*:bvr*:bd*:svnFUJITSU*:pnAmilo*Li*1718:* + KEYBOARD_KEY_d6=wlan + +# Amilo Li 2732 +keyboard:dmi:bvn*:bvr*:bd*:svnFUJITSU*:pnAMILO*Li*2732:* + KEYBOARD_KEY_d9=brightnessdown # Fn+F8 brightness down + KEYBOARD_KEY_ef=brightnessup # Fn+F9 brightness up + KEYBOARD_KEY_a9=switchvideomode # Fn+F10 Cycle between available video outputs + +# Amilo Pa 2548 +keyboard:dmi:bvn*:bvr*:bd*:svnFUJITSU*:pn*AMILO*Pa*2548*:pvr* + KEYBOARD_KEY_e0=volumedown + KEYBOARD_KEY_e1=volumeup + KEYBOARD_KEY_e5=prog1 + +# Amilo Pro Edition V3505 +keyboard:dmi:bvn*:bvr*:bd*:svnFUJITSU*:pn*AMILO*Pro*Edition*V3505*:pvr* + KEYBOARD_KEY_a5=help # Fn+F1 + KEYBOARD_KEY_a9=switchvideomode # Fn+F3 + KEYBOARD_KEY_d9=brightnessdown # Fn+F8 + KEYBOARD_KEY_e0=brightnessup # Fn+F9 + +# Amilo Pro v3205 +keyboard:dmi:bvn*:bvr*:bd*:svnFUJITSU*:pn*AMILO*Pro*V3205*:pvr* + KEYBOARD_KEY_f4=f21 # FIXME: silent-mode decrease CPU/GPU clock + KEYBOARD_KEY_f7=switchvideomode # Fn+F3 + +# Amilo Si 1520 +keyboard:dmi:bvn*:bvr*:bd*:svnFUJITSU*:pn*Amilo*Si*1520*:pvr* + KEYBOARD_KEY_e1=wlan + KEYBOARD_KEY_f3=wlan + KEYBOARD_KEY_ee=brightnessdown + KEYBOARD_KEY_e0=brightnessup + KEYBOARD_KEY_e2=bluetooth + KEYBOARD_KEY_f7=video + +# Esprimo Mobile V5 +keyboard:dmi:bvn*:bvr*:bd*:svnFUJITSU*:pn*ESPRIMO*Mobile*V5*:pvr* + KEYBOARD_KEY_a9=switchvideomode + KEYBOARD_KEY_d9=brightnessdown + KEYBOARD_KEY_df=sleep + KEYBOARD_KEY_ef=brightnessup + +# Esprimo Mobile V6 +keyboard:dmi:bvn*:bvr*:bd*:svnFUJITSU*:pn*ESPRIMO*Mobile*V6*:pvr* + KEYBOARD_KEY_ce=brightnessup + KEYBOARD_KEY_ef=brightnessdown + +########################################################### +# GIGABYTE +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svnGIGABYTE:pnU2442:* + KEYBOARD_KEY_a0=! # mute + +########################################################### +# Genius +########################################################### + +# Slimstar 320 +keyboard:usb:b0003v0458p0708* + KEYBOARD_KEY_0900f0=scrollup + KEYBOARD_KEY_0900f1=scrolldown + KEYBOARD_KEY_0900f3=back + KEYBOARD_KEY_0900f2=forward + KEYBOARD_KEY_0900f5=wordprocessor + KEYBOARD_KEY_0900f6=spreadsheet + KEYBOARD_KEY_0900f4=presentation + KEYBOARD_KEY_0c0223=www + KEYBOARD_KEY_0900f7=chat + KEYBOARD_KEY_0900fb=prog1 + KEYBOARD_KEY_0900f8=close + KEYBOARD_KEY_0900f9=graphicseditor + KEYBOARD_KEY_0900fd=scale + KEYBOARD_KEY_0900fc=screenlock + +########################################################### +# Hewlett Packard +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnHP*:pn*:pvr* + KEYBOARD_KEY_81=fn_esc + KEYBOARD_KEY_89=battery # Fn+F8 + KEYBOARD_KEY_8a=screenlock # Fn+F6 + KEYBOARD_KEY_8b=camera + KEYBOARD_KEY_8c=media # music + KEYBOARD_KEY_8e=dvd + KEYBOARD_KEY_b1=help + KEYBOARD_KEY_b3=unknown # FIXME: Auto brightness + KEYBOARD_KEY_d7=wlan + KEYBOARD_KEY_92=brightnessdown # Fn+F7 (Fn+F9 on 6730b) + KEYBOARD_KEY_97=brightnessup # Fn+F8 (Fn+F10 on 6730b) + KEYBOARD_KEY_ee=switchvideomode # Fn+F4 + +# Tablet +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*[tT][aA][bB][lL][eE][tT]*:pvr* + KEYBOARD_KEY_82=prog2 # Funny Key + KEYBOARD_KEY_83=prog1 # Q + KEYBOARD_KEY_84=tab + KEYBOARD_KEY_85=esc + KEYBOARD_KEY_86=pageup + KEYBOARD_KEY_87=pagedown + +# Pavilion +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*[pP][aA][vV][iI][lL][iI][oO][nN]*:pvr* + KEYBOARD_KEY_88=media # FIXME: quick play + KEYBOARD_KEY_b7=print + KEYBOARD_KEY_d8=!f23 # touchpad off + KEYBOARD_KEY_d9=!f22 # touchpad on + +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP*Pavilion*dv7*Notebook*PC:pvr* + KEYBOARD_KEY_b7=print + KEYBOARD_KEY_c2=media # FIXME: quick play + KEYBOARD_KEY_c6=break + KEYBOARD_KEY_94=reserved + +# Elitebook +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*Compaq*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*EliteBook*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*2230s*:pvr* + KEYBOARD_KEY_88=presentation + KEYBOARD_KEY_d9=help # I key (high keycode: "info") + +# Presario +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*Presario*CQ*:pvr* + KEYBOARD_KEY_d8=f21 + KEYBOARD_KEY_d9=f21 + +# 2510p 2530p +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*2510p*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*2530p*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP*G60*Notebook*PC:pvr* + KEYBOARD_KEY_d8=!f23 # touchpad off + KEYBOARD_KEY_d9=!f22 # touchpad on + +# 2570p +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*2570p*:pvr* + KEYBOARD_KEY_f8=wlan # Wireless HW switch button + +# TX2 +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*[tT][xX]2*:pvr* + KEYBOARD_KEY_c2=media + KEYBOARD_KEY_d8=!f23 # Toggle touchpad button on tx2 (OFF) + KEYBOARD_KEY_d9=!f22 # Toggle touchpad button on tx2 (ON) + +# Presario 2100 +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnPresario*2100*:pvr* + KEYBOARD_KEY_f0=help + KEYBOARD_KEY_f1=screenlock + KEYBOARD_KEY_f3=search + +# Elitebook 8440p +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP*EliteBook*8440p:pvr* + KEYBOARD_KEY_88=www + KEYBOARD_KEY_a0=mute + KEYBOARD_KEY_ae=volumedown + KEYBOARD_KEY_b0=volumeup + KEYBOARD_KEY_ec=mail + +# Elitebook 8460p +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP*EliteBook*8460p:pvr* + KEYBOARD_KEY_f8=wlan # Wireless HW switch button + KEYBOARD_KEY_b3=prog1 # Fn+F11 - Ambient Light Sensor button + KEYBOARD_KEY_b1=prog2 # Fn+ESC - System information button + +# HDX9494nr +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHDX9494NR:pvr* + KEYBOARD_KEY_b2=www # Fn+F3 + KEYBOARD_KEY_d8=!f23 # touchpad off + KEYBOARD_KEY_d9=!f22 # touchpad on + +# Chromebook 14 +# Top row keys (between ESC and power button) +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnFalco:pvr* + KEYBOARD_KEY_3b=back + KEYBOARD_KEY_3c=forward + KEYBOARD_KEY_3d=refresh + KEYBOARD_KEY_3f=switchvideomode + KEYBOARD_KEY_40=brightnessdown + KEYBOARD_KEY_41=brightnessup + KEYBOARD_KEY_42=mute + KEYBOARD_KEY_43=volumedown + KEYBOARD_KEY_44=volumeup + KEYBOARD_KEY_db=search # Same position as caps lock key on most keyboards +# KEYBOARD_KEY_3e=fullscreen, no defined key sym + + +# HP EliteBook 725 G2 +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHPLicrice:pvr* +# HP ProBook 440 G2 +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP440G2:pvr* +# several HP ProBooks 4xx +keyboard:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHP*ProBook4*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnHP*:pnHP*ProBook*4*:pvr* + KEYBOARD_KEY_81=f20 # Fn+F8; Microphone mute button, should be micmute + +# HP ProBook 440 G3 +keyboard:dmi:bvn*:bvr*:svnHP*:pnHP*ProBook*440*G3* + KEYBOARD_KEY_85=unknown # lid close; also reported via special evdev + KEYBOARD_KEY_f8=unknown # rf kill; also reported via special evdev + +########################################################### +# IBM +########################################################### + +# thinkpad_acpi driver +keyboard:name:ThinkPad Extra Buttons:dmi:bvn*:bvr*:bd*:svnIBM*:pn*:pvr* + KEYBOARD_KEY_01=battery # Fn+F2 + KEYBOARD_KEY_02=screenlock # Fn+F3 + KEYBOARD_KEY_03=sleep # Fn+F4 + KEYBOARD_KEY_04=wlan # Fn+F5 + KEYBOARD_KEY_06=switchvideomode # Fn+F7 + KEYBOARD_KEY_07=zoom # Fn+F8 screen expand + KEYBOARD_KEY_08=f24 # Fn+F9 undock + KEYBOARD_KEY_0b=suspend # Fn+F12 + KEYBOARD_KEY_0f=brightnessup # Fn+Home + KEYBOARD_KEY_10=brightnessdown # Fn+End + KEYBOARD_KEY_11=kbdillumtoggle # Fn+PgUp - ThinkLight + KEYBOARD_KEY_13=zoom # Fn+Space + KEYBOARD_KEY_14=volumeup + KEYBOARD_KEY_15=volumedown + KEYBOARD_KEY_16=mute + KEYBOARD_KEY_17=prog1 # ThinkPad/ThinkVantage button (high keycode: "vendor") + +# IBM Thinkpad USB Keyboard Trackpoint +keyboard:usb:b0003v04B3p301[89]* + KEYBOARD_KEY_900f0=screenlock + KEYBOARD_KEY_900f1=wlan + KEYBOARD_KEY_900f2=switchvideomode + KEYBOARD_KEY_900f3=suspend + KEYBOARD_KEY_900f4=brightnessup + KEYBOARD_KEY_900f5=brightnessdown + KEYBOARD_KEY_900f8=zoom + +########################################################### +# Inventec +########################################################### + +# Symphony +keyboard:dmi:bvn*:bvr*:bd*:svnINVENTEC:pnSYMPHONY*6.0/7.0:pvr* + KEYBOARD_KEY_f3=prog2 + KEYBOARD_KEY_f4=prog1 + +########################################################### +# Lenovo +########################################################### + +# thinkpad_acpi driver +keyboard:name:ThinkPad Extra Buttons:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn* + KEYBOARD_KEY_01=screenlock + KEYBOARD_KEY_02=battery + KEYBOARD_KEY_03=sleep + KEYBOARD_KEY_04=wlan + KEYBOARD_KEY_06=switchvideomode + KEYBOARD_KEY_07=f21 + KEYBOARD_KEY_08=f24 + KEYBOARD_KEY_0b=suspend + KEYBOARD_KEY_0f=brightnessup + KEYBOARD_KEY_10=brightnessdown + KEYBOARD_KEY_11=kbdillumtoggle + KEYBOARD_KEY_13=zoom + KEYBOARD_KEY_14=volumeup + KEYBOARD_KEY_15=volumedown + KEYBOARD_KEY_16=mute + KEYBOARD_KEY_17=prog1 + KEYBOARD_KEY_1a=f20 # Microphone mute button; should be micmute + +# ThinkPad Keyboard with TrackPoint +keyboard:usb:b0003v17EFp6009* + KEYBOARD_KEY_090012=screenlock # Fn+F2 + KEYBOARD_KEY_090013=battery # Fn+F3 + KEYBOARD_KEY_090014=wlan # Fn+F5 + KEYBOARD_KEY_090016=switchvideomode # Fn+F7 + KEYBOARD_KEY_090017=f21 # Fn+F8 touchpad toggle + KEYBOARD_KEY_090019=suspend # Fn+F12 + KEYBOARD_KEY_09001a=brightnessup # Fn+Home + KEYBOARD_KEY_09001b=brightnessdown # Fn+End + KEYBOARD_KEY_09001d=zoom # Fn+Space + KEYBOARD_KEY_090011=prog1 # ThinkVantage button + KEYBOARD_KEY_090015=camera # Fn+F6 headset/camera VoIP key ?? + KEYBOARD_KEY_090010=f20 # Microphone mute button; should be micmute + +# Lenovo 3000 +keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*3000*:pvr* + KEYBOARD_KEY_8b=switchvideomode # Fn+F7 video + KEYBOARD_KEY_96=wlan # Fn+F5 wireless + KEYBOARD_KEY_97=sleep # Fn+F4 suspend + KEYBOARD_KEY_98=suspend # Fn+F12 hibernate + KEYBOARD_KEY_b4=prog1 # Lenovo Care + +# "Lenovo Care" Key of the 3000 N200 +keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO:pn0769AP2:pvr3000N200:* + KEYBOARD_KEY_b4=prog1 + +# lenovo-ideapad +keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*IdeaPad*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pnS10-*:pvr* + KEYBOARD_KEY_81=rfkill # does nothing in BIOS + KEYBOARD_KEY_83=display_off # BIOS toggles screen state + KEYBOARD_KEY_b9=brightnessup # does nothing in BIOS + KEYBOARD_KEY_ba=brightnessdown # does nothing in BIOS + KEYBOARD_KEY_f1=camera # BIOS toggles camera power + KEYBOARD_KEY_f2=f21 # touchpad toggle (key alternately emits F2 and F3) + KEYBOARD_KEY_f3=f21 + +# Thinkpad X200_Tablet +keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*:pvrThinkPad*X2*Tablet* + KEYBOARD_KEY_5d=menu + KEYBOARD_KEY_63=fn + KEYBOARD_KEY_66=screenlock + KEYBOARD_KEY_67=cyclewindows # bezel circular arrow + KEYBOARD_KEY_68=setup # bezel setup / menu + KEYBOARD_KEY_6c=direction # rotate screen + +# ThinkPad X6 Tablet +keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*:pvrThinkPad*X6*Tablet* + KEYBOARD_KEY_6c=direction # rotate + KEYBOARD_KEY_68=leftmeta # toolbox + KEYBOARD_KEY_6b=esc # escape + KEYBOARD_KEY_6d=right # right on d-pad + KEYBOARD_KEY_6e=left # left on d-pad + KEYBOARD_KEY_71=up # up on d-pad + KEYBOARD_KEY_6f=down # down on d-pad + KEYBOARD_KEY_69=enter # enter on d-pad + +# ThinkPad X41 Tablet +keyboard:dmi:bvn*:bvr*:bd*:svnIBM*:pn18666TU:pvr* + KEYBOARD_KEY_6c=direction # rotate + KEYBOARD_KEY_68=leftmeta # toolbox + KEYBOARD_KEY_6b=esc # escape + KEYBOARD_KEY_69=enter # enter on d-pad + +# IdeaPad +keyboard:name:Ideapad extra buttons:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn* + KEYBOARD_KEY_42=f23 + KEYBOARD_KEY_43=f22 + +keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*IdeaPad*Y550*:pvr* + KEYBOARD_KEY_95=media + KEYBOARD_KEY_a3=play + +keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*IdeaPad*U300s*:pvr* + KEYBOARD_KEY_f1=f21 + KEYBOARD_KEY_ce=f20 # micmute + +keyboard:dmi:bvn*:bvr*:svnLENOVO*:pn*IdeaPad*Z370*:pvr* + KEYBOARD_KEY_a0=!mute + KEYBOARD_KEY_ae=!volumedown + KEYBOARD_KEY_b0=!volumeup + +# V480 +keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*Lenovo*V480*:pvr* + KEYBOARD_KEY_f1=f21 + +# enhanced USB keyboard +keyboard:usb:b0003v04B3p301B* + KEYBOARD_KEY_90001=prog1 # ThinkVantage + KEYBOARD_KEY_90002=screenlock + KEYBOARD_KEY_90003=file + KEYBOARD_KEY_90004=wordprocessor + KEYBOARD_KEY_90005=spreadsheet + KEYBOARD_KEY_90006=calc + KEYBOARD_KEY_90007=mail + KEYBOARD_KEY_90008=www + + +########################################################### +# Logitech +########################################################### + +# iTouch +keyboard:usb:b0003v046DpC308* + KEYBOARD_KEY_90001=shop # Shopping + KEYBOARD_KEY_90002=config # iTouch + KEYBOARD_KEY_90003=finance # Finance + KEYBOARD_KEY_90004=prog1 # My Sites + KEYBOARD_KEY_90005=prog2 # Community + KEYBOARD_KEY_C0183=media # Media + +# Cordless Desktop S510 +keyboard:usb:b0003v046DpC50C* + KEYBOARD_KEY_d4=zoomin + KEYBOARD_KEY_cc=zoomout + +# Wave cordless +keyboard:usb:b0003v046DpC317* + KEYBOARD_KEY_9001c=scale # expo + KEYBOARD_KEY_9001f=zoomout + KEYBOARD_KEY_90020=zoomin + KEYBOARD_KEY_9003d=prog1 # gadget + KEYBOARD_KEY_90005=camera + KEYBOARD_KEY_90018=media + KEYBOARD_KEY_90041=wordprocessor + KEYBOARD_KEY_90042=spreadsheet + KEYBOARD_KEY_90043=calendar + KEYBOARD_KEY_90044=prog2 # fn+f4 (program a) + KEYBOARD_KEY_90045=prog3 # fn+f5 (program b) + KEYBOARD_KEY_90046=prog4 # fn+f6 (program c) + KEYBOARD_KEY_90048=messenger # fn+f8 (msn messenger) + KEYBOARD_KEY_9002d=search # fn+f10 (search www) + KEYBOARD_KEY_9004b=find # fn+f11 (search pc) + KEYBOARD_KEY_9004c=ejectclosecd + +# Wave cordless +keyboard:usb:b0003v046DpC517* + KEYBOARD_KEY_c101f=zoomout + KEYBOARD_KEY_c1020=zoomin + KEYBOARD_KEY_c1005=camera + KEYBOARD_KEY_c0183=media + KEYBOARD_KEY_c1041=wordprocessor + KEYBOARD_KEY_c1042=spreadsheet + KEYBOARD_KEY_c1043=calendar + KEYBOARD_KEY_c1044=prog2 # fn+f4 (program a) + KEYBOARD_KEY_c1045=prog3 # fn+f5 (program b) + KEYBOARD_KEY_c1046=prog4 # fn+f6 (program c) + KEYBOARD_KEY_c1048=messenger # fn+f8 (msn messenger) + KEYBOARD_KEY_c104a=find # fn+f10 (search www) + KEYBOARD_KEY_c104c=ejectclosecd + +# Cordless Wave Pro +keyboard:usb:b0003v046DpC52[9B]* + KEYBOARD_KEY_0c01b6=camera + KEYBOARD_KEY_0c0183=media + KEYBOARD_KEY_0c0184=wordprocessor + KEYBOARD_KEY_0c0186=spreadsheet + KEYBOARD_KEY_0c018e=calendar + KEYBOARD_KEY_0c0223=homepage + KEYBOARD_KEY_0c01bc=messenger + KEYBOARD_KEY_0c018a=mail + KEYBOARD_KEY_0c0221=search + KEYBOARD_KEY_0c00b8=ejectcd + KEYBOARD_KEY_0c022d=zoomin + KEYBOARD_KEY_0c022e=zoomout + +# Logitech Presenter R400 +keyboard:usb:b0003v046DpC52D* + KEYBOARD_KEY_070029=presentation + KEYBOARD_KEY_07003e=presentation + KEYBOARD_KEY_070037=displaytoggle + +# Internet Navigator +keyboard:usb:b0003v046DpC309* + KEYBOARD_KEY_90001=chat # Messenger/SMS + KEYBOARD_KEY_90002=camera # webcam + KEYBOARD_KEY_90003=prog1 # iTouch + KEYBOARD_KEY_90004=shop # Shopping + KEYBOARD_KEY_C0201=new # New (F1) + KEYBOARD_KEY_C0289=reply # Reply mail (F2) + KEYBOARD_KEY_C028B=forwardmail # Forward mail (F3) + KEYBOARD_KEY_C028C=send # Send (F4) + KEYBOARD_KEY_C021A=undo # Undo (F5). + KEYBOARD_KEY_C0279=redo # Redo (F6). + KEYBOARD_KEY_C0208=print # Print (F7) + KEYBOARD_KEY_C0207=save # Save (F8) + KEYBOARD_KEY_C0194=file # My Computer (F9) + KEYBOARD_KEY_C01A7=documents # My Documents (F10) + KEYBOARD_KEY_C01B6=images # My Pictures (F11) ?? + KEYBOARD_KEY_C01B7=sound # My Music (F12) ?? + + +########################################################### +# Maxdata +########################################################### + +# Pro 7000 +keyboard:dmi:bvn*:bvr*:bd*:svnMAXDATA:pnPro*7000*:pvr* + KEYBOARD_KEY_97=prog2 + KEYBOARD_KEY_9f=prog1 + KEYBOARD_KEY_a0=mute # Fn+F5 + KEYBOARD_KEY_82=www + KEYBOARD_KEY_ec=email + KEYBOARD_KEY_ae=volumedown # Fn+Down + KEYBOARD_KEY_b0=volumeup # Fn+Up + KEYBOARD_KEY_df=suspend # Fn+F2 + KEYBOARD_KEY_f5=help + +########################################################### +# Medion +########################################################### + +# FID2060 +keyboard:dmi:bvn*:bvr*:bd*:svnMEDION*:pn*FID2060*:pvr* + KEYBOARD_KEY_6b=channeldown # Thottle Down + KEYBOARD_KEY_6d=channelup # Thottle Up + +# NB-A555 +keyboard:dmi:bvn*:bvr*:bd*:svnMEDIONNB:pnA555*:pvr* + KEYBOARD_KEY_63=www # N button + KEYBOARD_KEY_66=prog1 # link 1 button + KEYBOARD_KEY_67=email # envelope button + KEYBOARD_KEY_69=prog2 # link 2 button + +########################################################### +# Microsoft +########################################################### + +# Microsoft Natural Ergonomic Keyboard 4000 +keyboard:usb:b0003v045Ep00DB* + KEYBOARD_KEY_c022d=zoomin + KEYBOARD_KEY_c022e=zoomout + +########################################################### +# Micro Star +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pn* +keyboard:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn* + KEYBOARD_KEY_a0=mute # Fn+F9 + KEYBOARD_KEY_ae=volumedown # Fn+F7 + KEYBOARD_KEY_b0=volumeup # Fn+F8 + KEYBOARD_KEY_b2=www # e button + KEYBOARD_KEY_df=sleep # Fn+F12 + KEYBOARD_KEY_e2=bluetooth # satellite dish2 + KEYBOARD_KEY_e4=f21 # Fn+F3 Touchpad disable + KEYBOARD_KEY_ec=email # envelope button + KEYBOARD_KEY_ee=camera # Fn+F6 camera disable + KEYBOARD_KEY_f6=wlan # satellite dish1 + KEYBOARD_KEY_f7=brightnessdown # Fn+F4 + KEYBOARD_KEY_f8=brightnessup # Fn+F5 + KEYBOARD_KEY_f9=search + +# +keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pnGE60*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pnGE70*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*:pvr* + KEYBOARD_KEY_c2=ejectcd + +# some MSI models generate ACPI/input events on the LNXVIDEO input devices, +# plus some extra synthesized ones on dmi as an echo of actually changing the +# brightness; so ignore those dmi ones, to avoid loops +keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pn*U-100*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pn*U100*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pn*N033:* + KEYBOARD_KEY_f7=reserved + KEYBOARD_KEY_f8=reserved + +# MSI Wind U90/U100 generates separate touchpad on/off keycodes so ignore touchpad toggle keycode +keyboard:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pnU90/U100:* + KEYBOARD_KEY_e4=reserved + +########################################################### +# MSI +########################################################### + +keyboard:name:MSI Laptop hotkeys:dmi:bvn*:bvr*:bd*:svn*:pnM[iI][cC][rR][oO]-S[tT][aA][rR]*:pvr* + KEYBOARD_KEY_0213=f22 + KEYBOARD_KEY_0214=f23 + +########################################################### +# OLPC +########################################################### + +# XO +keyboard:dmi:bvn*:bvr*:bd*:svnOLPC:pnXO:* + KEYBOARD_KEY_59=fn + KEYBOARD_KEY_81=fn_esc + KEYBOARD_KEY_f9=camera + KEYBOARD_KEY_f8=sound # Fn+CAMERA = Mic + KEYBOARD_KEY_43=brightnessdown + KEYBOARD_KEY_44=brightnessup + KEYBOARD_KEY_57=volumedown + KEYBOARD_KEY_58=volumeup + KEYBOARD_KEY_bb=f1 + KEYBOARD_KEY_bc=f2 + KEYBOARD_KEY_bd=f3 + KEYBOARD_KEY_be=f4 + KEYBOARD_KEY_bf=f5 + KEYBOARD_KEY_c0=f6 + KEYBOARD_KEY_c1=f7 + KEYBOARD_KEY_c2=f8 + KEYBOARD_KEY_c3=f9 + KEYBOARD_KEY_c4=f10 + KEYBOARD_KEY_c7=f11 + KEYBOARD_KEY_d8=f12 + KEYBOARD_KEY_f7=f13 + KEYBOARD_KEY_f6=f14 + KEYBOARD_KEY_f5=f15 + KEYBOARD_KEY_f4=f16 + KEYBOARD_KEY_f3=f17 + KEYBOARD_KEY_f2=f18 + KEYBOARD_KEY_f1=f19 + KEYBOARD_KEY_f0=f20 # micmute + KEYBOARD_KEY_ef=f21 + KEYBOARD_KEY_ee=chat + KEYBOARD_KEY_e4=chat + KEYBOARD_KEY_dd=menu # Frame + KEYBOARD_KEY_da=prog1 # Fn+Frame + KEYBOARD_KEY_d3=delete + KEYBOARD_KEY_d2=insert + KEYBOARD_KEY_c9=pageup + KEYBOARD_KEY_d1=pagedown + KEYBOARD_KEY_c7=home + KEYBOARD_KEY_cF=end + KEYBOARD_KEY_73=hp + KEYBOARD_KEY_7e=hp + KEYBOARD_KEY_db=leftmeta # left grab + KEYBOARD_KEY_dc=rightmeta # right grab + KEYBOARD_KEY_85=rightmeta # Right grab releases on a different scancode + KEYBOARD_KEY_d6=kbdillumtoggle # Fn+Space + KEYBOARD_KEY_69=switchvideomode # Brightness key + KEYBOARD_KEY_65=kp8 # up + KEYBOARD_KEY_66=kp2 # down + KEYBOARD_KEY_67=kp4 # left + KEYBOARD_KEY_68=kp6 # right + KEYBOARD_KEY_e5=kp9 # pgup + KEYBOARD_KEY_e6=kp3 # pgdn + KEYBOARD_KEY_e7=kp7 # home + KEYBOARD_KEY_e8=kp1 # end + +########################################################### +# Onkyo +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svnONKYO*CORPORATION:pnONKYOPC:* + KEYBOARD_KEY_a0=mute # Fn+D + KEYBOARD_KEY_ae=volumedown # Fn+F + KEYBOARD_KEY_b0=volumeup # Fn+G + KEYBOARD_KEY_df=sleep # Fn+W + KEYBOARD_KEY_e0=bluetooth # Fn+H + KEYBOARD_KEY_e2=cyclewindows # Fn+Esc + KEYBOARD_KEY_ee=battery # Fn+Q + KEYBOARD_KEY_f0=media # Fn+R + KEYBOARD_KEY_f5=switchvideomode # Fn+E + KEYBOARD_KEY_f6=camera # Fn+T + KEYBOARD_KEY_f7=f21 # Fn+Y (touchpad toggle) + KEYBOARD_KEY_f8=brightnessup # Fn+S + KEYBOARD_KEY_f9=brightnessdown # Fn+A + KEYBOARD_KEY_fb=wlan # Fn+J + +########################################################### +# OQO +########################################################### + +# Model 2 +keyboard:dmi:bvn*:bvr*:bd*:svnOQO*Inc.*:pnOQO*Model*2*:pvr* + KEYBOARD_KEY_8e=wlan + KEYBOARD_KEY_f0=switchvideomode + KEYBOARD_KEY_f1=mute + KEYBOARD_KEY_f2=volumedown + KEYBOARD_KEY_f3=volumeup + +########################################################### +# Plantronics +########################################################### + +# Plantronics .Audio 626 DSP +keyboard:usb:b0003v047FpC006* + KEYBOARD_KEY_b002f=f20 # Microphone mute button; should be micmute + +########################################################### +# Quanta +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr*:rvnQuanta:rn30B7:rvr65.2B:* + KEYBOARD_KEY_88=media # "quick play + +########################################################### +# Samsung +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn* + KEYBOARD_KEY_74=prog1 # User key + KEYBOARD_KEY_75=www + KEYBOARD_KEY_78=mail + KEYBOARD_KEY_82=!switchvideomode # Fn+F4 CRT/LCD (high keycode: "displaytoggle") + KEYBOARD_KEY_83=!battery # Fn+F2 + KEYBOARD_KEY_84=!prog1 # Fn+F5 backlight on/off + KEYBOARD_KEY_86=!wlan # Fn+F9 + KEYBOARD_KEY_88=!brightnessup # Fn+Up + KEYBOARD_KEY_89=!brightnessdown # Fn+Down + KEYBOARD_KEY_b1=!prog2 # Fn+F7 run Samsung Magic Doctor (keypressed event is generated twice) + KEYBOARD_KEY_b3=!prog3 # Fn+F8 switch power mode (battery/dynamic/performance) + KEYBOARD_KEY_b4=!wlan # Fn+F9 (X60P) + KEYBOARD_KEY_c5=!prog3 # Fn+F8 switch power mode (battery/dynamic/performance) + KEYBOARD_KEY_d5=!wlan # Fn+F12 wlan/airplane switch + KEYBOARD_KEY_f7=!f22 # Fn+F10 Touchpad on + KEYBOARD_KEY_f9=!f23 # Fn+F10 Touchpad off + +# Series 3 +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*300E[457]*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*200E[45]*:pvr* + KEYBOARD_KEY_ce=! # Fn+F1 launch control setting + +# Series 5 +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*530U*:pvr* + KEYBOARD_KEY_ce=!prog1 # Fn+F1 launch settings + KEYBOARD_KEY_a8=! # Fn Lock - Function lock on + KEYBOARD_KEY_a9=! # Fn Lock - Function lock off + +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*550P*:pvr* + KEYBOARD_KEY_ce=!prog1 # Fn+F1 launch settings + KEYBOARD_KEY_a8=! # Fn Lock - Function lock on + KEYBOARD_KEY_a9=! # Fn Lock - Function lock off + +# Series 7 / 9 +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*350V*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*670Z*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*700Z*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*700G*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*900X[34]*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*940X3G*:pvr* + KEYBOARD_KEY_ce=!prog1 # Fn+F1 launch settings + KEYBOARD_KEY_a0=!mute # Fn+F6 mute + KEYBOARD_KEY_ae=!volumedown # Fn+F7 + KEYBOARD_KEY_b0=!volumeup # Fn+F8 + KEYBOARD_KEY_97=!kbdillumdown # Fn+F9 keyboard backlight down + KEYBOARD_KEY_96=!kbdillumup # Fn+F10 keyboard backlight up + KEYBOARD_KEY_b3=!prog3 # Fn+F11 fan/cooling mode changer + +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*900X[34][AB]*:pvr* + KEYBOARD_KEY_ce=! # Fn+F8 keyboard backlight up + KEYBOARD_KEY_8d=! # Fn+F7 keyboard backlight down + KEYBOARD_KEY_96=! # Fn+F1 performance mode (?) + KEYBOARD_KEY_97=! # Fn+F12 Wi-Fi toggle + KEYBOARD_KEY_d5=! # Fn+F6 battery life extender + +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*90X3A*:pvr* + KEYBOARD_KEY_ce=!prog1 # Fn+F1 launch settings + KEYBOARD_KEY_8d=!prog3 # Fn+F6 performance mode + KEYBOARD_KEY_97=!kbdillumdown # Fn+F7 keyboard backlight down + KEYBOARD_KEY_96=!kbdillumup # Fn+F8 keyboard backlight up + KEYBOARD_KEY_d5=!wlan # Fn+F12 Wi-Fi toggle + +# Series 7 Ultra +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*7[34]0U3E*:pvr* + KEYBOARD_KEY_ce=!prog1 # Fn+F1 launch settings + KEYBOARD_KEY_97=!kbdillumdown # Fn+F9 keyboard backlight down + KEYBOARD_KEY_96=!kbdillumup # Fn+F10 keyboard backlight up + KEYBOARD_KEY_b3=!prog3 # Fn+F11 fan/cooling mode changer + KEYBOARD_KEY_d5=!wlan # Fn+F12 wlan/airplane switch + +# ATIV Book 6 / 8 +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*[68][78]0Z*:pvr* + KEYBOARD_KEY_ce=!prog1 # Fn+F1 launch settings + KEYBOARD_KEY_96=!kbdillumup # Fn+F10 keyboard backlight up + KEYBOARD_KEY_97=!kbdillumdown # Fn+F9 keyboard backlight down + +# SQ1US +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pnSQ1US:pvr* + KEYBOARD_KEY_d4=menu + KEYBOARD_KEY_d8=f1 + KEYBOARD_KEY_d9=f10 + KEYBOARD_KEY_d6=f3 + KEYBOARD_KEY_d7=f9 + KEYBOARD_KEY_e4=f5 + KEYBOARD_KEY_ee=f11 + +# SX20S +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*SX20S*:pvr* + KEYBOARD_KEY_74=mute + KEYBOARD_KEY_75=mute + KEYBOARD_KEY_77=f22 # Touchpad on + KEYBOARD_KEY_79=f23 # Touchpad off + +keyboard:dmi:bvn*:bvr*:bd*:svn[sS][aA][mM][sS][uU][nN][gG]*:pn*700T*:pvr* + KEYBOARD_KEY_ad=leftmeta + +########################################################### +# SONY +########################################################### + +# sony-laptop driver +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pn* + KEYBOARD_KEY_06=mute # Fn+F2 + KEYBOARD_KEY_07=volumedown # Fn+F3 + KEYBOARD_KEY_08=volumeup # Fn+F4 + KEYBOARD_KEY_09=brightnessdown # Fn+F5 + KEYBOARD_KEY_0a=brightnessup # Fn+F6 + KEYBOARD_KEY_0b=switchvideomode # Fn+F7 + KEYBOARD_KEY_0e=zoom # Fn+F10 + KEYBOARD_KEY_10=suspend # Fn+F12 + +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pn*PCG-C1*:pvr* +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pn*PCG-K25*:pvr* +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pn*PCG-F[1-6]*:pvr* +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pn*PCG-FX*:pvr* +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pn*PCG-FRV*:pvr* +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pn*PCG-GR*:pvr* +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pn*PCG-TR*:pvr* +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pn*PCG-NV*:pvr* +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pn*PCG-Z*:pvr* +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pn*VGN-S360*:pvr* + KEYBOARD_KEY_06=battery + KEYBOARD_KEY_07=mute + +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pnVGN-AR71*:pvr* +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pnVGN-FW*:pvr* +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pnVGN-Z21*:pvr* + KEYBOARD_KEY_00=brightnessdown # Fn+F5 + KEYBOARD_KEY_10=brightnessup # Fn+F6 + KEYBOARD_KEY_11=switchvideomode # Fn+F7 + KEYBOARD_KEY_12=zoomout + KEYBOARD_KEY_14=zoomin + KEYBOARD_KEY_15=suspend # Fn+F12 + KEYBOARD_KEY_17=prog1 + KEYBOARD_KEY_20=media + +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pnVGN-FW250*:pvr* + KEYBOARD_KEY_10=suspend # Fn+F12 + +keyboard:name:Sony Vaio Keys:dmi:bvn*:bvr*:bd*:svnSony*:pnVPC*:pvr* + KEYBOARD_KEY_05=f21 # Fn+F1 -> KEY_F21 (The actual touchpad toggle) + KEYBOARD_KEY_0d=zoomout # Fn+F9 + KEYBOARD_KEY_0e=zoomin # Fn+F10 + +########################################################### +# Toshiba +########################################################### + +# Satellite A100 +keyboard:dmi:bvn*:bvr*:bd*:svnTOSHIBA*:pnSATELLITE*A100:pvr* + KEYBOARD_KEY_a4=stopcd + KEYBOARD_KEY_b2=www + +# Satellite A110 +keyboard:dmi:bvn*:bvr*:bd*:svnTOSHIBA*:pnSatellite*A110:pvr* + KEYBOARD_KEY_92=stop + KEYBOARD_KEY_93=www + KEYBOARD_KEY_94=media + KEYBOARD_KEY_9e=f22 # Touchpad on + KEYBOARD_KEY_9f=f23 # Touchpad off + KEYBOARD_KEY_b9=nextsong + KEYBOARD_KEY_d9=brightnessup + KEYBOARD_KEY_ee=screenlock + KEYBOARD_KEY_f4=previoussong + KEYBOARD_KEY_f7=playpause + +# Satellite M30X +keyboard:dmi:bvn*:bvr*:bd*:svnTOSHIBA*:pnSatellite*M30X:pvr* + KEYBOARD_KEY_ef=brightnessdown + KEYBOARD_KEY_d9=brightnessup + KEYBOARD_KEY_ee=screenlock + KEYBOARD_KEY_93=media + KEYBOARD_KEY_9e=f22 # touchpad enable + KEYBOARD_KEY_9f=f23 # touchpad disable + +# Satellite P75-A +keyboard:dmi:bvn*:bvr*:bd*:svnTOSHIBA*:pnSatellite*P75-A:pvr* + KEYBOARD_KEY_ef=brightnessdown + KEYBOARD_KEY_ee=brightnessup + KEYBOARD_KEY_a9=switchvideomode # switch display outputs + KEYBOARD_KEY_d4=wlan # RF Switch Off + +# Satellite U940 +keyboard:name:Toshiba*input*device:dmi:bvn*:bvr*:bd*:svnTOSHIBA*:pnSATELLITEU940:pvr* + KEYBOARD_KEY_13c=brightnessdown + KEYBOARD_KEY_13d=brightnessup + KEYBOARD_KEY_13e=switchvideomode + KEYBOARD_KEY_13f=f21 # Touchpad toggle + +# Satellite P75-A7200 +keyboard:name:Toshiba*input*device:dmi:bvn*:bvr*:bd*:svnTOSHIBA*:pnSatellite*P75-A:pvr* + KEYBOARD_KEY_13c=brightnessdown + KEYBOARD_KEY_13d=brightnessup + KEYBOARD_KEY_13e=switchvideomode + KEYBOARD_KEY_13f=f21 # Touchpad toggle + KEYBOARD_KEY_9e=wlan + +########################################################### +# VIA +########################################################### + +keyboard:dmi:bvn*:bvr*:bd*:svnVIA:pnK8N800:pvr* + KEYBOARD_KEY_81=prog1 + +########################################################### +# Zepto +########################################################### + +# Znote +keyboard:dmi:bvn*:bvr*:bd*:svnZepto:pnZnote:* + KEYBOARD_KEY_93=switchvideomode # Fn+F3 Toggle Video Output + KEYBOARD_KEY_95=brightnessdown # Fn+F4 Brightness Down + KEYBOARD_KEY_91=brightnessup # Fn+F5 Brightness Up + KEYBOARD_KEY_a5=f23 # Fn+F6 Disable Touchpad + KEYBOARD_KEY_a6=f22 # Fn+F6 Enable Touchpad + KEYBOARD_KEY_a7=bluetooth # Fn+F10 Enable Bluetooth + KEYBOARD_KEY_a9=bluetooth # Fn+F10 Disable Bluetooth + KEYBOARD_KEY_f1=wlan # RF Switch Off + KEYBOARD_KEY_f2=wlan # RF Switch On + KEYBOARD_KEY_f4=prog1 # P1 Button + KEYBOARD_KEY_f3=prog2 # P2 Button + KEYBOARD_KEY_a0=! # mute + KEYBOARD_KEY_ae=! # volume down + KEYBOARD_KEY_b0=! # volume up + +# Znote 6615WD +keyboard:dmi:bvn*:bvr*:bd*:svnZepto:pnZnote*6615WD:* + KEYBOARD_KEY_a0=! # mute + KEYBOARD_KEY_ae=! # volume down + KEYBOARD_KEY_b0=! # volume up + +########################################################### +# Other +########################################################### + +# Common Volume Keys +keyboard:dmi:bvn*:bvr*:bd*:svnFUJITSU*SIEMENS:pnAMILO*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnFOXCONN:pnQBOOK:* +keyboard:dmi:bvn*:bvr*:bd*:svnMTC:pn*:pvrA0:* +keyboard:dmi:bvn*:bvr*:bd*:svnMio*Technology:pnN890:* +keyboard:dmi:bvn*:bvr*:bd*:svnPEGATRON*CORP.:pnSpring*Peak:* +keyboard:dmi:bvn*:bvr*:bd*:svnTOSHIBA:pnSatellite*[uU][35]0[05]*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnTOSHIBA:pnSATELLITE*[uU][35]0[05]*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnTOSHIBA:pnSatellite*Pro*[uU]300*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnTOSHIBA:pnEQUIUM [uU][35]0[05]*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnViooo*Corporation:pnPT17:* +keyboard:dmi:bvn*:bvr*:bd*:svnHANNspree:pnSN10E100:* +keyboard:dmi:bvn*:bvr*:bd*:svnGIGABYTE:pni1520M:* +keyboard:dmi:bvn*:bvr*:bd*:svnBenQ:pn*nScreen*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnBenQ:pnJoybook*Lite*:pvr* +keyboard:dmi:bvn*:bvr*:bd*:svnDIXONSP:pnDIXON*:pvr* + KEYBOARD_KEY_a0=! # mute + KEYBOARD_KEY_ae=! # volume down + KEYBOARD_KEY_b0=! # volume up diff -Nru systemd-204/debian/extra/README-etc-rules.d systemd-204/debian/extra/README-etc-rules.d --- systemd-204/debian/extra/README-etc-rules.d 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/extra/README-etc-rules.d 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,24 @@ +The files in this directory are read by udev(7) and used when events +are performed by the kernel. The udev daemon watches this directory +with inotify so that changes to these files are automatically picked +up, for this reason they must be files and not symlinks to another +location as in the case in Debian. + +Packages do not generally install rules here, this directory is for +local rules. If you want to override behaviour of package-supplied +rules, which can be found in /lib/udev/rules.d, you can do one of +two things: + + 1) Write your own rules in this directory that assign the name, + symlinks, permissions, etc. that you want. Pick a number higher + than the rules you want to override, and yours will be used. + + 2) Copy the file from /lib/udev/rules.d and edit it here; you + should generally only do this if you want to prevent a program + from being run. + + +If the ordering of files in this directory are not important to you, +it's recommended that you simply name your files "descriptive-name.rules" +such that they are processed AFTER all numbered rules in both this +directory and /lib/udev/rules.d and thus override anything set there. diff -Nru systemd-204/debian/extra/README-lib-rules.d systemd-204/debian/extra/README-lib-rules.d --- systemd-204/debian/extra/README-lib-rules.d 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/extra/README-lib-rules.d 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,40 @@ +The files in this directory are read by udev(7) and used when events +are performed by the kernel. The udev daemon watches this directory +with inotify so that changes to these files are automatically picked +up, for this reason they must be files and not symlinks to another +location as in the case in Debian. + +These are not conffiles. If you want to override the behaviour, you +can do one of two things: + + 1) Write your own rules in /etc/udev/rules.d that assign the name, + symlinks, permissions, etc. that you want. Pick a number higher + than the rules you want to override, and yours will be used. + + 2) Copy the file to /etc/udev/rules.d and edit it there; you + should generally only do this if you want to prevent a program + from being run. + + +Files should be named xx-descriptive-name.rules, the xx should be +chosen first according to the following sequence points: + + < 60 rules shipped in packages; these can be overriden by later or + default rules unless := is used in assignment. + + these cannot access persistent information such as that from + blkid + + < 70 rules that run helpers such as blkid to populate the udev db + + < 90 rules that run other programs (often using information in the + udev db) + + >=90 rules that should run last + +Common locations for package rules: + + 40-xx general rules, setting names and permissions + 65-xx rules to populate the udev db + 85-xx rules to run programs + diff -Nru systemd-204/debian/extra/dbus.service systemd-204/debian/extra/dbus.service --- systemd-204/debian/extra/dbus.service 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/extra/dbus.service 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,7 @@ +[Unit] +Description=D-Bus System Message Bus (deputy systemd dummy) + +[Service] +Type=oneshot +ExecStart=/bin/true +RemainAfterExit=true diff -Nru systemd-204/debian/extra/initramfs.bottom systemd-204/debian/extra/initramfs.bottom --- systemd-204/debian/extra/initramfs.bottom 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/initramfs.bottom 2017-01-05 12:30:27.000000000 +0000 @@ -11,13 +11,21 @@ ;; esac +# we cannot properly synthesize LVM LV change events with udevadm trigger, so +# if we use LVM, we need to let it finish; otherwise we get missing LV symlinks +# (LP #1185394) +if [ -x /sbin/vgchange ]; then + udevadm settle --timeout=121 || true +fi + # Stop udevd, we'll miss a few events while we run init, but we catch up -udevadm control --exit +udevadm control --timeout=121 --exit || \ + echo "udev exit failed -- rc=$?" # move the /dev tmpfs to the rootfs mount -n -o move /dev ${rootmnt}/dev # create a temporary symlink to the final /dev for other initramfs scripts -nuke /dev +rm -rf /dev ln -s ${rootmnt}/dev /dev diff -Nru systemd-204/debian/extra/initramfs.hook systemd-204/debian/extra/initramfs.hook --- systemd-204/debian/extra/initramfs.hook 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/initramfs.hook 2017-01-05 12:30:27.000000000 +0000 @@ -24,8 +24,11 @@ mkdir -p $DESTDIR/lib/systemd copy_exec /lib/systemd/systemd-udevd /lib/systemd -copy_exec /bin/udevadm /bin - +if [ -x /bin/udevadm.upgrade ]; then + copy_exec /bin/udevadm.upgrade /bin/udevadm +else + copy_exec /bin/udevadm +fi # copy compat symlink cp -a /sbin/udevadm $DESTDIR/sbin/udevadm diff -Nru systemd-204/debian/extra/initramfs.top systemd-204/debian/extra/initramfs.top --- systemd-204/debian/extra/initramfs.top 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/initramfs.top 2017-01-05 12:30:27.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -e -PREREQS="" +PREREQS="all_generic_ide blacklist" prereqs() { echo "$PREREQS"; } @@ -16,18 +16,6 @@ /lib/systemd/systemd-udevd --daemon --resolve-names=never udevadm trigger --action=add -udevadm settle || true - -if [ -d /sys/bus/scsi ]; then - modprobe -q scsi_wait_scan && modprobe -r scsi_wait_scan || true - udevadm settle || true -fi - -# If the rootdelay parameter has been set, we wait a bit for devices -# like usb/firewire disks to settle. -if [ "$ROOTDELAY" ]; then - sleep $ROOTDELAY -fi # Leave udev running to process events that come in out-of-band (like USB # connections) diff -Nru systemd-204/debian/extra/rules/40-hyperv-hotadd.rules systemd-204/debian/extra/rules/40-hyperv-hotadd.rules --- systemd-204/debian/extra/rules/40-hyperv-hotadd.rules 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/extra/rules/40-hyperv-hotadd.rules 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,11 @@ +# On Hyper-V Virtual Machines we want to add memory and cpus as soon as they appear +ATTR{[dmi/id]sys_vendor}!="Microsoft Corporation", GOTO="hyperv_hotadd_end" +ATTR{[dmi/id]product_name}!="Virtual Machine", GOTO="hyperv_hotadd_end" + +# Memory hotadd request +SUBSYSTEM=="memory", ACTION=="add", DEVPATH=="/devices/system/memory/memory[0-9]*", TEST=="state", ATTR{state}="online" + +# CPU hotadd request +SUBSYSTEM=="cpu", ACTION=="add", DEVPATH=="/devices/system/cpu/cpu[0-9]*", TEST=="online", ATTR{online}="1" + +LABEL="hyperv_hotadd_end" diff -Nru systemd-204/debian/extra/rules/50-udev-default.rules systemd-204/debian/extra/rules/50-udev-default.rules --- systemd-204/debian/extra/rules/50-udev-default.rules 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/rules/50-udev-default.rules 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -# virtio serial / console ports -KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" - -SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id" - -# RTC on some architectures -SUBSYSTEM=="rtc", DRIVERS=="rtc_cmos", SYMLINK+="rtc" - -# /dev/sndstat -SUBSYSTEM=="module", KERNEL=="snd", ACTION=="add", \ - RUN+="/bin/ln -sf /proc/asound/oss/sndstat $root/sndstat" - diff -Nru systemd-204/debian/extra/rules/60-persistent-storage-tape.rules systemd-204/debian/extra/rules/60-persistent-storage-tape.rules --- systemd-204/debian/extra/rules/60-persistent-storage-tape.rules 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/rules/60-persistent-storage-tape.rules 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -# This file contains the rules needed to create persistent device names. - -# we are only interested in add and change actions for block devices -ACTION=="remove", GOTO="persistent_storage_tape_end" - -# "Medium Changers" -SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", \ - IMPORT{program}="scsi_id --export --sg-version=3 --whitelisted --device=$tempnode" - -KERNEL=="sg[0-9]*", ATTRS{type}=="8", ENV{ID_SERIAL}=="?*", \ - SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}" - -SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end" - -KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", \ - ENV{ID_BUS}="ieee1394", ENV{ID_SERIAL}="$attr{ieee1394_id}" -KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \ - SUBSYSTEMS=="usb", \ - IMPORT{builtin}="usb_id" - -KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \ - SUBSYSTEMS=="scsi", KERNELS=="[0-9]*:*[0-9]", \ - ENV{.BSG_DEV}="$root/bsg/$id" -KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \ - WAIT_FOR="$env{.BSG_DEV}", \ - ENV{ID_BUS}="scsi", \ - IMPORT{program}="scsi_id --export --device=$env{.BSG_DEV}" - -KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}=="?*", \ - SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}" - -KERNEL=="st*[0-9]|nst*[0-9]", \ - IMPORT{builtin}="path_id" -KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", \ - SYMLINK+="tape/by-path/$env{ID_PATH}" -KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", \ - SYMLINK+="tape/by-path/$env{ID_PATH}-nst" - -# end of processing -LABEL="persistent_storage_tape_end" - diff -Nru systemd-204/debian/extra/rules/60-persistent-storage.rules systemd-204/debian/extra/rules/60-persistent-storage.rules --- systemd-204/debian/extra/rules/60-persistent-storage.rules 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/rules/60-persistent-storage.rules 1970-01-01 00:00:00.000000000 +0000 @@ -1,163 +0,0 @@ -# This file contains the rules needed to create persistent device names. - -# forward scsi device events to the corresponding block device -ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", \ - TEST=="block", ATTR{block/*/uevent}="change" - -ACTION=="remove", GOTO="persistent_storage_end" - -# enable in-kernel media-presence polling -ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", \ - ATTR{parameters/events_dfl_poll_msecs}=="0", \ - ATTR{parameters/events_dfl_poll_msecs}="2000" - -SUBSYSTEM!="block", GOTO="persistent_storage_end" - -# and we can safely ignore these kinds of devices -KERNEL=="fd[0-9]*|mtd[0-9]*|mtdblock[0-9]*|nbd[0-9]*|gnbd[0-9]*|dm-[0-9]*|md[0-9]*|btibm[0-9]*", \ - GOTO="persistent_storage_end" - -# skip removable ide devices, because open(2) on them causes an events loop -KERNEL=="hd*[!0-9]", ATTR{removable}=="1", \ - SUBSYSTEMS=="ide", ATTRS{media}=="disk|floppy", \ - GOTO="persistent_storage_end" -KERNEL=="hd*[0-9]", ATTRS{removable}=="1", \ - GOTO="persistent_storage_end" - -# ignore partitions that span the entire disk -TEST=="whole_disk", GOTO="persistent_storage_end" - -# partitions do not have hardware identificators -ENV{DEVTYPE}!="disk", GOTO="persistent_storage_not_a_disk" - -# look for different kinds of unique identificators -KERNEL=="hd*", \ - IMPORT{program}="ata_id --export $tempnode" - -KERNEL=="mmcblk[0-9]", ATTRS{name}=="?*", ATTRS{serial}=="?*", \ - ENV{ID_BUS}="memstick", ENV{ID_SERIAL}="$attr{name}_$attr{serial}" -KERNEL=="mspblk[0-9]", ATTRS{name}=="?*", ATTRS{serial}=="?*", \ - ENV{ID_BUS}="mmc", ENV{ID_SERIAL}="$attr{name}_$attr{serial}" - -KERNEL=="sd*|sr*", ATTRS{ieee1394_id}=="?*", \ - ENV{ID_BUS}="ieee1394", ENV{ID_SERIAL}="$attr{ieee1394_id}" - -KERNEL=="vd*", ATTRS{serial}=="?*", \ - ENV{ID_BUS}="virtio", ENV{ID_SERIAL}="$attr{serial}" - -# ATA devices with their own "ata" kernel subsystem -KERNEL=="sd*|sr*", ENV{ID_SERIAL}!="?*", \ - SUBSYSTEMS=="ata", \ - IMPORT{program}="ata_id --export $tempnode" -# ATA devices using the "scsi" subsystem -KERNEL=="sd*|sr*", ENV{ID_SERIAL}!="?*", \ - SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", \ - IMPORT{program}="ata_id --export $tempnode" -# ATA/ATAPI devices (SPC-3 or later) using the "scsi" subsystem -KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", \ - SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", \ - IMPORT{program}="ata_id --export $tempnode" - -# Run ata_id on non-removable USB Mass Storage (SATA/PATA disks in enclosures) -KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", \ - SUBSYSTEMS=="usb", ATTR{removable}=="0", \ - IMPORT{program}="ata_id --export $tempnode" -# Otherwise fall back to using usb_id for USB devices -KERNEL=="sd*|sr*", ENV{ID_SERIAL}!="?*", \ - SUBSYSTEMS=="usb", \ - IMPORT{builtin}="usb_id" - -# scsi devices -KERNEL=="sd*|sr*", ENV{ID_SERIAL}!="?*", \ - ENV{ID_BUS}="scsi", \ - IMPORT{program}="scsi_id --export --whitelisted --device=$tempnode" - -KERNEL=="cciss*", ENV{ID_SERIAL}!="?*", \ - ENV{ID_BUS}="cciss", \ - IMPORT{program}="scsi_id --export --whitelisted --device=$tempnode" - -KERNEL=="dasd*", \ - IMPORT{program}="dasd_id --export $tempnode" - -# scsi compat links for ATA devices -KERNEL=="sd*", ENV{ID_BUS}=="ata", \ - PROGRAM="scsi_id --whitelisted --replace-whitespace -p0x80 -d$tempnode", \ - RESULT=="?*", ENV{ID_SCSI_COMPAT}="$result" - -# find the physical path of the device -ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", \ - IMPORT{builtin}="path_id" - -LABEL="persistent_storage_not_a_disk" - -# import the variables of partitions from the parent disks -ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*" - -# by-id (hardware serial number) -KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", \ - SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}" -KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", \ - SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}-part%n" - -KERNEL=="sd*[!0-9]", ENV{ID_SCSI_COMPAT}=="?*", \ - SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}" -KERNEL=="sd*[0-9]", ENV{ID_SCSI_COMPAT}=="?*", \ - SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}-part%n" - -ENV{DEVTYPE}=="disk", ENV{ID_BUS}=="?*", ENV{ID_SERIAL}=="?*", \ - SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" -ENV{DEVTYPE}=="partition", ENV{ID_BUS}=="?*", ENV{ID_SERIAL}=="?*", \ - SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" - -ENV{DEVTYPE}=="disk", ENV{ID_EDD}=="?*", \ - SYMLINK+="disk/by-id/edd-$env{ID_EDD}" -ENV{DEVTYPE}=="partition", ENV{ID_EDD}=="?*", \ - SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n" - -ENV{DEVTYPE}=="disk", ENV{ID_WWN_WITH_EXTENSION}=="?*", \ - SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}" -ENV{DEVTYPE}=="partition", ENV{ID_WWN_WITH_EXTENSION}=="?*", \ - SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}-part%n" - -# by-partlabel/by-partuuid links (partition metadata) -ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_UUID}=="?*", \ - SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}" -ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", \ - SYMLINK+="disk/by-partlabel/$env{ID_PART_ENTRY_NAME}" - -# by-path (parent device path) -ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", \ - SYMLINK+="disk/by-path/$env{ID_PATH}" -ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", \ - SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" - -# skip unpartitioned removable media devices from drivers which do not send -# "change" events -ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", \ - GOTO="persistent_storage_end" - -# probe filesystem metadata of optical drives which have a media inserted -KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", \ - ENV{DISK_EJECT_REQUEST}!="?*", \ - ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", \ - IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" -# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET -KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", \ - ENV{DISK_EJECT_REQUEST}!="?*", \ - ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \ - IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" - -# probe filesystem metadata of disks -KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" - -# watch metadata changes by tools closing the device after writing -KERNEL!="sr*", OPTIONS+="watch" - -# by-label/by-uuid links (filesystem metadata) -ENV{ID_FS_UUID_ENC}=="?*", ENV{ID_FS_USAGE}=="filesystem|other|crypto", \ - SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -ENV{ID_FS_LABEL_ENC}=="?*", ENV{ID_FS_USAGE}=="filesystem|other", \ - SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" - -LABEL="persistent_storage_end" - diff -Nru systemd-204/debian/extra/rules/62-google-cloudimg.rules systemd-204/debian/extra/rules/62-google-cloudimg.rules --- systemd-204/debian/extra/rules/62-google-cloudimg.rules 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/extra/rules/62-google-cloudimg.rules 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,3 @@ +# Use NOOP as the default scheduler on Google clouds for better performance +SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_VENDOR}=="*Google*", ENV{ID_PATH}=="*virtio-pci*", ATTR{queue/scheduler}="noop" + diff -Nru systemd-204/debian/extra/rules/73-idrac.rules systemd-204/debian/extra/rules/73-idrac.rules --- systemd-204/debian/extra/rules/73-idrac.rules 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/extra/rules/73-idrac.rules 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,4 @@ +# On Dell PowerEdge systems, the iDRAC7 and later support a USB Virtual NIC +# which terminates in the iDRAC. Help identify this with 'idrac' +ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb", ATTRS{idVendor}=="413c", ATTRS{idProduct}=="a102", NAME="idrac" + diff -Nru systemd-204/debian/extra/rules/75-cd-aliases-generator.rules systemd-204/debian/extra/rules/75-cd-aliases-generator.rules --- systemd-204/debian/extra/rules/75-cd-aliases-generator.rules 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/rules/75-cd-aliases-generator.rules 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -# These rules generate rules for the /dev/{cdrom,dvd,...} symlinks and -# write them to /etc/udev/rules.d/70-persistent-cd.rules. - -ACTION=="add", SUBSYSTEM=="block", ENV{GENERATED}!="?*", ENV{ID_CDROM}=="?*", \ - SUBSYSTEMS!="usb|ieee1394", \ - PROGRAM="write_cd_rules", SYMLINK+="$result" - -ACTION=="add", SUBSYSTEM=="block", ENV{GENERATED}!="?*", ENV{ID_CDROM}=="?*", \ - SUBSYSTEMS=="usb|ieee1394", \ - PROGRAM="write_cd_rules by-id", SYMLINK+="$result" - diff -Nru systemd-204/debian/extra/rules/75-persistent-net-generator.rules systemd-204/debian/extra/rules/75-persistent-net-generator.rules --- systemd-204/debian/extra/rules/75-persistent-net-generator.rules 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/rules/75-persistent-net-generator.rules 2017-01-05 12:30:27.000000000 +0000 @@ -67,6 +67,9 @@ ENV{MATCHADDR}=="52:54:ab:*", GOTO="globally_administered_whitelist" # Kingston Technologies ENV{MATCHADDR}=="e2:0c:0f:*", GOTO="globally_administered_whitelist" +# Ravello Systems +ENV{MATCHADDR}=="2c:c2:60:*", GOTO="globally_administered_whitelist" + # ignore interfaces with locally administered or null MAC addresses # and VMWare, Hyper-V, KVM, Virtualbox and Xen virtual interfaces @@ -79,10 +82,26 @@ ENV{MATCHADDR}=="08:00:27:*", ENV{MATCHADDR}="" ENV{MATCHADDR}=="00:16:3e:*", ENV{MATCHADDR}="" +# ignore Windows Azure Hyper-V virtual interfaces +ENV{MATCHADDR}=="00:03:ff:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="00:0d:3a:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="00:1d:d8:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="00:12:5a:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="00:17:fa:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="00:22:48:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="00:50:f2:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="28:18:78:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="50:1a:c5:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="60:45:bd:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="7c:1e:52:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="7c:ed:8d:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="dc:b4:c4:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="00:25:ae:*", ENV{MATCHADDR}="" + LABEL="globally_administered_whitelist" # ibmveth interfaces have stable locally administered MAC addresses -SUBSYSTEMS=="ibmveth", ENV{MATCHADDR}="$attr{address}" +DRIVERS=="ibmveth", ENV{MATCHADDR}="$attr{address}" # S/390 interfaces are matched only by id SUBSYSTEMS=="ccwgroup", \ @@ -103,7 +122,7 @@ ENV{COMMENT}="USB device 0x$attr{idVendor}:0x$attr{idProduct}" SUBSYSTEMS=="ccwgroup", \ ENV{COMMENT}="S/390 device at $id" -SUBSYSTEMS=="ibmveth", \ +DRIVERS=="ibmveth", \ ENV{COMMENT}="LPAR virtual device at $id" SUBSYSTEMS=="ieee1394", \ ENV{COMMENT}="Firewire device $attr{host_id}" diff -Nru systemd-204/debian/extra/rules/78-graphics-card.rules systemd-204/debian/extra/rules/78-graphics-card.rules --- systemd-204/debian/extra/rules/78-graphics-card.rules 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/extra/rules/78-graphics-card.rules 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,30 @@ +# do not edit this file, it will be overwritten on update + +ACTION!="add", GOTO="graphics_end" + +# Tag the drm device for KMS-supporting drivers as the primary device for +# the display; for non-KMS drivers tag the framebuffer device instead. + +SUBSYSTEM!="drm", GOTO="drm_end" +KERNEL!="card[0-9]*", GOTO="drm_end" +ENV{DEVTYPE}!="drm_minor", GOTO="drm_end" + +DRIVERS=="i915", ENV{PRIMARY_DEVICE_FOR_DISPLAY}="1" +DRIVERS=="radeon", ENV{PRIMARY_DEVICE_FOR_DISPLAY}="1" +DRIVERS=="nouveau", ENV{PRIMARY_DEVICE_FOR_DISPLAY}="1" +DRIVERS=="vmwgfx", ENV{PRIMARY_DEVICE_FOR_DISPLAY}="1" + +LABEL="drm_end" + +SUBSYSTEM!="graphics", GOTO="graphics_end" + +DRIVERS=="i915", GOTO="graphics_end" +DRIVERS=="radeon", GOTO="graphics_end" +DRIVERS=="nouveau", GOTO="graphics_end" +DRIVERS=="efifb", GOTO="graphics_end" +DRIVERS=="efi-framebuffer", GOTO="graphics_end" +DRIVERS=="vesa-framebuffer", GOTO="graphics_end" + +KERNEL=="fb[0-9]*", ENV{PRIMARY_DEVICE_FOR_DISPLAY}="1" + +LABEL="graphics_end" diff -Nru systemd-204/debian/extra/rules/80-drivers.rules systemd-204/debian/extra/rules/80-drivers.rules --- systemd-204/debian/extra/rules/80-drivers.rules 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/rules/80-drivers.rules 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -ACTION=="remove", GOTO="drivers_end" - -# check if the device has already been claimed by a driver -ENV{DRIVER}=="?*", SUBSYSTEM!="input", GOTO="hotplug_driver_loaded" - -# load the drivers -ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -b $env{MODALIAS}" - -SUBSYSTEM=="pcmcia_socket", RUN+="/sbin/modprobe -b pcmcia" - -# rules for subsystems which lack proper hotplug support -SUBSYSTEM=="i2o", RUN+="/sbin/modprobe -b i2o_block" -SUBSYSTEM=="memstick", RUN+="/sbin/modprobe -b --all ms_block mspro_block" -SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", \ - RUN+="/sbin/modprobe -b tifm_sd" -SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", \ - RUN+="/sbin/modprobe -b tifm_ms" - -SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", \ - RUN+="/sbin/modprobe -b sg" - -# Load VIO modules based on the device type -SUBSYSTEM!="vio", GOTO="hotplug_vio_end" -ENV{MODALIAS}=="?*", GOTO="hotplug_vio_end" -ENV{VIO_TYPE}!="?*", IMPORT{program}="vio_type --export $devpath" -ENV{VIO_TYPE}=="serial", RUN+="/sbin/modprobe -b hvc_console" -ENV{VIO_TYPE}=="serial-server", RUN+="/sbin/modprobe -b hvcs" -ENV{VIO_TYPE}=="network", RUN+="/sbin/modprobe -b ibmveth" -ENV{VIO_TYPE}=="vscsi", RUN+="/sbin/modprobe -b ibmvscsic" -ENV{VIO_TYPE}=="vlan", RUN+="/sbin/modprobe -b iseries_veth" -ENV{VIO_TYPE}=="viodasd", RUN+="/sbin/modprobe -b viodasd" -ENV{VIO_TYPE}=="viocd", RUN+="/sbin/modprobe -b viocd" -ENV{VIO_TYPE}=="vnet", RUN+="/sbin/modprobe -b sunvnet" -ENV{VIO_TYPE}=="vdisk", RUN+="/sbin/modprobe -b sunvdc" -LABEL="hotplug_vio_end" - -# From here on follows the hotplug agents which do not load modules -LABEL="hotplug_driver_loaded" - -LABEL="drivers_end" - -# Log every event to /dev/hotplug.log (for debugging). -#SUBSYSTEM!="uids", RUN+="logger.agent" - diff -Nru systemd-204/debian/extra/rules/80-networking.rules systemd-204/debian/extra/rules/80-networking.rules --- systemd-204/debian/extra/rules/80-networking.rules 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/rules/80-networking.rules 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -SUBSYSTEM=="net", RUN+="net.agent" - -SUBSYSTEM=="atm", RUN+="dsl-modem.agent" - diff -Nru systemd-204/debian/extra/rules/91-permissions.rules systemd-204/debian/extra/rules/91-permissions.rules --- systemd-204/debian/extra/rules/91-permissions.rules 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/rules/91-permissions.rules 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -ACTION=="remove", GOTO="permissions_end" - -# default permissions for block devices -SUBSYSTEM=="block", GROUP="disk" -SUBSYSTEM=="block", ATTRS{removable}=="1", GROUP="floppy" -# the aacraid driver is broken and reports the disks as removable (see #404927) -SUBSYSTEM=="block", DRIVERS=="aacraid", GROUP="disk" -# all block devices on these buses are "removable" -SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy" - -KERNEL=="cbm", GROUP="floppy" - -# IDE devices -ENV{ID_CDROM}=="?*", GROUP="cdrom" -KERNEL=="ht[0-9]*", GROUP="tape" -KERNEL=="nht[0-9]*", GROUP="tape" - -# SCSI devices -SUBSYSTEM=="scsi_generic|scsi_tape", \ -SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape" -SUBSYSTEM=="scsi_generic", \ -SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom" - -# USB devices -KERNEL=="legousbtower*", MODE="0666" -KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb", GROUP="lp" -# hplip and cups 1.4+ use raw USB devices, so permissions should be similar to -# the ones from the old usblp kernel module -SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \ - ENV{ID_USB_INTERFACES}=="", IMPORT{builtin}="usb_id" -SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \ - ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp" - -# usbfs-like devices -SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \ - MODE="0664" - -# serial devices -SUBSYSTEM=="tty", GROUP="dialout" -SUBSYSTEM=="capi", GROUP="dialout" -SUBSYSTEM=="slamr", GROUP="dialout" -SUBSYSTEM=="zaptel", GROUP="dialout" -KERNEL=="mISDNtimer", GROUP="dialout" -KERNEL=="mwave", GROUP="dialout" -KERNEL=="hvc*|hvsi*", GROUP="dialout" - -# vc devices (all members of the tty subsystem) -KERNEL=="ptmx", MODE="0666", GROUP="root" -KERNEL=="console", MODE="0600", GROUP="root" -KERNEL=="tty", MODE="0666", GROUP="root" -KERNEL=="tty[0-9]*", GROUP="root" -KERNEL=="pty*", MODE="0666", GROUP="tty" - -# video devices -SUBSYSTEM=="video4linux", GROUP="video" -SUBSYSTEM=="drm", GROUP="video" -SUBSYSTEM=="dvb", GROUP="video" -SUBSYSTEM=="em8300", GROUP="video" -SUBSYSTEM=="graphics", GROUP="video" -SUBSYSTEM=="nvidia", GROUP="video" - -# misc devices -KERNEL=="random", MODE="0666" -KERNEL=="urandom", MODE="0666" -KERNEL=="mem", MODE="0640", GROUP="kmem" -KERNEL=="kmem", MODE="0640", GROUP="kmem" -KERNEL=="port", MODE="0640", GROUP="kmem" -KERNEL=="nvram", MODE="0640", GROUP="kmem" -KERNEL=="full", MODE="0666" -KERNEL=="null", MODE="0666" -KERNEL=="zero", MODE="0666" -KERNEL=="inotify", MODE="0666" -KERNEL=="sonypi", MODE="0666" -KERNEL=="cpu[0-9]*", MODE="0444" -KERNEL=="agpgart", GROUP="video" -KERNEL=="pmu", GROUP="video" -KERNEL=="kqemu", MODE="0666" -KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun" -KERNEL=="rfkill", MODE="0644" - -KERNEL=="cdemu[0-9]*", GROUP="cdrom" -KERNEL=="pktcdvd[0-9]*", GROUP="cdrom" -KERNEL=="pktcdvd", MODE="0644" - -# printers and parallel devices -SUBSYSTEM=="printer", GROUP="lp" -SUBSYSTEM=="ppdev", GROUP="lp" -KERNEL=="irlpt[0-9]*", GROUP="lp" -KERNEL=="pt[0-9]*", GROUP="tape" -KERNEL=="pht[0-9]*", GROUP="tape" - -# sound devices -SUBSYSTEM=="sound", GROUP="audio", - OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer" - -# ieee1394 devices -SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", GROUP="video" -SUBSYSTEM=="firewire", ATTR{units}=="*0x00b09d:0x00010*", GROUP="video" -SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video" -SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", GROUP="video" -KERNEL=="raw1394", GROUP="disk" -KERNEL=="dv1394-[0-9]*", GROUP="video" -KERNEL=="video1394-[0-9]*", GROUP="video" - -# input devices -KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *" \ - MODE="0664", GROUP="video" -KERNEL=="js[0-9]*", MODE="0664" -KERNEL=="event[0-9]*", ENV{ID_CLASS}=="joystick", \ - MODE="0664", GROUP="audio" -KERNEL=="lirc[0-9]*", GROUP="video" - -KERNEL=="mmtimer", MODE="0644" -KERNEL=="sgi_*", MODE="0666" -KERNEL=="z90crypt", MODE="0666" -KERNEL=="iseries/ibmsis*", GROUP="disk" -KERNEL=="iseries/nvt*", GROUP="disk" -KERNEL=="iseries/vt*", GROUP="disk" -KERNEL=="iseries/vtty*", GROUP="dialout" - -# AOE character devices -SUBSYSTEM=="aoe", MODE="0220", GROUP="disk" -SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440", GROUP="disk" - -LABEL="permissions_end" - diff -Nru systemd-204/debian/extra/udev.py systemd-204/debian/extra/udev.py --- systemd-204/debian/extra/udev.py 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/extra/udev.py 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,19 @@ +'''apport package hook for udev + +(c) 2009 Canonical Ltd. +Author: Martin Pitt +''' + +import os +import apport.hookutils + +def add_info(report): + apport.hookutils.attach_hardware(report) + + user_rules = [] + for f in os.listdir('/etc/udev/rules.d'): + if not f.startswith('70-persistent-') and f != 'README': + user_rules.append(f) + + if user_rules: + report['CustomUdevRuleFiles'] = ' '.join(user_rules) diff -Nru systemd-204/debian/extra/udev.startup systemd-204/debian/extra/udev.startup --- systemd-204/debian/extra/udev.startup 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/udev.startup 2017-01-05 12:30:27.000000000 +0000 @@ -1,31 +1,17 @@ #!/bin/sh -e -make_extra_nodes() { - [ -e /etc/udev/links.conf ] || return 0 - grep '^[^#]' /etc/udev/links.conf | \ - while read type name arg1; do - [ "$type" -a "$name" -a ! -e "/dev/$name" -a ! -L "/dev/$name" ] ||continue - case "$type" in - L) ln -s $arg1 /dev/$name ;; - D) mkdir -p /dev/$name ;; - M) mknod -m 600 /dev/$name $arg1 ;; - *) echo "links.conf: unparseable line ($type $name $arg1)" ;; - esac - done -} - echo > /sys/kernel/uevent_helper if ! grep -E -q "^[^[:space:]]+ /dev devtmpfs" /proc/mounts; then mount -n -o mode=0755 -t devtmpfs devtmpfs /dev fi -make_extra_nodes /lib/systemd/systemd-udevd --daemon --resolve-names=never udevadm trigger --action=add -mount /dev/pts +mkdir -p /dev/pts +mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts udevadm settle || true diff -Nru systemd-204/debian/extra/write_net_rules systemd-204/debian/extra/write_net_rules --- systemd-204/debian/extra/write_net_rules 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/extra/write_net_rules 2017-01-05 12:30:27.000000000 +0000 @@ -117,6 +117,17 @@ basename=${INTERFACE%%[0-9]*} match="$match, KERNEL==\"$basename*\"" +# build a regular expression that matches the new rule that we want to write +new_rule_pattern=$(echo "^SUBSYSTEM==\"net\", ACTION==\"add\"$match" | sed -re 's/([\?\*\{\}])/\\\1/g') + +# Double check if the new rule has already been written. This happens if +# multiple add events are generated before the script returns and udevd +# renames the interfaces. See #765577 for details. +if egrep -qs "$new_rule_pattern" $RO_RULES_FILE $RULES_FILE; then + unlock_rules_file + exit 0 +fi + if [ "$INTERFACE_NAME" ]; then # external tools may request a custom name COMMENT="$COMMENT (custom name provided by external tool)" diff -Nru systemd-204/debian/libpam-systemd.postinst systemd-204/debian/libpam-systemd.postinst --- systemd-204/debian/libpam-systemd.postinst 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/libpam-systemd.postinst 2017-01-05 12:30:27.000000000 +0000 @@ -4,4 +4,11 @@ pam-auth-update --package +# upgrading from pre-204 needs a reboot due to changed cgroup layout, +# restarting logind after the upgrade would lose all existing sessions +if dpkg --compare-versions "$2" lt-nl 204 && + [ -x /usr/share/update-notifier/notify-reboot-required ]; then + /usr/share/update-notifier/notify-reboot-required +fi + #DEBHELPER# diff -Nru systemd-204/debian/libpam-systemd.prerm systemd-204/debian/libpam-systemd.prerm --- systemd-204/debian/libpam-systemd.prerm 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/libpam-systemd.prerm 2017-01-05 12:30:27.000000000 +0000 @@ -13,7 +13,7 @@ # # This may need to change later as pam-auth-update evolves. -if [ "$1" = "remove" ] ; then +if [ "$1" = remove ] && [ "${DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT:-1}" = 1 ]; then pam-auth-update --package --remove systemd fi diff -Nru systemd-204/debian/libpam-systemd.systemd-logind.upstart systemd-204/debian/libpam-systemd.systemd-logind.upstart --- systemd-204/debian/libpam-systemd.systemd-logind.upstart 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/libpam-systemd.systemd-logind.upstart 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,35 @@ +description "SystemD login management service" + +start on started dbus +stop on stopping dbus + +respawn + +env SYSTEMD_LOG_TARGET=syslog + +pre-start script + # only start if PAM module is actually available, not if libpam-systemd is + # removed but not purged + ls /lib/*/security/pam_systemd.so >/dev/null 2>&1 || { stop; exit 0; } + + # this is being done by systemd or mountall usually, but not during + # upgrades from earlier distro releases + if ! mountpoint -q /sys/fs/cgroup; then + mount -t tmpfs -o uid=0,gid=0,mode=0755,size=1024 none /sys/fs/cgroup + fi + mkdir -p /run/systemd + # mounting the cgroup does not work in LXC, there it uses cgmanager + if [ ! -e /run/container_type ] && ! mountpoint -q /sys/fs/cgroup/systemd; then + mkdir -p /sys/fs/cgroup/systemd + mount -t cgroup -o nosuid,noexec,nodev,none,name=systemd systemd /sys/fs/cgroup/systemd + fi +end script + +script + # Don't use the limit stanza as failure to set the limit (unprivileged + # containers for example) causes a complete failure to start the job. + ulimit -S -n 16384 || true + ulimit -H -n 16384 || true + + exec /lib/systemd/systemd-logind +end script diff -Nru systemd-204/debian/patches/0001-libudev-util-change-util_replace_whitespace-to-retur.patch systemd-204/debian/patches/0001-libudev-util-change-util_replace_whitespace-to-retur.patch --- systemd-204/debian/patches/0001-libudev-util-change-util_replace_whitespace-to-retur.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/0001-libudev-util-change-util_replace_whitespace-to-retur.patch 2017-02-01 10:46:13.000000000 +0000 @@ -0,0 +1,34 @@ +From bdc0610f8dee34073201242b917c2f3f84e20dd2 Mon Sep 17 00:00:00 2001 +From: Dan Streetman +Date: Tue, 3 Jan 2017 14:31:45 -0500 +Subject: [PATCH 1/3] libudev-util: change util_replace_whitespace to return + number of chars in dest + +Instead of returning 0, which is unhelpful, return the number of chars +copied into the dest string. This allows callers that care about that +to easily use it, instead of having to calculate the strlen. + +No current users of the function check the return value, so this does not +break any existing code; it is used in the following patch. + +Part of LP: #1647485 +--- + src/libudev/libudev-util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c +index 714dc50..9799ab0 100644 +--- a/src/libudev/libudev-util.c ++++ b/src/libudev/libudev-util.c +@@ -454,7 +454,7 @@ int util_replace_whitespace(const char *str, char *to, size_t len) + to[j++] = str[i++]; + } + to[j] = '\0'; +- return 0; ++ return j; + } + + static int is_whitelisted(char c, const char *white) +-- +2.7.4 + diff -Nru systemd-204/debian/patches/0001-udev-build-by-path-identifiers-for-ATA-devices.patch systemd-204/debian/patches/0001-udev-build-by-path-identifiers-for-ATA-devices.patch --- systemd-204/debian/patches/0001-udev-build-by-path-identifiers-for-ATA-devices.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/0001-udev-build-by-path-identifiers-for-ATA-devices.patch 2018-11-09 15:14:09.000000000 +0000 @@ -0,0 +1,68 @@ +From: David Milburn +Subject: [PATCH] udev: build by-path identifiers for ATA devices. +Origin: upstream, https://github.com/systemd/systemd/commit/ba86822db70d9ffd02ad78cd02b237ff8c569c7a +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1802525 + +--- a/src/udev/udev-builtin-path_id.c ++++ b/src/udev/udev-builtin-path_id.c +@@ -217,6 +217,39 @@ + return parent; + } + ++static struct udev_device *handle_scsi_ata(struct udev_device *parent, char **path) { ++ struct udev *udev = udev_device_get_udev(parent); ++ struct udev_device *targetdev; ++ struct udev_device *target_parent; ++ struct udev_device *atadev; ++ const char *port_no; ++ ++ assert(parent); ++ assert(path); ++ ++ targetdev = udev_device_get_parent_with_subsystem_devtype(parent, "scsi", "scsi_host"); ++ if (!targetdev) ++ return NULL; ++ ++ target_parent = udev_device_get_parent(targetdev); ++ if (!target_parent) ++ return NULL; ++ ++ atadev = udev_device_new_from_subsystem_sysname(udev, "ata_port", udev_device_get_sysname(target_parent)); ++ if (!atadev) ++ return NULL; ++ ++ port_no = udev_device_get_sysattr_value(atadev, "port_no"); ++ if (!port_no) { ++ parent = NULL; ++ goto out; ++ } ++ path_prepend(path, "ata-%s", port_no); ++out: ++ udev_device_unref(atadev); ++ return parent; ++} ++ + static struct udev_device *handle_scsi_default(struct udev_device *parent, char **path) + { + struct udev_device *hostdev; +@@ -374,19 +407,8 @@ + goto out; + } + +- /* +- * We do not support the ATA transport class, it uses global counters +- * to name the ata devices which numbers spread across multiple +- * controllers. +- * +- * The real link numbers are not exported. Also, possible chains of ports +- * behind port multipliers cannot be composed that way. +- * +- * Until all that is solved at the kernel level, there are no by-path/ +- * links for ATA devices. +- */ + if (strstr(name, "/ata") != NULL) { +- parent = NULL; ++ parent = handle_scsi_ata(parent, path); + goto out; + } + diff -Nru systemd-204/debian/patches/0002-udev-event-add-replace_whitespace-param-to-udev_even.patch systemd-204/debian/patches/0002-udev-event-add-replace_whitespace-param-to-udev_even.patch --- systemd-204/debian/patches/0002-udev-event-add-replace_whitespace-param-to-udev_even.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/0002-udev-event-add-replace_whitespace-param-to-udev_even.patch 2017-02-01 10:46:13.000000000 +0000 @@ -0,0 +1,300 @@ +From 1a9e0d7de659efb5ae453468e20e598f00c7f616 Mon Sep 17 00:00:00 2001 +From: Dan Streetman +Date: Tue, 3 Jan 2017 14:37:59 -0500 +Subject: [PATCH 2/3] udev-event: add replace_whitespace param to + udev_event_apply_format + +If replace_whitespace is true, each substitution value has all its +whitespace removed/replaced by util_replace_whitespace (except the +SUBST_RESULT substitution - $result{} or %c{} - which handles spaces +itself as field separators). All existing callers are updated to +pass false, so no functional change is made by this patch. + +This is needed so the SYMLINK assignment can replace any spaces +introduced through variable substitution, becuase the SYMLINK value is +a space-separated list of symlinks to create. Any variables that +contain spaces will thus unexpectedly change the symlink value from +a single symlink to multiple incorrectly-named symlinks. + +This is used in the next patch, which enables the whitespace +replacement for SYMLINK variable substitution. + +Part of LP: #1647485 +--- + src/udev/udev-event.c | 42 ++++++++++++++++++++++++++++++++++++------ + src/udev/udev-rules.c | 34 +++++++++++++++++----------------- + src/udev/udev.h | 4 +++- + src/udev/udevadm-test.c | 2 +- + 4 files changed, 57 insertions(+), 25 deletions(-) + +diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c +index 3db2cb7..7fe44bb 100644 +--- a/src/udev/udev-event.c ++++ b/src/udev/udev-event.c +@@ -63,8 +63,9 @@ void udev_event_unref(struct udev_event *event) + free(event); + } + +-size_t udev_event_apply_format(struct udev_event *event, const char *src, char *dest, size_t size) +-{ ++size_t udev_event_apply_format(struct udev_event *event, ++ const char *src, char *dest, size_t size, ++ bool replace_whitespace) { + struct udev_device *dev = event->dev; + enum subst_type { + SUBST_UNKNOWN, +@@ -119,8 +120,10 @@ size_t udev_event_apply_format(struct udev_event *event, const char *src, char * + + for (;;) { + enum subst_type type = SUBST_UNKNOWN; +- char attrbuf[UTIL_PATH_SIZE]; +- char *attr = NULL; ++ char attrbuf[UTIL_PATH_SIZE], sbuf[UTIL_PATH_SIZE]; ++ char *attr = NULL, *_s; ++ size_t _l; ++ bool replws = replace_whitespace; + + while (from[0] != '\0') { + if (from[0] == '$') { +@@ -189,6 +192,19 @@ subst: + attr = NULL; + } + ++ /* result subst handles space as field separator */ ++ if (type == SUBST_RESULT) ++ replws = false; ++ ++ if (replws) { ++ /* store dest string ptr and remaining len */ ++ _s = s; ++ _l = l; ++ /* temporarily use sbuf */ ++ s = &sbuf; ++ l = UTIL_PATH_SIZE; ++ } ++ + switch (type) { + case SUBST_DEVPATH: + l = strpcpy(&s, l, udev_device_get_devpath(dev)); +@@ -367,6 +383,20 @@ subst: + log_error("unknown substitution type=%i\n", type); + break; + } ++ ++ /* replace whitespace in sbuf and copy to dest */ ++ if (replws) { ++ size_t tmplen = UTIL_PATH_SIZE - l; ++ ++ /* restore s and l to dest string values */ ++ s = _s; ++ l = _l; ++ ++ /* copy ws-replaced value to s */ ++ tmplen = util_replace_whitespace(sbuf, s, MIN(tmplen, l)); ++ l -= tmplen; ++ s += tmplen; ++ } + } + + out: +@@ -895,7 +925,7 @@ void udev_event_execute_run(struct udev_event *event, const sigset_t *sigmask) + if (builtin_cmd < UDEV_BUILTIN_MAX) { + char command[UTIL_PATH_SIZE]; + +- udev_event_apply_format(event, cmd, command, sizeof(command)); ++ udev_event_apply_format(event, cmd, command, sizeof(command), false); + udev_builtin_run(event->dev, builtin_cmd, command, false); + } else { + char program[UTIL_PATH_SIZE]; +@@ -906,7 +936,7 @@ void udev_event_execute_run(struct udev_event *event, const sigset_t *sigmask) + sleep(event->exec_delay); + } + +- udev_event_apply_format(event, cmd, program, sizeof(program)); ++ udev_event_apply_format(event, cmd, program, sizeof(program), false); + envp = udev_device_get_properties_envp(event->dev); + udev_event_spawn(event, program, envp, sigmask, NULL, 0); + } +diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c +index 7a4fb70..a2a5914 100644 +--- a/src/udev/udev-rules.c ++++ b/src/udev/udev-rules.c +@@ -1792,7 +1792,7 @@ static int match_attr(struct udev_rules *rules, struct udev_device *dev, struct + name = rules_str(rules, cur->key.attr_off); + switch (cur->key.attrsubst) { + case SB_FORMAT: +- udev_event_apply_format(event, name, nbuf, sizeof(nbuf)); ++ udev_event_apply_format(event, name, nbuf, sizeof(nbuf), false); + name = nbuf; + /* fall through */ + case SB_NONE: +@@ -1934,7 +1934,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + char filename[UTIL_PATH_SIZE]; + int found; + +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), filename, sizeof(filename)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), filename, sizeof(filename), false); + found = (wait_for_file(event->dev, filename, 10) == 0); + if (!found && (cur->key.op != OP_NOMATCH)) + goto nomatch; +@@ -2010,7 +2010,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + struct stat statbuf; + int match; + +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), filename, sizeof(filename)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), filename, sizeof(filename), false); + if (util_resolve_subsys_kernel(event->udev, filename, filename, sizeof(filename), 0) != 0) { + if (filename[0] != '/') { + char tmp[UTIL_PATH_SIZE]; +@@ -2042,7 +2042,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + + free(event->program_result); + event->program_result = NULL; +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), program, sizeof(program)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), program, sizeof(program), false); + envp = udev_device_get_properties_envp(event->dev); + log_debug("PROGRAM '%s' %s:%u\n", + program, +@@ -2070,7 +2070,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + case TK_M_IMPORT_FILE: { + char import[UTIL_PATH_SIZE]; + +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), import, sizeof(import)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), import, sizeof(import), false); + if (import_file_into_properties(event->dev, import) != 0) + if (cur->key.op != OP_NOMATCH) + goto nomatch; +@@ -2079,7 +2079,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + case TK_M_IMPORT_PROG: { + char import[UTIL_PATH_SIZE]; + +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), import, sizeof(import)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), import, sizeof(import), false); + log_debug("IMPORT '%s' %s:%u\n", + import, + rules_str(rules, rule->rule.filename_off), +@@ -2110,7 +2110,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + event->builtin_run |= (1 << cur->key.builtin_cmd); + } + +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), command, sizeof(command)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), command, sizeof(command), false); + log_debug("IMPORT builtin '%s' %s:%u\n", + udev_builtin_name(cur->key.builtin_cmd), + rules_str(rules, rule->rule.filename_off), +@@ -2187,7 +2187,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + case TK_M_IMPORT_PARENT: { + char import[UTIL_PATH_SIZE]; + +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), import, sizeof(import)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), import, sizeof(import), false); + if (import_parent_into_properties(event->dev, import) != 0) + if (cur->key.op != OP_NOMATCH) + goto nomatch; +@@ -2223,7 +2223,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + break; + if (cur->key.op == OP_ASSIGN_FINAL) + event->owner_final = true; +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), owner, sizeof(owner)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), owner, sizeof(owner), false); + event->owner_set = true; + event->uid = util_lookup_user(event->udev, owner); + log_debug("OWNER %u %s:%u\n", +@@ -2239,7 +2239,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + break; + if (cur->key.op == OP_ASSIGN_FINAL) + event->group_final = true; +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), group, sizeof(group)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), group, sizeof(group), false); + event->group_set = true; + event->gid = util_lookup_group(event->udev, group); + log_debug("GROUP %u %s:%u\n", +@@ -2255,7 +2255,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + + if (event->mode_final) + break; +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), mode_str, sizeof(mode_str)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), mode_str, sizeof(mode_str), false); + mode = strtol(mode_str, &endptr, 8); + if (endptr[0] != '\0') { + log_error("ignoring invalid mode '%s'\n", mode_str); +@@ -2327,10 +2327,10 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + char temp[UTIL_NAME_SIZE]; + + /* append value separated by space */ +- udev_event_apply_format(event, value, temp, sizeof(temp)); ++ udev_event_apply_format(event, value, temp, sizeof(temp), false); + strscpyl(value_new, sizeof(value_new), value_old, " ", temp, NULL); + } else +- udev_event_apply_format(event, value, value_new, sizeof(value_new)); ++ udev_event_apply_format(event, value, value_new, sizeof(value_new), false); + + entry = udev_device_add_property(event->dev, name, value_new); + /* store in db, skip private keys */ +@@ -2342,7 +2342,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + char tag[UTIL_PATH_SIZE]; + const char *p; + +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), tag, sizeof(tag)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), tag, sizeof(tag), false); + if (cur->key.op == OP_ASSIGN || cur->key.op == OP_ASSIGN_FINAL) + udev_device_cleanup_tags_list(event->dev); + for (p = tag; *p != '\0'; p++) { +@@ -2367,7 +2367,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + break; + if (cur->key.op == OP_ASSIGN_FINAL) + event->name_final = true; +- udev_event_apply_format(event, name, name_str, sizeof(name_str)); ++ udev_event_apply_format(event, name, name_str, sizeof(name_str), false); + if (esc == ESCAPE_UNSET || esc == ESCAPE_REPLACE) { + count = util_replace_chars(name_str, "/"); + if (count > 0) +@@ -2404,7 +2404,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + udev_device_cleanup_devlinks_list(event->dev); + + /* allow multiple symlinks separated by spaces */ +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), temp, sizeof(temp)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), temp, sizeof(temp), false); + if (esc == ESCAPE_UNSET) + count = util_replace_chars(temp, "/ "); + else if (esc == ESCAPE_REPLACE) +@@ -2444,7 +2444,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + strscpyl(attr, sizeof(attr), udev_device_get_syspath(event->dev), "/", key_name, NULL); + attr_subst_subdir(attr, sizeof(attr)); + +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), value, sizeof(value)); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), value, sizeof(value), false); + log_debug("ATTR '%s' writing '%s' %s:%u\n", attr, value, + rules_str(rules, rule->rule.filename_off), + rule->rule.filename_line); +diff --git a/src/udev/udev.h b/src/udev/udev.h +index caec5f0..8a8b655 100644 +--- a/src/udev/udev.h ++++ b/src/udev/udev.h +@@ -77,7 +77,9 @@ void udev_rules_apply_static_dev_perms(struct udev_rules *rules); + /* udev-event.c */ + struct udev_event *udev_event_new(struct udev_device *dev); + void udev_event_unref(struct udev_event *event); +-size_t udev_event_apply_format(struct udev_event *event, const char *src, char *dest, size_t size); ++size_t udev_event_apply_format(struct udev_event *event, ++ const char *src, char *dest, size_t size, ++ bool replace_whitespace); + int udev_event_apply_subsys_kernel(struct udev_event *event, const char *string, + char *result, size_t maxsize, int read_value); + int udev_event_spawn(struct udev_event *event, +diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c +index df1409b..edf5470 100644 +--- a/src/udev/udevadm-test.c ++++ b/src/udev/udevadm-test.c +@@ -150,7 +150,7 @@ static int adm_test(struct udev *udev, int argc, char *argv[]) + udev_list_entry_foreach(entry, udev_list_get_entry(&event->run_list)) { + char program[UTIL_PATH_SIZE]; + +- udev_event_apply_format(event, udev_list_entry_get_name(entry), program, sizeof(program)); ++ udev_event_apply_format(event, udev_list_entry_get_name(entry), program, sizeof(program), false); + printf("run: '%s'\n", program); + } + } +-- +2.7.4 + diff -Nru systemd-204/debian/patches/0003-udev-rules-perform-whitespace-replacement-for-symlin.patch systemd-204/debian/patches/0003-udev-rules-perform-whitespace-replacement-for-symlin.patch --- systemd-204/debian/patches/0003-udev-rules-perform-whitespace-replacement-for-symlin.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/0003-udev-rules-perform-whitespace-replacement-for-symlin.patch 2017-02-01 10:46:13.000000000 +0000 @@ -0,0 +1,37 @@ +From 1ebbdc4de63664c5a727f3ccc00392989a36d407 Mon Sep 17 00:00:00 2001 +From: Dan Streetman +Date: Tue, 3 Jan 2017 14:39:50 -0500 +Subject: [PATCH 3/3] udev-rules: perform whitespace replacement for symlink + subst values + +If the string_escape option is either unset or 'replace' (i.e. if it is +not 'none'), then enable whitespace replacement in SYMLINK variable +substitution values, as added in the last patch. + +This will keep any whitespace that is directly contained in a SYMLINK +value, but will replace any whitespace that is added to the SYMLINK +value as a result of variable substitution (except $result/%c). + +This fixes bug 4833. + +(LP: #1647485) +--- + src/udev/udev-rules.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c +index a2a5914..d3ba4e2 100644 +--- a/src/udev/udev-rules.c ++++ b/src/udev/udev-rules.c +@@ -2404,7 +2404,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event + udev_device_cleanup_devlinks_list(event->dev); + + /* allow multiple symlinks separated by spaces */ +- udev_event_apply_format(event, rules_str(rules, cur->key.value_off), temp, sizeof(temp), false); ++ udev_event_apply_format(event, rules_str(rules, cur->key.value_off), temp, sizeof(temp), esc != ESCAPE_NONE); + if (esc == ESCAPE_UNSET) + count = util_replace_chars(temp, "/ "); + else if (esc == ESCAPE_REPLACE) +-- +2.7.4 + diff -Nru systemd-204/debian/patches/Advertise-hibernation-only-if-there-s-enough-free-sw.patch systemd-204/debian/patches/Advertise-hibernation-only-if-there-s-enough-free-sw.patch --- systemd-204/debian/patches/Advertise-hibernation-only-if-there-s-enough-free-sw.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/Advertise-hibernation-only-if-there-s-enough-free-sw.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,289 @@ +From: =?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= +Date: Fri, 13 Sep 2013 19:41:52 -0400 +Subject: Advertise hibernation only if there's enough free swap + +Cherry-pick various upstream patches starting from 69ab80881 and 442e00839 +to check whether there is swap available for hibernation. + +Bug-Ubuntu: https://launchpad.net/bugs/1313522 +--- + src/shared/fileio.c | 34 +++++++++++++ + src/shared/fileio.h | 2 + + src/shared/sleep-config.c | 126 +++++++++++++++++++++++++++++++++++++++------- + src/shared/util.c | 1 - + src/test/test-fileio.c | 24 +++++++++ + src/test/test-sleep.c | 16 +++--- + 6 files changed, 175 insertions(+), 28 deletions(-) + +diff --git a/src/shared/fileio.c b/src/shared/fileio.c +index ad068bf..9af284d 100644 +--- a/src/shared/fileio.c ++++ b/src/shared/fileio.c +@@ -594,3 +594,37 @@ int write_env_file(const char *fname, char **l) { + + return r; + } ++ ++/** ++ * Retrieve one field from a file like /proc/self/status. ++ * pattern should start with '\n' and end with ':'. Whitespace ++ * after ':' will be skipped. field must be freed afterwards. ++ */ ++int get_status_field(const char *filename, const char *pattern, char **field) { ++ _cleanup_free_ char *status = NULL; ++ char *t; ++ size_t len; ++ int r; ++ ++ assert(filename); ++ assert(field); ++ ++ r = read_full_file(filename, &status, NULL); ++ if (r < 0) ++ return r; ++ ++ t = strstr(status, pattern); ++ if (!t) ++ return -ENOENT; ++ ++ t += strlen(pattern); ++ t += strspn(t, WHITESPACE); ++ ++ len = strcspn(t, WHITESPACE); ++ ++ *field = strndup(t, len); ++ if (!*field) ++ return -ENOMEM; ++ ++ return 0; ++} +diff --git a/src/shared/fileio.h b/src/shared/fileio.h +index 0ca6878..d8079ab 100644 +--- a/src/shared/fileio.h ++++ b/src/shared/fileio.h +@@ -35,3 +35,5 @@ int read_full_file(const char *fn, char **contents, size_t *size); + int parse_env_file(const char *fname, const char *separator, ...) _sentinel_; + int load_env_file(const char *fname, const char *separator, char ***l); + int write_env_file(const char *fname, char **l); ++ ++int get_status_field(const char *filename, const char *pattern, char **field); +diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c +index cd3238b..cf1cd40 100644 +--- a/src/shared/sleep-config.c ++++ b/src/shared/sleep-config.c +@@ -28,11 +28,14 @@ + #include "strv.h" + #include "util.h" + +-int parse_sleep_config(const char *verb, char ***modes, char ***states) { ++#define USE(x, y) do{ (x) = (y); (y) = NULL; } while(0) ++ ++int parse_sleep_config(const char *verb, char ***_modes, char ***_states) { + _cleanup_strv_free_ char + **suspend_mode = NULL, **suspend_state = NULL, + **hibernate_mode = NULL, **hibernate_state = NULL, + **hybrid_mode = NULL, **hybrid_state = NULL; ++ char **modes, **states; + + const ConfigTableItem items[] = { + { "Sleep", "SuspendMode", config_parse_strv, 0, &suspend_mode }, +@@ -59,47 +62,46 @@ int parse_sleep_config(const char *verb, char ***modes, char ***states) { + + if (streq(verb, "suspend")) { + /* empty by default */ +- *modes = suspend_mode; ++ USE(modes, suspend_mode); + + if (suspend_state) +- *states = suspend_state; ++ USE(states, suspend_state); + else +- *states = strv_split_nulstr("mem\0standby\0freeze\0"); ++ states = strv_new("mem", "standby", "freeze", NULL); + +- suspend_mode = suspend_state = NULL; + } else if (streq(verb, "hibernate")) { + if (hibernate_mode) +- *modes = hibernate_mode; ++ USE(modes, hibernate_mode); + else +- *modes = strv_split_nulstr("platform\0shutdown\0"); ++ modes = strv_new("platform", "shutdown", NULL); + + if (hibernate_state) +- *states = hibernate_state; ++ USE(states, hibernate_state); + else +- *states = strv_split_nulstr("disk\0"); ++ states = strv_new("disk", NULL); + +- hibernate_mode = hibernate_state = NULL; + } else if (streq(verb, "hybrid-sleep")) { + if (hybrid_mode) +- *modes = hybrid_mode; ++ USE(modes, hybrid_mode); + else +- *modes = strv_split_nulstr("suspend\0platform\0shutdown\0"); ++ modes = strv_new("suspend", "platform", "shutdown", NULL); + + if (hybrid_state) +- *states = hybrid_state; ++ USE(states, hybrid_state); + else +- *states = strv_split_nulstr("disk\0"); ++ states = strv_new("disk", NULL); + +- hybrid_mode = hybrid_state = NULL; + } else + assert_not_reached("what verb"); + +- if (!modes || !states) { +- strv_free(*modes); +- strv_free(*states); ++ if ((!modes && !streq(verb, "suspend")) || !states) { ++ strv_free(modes); ++ strv_free(states); + return log_oom(); + } + ++ *_modes = modes; ++ *_states = states; + return 0; + } + +@@ -163,6 +165,89 @@ int can_sleep_disk(char **types) { + return false; + } + ++#define HIBERNATION_SWAP_THRESHOLD 0.98 ++ ++static int hibernation_partition_size(size_t *size, size_t *used) { ++ _cleanup_fclose_ FILE *f; ++ int i; ++ ++ assert(size); ++ assert(used); ++ ++ f = fopen("/proc/swaps", "re"); ++ if (!f) { ++ log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING, ++ "Failed to retrieve open /proc/swaps: %m"); ++ assert(errno > 0); ++ return -errno; ++ } ++ ++ (void) fscanf(f, "%*s %*s %*s %*s %*s\n"); ++ ++ for (i = 1;; i++) { ++ _cleanup_free_ char *dev = NULL, *type = NULL; ++ size_t size_field, used_field; ++ int k; ++ ++ k = fscanf(f, ++ "%ms " /* device/file */ ++ "%ms " /* type of swap */ ++ "%zd " /* swap size */ ++ "%zd " /* used */ ++ "%*i\n", /* priority */ ++ &dev, &type, &size_field, &used_field); ++ if (k != 4) { ++ if (k == EOF) ++ break; ++ ++ log_warning("Failed to parse /proc/swaps:%u", i); ++ continue; ++ } ++ ++ if (streq(type, "partition") && endswith(dev, "\\040(deleted)")) { ++ log_warning("Ignoring deleted swapfile '%s'.", dev); ++ continue; ++ } ++ ++ *size = size_field; ++ *used = used_field; ++ return 0; ++ } ++ ++ log_debug("No swap partitions were found."); ++ return -ENOSYS; ++} ++ ++static bool enough_memory_for_hibernation(void) { ++ _cleanup_free_ char *active = NULL; ++ unsigned long long act = 0; ++ size_t size = 0, used = 0; ++ int r; ++ ++ r = hibernation_partition_size(&size, &used); ++ if (r < 0) ++ return false; ++ ++ r = get_status_field("/proc/meminfo", "\nActive(anon):", &active); ++ if (r < 0) { ++ log_error("Failed to retrieve Active(anon) from /proc/meminfo: %s", strerror(-r)); ++ return false; ++ } ++ ++ r = safe_atollu(active, &act); ++ if (r < 0) { ++ log_error("Failed to parse Active(anon) from /proc/meminfo: %s: %s", ++ active, strerror(-r)); ++ return false; ++ } ++ ++ r = act <= (size - used) * HIBERNATION_SWAP_THRESHOLD; ++ log_debug("Hibernation is %spossible, Active(anon)=%llu kB, size=%zu kB, used=%zu kB, threshold=%.2g%%", ++ r ? "" : "im", act, size, used, 100*HIBERNATION_SWAP_THRESHOLD); ++ ++ return r; ++} ++ + int can_sleep(const char *verb) { + _cleanup_strv_free_ char **modes = NULL, **states = NULL; + int r; +@@ -175,5 +260,8 @@ int can_sleep(const char *verb) { + if (r < 0) + return false; + +- return can_sleep_state(states) && can_sleep_disk(modes); ++ if (!can_sleep_state(states) || !can_sleep_disk(modes)) ++ return false; ++ ++ return streq(verb, "suspend") || enough_memory_for_hibernation(); + } +diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c +index d56f7cc..8049efa 100644 +--- a/src/test/test-fileio.c ++++ b/src/test/test-fileio.c +@@ -139,7 +139,31 @@ static void test_parse_env_file(void) { + unlink("/tmp/test-fileio"); + } + ++static void test_status_field(void) { ++ _cleanup_free_ char *t = NULL, *p = NULL, *s = NULL; ++ unsigned long long total, buffers; ++ int r; ++ ++ assert_se(get_status_field("/proc/self/status", "\nThreads:", &t) == 0); ++ puts(t); ++ assert_se(streq(t, "1")); ++ ++ r = get_status_field("/proc/meminfo", "MemTotal:", &p); ++ if (r == -ENOENT) ++ return; ++ assert(r == 0); ++ puts(p); ++ assert_se(safe_atollu(p, &total) == 0); ++ ++ assert_se(get_status_field("/proc/meminfo", "\nBuffers:", &s) == 0); ++ puts(s); ++ assert_se(safe_atollu(s, &buffers) == 0); ++ ++ assert(buffers < total); ++} ++ + int main(int argc, char *argv[]) { + test_parse_env_file(); ++ test_status_field(); + return 0; + } diff -Nru systemd-204/debian/patches/CVE-2018-1049.patch systemd-204/debian/patches/CVE-2018-1049.patch --- systemd-204/debian/patches/CVE-2018-1049.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/CVE-2018-1049.patch 2018-02-01 13:13:44.000000000 +0000 @@ -0,0 +1,81 @@ +Backport of: + +From e7d54bf58789545a9eb0b3964233defa0b007318 Mon Sep 17 00:00:00 2001 +From: Anchor Cat +Date: Wed, 10 May 2017 21:23:58 +1000 +Subject: [PATCH] automount: ack automount requests even when already mounted + (#5916) + +If a process accesses an autofs filesystem while systemd is in the +middle of starting the mount unit on top of it, it is possible for the +autofs_ptype_missing_direct request from the kernel to be received after +the mount unit has been fully started: + + systemd forks and execs mount ... + ... access autofs, blocks + mount exits ... + systemd receives SIGCHLD ... + ... kernel sends request + systemd receives request ... + +systemd needs to respond to this request, otherwise the kernel will +continue to block access to the mount point. +--- + src/core/automount.c | 33 ++++++++++++++++++--------------- + 1 file changed, 18 insertions(+), 15 deletions(-) + +Index: systemd-204/src/core/automount.c +=================================================================== +--- systemd-204.orig/src/core/automount.c 2018-02-01 07:52:13.746962884 -0500 ++++ systemd-204/src/core/automount.c 2018-02-01 08:10:53.228380576 -0500 +@@ -582,7 +582,7 @@ fail: + automount_enter_dead(a, AUTOMOUNT_FAILURE_RESOURCES); + } + +-static void automount_enter_runnning(Automount *a) { ++static void automount_enter_running(Automount *a) { + _cleanup_dbus_error_free_ DBusError error; + struct stat st; + int r; +@@ -609,18 +609,22 @@ static void automount_enter_runnning(Aut + goto fail; + } + +- if (!S_ISDIR(st.st_mode) || st.st_dev != a->dev_id) ++ /* The mount unit may have been explicitly started before we got the ++ * autofs request. Ack it to unblock anything waiting on the mount point. */ ++ if (!S_ISDIR(st.st_mode) || st.st_dev != a->dev_id) { + log_info_unit(UNIT(a)->id, + "%s's automount point already active?", UNIT(a)->id); +- else { +- r = manager_add_job(UNIT(a)->manager, JOB_START, UNIT_TRIGGER(UNIT(a)), +- JOB_REPLACE, true, &error, NULL); +- if (r < 0) { +- log_warning_unit(UNIT(a)->id, +- "%s failed to queue mount startup job: %s", +- UNIT(a)->id, bus_error(&error, r)); +- goto fail; +- } ++ automount_send_ready(a, 0); ++ return; ++ } ++ ++ r = manager_add_job(UNIT(a)->manager, JOB_START, UNIT_TRIGGER(UNIT(a)), ++ JOB_REPLACE, true, &error, NULL); ++ if (r < 0) { ++ log_warning_unit(UNIT(a)->id, ++ "%s failed to queue mount startup job: %s", ++ UNIT(a)->id, bus_error(&error, r)); ++ goto fail; + } + + automount_set_state(a, AUTOMOUNT_RUNNING); +@@ -819,7 +823,7 @@ static void automount_fd_event(Unit *u, + goto fail; + } + +- automount_enter_runnning(a); ++ automount_enter_running(a); + break; + + default: diff -Nru systemd-204/debian/patches/CVE-2019-3842.patch systemd-204/debian/patches/CVE-2019-3842.patch --- systemd-204/debian/patches/CVE-2019-3842.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/CVE-2019-3842.patch 2019-03-07 16:30:13.000000000 +0000 @@ -0,0 +1,25 @@ +--- a/src/login/pam-module.c ++++ b/src/login/pam-module.c +@@ -424,11 +424,11 @@ + + seat = pam_getenv(handle, "XDG_SEAT"); + if (isempty(seat)) +- seat = getenv("XDG_SEAT"); ++ seat = secure_getenv("XDG_SEAT"); + + cvtnr = pam_getenv(handle, "XDG_VTNR"); + if (isempty(cvtnr)) +- cvtnr = getenv("XDG_VTNR"); ++ cvtnr = secure_getenv("XDG_VTNR"); + + service = strempty(service); + tty = strempty(tty); +@@ -477,7 +477,7 @@ + + class = pam_getenv(handle, "XDG_SESSION_CLASS"); + if (isempty(class)) +- class = getenv("XDG_SESSION_CLASS"); ++ class = secure_getenv("XDG_SESSION_CLASS"); + if (isempty(class)) + class = class_pam; + if (isempty(class)) diff -Nru systemd-204/debian/patches/ProLiant-power-button.patch systemd-204/debian/patches/ProLiant-power-button.patch --- systemd-204/debian/patches/ProLiant-power-button.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/ProLiant-power-button.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,18 @@ +Description: Add power button support for HP Moonshot cartridges +Author: Manoj Iyer +Author: dann frazier +Bug-Ubuntu: http://launchpad.net/bugs/1354306, +Bug-Ubuntu: http://launchpad.net/bugs/1347776 + +Index: systemd-204/src/login/70-power-switch.rules +=================================================================== +--- systemd-204.orig/src/login/70-power-switch.rules ++++ systemd-204/src/login/70-power-switch.rules +@@ -9,5 +9,7 @@ ACTION=="remove", GOTO="power_switch_end + + SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="acpi", TAG+="power-switch" + SUBSYSTEM=="input", KERNEL=="event*", KERNELS=="thinkpad_acpi", TAG+="power-switch" ++SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="platform", KERNELS=="gpio_keys.6|soc:gpio_keys", PROGRAM="/bin/cat /proc/device-tree/model", RESULT=="HP ProLiant m400 Server Cartridge", TAG+="power-switch" ++SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="platform", KERNELS=="gpio_keys.12", ATTRS{keys}=="116", PROGRAM="/bin/cat /proc/device-tree/model", RESULT=="HP ProLiant m800 Server Cartridge", TAG+="power-switch" + + LABEL="power_switch_end" diff -Nru systemd-204/debian/patches/add-cgmanager-support systemd-204/debian/patches/add-cgmanager-support --- systemd-204/debian/patches/add-cgmanager-support 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/add-cgmanager-support 2017-01-13 10:16:41.000000000 +0000 @@ -0,0 +1,981 @@ +Index: systemd-204/Makefile.am +=================================================================== +--- systemd-204.orig/Makefile.am 2014-06-18 23:28:10.000000000 -0400 ++++ systemd-204/Makefile.am 2014-06-18 23:28:27.564644732 -0400 +@@ -178,6 +178,10 @@ + -I $(top_srcdir)/src/libsystemd-bus \ + $(OUR_CPPFLAGS) + ++if ENABLE_CGMANAGER ++AM_CPPFLAGS += -DHAVE_CGMANAGER ++endif ++ + AM_CFLAGS = $(OUR_CFLAGS) + AM_LDFLAGS = $(OUR_LDFLAGS) + +@@ -675,6 +679,8 @@ + src/shared/cgroup-util.h \ + src/shared/cgroup-show.c \ + src/shared/cgroup-show.h \ ++ src/shared/cgmanager.c \ ++ src/shared/cgmanager.h \ + src/shared/unit-name.c \ + src/shared/unit-name.h \ + src/shared/utmp-wtmp.c \ +@@ -699,6 +705,14 @@ + src/shared/MurmurHash3.c \ + src/shared/MurmurHash3.h + ++if ENABLE_CGMANAGER ++libsystemd_shared_la_CFLAGS = \ ++ $(AM_CFLAGS) \ ++ $(CGMANAGER_CFLAGS) ++libsystemd_shared_la_LIBADD = \ ++ $(CGMANAGER_LIBS) ++endif ++ + #------------------------------------------------------------------------------- + noinst_LTLIBRARIES += \ + libsystemd-dbus.la +@@ -763,6 +777,11 @@ + libsystemd_label_la_LIBADD = \ + $(SELINUX_LIBS) + ++if ENABLE_CGMANAGER ++libsystemd_label_la_CFLAGS += $(CGMANAGER_CFLAGS) ++libsystemd_label_la_LIBADD += $(CGMANAGER_LIBS) ++endif ++ + # ------------------------------------------------------------------------------ + noinst_LTLIBRARIES += \ + libsystemd-logs.la +Index: systemd-204/configure.ac +=================================================================== +--- systemd-204.orig/configure.ac 2014-06-18 23:28:10.000000000 -0400 ++++ systemd-204/configure.ac 2014-06-18 23:28:27.564644732 -0400 +@@ -780,6 +780,24 @@ + + # ------------------------------------------------------------------------------ + ++AC_ARG_ENABLE([cgmanager], ++ [AC_HELP_STRING([--enable-cgmanager], [enable cgmanager support [default=auto]])], ++ [], [enable_cgmanager=auto]) ++ ++if test "x$enable_cgmanager" = "xauto" ; then ++ AC_CHECK_LIB([cgmanager],[cgmanager_create],[enable_cgmanager=yes],[enable_cgmanager=no],[-lnih -lnih-dbus -ldbus-1]) ++fi ++AM_CONDITIONAL([ENABLE_CGMANAGER], [test "x$enable_cgmanager" = "xyes"]) ++ ++AM_COND_IF([ENABLE_CGMANAGER], ++ [PKG_CHECK_MODULES([CGMANAGER], [libcgmanager]) ++ PKG_CHECK_MODULES([NIH], [libnih >= 1.0.2]) ++ PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0]) ++ PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16]) ++ ]) ++ ++# ------------------------------------------------------------------------------ ++ + # Location of the init scripts as mandated by LSB + SYSTEM_SYSVINIT_PATH=/etc/init.d + SYSTEM_SYSVRCND_PATH=/etc/rc.d +@@ -946,6 +964,7 @@ + gtk-doc: ${enable_gtk_doc} + Split /usr: ${enable_split_usr} + SysV compatibility: ${SYSTEM_SYSV_COMPAT} ++ CGManager ${enable_cgmanager} + + prefix: ${prefix} + rootprefix: ${with_rootprefix} +Index: systemd-204/src/shared/cgmanager.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ systemd-204/src/shared/cgmanager.c 2014-06-18 23:28:27.564644732 -0400 +@@ -0,0 +1,247 @@ ++/* ++ * lxc: linux Container library ++ * ++ * (C) Copyright Canonical Ltd. 2013-2014 ++ * ++ * Authors: ++ * Serge Hallyn ++ * Stéphane Graber ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifdef HAVE_CGMANAGER ++ ++#include ++#include ++#include ++#include ++ ++#include "cgmanager.h" ++#include "log.h" ++ ++static NihDBusProxy *cgroup_manager = NULL; ++ ++#define CGMANAGER_DBUS_SOCK "unix:path=/sys/fs/cgroup/cgmanager/sock" ++bool cgm_dbus_connect(void) ++{ ++ DBusError dbus_error; ++ DBusConnection *connection; ++ dbus_error_init(&dbus_error); ++ ++ connection = dbus_connection_open_private(CGMANAGER_DBUS_SOCK, &dbus_error); ++ if (!connection) { ++ dbus_error_free(&dbus_error); ++ return false; ++ } ++ ++ dbus_connection_set_exit_on_disconnect(connection, FALSE); ++ dbus_error_free(&dbus_error); ++ cgroup_manager = nih_dbus_proxy_new(NULL, connection, ++ NULL /* p2p */, ++ "/org/linuxcontainers/cgmanager", NULL, NULL); ++ dbus_connection_unref(connection); ++ if (!cgroup_manager) { ++ NihError *nerr; ++ nerr = nih_error_get(); ++ log_error("cgmanager: Error opening proxy: %s", nerr->message); ++ nih_free(nerr); ++ return false; ++ } ++ ++ // force fd passing negotiation ++ if (cgmanager_ping_sync(NULL, cgroup_manager, 0) != 0) { ++ NihError *nerr; ++ nerr = nih_error_get(); ++ log_error("cgmanager: Error pinging manager: %s", nerr->message); ++ nih_free(nerr); ++ nih_free(cgroup_manager); ++ cgroup_manager = NULL; ++ return false; ++ } ++ return true; ++} ++ ++void cgm_dbus_disconnect(void) ++{ ++ if (cgroup_manager) { ++ dbus_connection_flush(cgroup_manager->connection); ++ dbus_connection_close(cgroup_manager->connection); ++ nih_free(cgroup_manager); ++ cgroup_manager = NULL; ++ } ++} ++ ++bool cgm_create(const char *controller, const char *cgroup_path, int32_t *existed) ++{ ++ if (cgroup_path[0] == '/') ++ cgroup_path++; ++ ++ if ( cgmanager_create_sync(NULL, cgroup_manager, controller, ++ cgroup_path, existed) != 0) { ++ NihError *nerr; ++ nerr = nih_error_get(); ++ log_error("cgmanager: cgm_create for controller=%s, cgroup_path=%s failed: %s", ++ controller, cgroup_path, nerr->message); ++ nih_free(nerr); ++ return false; ++ } ++ ++ return true; ++} ++ ++bool cgm_remove(const char *controller, const char *cgroup_path, int recursive) ++{ ++ int existed; ++ ++ if (cgroup_path[0] == '/') ++ cgroup_path++; ++ ++ if ( cgmanager_remove_sync(NULL, cgroup_manager, controller, ++ cgroup_path, recursive, &existed) != 0) { ++ NihError *nerr; ++ nerr = nih_error_get(); ++ log_error("cgmanager: cgm_remove for controller=%s, cgroup_path=%s, recursive=%d failed: %s", ++ controller, cgroup_path, recursive, nerr->message); ++ nih_free(nerr); ++ return false; ++ } ++ ++ if (existed == -1) { ++ log_error("cgmanager: cgm_remove failed: %s:%s did not exist", controller, cgroup_path); ++ return false; ++ } ++ return true; ++} ++ ++char *cgm_get(const char *controller, const char *cgroup_path, const char *key) ++{ ++ char *result = NULL; ++ char *ret = NULL; ++ ++ if (cgroup_path[0] == '/') ++ cgroup_path++; ++ ++ if (cgmanager_get_value_sync(NULL, cgroup_manager, controller, cgroup_path, key, &result) != 0) { ++ NihError *nerr; ++ nerr = nih_error_get(); ++ log_error("cgmanager: cgm_get for controller=%s, cgroup_path=%s failed: %s", ++ controller, cgroup_path, nerr->message); ++ nih_free(nerr); ++ if (result) nih_free(result); ++ return NULL; ++ } ++ ++ if (result) { ++ ret = strdup(result); ++ nih_free(result); ++ } ++ ++ return ret; ++} ++ ++bool cgm_chmod(const char *controller, const char *cgroup_path, int mode) ++{ ++ nih_local char *path_dirname = NULL; ++ nih_local char *path_basename = NULL; ++ ++ if (cgroup_path[0] == '/') ++ cgroup_path++; ++ ++ path_dirname = NIH_MUST(nih_strdup(NULL, cgroup_path)); ++ path_basename = NIH_MUST(nih_strdup(NULL, cgroup_path)); ++ ++ if (cgmanager_chmod_sync(NULL, cgroup_manager, controller, ++ dirname(path_dirname), basename(path_basename), mode) != 0) { ++ NihError *nerr; ++ nerr = nih_error_get(); ++ log_error("cgmanager: cgm_chmod for controller=%s, cgroup_path=%s, mode=%d failed: %s", ++ controller, cgroup_path, mode, nerr->message); ++ nih_free(nerr); ++ return false; ++ } ++ ++ return true; ++} ++ ++bool cgm_chown(const char *controller, const char *cgroup_path, int uid, int gid) ++{ ++ if (cgroup_path[0] == '/') ++ cgroup_path++; ++ ++ if (cgmanager_chown_sync(NULL, cgroup_manager, controller, ++ cgroup_path, uid, gid) != 0) { ++ NihError *nerr; ++ nerr = nih_error_get(); ++ log_error("cgmanager: cgm_chown for controller=%s, cgroup_path=%s, uid=%d, gid=%d failed: %s", ++ controller, cgroup_path, uid, gid, nerr->message); ++ nih_free(nerr); ++ return false; ++ } ++ ++ return true; ++} ++ ++bool cgm_list_children(const char *controller, const char *cgroup_path, char ***children) ++{ ++ if (cgroup_path[0] == '/') ++ cgroup_path++; ++ ++ if ( cgmanager_list_children_sync(NULL, cgroup_manager, controller, ++ cgroup_path, children) != 0) { ++ NihError *nerr; ++ nerr = nih_error_get(); ++ log_error("cgmanager: cgm_list_children for controller=%s, cgroup_path=%s failed: %s", ++ controller, cgroup_path, nerr->message); ++ nih_free(nerr); ++ return false; ++ } ++ ++ return true; ++} ++ ++bool cgm_controller_exists(const char *controller) ++{ ++ char *cgroup_name = NULL; ++ ++ if ( cgmanager_get_pid_cgroup_sync(NULL, cgroup_manager, controller, ++ getpid(), &cgroup_name) != 0) { ++ NihError *nerr; ++ nerr = nih_error_get(); ++ nih_free(nerr); ++ return false; ++ } ++ ++ nih_free(cgroup_name); ++ return true; ++} ++ ++bool cgm_enter(const char *controller, const char *cgroup_path, pid_t pid) ++{ ++ if (cgroup_path[0] == '/') ++ cgroup_path++; ++ ++ if (cgmanager_move_pid_sync(NULL, cgroup_manager, controller, ++ cgroup_path, pid) != 0) { ++ NihError *nerr; ++ nerr = nih_error_get(); ++ log_error("cgmanager: cgm_enter for controller=%s, cgroup_path=%s, pid=%d failed: %s", ++ controller, cgroup_path, pid, nerr->message); ++ nih_free(nerr); ++ return false; ++ } ++ return true; ++} ++#endif +Index: systemd-204/src/shared/cgmanager.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ systemd-204/src/shared/cgmanager.h 2014-06-18 23:28:27.564644732 -0400 +@@ -0,0 +1,44 @@ ++/* ++ * lxc: linux Container library ++ * ++ * (C) Copyright Canonical Ltd. 2013-2014 ++ * ++ * Authors: ++ * Serge Hallyn ++ * Stéphane Graber ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#ifdef HAVE_CGMANAGER ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++bool cgm_dbus_connect(void); ++void cgm_dbus_disconnect(void); ++bool cgm_create(const char *controller, const char *cgroup_path, int32_t *existed); ++bool cgm_remove(const char *controller, const char *cgroup_path, int recursive); ++char *cgm_get(const char *controller, const char *path, const char *key); ++bool cgm_chmod(const char *controller, const char *cgroup_path, int mode); ++bool cgm_chown(const char *controller, const char *cgroup_path, int uid, int gid); ++bool cgm_list_children(const char *controller, const char *cgroup_path, char ***children); ++bool cgm_controller_exists(const char *controller); ++bool cgm_enter(const char *controller, const char *cgroup_path, pid_t pid); ++#endif +Index: systemd-204/src/shared/cgroup-label.c +=================================================================== +--- systemd-204.orig/src/shared/cgroup-label.c 2013-04-15 22:41:21.360855712 -0400 ++++ systemd-204/src/shared/cgroup-label.c 2014-06-18 23:28:27.568644656 -0400 +@@ -30,6 +30,7 @@ + #include + + #include "cgroup-util.h" ++#include "cgmanager.h" + #include "log.h" + #include "set.h" + #include "macro.h" +@@ -40,6 +41,27 @@ + _cleanup_free_ char *fs = NULL; + int r; + ++ #ifdef HAVE_CGMANAGER ++ /* CGManager support */ ++ int existed; ++ if (cgm_dbus_connect()) { ++ if (!controller) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ ++ r = cgm_create(normalize_controller(controller), ++ path, &existed); ++ ++ cgm_dbus_disconnect(); ++ ++ if (!r) ++ return -1; ++ ++ return 1; ++ } ++ #endif ++ + r = cg_get_path_and_check(controller, path, suffix, &fs); + if (r < 0) + return r; +Index: systemd-204/src/shared/cgroup-util.c +=================================================================== +--- systemd-204.orig/src/shared/cgroup-util.c 2013-05-06 15:06:04.057670685 -0400 ++++ systemd-204/src/shared/cgroup-util.c 2014-06-18 23:28:27.568644656 -0400 +@@ -29,6 +29,7 @@ + #include + #include + ++#include "cgmanager.h" + #include "cgroup-util.h" + #include "log.h" + #include "set.h" +@@ -43,9 +44,57 @@ + _cleanup_free_ char *fs = NULL; + FILE *f; + int r; ++ char *value = NULL; ++ char *template = NULL; ++ int fd; + + assert(_f); + ++ #ifdef HAVE_CGMANAGER ++ /* CGManager support */ ++ if (cgm_dbus_connect()) { ++ if (!controller) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ ++ value = cgm_get(normalize_controller(controller), ++ path, "cgroup.procs"); ++ ++ cgm_dbus_disconnect(); ++ ++ if (!value) ++ return -1; ++ ++ template = strdup("/tmp/.cgmanager-logind.XXXXXX"); ++ if (!template) ++ return -1; ++ ++ fd = mkstemp(template); ++ ++ if (fd < 0) { ++ free(template); ++ return -1; ++ } ++ ++ f = fdopen(fd, "w+"); ++ if (!f) { ++ close(fd); ++ free(template); ++ return -1; ++ } ++ ++ unlink(template); ++ free(template); ++ write(fd, value, strlen(value)); ++ fflush(f); ++ rewind(f); ++ ++ *_f = f; ++ return 0; ++ } ++ #endif ++ + r = cg_get_path(controller, path, "cgroup.procs", &fs); + if (r < 0) + return r; +@@ -62,9 +111,56 @@ + _cleanup_free_ char *fs = NULL; + FILE *f; + int r; ++ char *value = NULL; ++ char *template = NULL; ++ int fd; + + assert(_f); + ++ #ifdef HAVE_CGMANAGER ++ /* CGManager support */ ++ if (cgm_dbus_connect()) { ++ if (!controller) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ ++ value = cgm_get(normalize_controller(controller), ++ path, "tasks"); ++ ++ cgm_dbus_disconnect(); ++ ++ if (!value) ++ return -1; ++ ++ template = strdup("/tmp/.cgmanager-logind.XXXXXX"); ++ if (!template) ++ return -1; ++ ++ fd = mkstemp(template); ++ if (fd < 0) { ++ free(template); ++ return -1; ++ } ++ ++ f = fdopen(fd, "w+"); ++ if (!f) { ++ close(fd); ++ free(template); ++ return -1; ++ } ++ ++ unlink(template); ++ free(template); ++ write(fd, value, strlen(value)); ++ fflush(f); ++ rewind(f); ++ ++ *_f = f; ++ return 0; ++ } ++ #endif ++ + r = cg_get_path(controller, path, "tasks", &fs); + if (r < 0) + return r; +@@ -154,6 +250,26 @@ + _cleanup_free_ char *p = NULL; + int r; + ++ #ifdef HAVE_CGMANAGER ++ /* CGManager support */ ++ if (cgm_dbus_connect()) { ++ if (!controller) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ ++ r = cgm_remove(normalize_controller(controller), ++ path, 0); ++ ++ cgm_dbus_disconnect(); ++ ++ if (!r) ++ return -1; ++ ++ return 0; ++ } ++ #endif ++ + r = cg_get_path(controller, path, NULL, &p); + if (r < 0) + return r; +@@ -462,7 +578,7 @@ + return ret; + } + +-static const char *normalize_controller(const char *controller) { ++const char *normalize_controller(const char *controller) { + + assert(controller); + +@@ -531,9 +647,24 @@ + + static int check_hierarchy(const char *p) { + char *cc; ++ int r; + + assert(p); + ++ #ifdef HAVE_CGMANAGER ++ /* CGManager support */ ++ if (cgm_dbus_connect()) { ++ r = cgm_controller_exists(p); ++ ++ cgm_dbus_disconnect(); ++ ++ if (!r) ++ return -1; ++ ++ return 0; ++ } ++ #endif ++ + /* Check if this controller actually really exists */ + cc = alloca(sizeof("/sys/fs/cgroup/") + strlen(p)); + strcpy(stpcpy(cc, "/sys/fs/cgroup/"), p); +@@ -592,9 +723,58 @@ + int cg_trim(const char *controller, const char *path, bool delete_root) { + _cleanup_free_ char *fs = NULL; + int r = 0; ++ char **children = NULL; ++ int i = 0; ++ char *p1 = NULL; + + assert(path); + ++ #ifdef HAVE_CGMANAGER ++ /* CGManager support */ ++ if (cgm_dbus_connect()) { ++ if (!controller) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ ++ if (delete_root) { ++ r = cgm_remove(normalize_controller(controller), ++ path, 1); ++ ++ if (!r) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ } ++ else { ++ r = cgm_list_children(normalize_controller(controller), ++ path, &children); ++ ++ if (!r) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ ++ if (children) { ++ while (children[i]) { ++ p1 = strjoin(path, "/", children[i], NULL); ++ ++ r = cgm_remove(normalize_controller(controller), ++ p1, 1); ++ ++ free(p1); ++ i++; ++ } ++ nih_free(children); ++ } ++ } ++ ++ cgm_dbus_disconnect(); ++ ++ return 0; ++ } ++ #endif ++ + r = cg_get_path(controller, path, NULL, &fs); + if (r < 0) + return r; +@@ -644,6 +824,26 @@ + assert(path); + assert(pid >= 0); + ++ #ifdef HAVE_CGMANAGER ++ /* CGManager support */ ++ if (cgm_dbus_connect()) { ++ if (!controller) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ ++ r = cgm_enter(normalize_controller(controller), ++ path, pid); ++ ++ cgm_dbus_disconnect(); ++ ++ if (!r) ++ return -1; ++ ++ return 0; ++ } ++ #endif ++ + r = cg_get_path_and_check(controller, path, "tasks", &fs); + if (r < 0) + return r; +@@ -664,10 +864,33 @@ + gid_t gid) { + + _cleanup_free_ char *fs = NULL; +- int r; ++ int r, r1; + + assert(path); + ++ #ifdef HAVE_CGMANAGER ++ /* CGManager support */ ++ if (cgm_dbus_connect()) { ++ if (!controller) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ ++ r = cgm_chmod(normalize_controller(controller), ++ path, mode); ++ ++ r1 = cgm_chown(normalize_controller(controller), ++ path, uid, gid); ++ ++ cgm_dbus_disconnect(); ++ ++ if (!r && !r1) ++ return -1; ++ ++ return 0; ++ } ++ #endif ++ + if (mode != (mode_t) -1) + mode &= 0777; + +@@ -697,6 +920,36 @@ + if (mode != (mode_t) -1) + mode &= 0666; + ++ #ifdef HAVE_CGMANAGER ++ /* CGManager support */ ++ if (cgm_dbus_connect()) { ++ if (!controller) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ ++ r = cgm_chmod(normalize_controller(controller), ++ path, mode); ++ ++ if (!r) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ ++ r = cgm_chown(normalize_controller(controller), ++ path, uid, gid); ++ ++ if (!r) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ ++ cgm_dbus_disconnect(); ++ return 0; ++ } ++ #endif ++ ++ + r = cg_get_path(controller, path, "tasks", &fs); + if (r < 0) + return r; +@@ -906,14 +1159,59 @@ + int cg_is_empty_recursive(const char *controller, const char *path, bool ignore_self) { + _cleanup_closedir_ DIR *d = NULL; + char *fn; ++ char *p; + int r; + ++ char **children = NULL; ++ char *p1; ++ int i = 0; ++ + assert(path); + + r = cg_is_empty(controller, path, ignore_self); + if (r <= 0) + return r; + ++ #ifdef HAVE_CGMANAGER ++ /* CGManager support */ ++ if (cgm_dbus_connect()) { ++ if (!controller) { ++ cgm_dbus_disconnect(); ++ return -1; ++ } ++ ++ r = cgm_list_children(normalize_controller(controller), ++ path, &children); ++ ++ cgm_dbus_disconnect(); ++ ++ if (!r) ++ return -1; ++ ++ if (children) { ++ r = 0; ++ while (children[i]) { ++ p1 = strjoin(path, "/", children[i], NULL); ++ ++ if (cg_is_empty_recursive(controller, p1, ignore_self) != 0) { ++ r = -1; ++ free(p1); ++ break; ++ } ++ ++ free(p1); ++ i++; ++ } ++ nih_free(children); ++ ++ if (r < 0) ++ return r; ++ } ++ ++ return 1; ++ } ++ #endif ++ + r = cg_enumerate_subgroups(controller, path, &d); + if (r < 0) + return r == -ENOENT ? 1 : r; +Index: systemd-204/src/shared/cgroup-util.h +=================================================================== +--- systemd-204.orig/src/shared/cgroup-util.h 2013-05-06 15:06:04.057670685 -0400 ++++ systemd-204/src/shared/cgroup-util.h 2014-06-18 23:28:27.568644656 -0400 +@@ -113,3 +113,5 @@ + char *cg_unescape(const char *p) _pure_; + + bool cg_controller_is_valid(const char *p, bool allow_named); ++ ++const char *normalize_controller(const char *controller); +Index: systemd-204/src/login/logind.c +=================================================================== +--- systemd-204.orig/src/login/logind.c 2014-06-18 23:28:10.000000000 -0400 ++++ systemd-204/src/login/logind.c 2014-06-18 23:28:27.564644732 -0400 +@@ -38,6 +38,7 @@ + #include "strv.h" + #include "conf-parser.h" + #include "mkdir.h" ++#include "cgmanager.h" + + Manager *manager_new(void) { + Manager *m; +@@ -601,6 +602,57 @@ + int r = 0, k; + char *name; + ++ char **children = NULL; ++ int i; ++ ++ #ifdef HAVE_CGMANAGER ++ /* CGManager support */ ++ if (cgm_dbus_connect()) { ++ r = cgm_list_children("systemd", m->cgroup_path, ++ &children); ++ ++ cgm_dbus_disconnect(); ++ if (!r) ++ return -1; ++ ++ if (children) { ++ i = 0; ++ while (children[i]) { ++ User *user; ++ char *e; ++ ++ name = children[i]; ++ ++ e = endswith(name, ".user"); ++ if (e) { ++ *e = 0; ++ ++ k = manager_add_user_by_name(m, name, &user); ++ if (k < 0) { ++ r = k; ++ i++; ++ continue; ++ } ++ ++ user_add_to_gc_queue(user); ++ ++ if (!user->cgroup_path) { ++ user->cgroup_path = strjoin(m->cgroup_path, "/", name, NULL); ++ if (!user->cgroup_path) { ++ r = log_oom(); ++ break; ++ } ++ } ++ } ++ i++; ++ } ++ nih_free(children); ++ } ++ ++ return r; ++ } ++ #endif ++ + r = cg_enumerate_subgroups(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_path, &d); + if (r < 0) { + if (r == -ENOENT) +@@ -737,6 +789,9 @@ + Iterator i; + int r = 0; + ++ char **children = NULL; ++ int i1; ++ + HASHMAP_FOREACH(u, m->users, i) { + _cleanup_closedir_ DIR *d = NULL; + char *name; +@@ -745,6 +800,55 @@ + if (!u->cgroup_path) + continue; + ++ #ifdef HAVE_CGMANAGER ++ /* CGManager support */ ++ if (cgm_dbus_connect()) { ++ r = cgm_list_children("systemd", ++ u->cgroup_path, &children); ++ ++ cgm_dbus_disconnect(); ++ ++ if (!r) ++ return -1; ++ ++ if (children) { ++ i1 = 0; ++ while (children[i1]) { ++ Session *session; ++ char *e; ++ ++ name = children[i1]; ++ ++ e = endswith(name, ".session"); ++ if (e) { ++ *e = 0; ++ ++ k = manager_add_session(m, u, name, &session); ++ if (k < 0) { ++ r = k; ++ i1++; ++ continue; ++ } ++ ++ session_add_to_gc_queue(session); ++ ++ if (!session->cgroup_path) { ++ session->cgroup_path = strjoin(m->cgroup_path, "/", name, NULL); ++ if (!session->cgroup_path) { ++ r = log_oom(); ++ break; ++ } ++ } ++ } ++ i1++; ++ } ++ nih_free(children); ++ } ++ ++ continue; ++ } ++ #endif ++ + k = cg_enumerate_subgroups(SYSTEMD_CGROUP_CONTROLLER, u->cgroup_path, &d); + if (k < 0) { + if (k == -ENOENT) diff -Nru systemd-204/debian/patches/block-polling.patch systemd-204/debian/patches/block-polling.patch --- systemd-204/debian/patches/block-polling.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/block-polling.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,16 @@ +Description: Set default polling interval on CD drives as well. The events_dfl_poll_msecs will not trigger if "block" is not a module, but built in. This will avoid udisks etc. having to poll from userspace, and provide proper ejection when the hardware eject button is pressed. +Author: Martin Pitt +Bug-Ubuntu: https://launchpad.net/bugs/890592 + +Index: systemd/rules/60-persistent-storage.rules +=================================================================== +--- systemd.orig/rules/60-persistent-storage.rules 2013-01-30 04:32:08.399835311 +0100 ++++ systemd/rules/60-persistent-storage.rules 2013-05-10 10:56:53.165247525 +0200 +@@ -10,6 +10,7 @@ + + # enable in-kernel media-presence polling + ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_poll_msecs}=="0", ATTR{parameters/events_dfl_poll_msecs}="2000" ++ACTION=="add", ATTR{removable}=="1", ATTR{events_poll_msecs}=="-1", ATTR{events_poll_msecs}="2000" + + SUBSYSTEM!="block", GOTO="persistent_storage_end" + diff -Nru systemd-204/debian/patches/deputy_cgroup.patch systemd-204/debian/patches/deputy_cgroup.patch --- systemd-204/debian/patches/deputy_cgroup.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/deputy_cgroup.patch 2017-01-16 15:07:45.000000000 +0000 @@ -0,0 +1,150 @@ +Description: deputy systemd should use alternative cgroups path +Author: Dimitri John Ledkov + +--- a/src/cgtop/cgtop.c ++++ b/src/cgtop/cgtop.c +@@ -350,7 +350,11 @@ + + assert(a); + ++#ifdef HAVE_DEPUTY ++ r = refresh_one("name=dsystemd", "/", a, b, iteration, 0); ++#else + r = refresh_one("name=systemd", "/", a, b, iteration, 0); ++#endif + if (r < 0) + if (r != -ENOENT) + return r; +--- a/src/core/mount-setup.c ++++ b/src/core/mount-setup.c +@@ -88,11 +88,21 @@ + { "tmpfs", "/sys/fs/cgroup", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME, + NULL, MNT_IN_CONTAINER }, + #ifdef HAVE_XATTR ++#ifdef HAVE_DEPUTY ++ { "cgroup", "/sys/fs/cgroup/dsystemd", "cgroup", "none,name=dsystemd,xattr", MS_NOSUID|MS_NOEXEC|MS_NODEV, ++ NULL, MNT_IN_CONTAINER }, ++#else + { "cgroup", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd,xattr", MS_NOSUID|MS_NOEXEC|MS_NODEV, + NULL, MNT_IN_CONTAINER }, + #endif ++#endif ++#ifdef HAVE_DEPUTY ++ { "cgroup", "/sys/fs/cgroup/dsystemd", "cgroup", "none,name=dsystemd", MS_NOSUID|MS_NOEXEC|MS_NODEV, ++ NULL, MNT_IN_CONTAINER }, ++#else + { "cgroup", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV, + NULL, MNT_IN_CONTAINER }, ++#endif + { "pstore", "/sys/fs/pstore", "pstore", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, + NULL, MNT_NONE }, + #ifdef ENABLE_EFI +--- a/src/shared/cgroup-util.c ++++ b/src/shared/cgroup-util.c +@@ -583,7 +583,11 @@ + assert(controller); + + if (streq(controller, SYSTEMD_CGROUP_CONTROLLER)) ++#ifdef HAVE_DEPUTY ++ return "dsystemd"; ++#else + return "systemd"; ++#endif + else if (startswith(controller, "name=")) + return controller + 5; + else +@@ -1324,7 +1328,11 @@ + assert(path); + + if (!controller) ++#ifdef HAVE_DEPUTY ++ controller = "dsystemd"; ++#else + controller = "systemd"; ++#endif + else { + if (!cg_controller_is_valid(controller, true)) + return -EINVAL; +@@ -1479,7 +1487,11 @@ + + p = normalize_controller(*f); + ++#ifdef HAVE_DEPUTY ++ if (streq(p, "dsystemd")) { ++#else + if (streq(p, "systemd")) { ++#endif + free(*f); + continue; + } +--- a/src/shared/def.h ++++ b/src/shared/def.h +@@ -29,7 +29,11 @@ + + #define DEFAULT_EXIT_USEC (5*USEC_PER_MINUTE) + ++#ifdef HAVE_DEPUTY ++#define SYSTEMD_CGROUP_CONTROLLER "name=dsystemd" ++#else + #define SYSTEMD_CGROUP_CONTROLLER "name=systemd" ++#endif + + #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT + #define SIGNALS_IGNORE SIGKILL,SIGPIPE +--- a/configure.ac ++++ b/configure.ac +@@ -796,6 +796,18 @@ + PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16]) + ]) + ++ ++# ------------------------------------------------------------------------------ ++ ++AC_ARG_ENABLE([deputy], ++ AS_HELP_STRING([--enable-deputy], [Enable deputy mode]), ++ [], ++ enable_deputy=no) ++ ++AS_IF([test "x${enable_deputy}" = "xyes"], [ ++ AC_DEFINE(HAVE_DEPUTY, 1, [Enable deputy mode]) ++]) ++ + # ------------------------------------------------------------------------------ + + # Location of the init scripts as mandated by LSB +@@ -965,6 +977,7 @@ + Split /usr: ${enable_split_usr} + SysV compatibility: ${SYSTEM_SYSV_COMPAT} + CGManager ${enable_cgmanager} ++ Deputy ${enable_deputy} + + prefix: ${prefix} + rootprefix: ${with_rootprefix} +--- a/src/core/cgroup.c ++++ b/src/core/cgroup.c +@@ -327,7 +327,11 @@ + assert(m); + + /* 0. Be nice to Ingo Molnar #628004 */ ++#ifdef HAVE_DEPUTY ++ if (path_is_mount_point("/sys/fs/cgroup/dsystemd", false) <= 0) { ++#else + if (path_is_mount_point("/sys/fs/cgroup/systemd", false) <= 0) { ++#endif + log_warning("No control group support available, not creating root group."); + return 0; + } +--- a/src/core/main.c ++++ b/src/core/main.c +@@ -1399,7 +1399,11 @@ + + /* Mount /proc, /sys and friends, so that /proc/cmdline and + * /proc/$PID/fd is available. */ ++#ifdef HAVE_DEPUTY ++ if (true) { ++#else + if (getpid() == 1) { ++#endif + r = mount_setup(loaded_policy); + if (r < 0) + goto finish; diff -Nru systemd-204/debian/patches/deputy_shutdown.patch systemd-204/debian/patches/deputy_shutdown.patch --- systemd-204/debian/patches/deputy_shutdown.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/deputy_shutdown.patch 2017-01-05 14:35:27.000000000 +0000 @@ -0,0 +1,48 @@ +--- a/units/systemd-halt.service.in ++++ b/units/systemd-halt.service.in +@@ -14,4 +14,4 @@ + + [Service] + Type=oneshot +-ExecStart=@SYSTEMCTL@ --force halt ++ExecStart=/sbin/halt +--- a/units/systemd-kexec.service.in ++++ b/units/systemd-kexec.service.in +@@ -14,4 +14,4 @@ + + [Service] + Type=oneshot +-ExecStart=@SYSTEMCTL@ --force kexec ++ExecStart=/bin/false +--- a/units/systemd-poweroff.service.in ++++ b/units/systemd-poweroff.service.in +@@ -14,4 +14,4 @@ + + [Service] + Type=oneshot +-ExecStart=@SYSTEMCTL@ --force poweroff ++ExecStart=/sbin/poweroff +--- a/units/systemd-reboot.service.in ++++ b/units/systemd-reboot.service.in +@@ -14,4 +14,4 @@ + + [Service] + Type=oneshot +-ExecStart=@SYSTEMCTL@ --force reboot ++ExecStart=/sbin/reboot +--- a/units/systemd-hibernate.service.in ++++ b/units/systemd-hibernate.service.in +@@ -14,4 +14,4 @@ + + [Service] + Type=oneshot +-ExecStart=@rootlibexecdir@/systemd-sleep hibernate ++ExecStart=/usr/sbin/pm-hibernate +--- a/units/systemd-suspend.service.in ++++ b/units/systemd-suspend.service.in +@@ -14,4 +14,4 @@ + + [Service] + Type=oneshot +-ExecStart=@rootlibexecdir@/systemd-sleep suspend ++ExecStart=/usr/sbin/pm-suspend diff -Nru systemd-204/debian/patches/deputy_unit_path.patch systemd-204/debian/patches/deputy_unit_path.patch --- systemd-204/debian/patches/deputy_unit_path.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/deputy_unit_path.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,40 @@ +Description: Do not read units from /lib/systemd/system, but from /lib/systemd/upstart/ + In Ubuntu 14.04 there are a lot of packages which ship a systemd system unit, + but almost all of these must not run for running systemd's service manager as + a "deputy" init alongside upstart. We do need some of them though, so read + units from /lib/systemd/upstart. +Author: Martin Pitt + +Index: systemd/src/shared/path-lookup.c +=================================================================== +--- systemd.orig/src/shared/path-lookup.c ++++ systemd/src/shared/path-lookup.c +@@ -303,11 +303,7 @@ int lookup_paths_init( + "/run/systemd/system", + STRV_IFNOTNULL(generator), + "/usr/local/lib/systemd/system", +- SYSTEM_DATA_UNIT_PATH, +- "/usr/lib/systemd/system", +-#ifdef HAVE_SPLIT_USR +- "/lib/systemd/system", +-#endif ++ "/lib/systemd/upstart", + STRV_IFNOTNULL(generator_late), + NULL); + +Index: systemd/src/core/load-fragment.c +=================================================================== +--- systemd.orig/src/core/load-fragment.c ++++ systemd/src/core/load-fragment.c +@@ -2113,6 +2113,11 @@ static int open_follow(char **filename, + r = readlink_and_make_absolute(*filename, &target); + if (r < 0) + return r; ++ /* Ignore linked units in /lib/systemd/system/ for deputy systemd init */ ++ if (strneq(target, "/lib/systemd/system/", strlen("/lib/systemd/system/"))) { ++ log_warning("Ignoring %s -> %s for systemd deputy init", *filename, target); ++ return -ENOENT; ++ } + + free(*filename); + *filename = target; diff -Nru systemd-204/debian/patches/disable-failing-buildd-tests.patch systemd-204/debian/patches/disable-failing-buildd-tests.patch --- systemd-204/debian/patches/disable-failing-buildd-tests.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/disable-failing-buildd-tests.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,36 @@ +Description: test-unit-name fails on buildds for now, presumably due to a missing /etc/hostname? +Author: Martin Pitt + +Index: systemd/Makefile.am +=================================================================== +--- systemd.orig/Makefile.am 2013-07-05 08:20:55.117243973 +0200 ++++ systemd/Makefile.am 2013-07-05 08:20:55.113243972 +0200 +@@ -1095,16 +1095,12 @@ + test-strv \ + test-path-util \ + test-strxcpyx \ +- test-unit-name \ + test-unit-file \ +- test-util \ + test-date \ + test-sleep \ + test-replace-var \ +- test-sched-prio \ + test-calendarspec \ + test-strip-tab-ansi \ +- test-cgroup-util \ + test-prioq \ + test-fileio \ + test-time \ +@@ -2867,10 +2863,9 @@ + test-journal-send \ + test-journal-syslog \ + test-journal-match \ +- test-journal-stream \ + test-journal-verify \ + test-mmap-cache \ +- test-catalog ++ $(NULL) + + pkginclude_HEADERS += \ + src/systemd/sd-journal.h \ diff -Nru systemd-204/debian/patches/do-not-create-run-nologin.patch systemd-204/debian/patches/do-not-create-run-nologin.patch --- systemd-204/debian/patches/do-not-create-run-nologin.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/do-not-create-run-nologin.patch 2017-02-02 10:24:53.000000000 +0000 @@ -0,0 +1,15 @@ +Description: Do not create /run/nologin + systemd in trusty is not responsible for handling startup/shutdown scenarios. + With that, it should not interfere with pam_nologin and should not touch + /run/nologin. +Author: Thomas Voß +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1660573 + +--- a/tmpfiles.d/systemd.conf ++++ b/tmpfiles.d/systemd.conf +@@ -20,5 +20,3 @@ + d /run/systemd/sessions 0755 root root - + d /run/systemd/users 0755 root root - + d /run/systemd/shutdown 0755 root root - +- +-F /run/nologin 0644 - - - "System is booting up." diff -Nru systemd-204/debian/patches/env-variable-for-machine-ID-path.patch systemd-204/debian/patches/env-variable-for-machine-ID-path.patch --- systemd-204/debian/patches/env-variable-for-machine-ID-path.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/env-variable-for-machine-ID-path.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,40 @@ +From 237e0f62065760fc0acf5f379457f6715cee6784 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Fri, 15 Mar 2013 08:27:43 +0100 +Subject: [PATCH] Add env variable for machine ID path + +During package build, in minimal chroots, or other systems which do not already +have an /etc/machine-id we get six test failures. Introduce a +$SYSTEMD_MACHINE_ID_PATH environment variable which can specify a location +other than /etc/machine-id, so that the unit tests are independent from the +environment. + +https://bugs.freedesktop.org/show_bug.cgi?id=62344 +--- + src/libsystemd-id128/sd-id128.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +Index: systemd/src/libsystemd-id128/sd-id128.c +=================================================================== +--- systemd.orig/src/libsystemd-id128/sd-id128.c 2013-07-05 08:20:51.769243811 +0200 ++++ systemd/src/libsystemd-id128/sd-id128.c 2013-07-05 08:20:51.765243810 +0200 +@@ -115,6 +115,7 @@ + ssize_t k; + unsigned j; + sd_id128_t t; ++ const char *machine_id_path; + + if (!ret) + return -EINVAL; +@@ -124,7 +125,10 @@ + return 0; + } + +- fd = open("/etc/machine-id", O_RDONLY|O_CLOEXEC|O_NOCTTY); ++ machine_id_path = getenv("SYSTEMD_MACHINE_ID_PATH"); ++ if (machine_id_path == NULL) ++ machine_id_path = "/etc/machine-id"; ++ fd = open(machine_id_path, O_RDONLY|O_CLOEXEC|O_NOCTTY); + if (fd < 0) + return -errno; + diff -Nru systemd-204/debian/patches/fix-ftbfs.patch systemd-204/debian/patches/fix-ftbfs.patch --- systemd-204/debian/patches/fix-ftbfs.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/fix-ftbfs.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,13 @@ +Description: Fix FTBFS against recent kernels & glibc. +Author: Dimitri John Ledkov + +--- systemd-204.orig/src/core/socket.c ++++ systemd-204/src/core/socket.c +@@ -29,6 +29,7 @@ + #include + #include + #ifdef HAVE_XATTR ++#include + #include + #endif + diff -Nru systemd-204/debian/patches/fix-race-condition-of-serio-driver-module-not-loading.patch systemd-204/debian/patches/fix-race-condition-of-serio-driver-module-not-loading.patch --- systemd-204/debian/patches/fix-race-condition-of-serio-driver-module-not-loading.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/fix-race-condition-of-serio-driver-module-not-loading.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,16 @@ +Author: Eric Miao +Description: Fix a race condition at boot with serio devices +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1014460 + +Index: systemd/rules/80-drivers.rules +=================================================================== +--- systemd.orig/rules/80-drivers.rules 2013-03-20 22:58:40.126281337 +0100 ++++ systemd/rules/80-drivers.rules 2013-05-10 11:02:28.505261354 +0200 +@@ -8,6 +8,7 @@ + SUBSYSTEM=="memstick", RUN{builtin}="kmod load ms_block mspro_block" + SUBSYSTEM=="i2o", RUN{builtin}="kmod load i2o_block" + SUBSYSTEM=="module", KERNEL=="parport_pc", RUN{builtin}="kmod load ppdev" ++SUBSYSTEM=="serio", ENV{MODALIAS}=="?*", RUN{builtin}="kmod load $env{MODALIAS}" + KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN{builtin}="kmod load sm_ftl" + + LABEL="drivers_end" diff -Nru systemd-204/debian/patches/ignore-omap-vsync.patch systemd-204/debian/patches/ignore-omap-vsync.patch --- systemd-204/debian/patches/ignore-omap-vsync.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/ignore-omap-vsync.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,77 @@ +Description: Ignore VSYNC change uevents from omapfb, as they happen at each vsync and thus keep waking up udevd (including rules processing), upstart, and other parts of the system 60 times a second. +Author: Martin Pitt +Forwarded: Heck, don't ever show this embarassing hack to anyone. Except if that anyone is an omapfb author, then please don't stop showing this to them until they fix the driver :-) +Bug-Ubuntu: https://launchpad.net/bugs/1234743 + +Index: systemd/src/libudev/libudev-monitor.c +=================================================================== +--- systemd.orig/src/libudev/libudev-monitor.c 2013-02-20 02:32:41.900839006 +0100 ++++ systemd/src/libudev/libudev-monitor.c 2013-10-17 11:38:56.216374114 +0200 +@@ -198,6 +198,9 @@ + (*i)++; + } + ++/* return uint32_t for the first 4 characters in s */ ++#define str2word(s) ((s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3]) ++ + /** + * udev_monitor_filter_update: + * @udev_monitor: monitor +@@ -216,6 +219,11 @@ + int err; + + if (udev_list_get_entry(&udev_monitor->filter_subsystem_list) == NULL && ++#ifdef __arm__ ++ /* we always need a filter chain for kernel monitors to get rid ++ * of the omapfb VSYNC uevents */ ++ udev_monitor->snl.nl.nl_groups != UDEV_MONITOR_KERNEL && ++#endif + udev_list_get_entry(&udev_monitor->filter_tag_list) == NULL) + return 0; + +@@ -224,8 +232,45 @@ + + /* load magic in A */ + bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, offsetof(struct udev_monitor_netlink_header, magic)); ++#ifndef __arm__ + /* jump if magic matches */ + bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, UDEV_MONITOR_MAGIC, 1, 0); ++#else ++ /* jump over our whole omapfb/VSYNC check if magic matches */ ++ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, UDEV_MONITOR_MAGIC, 10, 0); ++ ++ /* filter out omapfb change VSYNC uevents (LP #1234743); they look like ++change@/devices/platform/omapfb\x00ACTION=change\x00DEVPATH=/devices/platform/omapfb\x00SUBSYSTEM=platform\x00VSYNC=1737775695800\x00DRIVER=omapfb\x00MODALIAS=platform:omapfb\x00SEQNUM=8909\x00 ++ ++ Matching on the VSYNC attribute is a bit finicky, as its exact ++ position in the packet might not be reliable. The real VSYNC uevents ++ have packets of ~ 170 bytes length (varying with the string length of ++ VSYNC= and SEQNUM), while a simple synthetic ++ "echo change | tee /sys/devices/platform/omapfb/uevent" only has 150. ++ So we instead just compare the length of the packet and use 160 as a divider. ++ As we don't generally care about that device at all, this logic does ++ not need to be rock solid, though -- if we would just ignore all ++ change events from that device nothing should break. ++ */ ++ ++ /* if the event is shorter than 160 bytes, it can't be omapfb/VSYNC, jump to "pass" */ ++ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_LEN, 0); ++ bpf_jmp(ins, &i, BPF_JMP|BPF_JGE|BPF_K, 160, 0, 7); ++ ++ /* check if it is a change event; if not, jump to "pass" */ ++ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, 0); ++ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, str2word("chan"), 0, 5); ++ ++ /* check if it is from omapfb */ ++ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, 24); ++ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, str2word("/oma"), 0, 3); ++ bpf_stmt(ins, &i, BPF_LD|BPF_W|BPF_ABS, 28); ++ bpf_jmp(ins, &i, BPF_JMP|BPF_JEQ|BPF_K, str2word("pfb\0"), 0, 1); ++ ++ /* we found the omapfb change uevent, reject it */ ++ bpf_stmt(ins, &i, BPF_RET|BPF_K, 0); ++#endif /* omapfb filter hack on __arm__ */ ++ + /* wrong magic, pass packet */ + bpf_stmt(ins, &i, BPF_RET|BPF_K, 0xffffffff); + diff -Nru systemd-204/debian/patches/load-fbcon.patch systemd-204/debian/patches/load-fbcon.patch --- systemd-204/debian/patches/load-fbcon.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/load-fbcon.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,17 @@ +Description: Load the fbcon driver when a framebuffer is created. +Author: Scott James Remnant +Bug-Ubuntu: https://launchpad.net/bugs/392039 +Bug-Ubuntu: https://launchpad.net/bugs/431812 + +Index: systemd/rules/80-drivers.rules +=================================================================== +--- systemd.orig/rules/80-drivers.rules 2013-05-10 11:16:41.933296547 +0200 ++++ systemd/rules/80-drivers.rules 2013-05-10 11:17:06.949297579 +0200 +@@ -9,6 +9,7 @@ + SUBSYSTEM=="i2o", RUN{builtin}="kmod load i2o_block" + SUBSYSTEM=="module", KERNEL=="parport_pc", RUN{builtin}="kmod load ppdev" + SUBSYSTEM=="serio", ENV{MODALIAS}=="?*", RUN{builtin}="kmod load $env{MODALIAS}" ++SUBSYSTEM=="graphics", RUN{builtin}="kmod load fbcon" + KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN{builtin}="kmod load sm_ftl" + + LABEL="drivers_end" diff -Nru systemd-204/debian/patches/load-modules-for-bound-devices.patch systemd-204/debian/patches/load-modules-for-bound-devices.patch --- systemd-204/debian/patches/load-modules-for-bound-devices.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/load-modules-for-bound-devices.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,39 @@ +From bf7f800f2b3e93ccd1229d4717166f3a4d3af72f Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Sat, 20 Jul 2013 14:29:12 +0200 +Subject: rules: drivers - always call kmod, even when a driver is bound to the + device + +On Sat, Jul 20, 2013 at 12:56 PM, Rafael J. Wysocki wrote: +> After a recent change present in 3.11-rc1 there is a driver, called processor, +> that can be bound to the CPU devices whose sysfs directories are located under +> /sys/devices/system/cpu/. A side effect of this is that, after the driver has +> been bound to those devices, the kernel adds DRIVER=processor to ENV for CPU +> uevents and they don't match the default rule for autoloading modules matching +> MODALIAS: +> +> DRIVER!="?*", ENV{MODALIAS}=="?*", IMPORT{builtin}="kmod load $env{MODALIAS}" +> +> any more. However, there are some modules whose module aliases match specific +> CPU features through the modalias string and those modules should be loaded +> automatically if a compatible CPU is present. Yet, with the processor driver +> bound to the CPU devices the above rule is not sufficient for that, so we need +> a new default udev rule allowing those modules to be autoloaded even if the +> CPU devices have drivers. + +diff --git a/rules/80-drivers.rules b/rules/80-drivers.rules +index 50523e4..0b22d73 100644 +--- a/rules/80-drivers.rules ++++ b/rules/80-drivers.rules +@@ -2,7 +2,7 @@ + + ACTION=="remove", GOTO="drivers_end" + +-DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{builtin}="kmod load $env{MODALIAS}" ++ENV{MODALIAS}=="?*", RUN{builtin}="kmod load $env{MODALIAS}" + SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN{builtin}="kmod load tifm_sd" + SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN{builtin}="kmod load tifm_ms" + SUBSYSTEM=="memstick", RUN{builtin}="kmod load ms_block mspro_block" +-- +cgit v0.10.2 + diff -Nru systemd-204/debian/patches/login-monitor-no-machine.patch systemd-204/debian/patches/login-monitor-no-machine.patch --- systemd-204/debian/patches/login-monitor-no-machine.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/login-monitor-no-machine.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,22 @@ +Description: Fix sd_login_monitor_new() to not fail if there is no /sys/fs/cgroup/systemd/machine; that only exists when running with systemd as PID 1. +Author: Martin Pitt +Bug-Ubuntu: https://launchpad.net/bugs/1201180 + +Index: systemd/src/login/sd-login.c +=================================================================== +--- systemd.orig/src/login/sd-login.c 2013-05-07 21:07:22.906025572 +0200 ++++ systemd/src/login/sd-login.c 2013-07-19 08:38:39.437270958 +0200 +@@ -690,10 +690,13 @@ + return r; + + k = inotify_add_watch(fd, p, IN_MOVED_TO|IN_CREATE|IN_DELETE); ++ /* when running logind without pid 1, this will fail */ ++ /* + if (k < 0) { + close_nointr_nofail(fd); + return -errno; + } ++ */ + + good = true; + } diff -Nru systemd-204/debian/patches/logind-fix-small-memleaks.patch systemd-204/debian/patches/logind-fix-small-memleaks.patch --- systemd-204/debian/patches/logind-fix-small-memleaks.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/logind-fix-small-memleaks.patch 2018-04-03 18:27:52.000000000 +0000 @@ -0,0 +1,42 @@ +Description: logind - fix small memleaks + 1) Fix leak in session_free(), by freeing the reset_controllers ptr; + 2) Fix another leak in cgmanager glue code. +Author: Guilherme G. Piccoli +Bug-Ubuntu: https://launchpad.net/bugs/1750013 +Forwarded: not-needed +Last-Update: 2018-03-29 + +Index: systemd-204/src/login/logind-session.c +=================================================================== +--- systemd-204.orig/src/login/logind-session.c 2018-03-02 18:15:32.000417853 +0000 ++++ systemd-204/src/login/logind-session.c 2018-03-02 18:16:00.504417495 +0000 +@@ -93,6 +93,7 @@ + + free(s->cgroup_path); + strv_free(s->controllers); ++ strv_free(s->reset_controllers); + + free(s->tty); + free(s->display); +Index: systemd-204/src/shared/cgroup-util.c +=================================================================== +--- systemd-204.orig/src/shared/cgroup-util.c 2018-03-02 18:15:32.000417853 +0000 ++++ systemd-204/src/shared/cgroup-util.c 2018-03-02 18:15:31.996417853 +0000 +@@ -44,7 +44,7 @@ + _cleanup_free_ char *fs = NULL; + FILE *f; + int r; +- char *value = NULL; ++ _cleanup_free_ char *value = NULL; + char *template = NULL; + int fd; + +@@ -111,7 +111,7 @@ + _cleanup_free_ char *fs = NULL; + FILE *f; + int r; +- char *value = NULL; ++ _cleanup_free_ char *value = NULL; + char *template = NULL; + int fd; + diff -Nru systemd-204/debian/patches/pam-check-runtime-dir-user.patch systemd-204/debian/patches/pam-check-runtime-dir-user.patch --- systemd-204/debian/patches/pam-check-runtime-dir-user.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/pam-check-runtime-dir-user.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,57 @@ +From: Martin Pitt +Date: Wed, 13 Nov 2013 13:02:28 +0100 +Subject: [PATCH] pam: Check $XDG_RUNTIME_DIR owner + +http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html requires +that $XDG_RUNTIME_DIR "MUST be owned by the user, and he MUST be the only one +having read and write access to it.". + +Don't set an existing $XDG_RUNTIME_DIR in the PAM module if it isn't owned by +the session user. Otherwise su sessions get a runtime dir from a different user +which leads to either permission errors or scribbling over the other user's +files. + +Bug-Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=753882 +Bug-Ubuntu: https://launchpad.net/bugs/1197395 + +Index: systemd/src/login/pam-module.c +=================================================================== +--- systemd.orig/src/login/pam-module.c 2013-11-14 17:45:34.227987658 +0100 ++++ systemd/src/login/pam-module.c 2013-11-14 17:48:01.203986318 +0100 +@@ -329,6 +329,7 @@ + dbus_bool_t remote, existing; + int r; + uint32_t vtnr = 0; ++ struct stat st; + + assert(handle); + +@@ -565,11 +566,25 @@ + goto finish; + } + +- r = pam_misc_setenv(handle, "XDG_RUNTIME_DIR", runtime_path, 0); +- if (r != PAM_SUCCESS) { +- pam_syslog(handle, LOG_ERR, "Failed to set runtime dir."); ++ /* only set $XDG_RUNTIME_DIR if it is owned by the target user, as per ++ * XDG basedir-spec; this avoids su sessions to scribble over a runtime ++ * dir of a different user */ ++ r = lstat(runtime_path, &st); ++ if (r != 0) { ++ pam_syslog(handle, LOG_ERR, "Failed to stat runtime dir: %s", strerror(errno)); ++ r = PAM_SYSTEM_ERR; + goto finish; + } ++ if (st.st_uid == uid) { ++ r = pam_misc_setenv(handle, "XDG_RUNTIME_DIR", runtime_path, 0); ++ if (r != PAM_SUCCESS) { ++ pam_syslog(handle, LOG_ERR, "Failed to set runtime dir."); ++ goto finish; ++ } ++ } else if (debug) { ++ pam_syslog(handle, LOG_DEBUG, "Runtime dir %s is not owned by the target uid %u, ignoring.", ++ runtime_path, uid); ++ } + + if (!isempty(seat)) { + r = pam_misc_setenv(handle, "XDG_SEAT", seat, 0); diff -Nru systemd-204/debian/patches/persistent-storage-rule-mmc-partname.patch systemd-204/debian/patches/persistent-storage-rule-mmc-partname.patch --- systemd-204/debian/patches/persistent-storage-rule-mmc-partname.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/persistent-storage-rule-mmc-partname.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,23 @@ +Description: Create disk/by-partlabel links for mmcblk partitions + Android based kernel exports the uevent property PARTNAME, which can be + used to find out at run time the named partitions (e.g. boot) for the + device. + . + This is specially useful for the Touch based images and flash-kernel, + to automatically update the kernel by writing at the correct partition + (independently of the hardware revision). +Forwarded: no +Author: Ricardo Salveti + +Index: systemd/rules/60-persistent-storage.rules +=================================================================== +--- systemd.orig/rules/60-persistent-storage.rules 2013-01-30 04:32:08.399835311 +0100 ++++ systemd/rules/60-persistent-storage.rules 2013-05-22 11:07:07.486872081 +0200 +@@ -48,6 +48,7 @@ + + KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}" + KERNEL=="mmcblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n" ++KERNEL=="mmcblk[0-9]p[0-9]", ENV{PARTNAME}=="?*", SYMLINK+="disk/by-partlabel/$env{PARTNAME}" + KERNEL=="mspblk[0-9]", SUBSYSTEMS=="memstick", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}" + KERNEL=="mspblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}-part%n" + diff -Nru systemd-204/debian/patches/private-bus-for-nonpid1.patch systemd-204/debian/patches/private-bus-for-nonpid1.patch --- systemd-204/debian/patches/private-bus-for-nonpid1.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/private-bus-for-nonpid1.patch 2017-01-16 13:49:45.000000000 +0000 @@ -0,0 +1,50 @@ +Description: Create/use private D-Bus socket also for systemd --system + +Without this we cannot use systemctl as root or when D-Bus is not running. +--- a/src/core/dbus.c ++++ b/src/core/dbus.c +@@ -983,31 +983,8 @@ + } + + static int bus_init_system(Manager *m) { +- int r; +- +- if (m->system_bus) +- return 0; +- +- m->system_bus = manager_bus_connect_private(m, DBUS_BUS_SYSTEM); +- if (!m->system_bus) { +- log_debug("Failed to connect to system D-Bus, retrying later"); +- r = 0; +- goto fail; +- } +- +- r = bus_setup_loop(m, m->system_bus); +- if (r < 0) +- goto fail; +- +- r = manager_bus_async_register(m, &m->system_bus); +- if (r < 0) +- goto fail; +- ++ /* no need to connect to system D-Bus for the subordinate systemd */ + return 0; +-fail: +- bus_done_system(m); +- +- return r; + } + + static int bus_init_api(Manager *m) { +@@ -1064,11 +1041,6 @@ + return 0; + + if (m->running_as == SYSTEMD_SYSTEM) { +- +- /* We want the private bus only when running as init */ +- if (getpid() != 1) +- return 0; +- + unlink("/run/systemd/private"); + m->private_bus = dbus_server_listen("unix:path=/run/systemd/private", &error); + } else { diff -Nru systemd-204/debian/patches/rules-add-NVMe-rules-3136.patch systemd-204/debian/patches/rules-add-NVMe-rules-3136.patch --- systemd-204/debian/patches/rules-add-NVMe-rules-3136.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/rules-add-NVMe-rules-3136.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,38 @@ +From 427a28ecbe0eb170e651e0530ab58d6e6f6c498c Mon Sep 17 00:00:00 2001 +From: Ming Lin +Date: Fri, 29 Apr 2016 04:02:57 -0700 +Subject: [PATCH] rules: add NVMe rules (#3136) + +Add NVMe rules using the "wwid" attribute. + +root@target:~# cat /sys/block/nvme0n1/wwid +eui.3825004235000591 + +root@target:~# ls /dev/disk/by-id/ -l |grep nvme +lrwxrwxrwx 1 root root 13 Apr 27 16:08 nvme-eui.3825004235000591 -> ../../nvme0n1 +lrwxrwxrwx 1 root root 15 Apr 27 16:08 nvme-eui.3825004235000591-part1 -> ../../nvme0n1p1 +lrwxrwxrwx 1 root root 15 Apr 27 16:08 nvme-eui.3825004235000591-part2 -> ../../nvme0n1p2 + +Bug-Ubuntu: https://launchpad.net/bugs/1642903 +--- + rules/60-persistent-storage.rules | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules +index 0b14bb4..7ad8a55 100644 +--- a/rules/60-persistent-storage.rules ++++ b/rules/60-persistent-storage.rules +@@ -14,6 +14,10 @@ TEST=="whole_disk", GOTO="persistent_storage_end" + # for partitions import parent information + ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*" + ++# NVMe ++KERNEL=="nvme*[0-9]n*[0-9]", ATTR{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}" ++KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}-part%n" ++ + # virtio-blk + KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}" + KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n" +-- +2.9.3 + diff -Nru systemd-204/debian/patches/rules-introduce-disk-by-id-model_serial-symlinks-for.patch systemd-204/debian/patches/rules-introduce-disk-by-id-model_serial-symlinks-for.patch --- systemd-204/debian/patches/rules-introduce-disk-by-id-model_serial-symlinks-for.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/rules-introduce-disk-by-id-model_serial-symlinks-for.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,37 @@ +From a5110c90303cf455db5062faef34d5724d12e2e9 Mon Sep 17 00:00:00 2001 +From: Michal Sekletar +Date: Wed, 17 Aug 2016 14:10:28 +0200 +Subject: [PATCH] rules: introduce disk/by-id (model_serial) symlinks for NVMe + drives (#3974) + +$ ls -l /dev/disk/by-id/nvme* +lrwxrwxrwx. 1 root root 13 Aug 17 04:25 /dev/disk/by-id/nvme-HUSPR3216AHP301_STM0001B6780 -> ../../nvme0n1 +lrwxrwxrwx. 1 root root 15 Aug 17 04:25 /dev/disk/by-id/nvme-HUSPR3216AHP301_STM0001B6780-part1 -> ../../nvme0n1p1 + +https://github.com/systemd/systemd/issues/1453 +https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=779ff75617099f4defe14e20443b95019a4c5ae8 +Signed-off-by: Dan Streetman +--- + rules/60-persistent-storage.rules | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules +index d7bbbf9..c13d05c 100644 +--- a/rules/60-persistent-storage.rules ++++ b/rules/60-persistent-storage.rules +@@ -19,6 +19,12 @@ ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*" + KERNEL=="nvme*[0-9]n*[0-9]", ATTR{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}" + KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}-part%n" + ++KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}" ++KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{model}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_SERIAL}="$attr{model}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}" ++ ++KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}" ++KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{model}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_SERIAL}="$attr{model}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}-part%n" ++ + # virtio-blk + KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}" + KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n" +-- +2.9.3 + diff -Nru systemd-204/debian/patches/series systemd-204/debian/patches/series --- systemd-204/debian/patches/series 2013-09-23 11:28:40.000000000 +0000 +++ systemd-204/debian/patches/series 2019-03-07 16:30:13.000000000 +0000 @@ -1,3 +1,45 @@ # debian/source/git-patches exported from git by export-hook v204..upstream-fixes_204-5 debian-changes + +# cherrypicked from upstream trunk +upstream-hwdb-keyboard.patch +upstream-hwdb-updates.patch +upstream-reboot-polkit-permissions.patch +upstream-ignore-mmcrpmb.patch +upstream-uaccess-Add-new-DRM-render-nodes.patch +rules-add-NVMe-rules-3136.patch +rules-introduce-disk-by-id-model_serial-symlinks-for.patch +0001-libudev-util-change-util_replace_whitespace-to-retur.patch +0002-udev-event-add-replace_whitespace-param-to-udev_even.patch +0003-udev-rules-perform-whitespace-replacement-for-symlin.patch + +# rejected upstream +env-variable-for-machine-ID-path.patch +persistent-storage-rule-mmc-partname.patch + +# Ubuntu specific +login-monitor-no-machine.patch +disable-failing-buildd-tests.patch +block-polling.patch +fix-race-condition-of-serio-driver-module-not-loading.patch +load-fbcon.patch +load-modules-for-bound-devices.patch +support-phablet-etc-writable.patch +ignore-omap-vsync.patch +pam-check-runtime-dir-user.patch +ubuntu-logind-controllers.patch +fix-ftbfs.patch + +add-cgmanager-support +Advertise-hibernation-only-if-there-s-enough-free-sw.patch +ProLiant-power-button.patch +private-bus-for-nonpid1.patch +deputy_unit_path.patch +deputy_shutdown.patch +deputy_cgroup.patch +do-not-create-run-nologin.patch +CVE-2018-1049.patch +logind-fix-small-memleaks.patch +0001-udev-build-by-path-identifiers-for-ATA-devices.patch +CVE-2019-3842.patch diff -Nru systemd-204/debian/patches/support-phablet-etc-writable.patch systemd-204/debian/patches/support-phablet-etc-writable.patch --- systemd-204/debian/patches/support-phablet-etc-writable.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/support-phablet-etc-writable.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,175 @@ +Description: On Ubuntu Phone with readonly /etc we symlink /etc/{adjtime,localtime,timezone,hostname,machine-info} to /etc/writable/, so we need to update those files instead if the original files are symlinks into /etc/writable/. +Author: Martin Pitt +Forwarded: OMGno, this is a rather nasty hack until we get a clean solution for an /etc overlay +Bug-Ubuntu: https://launchpad.net/bugs/1227520 + +--- a/src/timedate/timedated.c ++++ b/src/timedate/timedated.c +@@ -105,6 +105,25 @@ + tz.local_rtc = false; + } + ++/* Hack for Ubuntu phone: check if path is an existing symlink to ++ * /etc/writable; if it is, update that instead */ ++static const char* writable_filename(const char *path) { ++ ssize_t r; ++ static char realfile_buf[PATH_MAX]; ++ _cleanup_free_ char *realfile = NULL; ++ const char *result = path; ++ int orig_errno = errno; ++ ++ r = readlink_and_make_absolute(path, &realfile); ++ if (r >= 0 && startswith(realfile, "/etc/writable")) { ++ snprintf(realfile_buf, sizeof(realfile_buf), "%s", realfile); ++ result = realfile_buf; ++ } ++ ++ errno = orig_errno; ++ return result; ++} ++ + static bool valid_timezone(const char *name) { + const char *p; + char *t; +@@ -159,7 +178,7 @@ + + free_data(); + +- r = readlink_malloc("/etc/localtime", &t); ++ r = readlink_malloc(writable_filename("/etc/localtime"), &t); + if (r < 0) { + if (r == -EINVAL) + log_warning("/etc/localtime should be a symbolic link to a timezone data file in /usr/share/zoneinfo/."); +@@ -207,25 +226,25 @@ + struct stat st; + + if (!tz.zone) { +- if (unlink("/etc/localtime") < 0 && errno != ENOENT) ++ if (unlink(writable_filename("/etc/localtime")) < 0 && errno != ENOENT) + r = -errno; + +- if (unlink("/etc/timezone") < 0 && errno != ENOENT) ++ if (unlink(writable_filename("/etc/timezone")) < 0 && errno != ENOENT) + r = -errno; + + return r; + } + +- p = strappend("../usr/share/zoneinfo/", tz.zone); ++ p = strappend("/usr/share/zoneinfo/", tz.zone); + if (!p) + return log_oom(); + +- r = symlink_atomic(p, "/etc/localtime"); ++ r = symlink_atomic(p, writable_filename("/etc/localtime")); + if (r < 0) + return r; + +- if (stat("/etc/timezone", &st) == 0 && S_ISREG(st.st_mode)) { +- r = write_string_file_atomic("/etc/timezone", tz.zone); ++ if (stat(writable_filename("/etc/timezone"), &st) == 0 && S_ISREG(st.st_mode)) { ++ r = write_string_file_atomic(writable_filename("/etc/timezone"), tz.zone); + if (r < 0) + return r; + } +@@ -276,7 +295,7 @@ + *(char*) mempcpy(stpcpy(mempcpy(w, s, a), tz.local_rtc ? "LOCAL" : "UTC"), e, b) = 0; + + if (streq(w, NULL_ADJTIME_UTC)) { +- if (unlink("/etc/adjtime") < 0) ++ if (unlink(writable_filename("/etc/adjtime")) < 0) + if (errno != ENOENT) + return -errno; + +@@ -284,7 +303,7 @@ + } + } + label_init("/etc"); +- return write_string_file_atomic_label("/etc/adjtime", w); ++ return write_string_file_atomic_label(writable_filename("/etc/adjtime"), w); + } + + static char** get_ntp_services(void) { +--- a/src/hostname/hostnamed.c ++++ b/src/hostname/hostnamed.c +@@ -108,6 +108,26 @@ + } + } + ++/* Hack for Ubuntu phone: check if path is an existing symlink to ++ * /etc/writable; if it is, update that instead */ ++static const char* writable_filename(const char *path) { ++ ssize_t r; ++ static char realfile_buf[PATH_MAX]; ++ _cleanup_free_ char *realfile = NULL; ++ const char *result = path; ++ int orig_errno = errno; ++ ++ r = readlink_and_make_absolute(path, &realfile); ++ if (r >= 0 && startswith(realfile, "/etc/writable")) { ++ snprintf(realfile_buf, sizeof(realfile_buf), "%s", realfile); ++ result = realfile_buf; ++ } ++ ++ errno = orig_errno; ++ return result; ++} ++ ++ + static int read_data(void) { + int r; + +@@ -117,11 +137,11 @@ + if (!data[PROP_HOSTNAME]) + return -ENOMEM; + +- r = read_one_line_file("/etc/hostname", &data[PROP_STATIC_HOSTNAME]); ++ r = read_one_line_file(writable_filename("/etc/hostname"), &data[PROP_STATIC_HOSTNAME]); + if (r < 0 && r != -ENOENT) + return r; + +- r = parse_env_file("/etc/machine-info", NEWLINE, ++ r = parse_env_file(writable_filename("/etc/machine-info"), NEWLINE, + "PRETTY_HOSTNAME", &data[PROP_PRETTY_HOSTNAME], + "ICON_NAME", &data[PROP_ICON_NAME], + "CHASSIS", &data[PROP_CHASSIS], +@@ -284,12 +304,12 @@ + + if (isempty(data[PROP_STATIC_HOSTNAME])) { + +- if (unlink("/etc/hostname") < 0) ++ if (unlink(writable_filename("/etc/hostname")) < 0) + return errno == ENOENT ? 0 : -errno; + + return 0; + } +- return write_string_file_atomic_label("/etc/hostname", data[PROP_STATIC_HOSTNAME]); ++ return write_string_file_atomic_label(writable_filename("/etc/hostname"), data[PROP_STATIC_HOSTNAME]); + } + + static int write_data_other(void) { +@@ -303,7 +323,7 @@ + char **l = NULL; + int r, p; + +- r = load_env_file("/etc/machine-info", NULL, &l); ++ r = load_env_file(writable_filename("/etc/machine-info"), NULL, &l); + if (r < 0 && r != -ENOENT) + return r; + +@@ -333,13 +353,13 @@ + + if (strv_isempty(l)) { + +- if (unlink("/etc/machine-info") < 0) ++ if (unlink(writable_filename("/etc/machine-info")) < 0) + return errno == ENOENT ? 0 : -errno; + + return 0; + } + +- r = write_env_file_label("/etc/machine-info", l); ++ r = write_env_file_label(writable_filename("/etc/machine-info"), l); + strv_free(l); + + return r; diff -Nru systemd-204/debian/patches/ubuntu-logind-controllers.patch systemd-204/debian/patches/ubuntu-logind-controllers.patch --- systemd-204/debian/patches/ubuntu-logind-controllers.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/ubuntu-logind-controllers.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,34 @@ +Description: Enable all cgroup controllers in logind + +This changes the default logind configuration to enable all cgroup +controllers. Doing so will result in a /user/$UID.user/cX.session cgroup +being created for each of the listed controller with the cX.session +entry belonging to the user. + +In the event that one of the listed controllers doesn't exist under +/sys/fs/cgroup, logind will simply ignore it. +The list in this patch should be kept up to date as new cgroup +controllers are added to the kernel and the distro (the config option +unfortunately doesn't support wildcards). + +This configuration is required, almongst other things by LXC for +unprivileged containers. + +Origin: vendor +Forwarded: not-needed + +Index: systemd-204/src/login/logind.conf +=================================================================== +--- systemd-204.orig/src/login/logind.conf 2014-05-08 18:30:35.349061594 -0500 ++++ systemd-204/src/login/logind.conf 2014-05-08 18:30:52.377060908 -0500 +@@ -13,8 +13,8 @@ + #KillUserProcesses=no + #KillOnlyUsers= + #KillExcludeUsers=root +-#Controllers= +-#ResetControllers=cpu ++Controllers=blkio cpu cpuacct cpuset devices freezer hugetlb memory perf_event net_cls net_prio ++ResetControllers= + #InhibitDelayMaxSec=5 + #HandlePowerKey=poweroff + #HandleSuspendKey=suspend diff -Nru systemd-204/debian/patches/upstream-hwdb-keyboard.patch systemd-204/debian/patches/upstream-hwdb-keyboard.patch --- systemd-204/debian/patches/upstream-hwdb-keyboard.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/upstream-hwdb-keyboard.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,320 @@ +From 9d7d42bc406a2ac04639674281ce3ff6beeda790 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 10 Jul 2013 16:02:24 +0200 +Subject: [PATCH] udev: add builtin 'keyboard' to manage key mappings + +--- + Makefile.am | 27 +++++++ + rules/60-keyboard.rules | 22 ++++++ + shell-completion/bash/udevadm | 2 +- + src/udev/.gitignore | 4 + + src/udev/udev-builtin-keyboard.c | 163 +++++++++++++++++++++++++++++++++++++++ + src/udev/udev-builtin.c | 1 + + src/udev/udev.h | 2 + + 7 files changed, 220 insertions(+), 1 deletion(-) + create mode 100644 rules/60-keyboard.rules + create mode 100644 src/udev/udev-builtin-keyboard.c + +Index: systemd/Makefile.am +=================================================================== +--- systemd.orig/Makefile.am 2013-08-27 08:37:36.930210689 +0200 ++++ systemd/Makefile.am 2013-08-27 08:37:36.922210689 +0200 +@@ -174,6 +174,7 @@ + -I $(top_srcdir)/src/core \ + -I $(top_srcdir)/src/libudev \ + -I $(top_srcdir)/src/udev \ ++ -I $(top_builddir)/src/udev \ + -I $(top_srcdir)/src/libsystemd-bus \ + $(OUR_CPPFLAGS) + +@@ -1931,6 +1932,7 @@ + rules/99-systemd.rules \ + rules/42-usb-hid-pm.rules \ + rules/50-udev-default.rules \ ++ rules/60-keyboard.rules \ + rules/60-persistent-storage-tape.rules \ + rules/60-persistent-serial.rules \ + rules/60-persistent-input.rules \ +@@ -1994,6 +1996,19 @@ + noinst_LTLIBRARIES += \ + libudev-core.la + ++src/udev/keyboard-keys.txt: Makefile ++ $(AM_V_at)$(MKDIR_P) $(dir $@) ++ $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h - < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@ ++ ++src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys.txt Makefile ++ $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print tolower(substr($$1 ,5)) ", " $$1 }' < $< > $@ ++ ++src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf Makefile ++ $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@ ++ ++src/udev/keyboard-keys-to-name.h: src/udev/keyboard-keys.txt Makefile ++ $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@ ++ + libudev_core_la_SOURCES = \ + src/udev/udev.h \ + src/udev/udev-event.c \ +@@ -2005,10 +2020,22 @@ + src/udev/udev-builtin-btrfs.c \ + src/udev/udev-builtin-hwdb.c \ + src/udev/udev-builtin-input_id.c \ ++ src/udev/udev-builtin-keyboard.c \ + src/udev/udev-builtin-net_id.c \ + src/udev/udev-builtin-path_id.c \ + src/udev/udev-builtin-usb_id.c + ++nodist_libudev_core_la_SOURCES = \ ++ src/udev/keyboard-keys-from-name.h \ ++ src/udev/keyboard-keys-to-name.h ++ ++BUILT_SOURCES += \ ++ $(nodist_libudev_core_la_SOURCES) ++ ++CLEANFILES += \ ++ src/udev/keyboard-keys-from-name.gperf \ ++ src/udev/keyboard-keys.txt ++ + libudev_core_la_CFLAGS = \ + $(AM_CFLAGS) \ + $(BLKID_CFLAGS) \ +Index: systemd/rules/60-keyboard.rules +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ systemd/rules/60-keyboard.rules 2013-08-27 08:37:48.706210151 +0200 +@@ -0,0 +1,22 @@ ++# do not edit this file, it will be overwritten on update ++ ++ACTION!="add", GOTO="keyboard_end" ++KERNEL!="event*", GOTO="keyboard_end" ++ENV{ID_INPUT_KEY}=="", GOTO="keyboard_end" ++ ++# ignore all bluetooth devices ++SUBSYSTEMS=="bluetooth", GOTO="keyboard_end" ++ ++# import key mapping for USB device ++SUBSYSTEMS=="usb", IMPORT{builtin}="hwdb --subsystem=usb --lookup-prefix=keyboard:", \ ++ RUN{builtin}+="keyboard", GOTO="keyboard_end" ++ ++# import key mapping for AT keyboard from DMI data ++DRIVERS=="atkbd", IMPORT{builtin}="hwdb 'keyboard:$attr{[dmi/id]modalias}'", \ ++ RUN{builtin}+="keyboard", GOTO="keyboard_end" ++ ++# import key mapping for platform input device ++KERNELS=="input*", IMPORT{builtin}="hwdb 'keyboard:name:$attr{name}:$attr{[dmi/id]modalias}'", \ ++ RUN{builtin}+="keyboard", GOTO="keyboard_end" ++ ++LABEL="keyboard_end" +Index: systemd/shell-completion/bash/udevadm +=================================================================== +--- systemd.orig/shell-completion/bash/udevadm 2013-08-27 08:37:36.930210689 +0200 ++++ systemd/shell-completion/bash/udevadm 2013-08-27 08:37:36.922210689 +0200 +@@ -93,7 +93,7 @@ + fi + + elif __contains_word "$verb" ${VERBS[TESTBUILTIN]}; then +- comps='blkid btrfs hwdb input_id kmod net_id path_id usb_id uaccess' ++ comps='blkid btrfs hwdb input_id keyboard kmod net_id path_id usb_id uaccess' + fi + + COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) +Index: systemd/src/udev/udev-builtin-keyboard.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ systemd/src/udev/udev-builtin-keyboard.c 2013-08-27 08:37:36.922210689 +0200 +@@ -0,0 +1,163 @@ ++/*** ++ This file is part of systemd. ++ ++ Copyright 2013 Kay Sievers ++ ++ systemd is free software; you can redistribute it and/or modify it ++ under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2.1 of the License, or ++ (at your option) any later version. ++ ++ systemd is distributed in the hope that it will be useful, but ++ WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with systemd; If not, see . ++***/ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "udev.h" ++ ++static const struct key *keyboard_lookup_key(const char *str, unsigned int len); ++#include "keyboard-keys-from-name.h" ++#include "keyboard-keys-to-name.h" ++ ++static int install_force_release(struct udev_device *dev, const unsigned int *release, unsigned int release_count) { ++ struct udev_device *atkbd; ++ const char *cur; ++ char codes[4096]; ++ char *s; ++ size_t l; ++ unsigned int i; ++ int ret; ++ ++ atkbd = udev_device_get_parent_with_subsystem_devtype(dev, "serio", NULL); ++ if (!atkbd) ++ return -ENODEV; ++ ++ cur = udev_device_get_sysattr_value(atkbd, "force_release"); ++ if (!cur) ++ return -ENODEV; ++ ++ s = codes; ++ l = sizeof(codes); ++ ++ /* copy current content */ ++ l = strpcpy(&s, l, cur); ++ ++ /* append new codes */ ++ for (i = 0; i < release_count; i++) ++ l = strpcpyf(&s, l, ",%d", release[i]); ++ ++ log_debug("keyboard: updating force-release list with '%s'\n", codes); ++ ret = udev_device_set_sysattr_value(atkbd, "force_release", codes); ++ if (ret < 0) ++ log_error("Error writing force-release attribute: %s", strerror(-ret)); ++ return ret; ++} ++ ++static int builtin_keyboard(struct udev_device *dev, int argc, char *argv[], bool test) { ++ struct udev_list_entry *entry; ++ struct { ++ unsigned int scan; ++ unsigned int key; ++ } map[1024]; ++ unsigned int map_count = 0; ++ unsigned int release[1024]; ++ unsigned int release_count = 0; ++ ++ udev_list_entry_foreach(entry, udev_device_get_properties_list_entry(dev)) { ++ const char *key; ++ unsigned int scancode; ++ char *endptr; ++ const char *keycode; ++ const struct key *k; ++ ++ key = udev_list_entry_get_name(entry); ++ if (!startswith(key, "KEYBOARD_KEY_")) ++ continue; ++ ++ /* KEYBOARD_KEY_= */ ++ scancode = strtoul(key + 13, &endptr, 16); ++ if (endptr[0] != '\0') { ++ log_error("Error, unable to parse scan code from '%s'\n", key); ++ continue; ++ } ++ ++ keycode = udev_list_entry_get_value(entry); ++ ++ /* a leading '!' needs a force-release entry */ ++ if (keycode[0] == '!') { ++ keycode++; ++ ++ release[release_count] = scancode; ++ if (release_count < ELEMENTSOF(release)-1) ++ release_count++; ++ ++ if (keycode[0] == '\0') ++ continue; ++ } ++ ++ /* translate identifier to key code */ ++ k = keyboard_lookup_key(keycode, strlen(keycode)); ++ if (!k) { ++ log_error("Error, unknown key identifier '%s'\n", keycode); ++ continue; ++ } ++ ++ map[map_count].scan = scancode; ++ map[map_count].key = k->id; ++ if (map_count < ELEMENTSOF(map)-1) ++ map_count++; ++ } ++ ++ if (map_count > 0 || release_count > 0) { ++ const char *node; ++ int fd; ++ unsigned int i; ++ ++ node = udev_device_get_devnode(dev); ++ if (!node) { ++ log_error("Error, no device node for '%s'\n", udev_device_get_syspath(dev)); ++ return EXIT_FAILURE; ++ } ++ ++ fd = open(udev_device_get_devnode(dev), O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY); ++ if (fd < 0) { ++ log_error("Error, opening device '%s': %m\n", node); ++ return EXIT_FAILURE; ++ } ++ ++ /* install list of map codes */ ++ for (i = 0; i < map_count; i++) { ++ log_debug("keyboard: mapping scan code %d (0x%x) to key code %d (0x%x)\n", ++ map[i].scan, map[i].scan, map[i].key, map[i].key); ++ if (ioctl(fd, EVIOCSKEYCODE, &map[i]) < 0) ++ log_error("Error calling EVIOCSKEYCODE: %m\n"); ++ } ++ ++ /* install list of force-release codes */ ++ if (release_count > 0) ++ install_force_release(dev, release, release_count); ++ ++ close(fd); ++ } ++ ++ return EXIT_SUCCESS; ++} ++ ++const struct udev_builtin udev_builtin_keyboard = { ++ .name = "keyboard", ++ .cmd = builtin_keyboard, ++ .help = "keyboard scan code to key mapping", ++}; +Index: systemd/src/udev/udev-builtin.c +=================================================================== +--- systemd.orig/src/udev/udev-builtin.c 2013-08-27 08:37:36.930210689 +0200 ++++ systemd/src/udev/udev-builtin.c 2013-08-27 08:37:36.922210689 +0200 +@@ -39,6 +39,7 @@ + #endif + [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb, + [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id, ++ [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard, + #ifdef HAVE_KMOD + [UDEV_BUILTIN_KMOD] = &udev_builtin_kmod, + #endif +Index: systemd/src/udev/udev.h +=================================================================== +--- systemd.orig/src/udev/udev.h 2013-08-27 08:37:36.930210689 +0200 ++++ systemd/src/udev/udev.h 2013-08-27 08:37:36.922210689 +0200 +@@ -145,6 +145,7 @@ + #endif + UDEV_BUILTIN_HWDB, + UDEV_BUILTIN_INPUT_ID, ++ UDEV_BUILTIN_KEYBOARD, + #ifdef HAVE_KMOD + UDEV_BUILTIN_KMOD, + #endif +@@ -174,6 +175,7 @@ + #endif + extern const struct udev_builtin udev_builtin_hwdb; + extern const struct udev_builtin udev_builtin_input_id; ++extern const struct udev_builtin udev_builtin_keyboard; + #ifdef HAVE_KMOD + extern const struct udev_builtin udev_builtin_kmod; + #endif diff -Nru systemd-204/debian/patches/upstream-hwdb-updates.patch systemd-204/debian/patches/upstream-hwdb-updates.patch --- systemd-204/debian/patches/upstream-hwdb-updates.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/upstream-hwdb-updates.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,410 @@ +Index: systemd/src/libudev/libudev-hwdb.c +=================================================================== +--- systemd.orig/src/libudev/libudev-hwdb.c 2013-08-27 10:49:32.349556246 +0200 ++++ systemd/src/libudev/libudev-hwdb.c 2013-08-27 10:49:32.337556245 +0200 +@@ -140,9 +140,13 @@ + } + + static int hwdb_add_property(struct udev_hwdb *hwdb, const char *key, const char *value) { +- /* TODO: add sub-matches (+) against DMI data */ ++ /* ++ * Silently ignore all properties which do not start with a ++ * space; future extensions might use additional prefixes. ++ */ + if (key[0] != ' ') + return 0; ++ + if (udev_list_entry_add(&hwdb->properties_list, key+1, value) == NULL) + return -ENOMEM; + return 0; +@@ -300,11 +304,11 @@ + } + + log_debug("=== trie on-disk ===\n"); +- log_debug("tool version: %llu", (unsigned long long)le64toh(hwdb->head->tool_version)); +- log_debug("file size: %8llu bytes\n", (unsigned long long)hwdb->st.st_size); +- log_debug("header size %8llu bytes\n", (unsigned long long)le64toh(hwdb->head->header_size)); +- log_debug("strings %8llu bytes\n", (unsigned long long)le64toh(hwdb->head->strings_len)); +- log_debug("nodes %8llu bytes\n", (unsigned long long)le64toh(hwdb->head->nodes_len)); ++ log_debug("tool version: %"PRIu64, le64toh(hwdb->head->tool_version)); ++ log_debug("file size: %8llu bytes\n", (unsigned long long) hwdb->st.st_size); ++ log_debug("header size %8"PRIu64" bytes\n", le64toh(hwdb->head->header_size)); ++ log_debug("strings %8"PRIu64" bytes\n", le64toh(hwdb->head->strings_len)); ++ log_debug("nodes %8"PRIu64" bytes\n", le64toh(hwdb->head->nodes_len)); + return hwdb; + } + +Index: systemd/src/udev/udev-builtin-hwdb.c +=================================================================== +--- systemd.orig/src/udev/udev-builtin-hwdb.c 2013-08-27 10:49:32.349556246 +0200 ++++ systemd/src/udev/udev-builtin-hwdb.c 2013-08-27 10:49:32.341556245 +0200 +@@ -23,20 +23,37 @@ + #include + #include + #include ++#include + #include + + #include "udev.h" + + static struct udev_hwdb *hwdb; + +-int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *modalias, bool test) { ++int udev_builtin_hwdb_lookup(struct udev_device *dev, ++ const char *prefix, const char *modalias, ++ const char *filter, bool test) { ++ struct udev_list_entry *list; + struct udev_list_entry *entry; + int n = 0; + + if (!hwdb) + return -ENOENT; + +- udev_list_entry_foreach(entry, udev_hwdb_get_properties_list_entry(hwdb, modalias, 0)) { ++ if (prefix) { ++ _cleanup_free_ const char *lookup; ++ ++ lookup = strjoin(prefix, modalias, NULL); ++ if (!lookup) ++ return -ENOMEM; ++ list = udev_hwdb_get_properties_list_entry(hwdb, lookup, 0); ++ } else ++ list = udev_hwdb_get_properties_list_entry(hwdb, modalias, 0); ++ ++ udev_list_entry_foreach(entry, list) { ++ if (filter && fnmatch(filter, udev_list_entry_get_name(entry), FNM_NOESCAPE) != 0) ++ continue; ++ + if (udev_builtin_add_property(dev, test, + udev_list_entry_get_name(entry), + udev_list_entry_get_value(entry)) < 0) +@@ -66,12 +83,14 @@ + return s; + } + +-static int udev_builtin_hwdb_search(struct udev_device *dev, const char *subsystem, bool test) { ++static int udev_builtin_hwdb_search(struct udev_device *dev, struct udev_device *srcdev, ++ const char *subsystem, const char *prefix, ++ const char *filter, bool test) { + struct udev_device *d; + char s[16]; + int n = 0; + +- for (d = dev; d; d = udev_device_get_parent(d)) { ++ for (d = srcdev; d; d = udev_device_get_parent(d)) { + const char *dsubsys; + const char *modalias = NULL; + +@@ -83,16 +102,16 @@ + if (subsystem && !streq(dsubsys, subsystem)) + continue; + +- /* the usb_device does not have a modalias, compose one */ +- if (streq(dsubsys, "usb")) +- modalias = modalias_usb(dev, s, sizeof(s)); ++ modalias = udev_device_get_property_value(d, "MODALIAS"); + +- if (!modalias) +- modalias = udev_device_get_property_value(d, "MODALIAS"); ++ /* the usb_device does not have a modalias, compose one */ ++ if (!modalias && streq(dsubsys, "usb")) ++ modalias = modalias_usb(d, s, sizeof(s)); + + if (!modalias) + continue; +- n = udev_builtin_hwdb_lookup(dev, modalias, test); ++ ++ n = udev_builtin_hwdb_lookup(dev, prefix, modalias, filter, test); + if (n > 0) + break; + } +@@ -102,10 +121,17 @@ + + static int builtin_hwdb(struct udev_device *dev, int argc, char *argv[], bool test) { + static const struct option options[] = { ++ { "filter", required_argument, NULL, 'f' }, ++ { "device", required_argument, NULL, 'd' }, + { "subsystem", required_argument, NULL, 's' }, ++ { "lookup-prefix", required_argument, NULL, 'p' }, + {} + }; ++ const char *filter = NULL; ++ const char *device = NULL; + const char *subsystem = NULL; ++ const char *prefix = NULL; ++ struct udev_device *srcdev; + + if (!hwdb) + return EXIT_FAILURE; +@@ -113,20 +139,47 @@ + for (;;) { + int option; + +- option = getopt_long(argc, argv, "s", options, NULL); ++ option = getopt_long(argc, argv, "f:d:s:p:", options, NULL); + if (option == -1) + break; + + switch (option) { ++ case 'f': ++ filter = optarg; ++ break; ++ ++ case 'd': ++ device = optarg; ++ break; ++ + case 's': + subsystem = optarg; + break; ++ ++ case 'p': ++ prefix = optarg; ++ break; + } + } + +- if (udev_builtin_hwdb_search(dev, subsystem, test) < 0) ++ /* query a specific key given as argument */ ++ if (argv[optind]) { ++ if (udev_builtin_hwdb_lookup(dev, prefix, argv[optind], filter, test) > 0) ++ return EXIT_SUCCESS; + return EXIT_FAILURE; +- return EXIT_SUCCESS; ++ } ++ ++ /* read data from another device than the device we will store the data */ ++ if (device) { ++ srcdev = udev_device_new_from_device_id(udev_device_get_udev(dev), device); ++ if (!srcdev) ++ return EXIT_FAILURE; ++ } else ++ srcdev = dev; ++ ++ if (udev_builtin_hwdb_search(dev, srcdev, subsystem, prefix, filter, test) > 0) ++ return EXIT_SUCCESS; ++ return EXIT_FAILURE; + } + + /* called at udev startup and reload */ +Index: systemd/src/udev/udevadm-hwdb.c +=================================================================== +--- systemd.orig/src/udev/udevadm-hwdb.c 2013-08-27 10:49:32.349556246 +0200 ++++ systemd/src/udev/udevadm-hwdb.c 2013-08-27 10:49:32.341556245 +0200 +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include "util.h" + #include "strbuf.h" +@@ -302,8 +303,10 @@ + int64_t child_off; + + child_off = trie_store_nodes(trie, node->children[i].child); +- if (child_off < 0) ++ if (child_off < 0) { ++ free(children); + return child_off; ++ } + children[i].c = node->children[i].c; + children[i].child_off = htole64(child_off); + } +@@ -402,66 +405,122 @@ + return err; + } + +-static int import_file(struct trie *trie, const char *filename) { ++static int insert_data(struct trie *trie, struct udev_list *match_list, ++ char *line, const char *filename) { ++ char *value; ++ struct udev_list_entry *entry; ++ ++ value = strchr(line, '='); ++ if (!value) { ++ log_error("Error, key/value pair expected but got '%s' in '%s':\n", line, filename); ++ return -EINVAL; ++ } ++ ++ value[0] = '\0'; ++ value++; ++ ++ if (line[0] == '\0' || value[0] == '\0') { ++ log_error("Error, empty key or value '%s' in '%s':\n", line, filename); ++ return -EINVAL; ++ } ++ ++ udev_list_entry_foreach(entry, udev_list_get_entry(match_list)) ++ trie_insert(trie, trie->root, udev_list_entry_get_name(entry), line, value); ++ ++ return 0; ++} ++ ++static int import_file(struct udev *udev, struct trie *trie, const char *filename) { ++ enum { ++ HW_MATCH, ++ HW_DATA, ++ HW_NONE, ++ } state = HW_NONE; + FILE *f; + char line[LINE_MAX]; +- char match[LINE_MAX]; +- char cond[LINE_MAX]; ++ struct udev_list match_list; ++ ++ udev_list_init(udev, &match_list, false); + + f = fopen(filename, "re"); + if (f == NULL) + return -errno; + +- match[0] = '\0'; +- cond[0] = '\0'; + while (fgets(line, sizeof(line), f)) { + size_t len; ++ char *pos; + ++ /* comment line */ + if (line[0] == '#') + continue; + +- /* new line, new record */ +- if (line[0] == '\n') { +- match[0] = '\0'; +- cond[0] = '\0'; +- continue; +- } ++ /* strip trailing comment */ ++ pos = strchr(line, '#'); ++ if (pos) ++ pos[0] = '\0'; + +- /* remove newline */ ++ /* strip trailing whitespace */ + len = strlen(line); +- if (len < 2) +- continue; +- line[len-1] = '\0'; ++ while (len > 0 && isspace(line[len-1])) ++ len--; ++ line[len] = '\0'; ++ ++ switch (state) { ++ case HW_NONE: ++ if (len == 0) ++ break; ++ ++ if (line[0] == ' ') { ++ log_error("Error, MATCH expected but got '%s' in '%s':\n", line, filename); ++ break; ++ } + +- /* start of new record */ +- if (match[0] == '\0') { +- strcpy(match, line); +- cond[0] = '\0'; +- continue; +- } ++ /* start of record, first match */ ++ state = HW_MATCH; ++ udev_list_entry_add(&match_list, line, NULL); ++ break; + +- if (line[0] == '+') { +- strcpy(cond, line); +- continue; +- } ++ case HW_MATCH: ++ if (len == 0) { ++ log_error("Error, DATA expected but got empty line in '%s':\n", filename); ++ state = HW_NONE; ++ udev_list_cleanup(&match_list); ++ break; ++ } + +- /* TODO: support +; skip the entire record until we support it */ +- if (cond[0] != '\0') +- continue; ++ /* another match */ ++ if (line[0] != ' ') { ++ udev_list_entry_add(&match_list, line, NULL); ++ break; ++ } + +- /* value lines */ +- if (line[0] == ' ') { +- char *value; ++ /* first data */ ++ state = HW_DATA; ++ insert_data(trie, &match_list, line, filename); ++ break; + +- value = strchr(line, '='); +- if (!value) +- continue; +- value[0] = '\0'; +- value++; +- trie_insert(trie, trie->root, match, line, value); +- } ++ case HW_DATA: ++ /* end of record */ ++ if (len == 0) { ++ state = HW_NONE; ++ udev_list_cleanup(&match_list); ++ break; ++ } ++ ++ if (line[0] != ' ') { ++ log_error("Error, DATA expected but got '%s' in '%s':\n", line, filename); ++ state = HW_NONE; ++ udev_list_cleanup(&match_list); ++ break; ++ } ++ ++ insert_data(trie, &match_list, line, filename); ++ break; ++ }; + } ++ + fclose(f); ++ udev_list_cleanup(&match_list); + return 0; + } + +@@ -549,7 +608,7 @@ + } + STRV_FOREACH(f, files) { + log_debug("reading file '%s'", *f); +- import_file(trie, *f); ++ import_file(udev, trie, *f); + } + strv_free(files); + +Index: systemd/src/udev/udev.h +=================================================================== +--- systemd.orig/src/udev/udev.h 2013-08-27 10:49:32.349556246 +0200 ++++ systemd/src/udev/udev.h 2013-08-27 10:49:32.341556245 +0200 +@@ -190,7 +190,8 @@ + void udev_builtin_list(struct udev *udev); + bool udev_builtin_validate(struct udev *udev); + int udev_builtin_add_property(struct udev_device *dev, bool test, const char *key, const char *val); +-int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *modalias, bool test); ++int udev_builtin_hwdb_lookup(struct udev_device *dev, const char *prefix, const char *modalias, ++ const char *filter, bool test); + + /* udev logging */ + void udev_main_log(struct udev *udev, int priority, +Index: systemd/src/udev/udev-builtin-net_id.c +=================================================================== +--- systemd.orig/src/udev/udev-builtin-net_id.c 2013-04-08 17:26:34.317113774 +0200 ++++ systemd/src/udev/udev-builtin-net_id.c 2013-08-27 10:50:02.873557723 +0200 +@@ -386,7 +386,7 @@ + snprintf(str, sizeof(str), "OUI:%02X%02X%02X%02X%02X%02X", + names->mac[0], names->mac[1], names->mac[2], + names->mac[3], names->mac[4], names->mac[5]); +- udev_builtin_hwdb_lookup(dev, str, test); ++ udev_builtin_hwdb_lookup(dev, NULL, str, NULL, test); + return 0; + } + diff -Nru systemd-204/debian/patches/upstream-ignore-mmcrpmb.patch systemd-204/debian/patches/upstream-ignore-mmcrpmb.patch --- systemd-204/debian/patches/upstream-ignore-mmcrpmb.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/upstream-ignore-mmcrpmb.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,31 @@ +From: Martin Pitt +Date: Wed, 11 Feb 2015 15:26:52 +0100 +Subject: rules: Fix by-path of mmc RPMB partitions and don't blkid them + +Linux 3.10+ exposes RPMB (Replay Protected Memory Block) partitions of MMC +devices [1] ; trying to read them with blkid or other unspecific means will +cause kernel buffer I/O errors and timeouts. + +Blacklist those to prevent creating wrong by-path links and +blkid'ing those. + +[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=090d25fe224c0 + +https://launchpad.net/bugs/1333140 +--- + rules/60-persistent-storage.rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: systemd-204/rules/60-persistent-storage.rules +=================================================================== +--- systemd-204.orig/rules/60-persistent-storage.rules ++++ systemd-204/rules/60-persistent-storage.rules +@@ -14,7 +14,7 @@ ACTION=="add", SUBSYSTEM=="module", KERN + SUBSYSTEM!="block", GOTO="persistent_storage_end" + + # skip rules for inappropriate block devices +-KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*", GOTO="persistent_storage_end" ++KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*|mmcblk[0-9]*rpmb", GOTO="persistent_storage_end" + + # ignore partitions that span the entire disk + TEST=="whole_disk", GOTO="persistent_storage_end" diff -Nru systemd-204/debian/patches/upstream-reboot-polkit-permissions.patch systemd-204/debian/patches/upstream-reboot-polkit-permissions.patch --- systemd-204/debian/patches/upstream-reboot-polkit-permissions.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/upstream-reboot-polkit-permissions.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,21 @@ +From 299404a19f26aa4f203042d8285ee0b7afa5bf40 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Thu, 26 Sep 2013 18:31:37 +0000 +Subject: logind: if a user is sitting in front of the computer and can shutdown the machine anyway he should also be able to reboot it + +--- +diff --git a/src/login/org.freedesktop.login1.policy.in b/src/login/org.freedesktop.login1.policy.in +index 0c551d4..b96d32d 100644 +--- a/src/login/org.freedesktop.login1.policy.in ++++ b/src/login/org.freedesktop.login1.policy.in +@@ -190,7 +190,7 @@ + + auth_admin_keep + auth_admin_keep +- auth_admin_keep ++ yes + + org.freedesktop.login1.reboot + +-- +cgit v0.9.0.2-2-gbebe diff -Nru systemd-204/debian/patches/upstream-uaccess-Add-new-DRM-render-nodes.patch systemd-204/debian/patches/upstream-uaccess-Add-new-DRM-render-nodes.patch --- systemd-204/debian/patches/upstream-uaccess-Add-new-DRM-render-nodes.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/patches/upstream-uaccess-Add-new-DRM-render-nodes.patch 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,25 @@ +From 735e5d83ee3391f8ab0e18218278302c2e87e5f3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= +Date: Tue, 12 Nov 2013 18:11:43 +0100 +Subject: [PATCH] uaccess: Add new DRM render nodes + +--- + src/login/70-uaccess.rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/login/70-uaccess.rules b/src/login/70-uaccess.rules +index 01484c9..e1cf897 100644 +--- a/src/login/70-uaccess.rules ++++ b/src/login/70-uaccess.rules +@@ -43,7 +43,7 @@ SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", TAG+="uaccess" + SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", TAG+="uaccess" + + # DRI video devices +-SUBSYSTEM=="drm", KERNEL=="card*", TAG+="uaccess" ++SUBSYSTEM=="drm", KERNEL=="card*|renderD*", TAG+="uaccess" + + # KVM + SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="uaccess" +-- +2.7.0 + diff -Nru systemd-204/debian/rules systemd-204/debian/rules --- systemd-204/debian/rules 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/rules 2017-10-03 12:31:13.000000000 +0000 @@ -3,13 +3,18 @@ #export DH_VERBOSE=1 #export DEB_BUILD_OPTIONS="nostrip" +VERSION = $(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/.*: //p') + +# Ubuntu: systemd{,-sysv} not yet approved for universe +BINARY_BLACKLIST = -Nsystemd-sysv + DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) CONFFLAGS = \ --with-rootprefix= \ --with-rootlibdir=/lib/$(DEB_HOST_MULTIARCH) \ - --with-sysvinit-path=/etc/init.d \ - --with-sysvrcnd-path=/etc \ + --with-sysvinit-path= \ + --with-sysvrcnd-path= \ --with-firmware-path=/lib/firmware \ --with-debug-shell=/bin/bash \ --enable-libcryptsetup \ @@ -17,6 +22,7 @@ --disable-coredump \ --disable-efi \ --disable-myhostname \ + --disable-keymap \ --disable-vconsole \ --disable-silent-rules @@ -25,7 +31,12 @@ --enable-introspection \ --enable-gtk-doc +CONFFLAGS_deputy = \ + --enable-deputy \ + --disable-cgmanager + CONFFLAGS_udeb = \ + --disable-cgmanager \ --disable-selinux \ --disable-introspection \ --disable-gtk-doc \ @@ -48,21 +59,27 @@ override_dh_auto_configure: dh_auto_configure --builddirectory=build-deb \ -- $(CONFFLAGS) $(CONFFLAGS_deb) + dh_auto_configure --builddirectory=build-deputy \ + -- $(CONFFLAGS) $(CONFFLAGS_deb) $(CONFFLAGS_deputy) dh_auto_configure --builddirectory=build-udeb \ -- $(CONFFLAGS) $(CONFFLAGS_udeb) override_dh_auto_build: dh_auto_build --builddirectory=build-deb + dh_auto_build --builddirectory=build-deputy dh_auto_build --builddirectory=build-udeb override_dh_auto_install: dh_auto_install --builddirectory=build-deb \ --destdir=debian/install/deb + dh_auto_install --builddirectory=build-deputy \ + --destdir=debian/install/deputy dh_auto_install --builddirectory=build-udeb \ --destdir=debian/install/udeb override_dh_auto_clean: dh_auto_clean --builddirectory=build-deb + dh_auto_clean --builddirectory=build-deputy dh_auto_clean --builddirectory=build-udeb rm -rf debian/install/ # remove pre-generated man pages so they are rebuilt @@ -80,7 +97,8 @@ rm -rf debian/install/*/etc/kernel/ find debian/install/ -name '*.la' -delete dh_install -pudev-udeb -plibudev1-udeb --sourcedir=debian/install/udeb - dh_install -Nudev-udeb -Nlibudev1-udeb --sourcedir=debian/install/deb + dh_install -psystemd --sourcedir=debian/install/deputy + dh_install -Nudev-udeb -Nlibudev1-udeb -Nsystemd --sourcedir=debian/install/deb --list-missing # install some files manually, --sourcedir makes that necessary # udev-udeb install -D --mode=755 debian/extra/udev.startup \ @@ -88,23 +106,12 @@ install -D --mode=755 debian/extra/udev.base-installer \ debian/udev-udeb/usr/lib/base-installer.d/05udev mkdir -p debian/udev-udeb/lib/udev/rules.d/ - install -D --mode=644 \ - debian/extra/rules/50-udev-default.rules \ - debian/extra/rules/60-persistent-storage.rules \ - debian/extra/rules/75-cd-aliases-generator.rules \ - debian/extra/rules/75-persistent-net-generator.rules \ - debian/extra/rules/80-drivers.rules \ - debian/extra/rules/91-permissions.rules \ - debian/udev-udeb/lib/udev/rules.d/ - install -D --mode=644 debian/extra/links.conf \ - debian/udev-udeb/etc/udev/links.conf mkdir -p debian/udev-udeb/lib/udev install -D --mode=644 \ debian/extra/hotplug.functions \ debian/extra/rule_generator.functions \ debian/udev-udeb/lib/udev/ install -D --mode=755 \ - debian/extra/write_cd_rules \ debian/extra/write_net_rules \ debian/udev-udeb/lib/udev/ # udev: initramfs-tools support @@ -117,8 +124,6 @@ # udev: debian specific rules and helpers install -D --mode=644 debian/extra/rules/* \ debian/udev/lib/udev/rules.d/ - install -D --mode=644 debian/extra/links.conf \ - debian/udev/etc/udev/ install -D --mode=644 debian/extra/fbdev-blacklist.conf \ debian/udev/etc/modprobe.d/fbdev-blacklist.conf install -D --mode=644 \ @@ -126,17 +131,15 @@ debian/extra/rule_generator.functions \ debian/udev/lib/udev/ install -D --mode=755 \ - debian/extra/create_static_nodes \ - debian/extra/dsl-modem.agent \ - debian/extra/logger.agent \ - debian/extra/net.agent \ - debian/extra/write_cd_rules \ debian/extra/write_net_rules \ debian/udev/lib/udev/ + # udev rules documentation + install -m 644 -o root -g root debian/extra/README-etc-rules.d \ + debian/udev/etc/udev/rules.d/README + install -m 644 -o root -g root debian/extra/README-lib-rules.d \ + debian/udev/lib/udev/rules.d/README # systemd cp -a debian/pam-configs debian/libpam-systemd/usr/share/ - install -D --mode=644 debian/init-functions.d/40-systemd \ - debian/systemd/lib/lsb/init-functions.d/40-systemd install --mode=644 debian/tmpfiles.d/debian.conf \ debian/systemd/usr/lib/tmpfiles.d/ install --mode=644 debian/debian-fixup.service debian/ifup@.service \ @@ -146,6 +149,9 @@ debian/systemd/lib/systemd/ install --mode=755 debian/systemd-logind-launch \ debian/systemd/lib/systemd/ + # LP: #1718966 (adapted fsck@.service for mount units to work, fixes snappy) + install --mode=644 debian/units/systemd-fsck@.service \ + debian/systemd/lib/systemd/upstart/systemd-fsck@.service # Remove tmp.mount symlink to avoid mounting /tmp as tmpfs by default. rm debian/systemd/lib/systemd/system/local-fs.target.wants/tmp.mount # remove duplicates @@ -160,34 +166,47 @@ # files shipped by libpam-systemd rm debian/systemd/usr/share/man/man8/pam_systemd.8 # files shipped by udev - rm -r debian/systemd/etc/udev/ rm debian/systemd/lib/systemd/system/systemd-udev* rm debian/systemd/lib/systemd/system/*.target.wants/systemd-udev* rm debian/systemd/lib/systemd/systemd-udevd rm debian/systemd/usr/share/man/man7/udev.7 rm debian/systemd/usr/share/man/man8/*udev*.8 - # files shipped by udev / bash-completion - rm debian/systemd/usr/share/bash-completion/completions/udevadm # files systemd by cryptsetup rm debian/systemd/usr/share/man/man5/crypttab.5 - # files shipped by systemd + # files shipped by systemd-services + rm debian/systemd/etc/systemd/logind.conf + rm debian/systemd/lib/systemd/systemd-logind + rm debian/systemd/lib/systemd/systemd-hostnamed + rm debian/systemd/lib/systemd/systemd-localed + rm debian/systemd/lib/systemd/systemd-timedated + rm debian/systemd/lib/systemd/systemd-multi-seat-x + rm debian/systemd/usr/share/man/man5/logind* + rm debian/systemd/usr/share/man/man8/systemd-logind* + rm debian/systemd/usr/share/man/man8/systemd-hostnamed* + rm debian/systemd/usr/share/man/man8/systemd-localed* + rm debian/systemd/usr/share/man/man8/systemd-timedated* rm debian/udev/lib/udev/rules.d/70-uaccess.rules rm debian/udev/lib/udev/rules.d/73-seat-late.rules rm debian/udev/lib/udev/rules.d/71-seat.rules + # files shipped by systemd rm debian/udev/lib/udev/rules.d/99-systemd.rules -# use symlinked doc directories as the old udev package did -override_dh_installdocs: - dh_installdocs -pudev -plibudev-dev --link-doc=libudev1 - dh_installdocs -pgir1.2-gudev-1.0 -plibgudev-1.0-dev --link-doc=libgudev-1.0-0 - dh_installdocs --remaining-packages + # Remove all actual services on system startup for running systemd as a + # deputy init; we use /lib/systemd/upstart/ as a unit path + rm -r debian/systemd/lib/systemd/system + + # we continue to use the old net iface naming schema for the time being + rm -f debian/udev/lib/udev/rules.d/80-net-name-slot.rules + rm -f debian/udev-udeb/lib/udev/rules.d/80-net-name-slot.rules override_dh_installinit: - dh_installinit --no-start - dh_installinit --name=udev-finish --no-start - dh_installinit --name=udevtrigger --no-start - dh_installinit --name=udevmonitor --no-start - dh_installinit --name=udev-fallback-graphics --no-start + dh_installinit --upstart-only --verbose -p systemd --no-restart-on-upgrade + dh_installinit --upstart-only --no-start + dh_installinit --upstart-only --name=udev-finish --no-start + dh_installinit --upstart-only --name=udevtrigger --no-start + dh_installinit --upstart-only --name=udevmonitor --no-start + dh_installinit --upstart-only --name=udev-fallback-graphics --no-start + dh_installinit --upstart-only --name systemd-logind --no-restart-on-upgrade override_dh_makeshlibs: dh_makeshlibs -plibudev1 --add-udeb=libudev1-udeb @@ -201,5 +220,27 @@ override_dh_autoreconf: dh_autoreconf debian/rules -- autoreconf +override_dh_auto_test: +ifeq (, $(findstring nocheck, $(DEB_BUILD_OPTIONS))) + # some tests hang under fakeroot, so disable fakeroot + echo "01234567890123456789012345678901" > build-deb/machine-id + env -u LD_PRELOAD SYSTEMD_MACHINE_ID_PATH=$(CURDIR)/build-deb/machine-id \ + make -C build-deb check || ( \ + cd build-deb; \ + for f in test-*.log; do echo "==== $$f ===="; cat $$f; done; \ + exit 1; ) +endif + %: dh $@ --with autoreconf,gir,python2 + +override_dh_gencontrol: + # Ubuntu has an epoch on gudev + dh_gencontrol -plibgudev-1.0-0 -plibgudev-1.0-dev -pgir1.2-gudev-1.0 -- "-v1:$(VERSION)" + dh_gencontrol $(BINARY_BLACKLIST) --remaining-packages + +override_dh_strip: + dh_strip $(BINARY_BLACKLIST) + +override_dh_builddeb: + dh_builddeb $(BINARY_BLACKLIST) diff -Nru systemd-204/debian/shlibs.local systemd-204/debian/shlibs.local --- systemd-204/debian/shlibs.local 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/shlibs.local 2017-01-05 12:30:27.000000000 +0000 @@ -1,4 +1,3 @@ -libudev 1 libudev1 (= ${binary:Version}) udeb: libudev 1 libudev1-udeb libsystemd-login 0 libsystemd-login0 (= ${binary:Version}) libsystemd-journal 0 libsystemd-journal0 (= ${binary:Version}) diff -Nru systemd-204/debian/source/git-patches systemd-204/debian/source/git-patches --- systemd-204/debian/source/git-patches 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/source/git-patches 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -#v$UPSTREAM_REF..debian-units_$DEB_VERSION -v$UPSTREAM_REF..upstream-fixes_$DEB_VERSION diff -Nru systemd-204/debian/source/options systemd-204/debian/source/options --- systemd-204/debian/source/options 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/source/options 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -single-debian-patch diff -Nru systemd-204/debian/systemd-services.install systemd-204/debian/systemd-services.install --- systemd-204/debian/systemd-services.install 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/systemd-services.install 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,46 @@ +bin/loginctl +etc/dbus-1/system.d/org.freedesktop.login1.conf +etc/dbus-1/system.d/org.freedesktop.hostname1.conf +etc/dbus-1/system.d/org.freedesktop.locale1.conf +etc/dbus-1/system.d/org.freedesktop.timedate1.conf +etc/systemd/logind.conf +lib/udev/rules.d/70-uaccess.rules +lib/udev/rules.d/73-seat-late.rules +lib/udev/rules.d/71-seat.rules +lib/systemd/systemd-hostnamed +lib/systemd/systemd-localed +lib/systemd/systemd-timedated +lib/systemd/systemd-logind +lib/systemd/systemd-multi-seat-x +usr/bin/timedatectl +usr/bin/localectl +usr/bin/hostnamectl +usr/share/bash-completion/completions/hostnamectl +usr/share/bash-completion/completions/timedatectl +usr/share/bash-completion/completions/localectl +usr/share/bash-completion/completions/loginctl +usr/share/dbus-1/system-services/org.freedesktop.login1.service +usr/share/dbus-1/system-services/org.freedesktop.hostname1.service +usr/share/dbus-1/system-services/org.freedesktop.locale1.service +usr/share/dbus-1/system-services/org.freedesktop.timedate1.service +usr/share/dbus-1/interfaces/org.freedesktop.hostname1.xml +usr/share/dbus-1/interfaces/org.freedesktop.locale1.xml +usr/share/dbus-1/interfaces/org.freedesktop.timedate1.xml +usr/share/man/man1/loginctl.1 +usr/share/man/man1/localectl.1 +usr/share/man/man1/hostnamectl.1 +usr/share/man/man1/timedatectl.1 +usr/share/man/man5/logind.conf.5 +usr/share/man/man8/systemd-logind.service.8 +usr/share/man/man8/systemd-logind.8 +usr/share/man/man8/systemd-hostnamed.service.8 +usr/share/man/man8/systemd-hostnamed.8 +usr/share/man/man8/systemd-localed.service.8 +usr/share/man/man8/systemd-localed.8 +usr/share/man/man8/systemd-timedated.service.8 +usr/share/man/man8/systemd-timedated.8 +usr/share/polkit-1/actions/org.freedesktop.login1.policy +usr/share/polkit-1/actions/org.freedesktop.hostname1.policy +usr/share/polkit-1/actions/org.freedesktop.locale1.policy +usr/share/polkit-1/actions/org.freedesktop.timedate1.policy + diff -Nru systemd-204/debian/systemd-services.maintscript systemd-204/debian/systemd-services.maintscript --- systemd-204/debian/systemd-services.maintscript 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/systemd-services.maintscript 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1 @@ +rm_conffile /etc/init/systemd-logind.conf 198-0ubuntu7~ diff -Nru systemd-204/debian/systemd.install systemd-204/debian/systemd.install --- systemd-204/debian/systemd.install 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/systemd.install 2017-01-05 14:35:48.000000000 +0000 @@ -1,7 +1,7 @@ -etc/ +etc/systemd/ +etc/dbus-1/system.d/org.freedesktop.systemd1.conf bin/systemctl bin/journalctl -bin/loginctl bin/systemd-notify bin/systemd-tty-ask-password-agent bin/systemd-ask-password @@ -10,9 +10,6 @@ bin/systemd-inhibit #usr/bin/kernel-install lib/systemd/ -lib/udev/rules.d/70-uaccess.rules -lib/udev/rules.d/73-seat-late.rules -lib/udev/rules.d/71-seat.rules lib/udev/rules.d/99-systemd.rules usr/bin/systemd-cgls usr/bin/systemd-cgtop @@ -22,22 +19,34 @@ usr/bin/systemd-cat usr/bin/systemd-detect-virt usr/bin/systemd-delta -usr/bin/timedatectl -usr/bin/localectl -usr/bin/hostnamectl -usr/share/man/man1/ +usr/share/man/man1/system*.1 +usr/share/man/man1/journalctl.1 +usr/share/man/man1/init.1 usr/share/man/man3/ usr/share/man/man5/ usr/share/man/man7/ usr/share/man/man8/ -usr/share/bash-completion/ -usr/share/dbus-1/ +usr/share/bash-completion/completions/systemctl +usr/share/bash-completion/completions/journalctl +usr/share/dbus-1/services/ +usr/share/dbus-1/system-services/org.freedesktop.systemd1.service usr/share/doc/ usr/share/pkgconfig/systemd.pc -usr/share/polkit-1/ +usr/share/polkit-1/actions/org.freedesktop.systemd1.policy usr/share/systemd/kbd-model-map usr/lib/binfmt.d/ usr/lib/modules-load.d/ usr/lib/sysctl.d/ usr/lib/systemd/ usr/lib/tmpfiles.d/ +# units that we want to run as deputy init +lib/systemd/system/*.target lib/systemd/upstart/ +lib/systemd/system/systemd-journal* lib/systemd/upstart/ +lib/systemd/system/sockets.target.wants/systemd-journald.socket lib/systemd/upstart/sockets.target.wants/ +lib/systemd/system/systemd-poweroff.service lib/systemd/upstart/ +lib/systemd/system/systemd-halt.service lib/systemd/upstart/ +lib/systemd/system/systemd-reboot.service lib/systemd/upstart/ +lib/systemd/system/systemd-kexec.service lib/systemd/upstart/ +lib/systemd/system/systemd-suspend.service lib/systemd/upstart/ +lib/systemd/system/systemd-hibernate.service lib/systemd/upstart/ +../../extra/dbus.service lib/systemd/upstart/ diff -Nru systemd-204/debian/systemd.links systemd-204/debian/systemd.links --- systemd-204/debian/systemd.links 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/systemd.links 2017-01-05 12:30:27.000000000 +0000 @@ -61,3 +61,7 @@ # Mount separate tmpfs file systems for /run/user and /run/lock /lib/systemd/system/run-user.mount /lib/systemd/system/local-fs.target.wants/run-user.mount /lib/systemd/system/run-lock.mount /lib/systemd/system/local-fs.target.wants/run-lock.mount + +# dummy unit for deputy systemd +/dev/null /lib/systemd/upstart/dbus.socket +/lib/systemd/upstart/dbus.service /lib/systemd/upstart/multi-user.target.wants/dbus.service diff -Nru systemd-204/debian/systemd.postinst systemd-204/debian/systemd.postinst --- systemd-204/debian/systemd.postinst 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/systemd.postinst 2017-01-16 12:48:48.000000000 +0000 @@ -28,7 +28,6 @@ if [ -n "$2" ]; then _systemctl daemon-reexec || true _systemctl try-restart systemd-journald.service || true - _systemctl try-restart systemd-logind.service || true fi # Do a one-time migration of the local time setting @@ -59,11 +58,6 @@ fi fi -# Create /run/initctl → /dev/initctl compat symlink on upgrades -if [ -d /run/systemd/system ]; then - _systemctl restart systemd-initctl.socket || true -fi - if dpkg --compare-versions "$2" lt "40-1"; then # /lib/init/rw has been replaced by /run, so try to remove it on upgrades # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=643699 diff -Nru systemd-204/debian/systemd.preinst systemd-204/debian/systemd.preinst --- systemd-204/debian/systemd.preinst 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/systemd.preinst 2017-01-05 12:30:27.000000000 +0000 @@ -8,4 +8,19 @@ --divert /lib/lsb/init-functions.systemd /lib/lsb/init-functions fi +# This function copies a unit file to /run/systemd/system/ (unless the target +# path already exists). +# This is necessary at least for certain .mount units when upgrading from 44 to +# 204, see http://bugs.debian.org/723936 +preserve_unit() { + if [ ! -e /run/systemd/system/$1 ]; then + cp /lib/systemd/system/$1 /run/systemd/system/$1 + fi +} + +if [ "$1" = "install" ] || [ "$1" = "upgrade" ] && [ -n "$2" ] && dpkg --compare-versions "$2" lt "204-1" && [ -d /run/systemd/system ]; then + preserve_unit "var-lock.mount" + preserve_unit "var-run.mount" +fi + #DEBHELPER# diff -Nru systemd-204/debian/systemd.prerm systemd-204/debian/systemd.prerm --- systemd-204/debian/systemd.prerm 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/systemd.prerm 2017-01-05 12:30:27.000000000 +0000 @@ -1,15 +1,10 @@ #! /bin/sh - set -e -# -# Prevent systemd from being removed if it's the active init. That -# will not work. -# - -if [ "$1" = "remove" ] && [ -d /run/systemd/system ]; then - echo "systemd is the active init system, please switch to another before removing systemd." - exit 1 +# we must stop the deputy init on upgrades to later Ubuntu releases which have a real systemd +if [ "$1" = "upgrade" ] && dpkg --compare-versions "$2" gt 219; then + invoke-rc.d systemd stop || true fi #DEBHELPER# + diff -Nru systemd-204/debian/systemd.upstart systemd-204/debian/systemd.upstart --- systemd-204/debian/systemd.upstart 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/systemd.upstart 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,10 @@ +description "run systemd deputy init" +author "Martin Pitt " + +start on started dbus +stop on stopping dbus + +pre-start exec mkdir -p /run/systemd/system +exec /lib/systemd/systemd --system + +post-stop exec rm -rf /run/systemd/system diff -Nru systemd-204/debian/tests/api systemd-204/debian/tests/api --- systemd-204/debian/tests/api 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/tests/api 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,39 @@ +#!/bin/sh +# autopkgtest check: Test various libsystemd* APIs +# (C) 2013 Canonical Ltd. +# Author: Martin Pitt + +set -e + +WORKDIR=$(mktemp -d) +trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM +cd $WORKDIR +cat < loginmonitor.c +#include +#include +#include + +int main(int argc, char **argv) +{ + sd_login_monitor* mon = NULL; + int res; + + res = sd_login_monitor_new(NULL, &mon); + if (res < 0) { + fprintf(stderr, "sd_login_monitor_new failed with value %i\n", res); + return 1; + } + + assert(sd_login_monitor_get_fd(mon) > 0); + + sd_login_monitor_unref(mon); + + return 0; +} +EOF + +gcc -Wall -Werror -o loginmonitor loginmonitor.c `pkg-config --cflags --libs libsystemd-login` +echo "loginmonitor build: OK" +[ -x loginmonitor ] +./loginmonitor +echo "loginmonitor run: OK" diff -Nru systemd-204/debian/tests/control systemd-204/debian/tests/control --- systemd-204/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/tests/control 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,7 @@ +Tests: timedated hostnamed localed-locale localed-x11-keymap logind +Depends: systemd-services, libpam-systemd, acl +Restrictions: needs-root isolation-machine + +Tests: api +Depends: systemd-services, libpam-systemd, libsystemd-login-dev, build-essential, pkg-config +Restrictions: isolation-machine diff -Nru systemd-204/debian/tests/hostnamed systemd-204/debian/tests/hostnamed --- systemd-204/debian/tests/hostnamed 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/tests/hostnamed 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +ORIG_HOST=`cat /etc/hostname` + +# should activate daemon and work +STATUS=`hostnamectl` +echo "$STATUS" | grep -q "Static hostname: $ORIG_HOST" +echo "$STATUS" | grep -q "Architecture: `uname -m`" + +# change hostname +OUT=`hostnamectl set-hostname testhost 2>&1` +[ -z "$OUT" ] +[ "`cat /etc/hostname`" = "testhost" ] +STATUS=`hostnamectl` +echo "$STATUS" | grep -q "Static hostname: testhost" + +# reset to original +OUT=`hostnamectl set-hostname $ORIG_HOST 2>&1` +[ -z "$OUT" ] +[ "`cat /etc/hostname`" = "$ORIG_HOST" ] +STATUS=`hostnamectl` +echo "$STATUS" | grep -q "Static hostname: $ORIG_HOST" diff -Nru systemd-204/debian/tests/localed-locale systemd-204/debian/tests/localed-locale --- systemd-204/debian/tests/localed-locale 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/tests/localed-locale 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,24 @@ +#!/bin/sh +set -e + +ORIG_LOC=`cat /etc/default/locale` + +# should activate daemon and work +STATUS=`localectl` +echo "$STATUS" | grep -q "System Locale:" + +# change locale +OUT=`localectl set-locale LANG=C LC_CTYPE=en_US.UTF-8 2>&1` +[ -z "$OUT" ] +sync +[ "`cat /etc/default/locale`" = "LANG=C +LC_CTYPE=en_US.UTF-8" ] + +! [ -f /etc/locale.conf ] + +STATUS=`localectl` +echo "$STATUS" | grep -q "System Locale: LANG=C" +echo "$STATUS" | grep -q "LC_CTYPE=en_US.UTF-8" + +# reset locale to original +echo "$ORIG_LOC" > /etc/default/locale diff -Nru systemd-204/debian/tests/localed-x11-keymap systemd-204/debian/tests/localed-x11-keymap --- systemd-204/debian/tests/localed-x11-keymap 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/tests/localed-x11-keymap 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +ORIG_KBD=`cat /etc/default/keyboard` + +# should activate daemon and work +STATUS=`localectl` +echo "$STATUS" | grep -q "X11 Layout:" + +# change layout +OUT=`localectl set-x11-keymap et pc101 2>&1` +[ -z "$OUT" ] +sync + +grep -q 'XKBMODEL="\?pc101"\?' /etc/default/keyboard +grep -q 'XKBLAYOUT="\?et"\?' /etc/default/keyboard + +! [ -f /etc/X11/xorg.conf.d/00-keyboard.conf ] + +STATUS=`localectl` +echo "$STATUS" | grep -q "X11 Layout: et" +echo "$STATUS" | grep -q "X11 Model: pc101" + +# reset locale to original +echo "$ORIG_KBD" > /etc/default/keyboard diff -Nru systemd-204/debian/tests/logind systemd-204/debian/tests/logind --- systemd-204/debian/tests/logind 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/tests/logind 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,69 @@ +#!/bin/sh +set -e + +echo " * cgroup is mounted" +mountpoint -q /sys/fs/cgroup/systemd +echo " * daemon is started" +# should happen with upstart script, not with D-BUS activation +pidof systemd-logind > /dev/null + +# loginctl should succeed +echo " * loginctl succeeds" +OUT=`loginctl` + +if ! echo "$OUT" | grep -q "seat0"; then + echo "Skipping ACL tests, as there is no seat" + exit 0 +fi + +# determine user +USER=`echo "$OUT" | grep seat0 | awk '{print $3}'` +echo "seat user: $USER" + +# scsi_debug should not be loaded yet +! test -d /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block + +# we use scsi_debug to create new devices which we can put ACLs on +# tell udev about the tagging, so that logind can pick it up +mkdir -p /run/udev/rules.d/ +cat < /run/udev/rules.d/60-scsi_debug-user.rules +SUBSYSTEM=="block", ATTRS{model}=="scsi_debug*", TAG+="uaccess" +EOF +trap "rm -f /run/udev/rules.d/60-scsi_debug-user.rules; pkill -HUP udevd || pkill -HUP systemd-udevd; rmmod scsi_debug 2>/dev/null || ( sleep 2; rmmod scsi_debug ) || true" 0 INT QUIT TERM PIPE +sync +pkill -HUP udevd || pkill -HUP systemd-udevd + +echo " * coldplug: logind started with existing device" +killall systemd-logind +modprobe scsi_debug +while ! dev=/dev/`ls /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block`; do sleep 0.1; done +test -b $dev +echo "got block device $dev" +udevadm settle +# trigger logind +loginctl > /dev/null +sleep 1 +if getfacl -p $dev | grep -q "user:$USER:rw-"; then + echo "$dev has ACL for user $USER" +else + echo "$dev has no ACL for user $USER:" >&2 + getfacl -p $dev >&2 + exit 1 +fi + +rmmod scsi_debug + +echo " * hotplug: new device appears while logind is running" +modprobe scsi_debug +while ! dev=/dev/`ls /sys/bus/pseudo/drivers/scsi_debug/adapter*/host*/target*/*:*/block`; do sleep 0.1; done +test -b $dev +echo "got block device $dev" +udevadm settle +sleep 1 +if getfacl -p $dev | grep -q "user:$USER:rw-"; then + echo "$dev has ACL for user $USER" +else + echo "$dev has no ACL for user $USER:" >&2 + getfacl -p $dev >&2 + exit 1 +fi diff -Nru systemd-204/debian/tests/timedated systemd-204/debian/tests/timedated --- systemd-204/debian/tests/timedated 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/tests/timedated 2017-01-05 12:30:27.000000000 +0000 @@ -0,0 +1,20 @@ +#!/bin/sh +set -e + +ORIG_TZ=`cat /etc/timezone` + +# should activate daemon and work +STATUS=`timedatectl` +echo "$STATUS" | grep -q "Local time:" + +# change timezone +OUT=`timedatectl set-timezone Europe/Moscow 2>&1` +[ -z "$OUT" ] +[ "`cat /etc/timezone`" = "Europe/Moscow" ] +STATUS=`timedatectl` +echo "$STATUS" | grep -q "Timezone: Europe/Moscow (MSK, +" + +# reset timezone to original +OUT=`timedatectl set-timezone $ORIG_TZ 2>&1` +[ -z "$OUT" ] +[ "`cat /etc/timezone`" = "$ORIG_TZ" ] diff -Nru systemd-204/debian/udev-udeb.install systemd-204/debian/udev-udeb.install --- systemd-204/debian/udev-udeb.install 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev-udeb.install 2017-01-05 12:30:27.000000000 +0000 @@ -3,6 +3,13 @@ lib/udev/ata_id lib/udev/scsi_id lib/udev/cdrom_id +lib/udev/rules.d/50-udev-default.rules lib/udev/rules.d/50-firmware.rules lib/udev/rules.d/60-cdrom_id.rules +lib/udev/rules.d/60-persistent-storage.rules lib/udev/rules.d/60-persistent-input.rules +lib/udev/rules.d/64-btrfs.rules +lib/udev/rules.d/75-probe_mtd.rules +lib/udev/rules.d/80-drivers.rules +../../extra/rules/73-idrac.rules lib/udev/rules.d/ +../../extra/rules/75-persistent-net-generator.rules lib/udev/rules.d/ diff -Nru systemd-204/debian/udev.NEWS systemd-204/debian/udev.NEWS --- systemd-204/debian/udev.NEWS 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev.NEWS 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -udev (0.140-1) unstable; urgency=low - - Starting from this release the last applicable NAME directive will be - used instead of the first one: check any custom udev rules. - The default rules files have been moved to /lib/udev/rules.d/ and - /etc/udev/rules.d/ is supposed to contain only generated files or - custom directives. - - -- Marco d'Itri Wed, 18 Mar 2009 02:34:13 +0100 diff -Nru systemd-204/debian/udev.dirs systemd-204/debian/udev.dirs --- systemd-204/debian/udev.dirs 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev.dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -/lib/udev/devices/ -/lib/firmware/ diff -Nru systemd-204/debian/udev.install systemd-204/debian/udev.install --- systemd-204/debian/udev.install 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev.install 2017-01-05 12:30:27.000000000 +0000 @@ -9,3 +9,10 @@ # currently installed by bash-completion, file a bug to get it removed #usr/share/bash-completion/completions/udevadm usr/share/pkgconfig/udev.pc + +# Ubuntu +../../extra/rules/40-hyperv-hotadd.rules lib/udev/rules.d/ +../../extra/rules/73-idrac.rules lib/udev/rules.d/ +../../extra/rules/78-graphics-card.rules lib/udev/rules.d/ +../../extra/udev.py usr/share/apport/package-hooks +../../extra/*.hwdb lib/udev/hwdb.d diff -Nru systemd-204/debian/udev.maintscript systemd-204/debian/udev.maintscript --- systemd-204/debian/udev.maintscript 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev.maintscript 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -rm_conffile /etc/init.d/udev-mtab 204-1~ diff -Nru systemd-204/debian/udev.postinst systemd-204/debian/udev.postinst --- systemd-204/debian/udev.postinst 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev.postinst 2017-01-05 12:30:27.000000000 +0000 @@ -1,202 +1,43 @@ -#!/bin/sh -e +#!/bin/sh +set -e -supported_kernel() { - case "$(uname -r)" in - 2.[012345].*|2.6.[0-9]|2.6.[0-9][!0-9]*) return 1 ;; - 2.6.[12][0-9]|2.6.[12][0-9][!0-9]*) return 1 ;; - 2.6.3[0-1]|2.6.3[0-1][!0-9]*) return 1 ;; - esac - return 0 -} - -tempdir() { - local dir=$(tempfile --prefix=udev.) - rm $dir - mkdir $dir - echo $dir -} - -chrooted() { - if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; - then - # the devicenumber/inode pair of / is the same as that of /sbin/init's - # root, so we're *not* in a chroot and hence return false. - return 1 - fi - echo "A chroot environment has been detected, udev not started." - return 0 -} - -in_debootstrap() { - # debootstrap --second-stage may be run in an emulator instead of a chroot, - # we need to check for this special case because start-stop-daemon would - # not be available. (#520742) - if [ -d /debootstrap/ ]; then - echo "Being installed by debootstrap, udev not started." - return 0 - fi - return 1 -} - -can_start_udevd() { - if ! supported_kernel; then - echo "udev requires a kernel >= 2.6.32, not started." - return 1 - fi - - if [ ! -d /sys/class/ ]; then - echo "udev requires a mounted sysfs, not started." - return 1 - fi - - if [ ! -e /sys/kernel/uevent_helper ]; then - echo "udev requires hotplug support, not started." - return 1 - fi - - if ! ps --no-headers --format args ax | egrep -q '^\['; then - echo "udev does not support containers, not started." - return 1 - fi - - if ! grep -q '[[:space:]]devtmpfs$' /proc/filesystems; then - echo "udev requires devtmpfs support, not started." - return 1 - fi - - if [ -e /etc/udev/disabled ]; then - echo "/etc/udev/disabled has been detected, udev not started." - return 1 - fi - - return 0 -} - -enable_udev() { - can_start_udevd || return 0 - - invoke-rc.d udev start - - # restart some daemons because their /dev sockets might have been hidden by - # the devtmpfs - kill -s HUP 1 - local sysloginits="inetutils-syslogd rsyslog socklog-run sysklogd syslog-ng" - for script in $sysloginits; do - [ -x /etc/init.d/$script ] && invoke-rc.d $script restart || true - done -} - -update_initramfs() { - [ -x /usr/sbin/update-initramfs -a -e /etc/initramfs-tools/initramfs.conf ] \ - || return 0 - update-initramfs -u -} - -write_interfaces_rules() { - local devpath - for devpath in /sys/class/net/*; do - [ -d "$devpath" ] || continue - udevadm test --action=add $devpath > /dev/null || true - done -} - -upgrade_fixes() { - # 167-1 introduced /run/udev/ but does not move the old database on - # upgrades when it decides to switch to /run/. - if ! chrooted && [ -d /dev/.udev/ -a ! -d /run/udev/ ] \ - && grep -E -q "^[^[:space:]]+ /run tmpfs " /proc/mounts; then - mv /dev/.udev/ /run/udev/ - fi - - if dpkg --compare-versions "$2" lt "171-3"; then - # in 171-2 this directory becomes a symlink to libudev0, so it must be - # manually deleted because dpkg cannot automatically deal with this - if [ -e /usr/share/doc/udev -a ! -L /usr/share/doc/udev ]; then - rm -rf /usr/share/doc/udev - ln -s libudev0 /usr/share/doc/udev +# Enable udevadm again +enable_udevadm() +{ + if [ -e /bin/udevadm.upgrade ]; then + rm -f /bin/udevadm + dpkg-divert --package fake-udev --rename --divert /bin/udevadm.upgrade \ + --remove /bin/udevadm fi - fi - - if dpkg --compare-versions "$2" lt "204-1"; then - # We dropped udev-mtab with udev 204. - update-rc.d udev-mtab remove - fi } update_hwdb() { udevadm hwdb --update || true } -# In udev-204, we ship systemd-udevd.service (upstream name), whereas previous -# versions used udev.service. We replace udev.service with a symlink to -# systemd-udevd.service, but systemd (both 44 and 204) exposes weird behavior: -# After a daemon-reload, it forgets about the /sbin/udevd process in the -# udev.service cgroup, so a restart will lead to having two udevd processes -# running — one in the udev.service cgroup and one in the systemd-udevd.service -# cgroup. -# -# To fix this, we explicitly stop udev.service and the corresponding sockets, -# then issue the daemon-reload, then restart the new systemd-udevd.service (via -# invoke-rc.d). -handle_service_rename() { - if dpkg --compare-versions "$2" lt "204-1"; then - if [ -d /run/systemd/system ]; then - systemctl stop udev.service udev-control.socket udev-kernel.socket >/dev/null 2>&1 || true - fi - fi -} - case "$1" in configure) - # update/create hwdb before we (re)start udev - update_hwdb + # update/create hwdb before we (re)start udev + update_hwdb - if [ -z "$2" ]; then # first install - if ! chrooted && ! in_debootstrap; then - write_interfaces_rules - enable_udev - fi - else # upgrades - upgrade_fixes "$@" - if ! chrooted; then - if [ -e /etc/udev/kernel-upgrade ]; then - echo "Kernel upgrade mode, udevd has not been restarted." - echo "Please reboot the system as soon as possible." - rm /etc/udev/kernel-upgrade - elif can_start_udevd; then - handle_service_rename - rm -f /run/systemd/system/systemd-udevd.service - rm -f /run/systemd/system/udev.service - # This is necessary for the handle_service_rename case, but does not - # hurt in general (invoke-rc.d does it, too). - if [ -d /run/systemd/system ] ; then - systemctl daemon-reload || true - fi - invoke-rc.d udev restart - fi - fi - fi - - update_initramfs - ;; + invoke-rc.d udev restart + enable_udevadm + update-initramfs -u + ;; - abort-upgrade|abort-remove|abort-deconfigure) - ;; + abort-upgrade|abort-deconfigure|abort-remove) + ;; triggered) - update_hwdb - exit 0 - ;; - - interfaces) - write_interfaces_rules - ;; + update_hwdb + exit 0 + ;; *) - echo "$0 called with unknown argument '$1'" >&2 - exit 1 - ;; + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; esac #DEBHELPER# - +exit 0 diff -Nru systemd-204/debian/udev.postrm systemd-204/debian/udev.postrm --- systemd-204/debian/udev.postrm 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev.postrm 2017-01-05 12:30:27.000000000 +0000 @@ -1,11 +1,70 @@ #!/bin/sh -e +# This script can be called in the following ways: +# +# After the package was removed: +# remove +# +# After the package was purged: +# purge +# +# After the package was upgraded: +# upgrade +# if that fails: +# failed-upgrade +# +# +# After all of the packages files have been replaced: +# disappear +# +# +# If preinst fails during install: +# abort-install +# +# If preinst fails during upgrade of removed package: +# abort-install +# +# If preinst fails during upgrade: +# abort-upgrade + +# Enable udevadm again +enable_udevadm() +{ + rm -f /bin/udevadm + dpkg-divert --package fake-udev --rename --divert /bin/udevadm.upgrade \ + --remove /bin/udevadm +} + + +# Remove configuration and log files +purge_files() +{ + if [ -f /var/log/udev ]; then + rm -f /var/log/udev || true + fi + rm -f /lib/udev/hwdb.bin +} + case "$1" in - purge) - rm -f /etc/udev/rules.d/70-persistent-*.rules - rmdir --ignore-fail-on-non-empty /etc/udev/rules.d/ 2> /dev/null || true - rm -f /lib/udev/hwdb.bin - ;; + remove) + ;; + + purge) + purge_files + ;; + + upgrade|failed-upgrade|disappear) + ;; + + abort-install|abort-upgrade) + enable_udevadm + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; esac #DEBHELPER# +exit 0 diff -Nru systemd-204/debian/udev.preinst systemd-204/debian/udev.preinst --- systemd-204/debian/udev.preinst 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev.preinst 2017-01-05 12:30:27.000000000 +0000 @@ -1,265 +1,59 @@ #!/bin/sh -e +# This script can be called in the following ways: +# +# Before the package is installed: +# install +# +# Before removed package is upgraded: +# install +# +# Before the package is upgraded: +# upgrade +# +# +# If postrm fails during upgrade or fails on failed upgrade: +# abort-upgrade + + +# Disable udevadm from being run during an upgrade, to cause installation +# failures of packages which call udevadm trigger without depending on udev +disable_udevadm() +{ + dpkg-divert --package fake-udev --rename --divert /bin/udevadm.upgrade \ + --add /bin/udevadm -# Hack to get the dpkg process' PID despite using debconf -if [ -z "$PARENT_PID" ]; then - export PARENT_PID=$PPID -fi - -. /usr/share/debconf/confmodule - -# adapted from postinst -chrooted() { - if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; - then - return 1 - fi - return 0 -} - -supported_kernel() { - local version - if [ "$1" ]; then - version="$1" - else - version="$(uname -r)" - fi - - case "$version" in - 2.[012345].*|2.6.[0-9]|2.6.[0-9][!0-9]*) return 1 ;; - 2.6.[12][0-9]|2.6.[12][0-9][!0-9]*) return 1 ;; - 2.6.3[0-1]|2.6.3[0-1][!0-9]*) return 1 ;; - esac - return 0 -} - -check_installed_kernel() { - for ver in /lib/modules/*; do - ver=${ver##*/} - [ "$ver" = '*' ] && return 1 - supported_kernel "$ver" && return 0 - done - return 1 -} - -check_installing_kernel() { - for pkg in $(ps hp $PARENT_PID -o args); do - ver=$(echo $pkg | sed -nr "s/^.*linux-image-(2\.6\.[0-9]+)-([0-9]+|trunk)-.*_.*_.*\.deb$/\1/p") - [ "$ver" ] && supported_kernel "$ver" && return 0 - done - return 1 -} - -check_kernel_version() { - # skip the check if udev is not already active - [ -d /dev/.udev/ -o -d /run/udev/ ] || return 0 - - supported_kernel && return - - if [ -e /etc/udev/kernel-upgrade ]; then - echo "This version of udev requires a kernel >= 2.6.32, but the upgrade was forced." - # restart udevd which was killed by the old prerm - udevd -d || true - return 0 - fi - - db_settitle udev/title/upgrade - - if check_installed_kernel || check_installing_kernel; then - db_fset udev/reboot_needed seen false - db_input high udev/reboot_needed || true - db_go - db_stop - echo "A reboot is needed, but proceeding with the upgrade." - touch /etc/udev/kernel-upgrade - # restart udevd which was killed by the old prerm - udevd -d || true - return 0 - fi - - db_fset udev/new_kernel_needed seen false - db_reset udev/new_kernel_needed - db_input critical udev/new_kernel_needed || true - db_go - db_get udev/new_kernel_needed - if [ "$RET" = true ]; then - db_stop - echo "This version of udev requires a kernel >= 2.6.32, but the upgrade was forced." - touch /etc/udev/kernel-upgrade - # restart udevd which was killed by the old prerm - udevd -d || true - return 0 - fi - db_stop - exit 1 -} - -check_kernel_features() { - # skip the check if udev is not already active - [ -d /dev/.udev/ -o -d /run/udev/ ] || return 0 - - # skip the check if check_kernel_version() decided that a new kernel is - # being installed - [ -e /etc/udev/kernel-upgrade ] && return 0 - - local abort_install=0 - - if [ -e /proc/kallsyms ]; then - - local needed_symbols='sys_inotify_init sys_signalfd' - local missing_symbol=0 - for symbol in $needed_symbols; do - if ! egrep -q "^[a-fA-F0-9]+ T \.?${symbol}$" /proc/kallsyms; then - missing_symbol=1 - abort_install=1 - break - fi - done - - fi - - local missing_devtmpfs=0 - if ! grep -q '[[:space:]]devtmpfs$' /proc/filesystems; then - missing_devtmpfs=1 - abort_install=1 - fi - - local sysfs_deprecated=0 - if [ -d /sys/class/mem/null -a ! -L /sys/class/mem/null ]; then - sysfs_deprecated=1 - fi - if [ -e /sys/block -a ! -e /sys/class/block ]; then - sysfs_deprecated=1 - fi - - if [ "$missing_symbol" -eq 1 ]; then - cat < /bin/udevadm +#!/bin/sh - db_stop - exit 1 -} - -rm_conffile() { - mv_conffile "$1" "$1.dpkg-bak" -} - -mv_conffile() { - local package='udev' - local name="$1" - local newname="$2" - - [ -e "$name" ] || return 0 - - local md5="$(md5sum $name | sed -e 's/ .*//')" - oldmd5="$(dpkg-query -W -f='${Conffiles}' $package | \ - sed -n -e "\' $name ' { s/ obsolete$//; s/.* //; p }")" - - if [ "$md5" = "$oldmd5" ]; then - rm -f "$name" - else - mv "$name" "$newname" - fi -} +if [ "$1" = "trigger" ]; then + echo "udevadm trigger is not permitted while udev is unconfigured." 1>&2 + exit 1 +fi -mask_systemd_service() { - if [ -x '/bin/systemctl' -a -d '/run/systemd/system/' ]; then - ln -s /dev/null /run/systemd/system/systemd-udevd.service - ln -s /dev/null /run/systemd/system/udev.service - systemctl daemon-reload || true - fi -} +if [ "$1" = "settle" ]; then + echo "udevadm settle is not permitted while udev is unconfigured." 1>&2 + exit 1 +fi -stop_on_upstart_upgrade() { - if which initctl >/dev/null && initctl version | grep -q upstart - then - # We have to stop udev before we can restart it under upstart in the - # postinst. - invoke-rc.d udev stop - fi +exec /bin/bash -c "exec -a \"\$0\" /bin/udevadm.upgrade \"\$@\"" "$0" "$@" +UDEVADM + chmod +x /bin/udevadm } -check_version() { - # $2 is non-empty when installing from the "config-files" state - [ "$2" ] || return 0 - - if dpkg --compare-versions $2 lt 204-4; then - # these must be checked first to allow aborting before changing anything - if chrooted; then - echo 'Running in a chroot, skipping the kernel versions checks!' - else - check_kernel_version - check_kernel_features - fi - fi # 168-2 - - if dpkg --compare-versions $2 lt 175-1; then - rm_conffile /etc/modprobe.d/blacklist.conf - fi # 175-1 - - if dpkg --compare-versions $2 lt 175-7.1; then - stop_on_upstart_upgrade - fi # 175-7.1 - - if dpkg --compare-versions $2 lt 204-4; then - # suppress errors when the new rules files contain options not supported by - # the old daemon - if ! chrooted; then - udevadm control --log-priority=0 || true - fi - fi # 204-4 -} case "$1" in - install) - check_version "$@" - ;; - - upgrade|abort-upgrade) - check_version "$@" - mask_systemd_service - ;; + install|upgrade) + disable_udevadm + ;; + + abort-upgrade) + ;; *) - echo "$0 called with unknown argument '$1'" >&2 - exit 1 - ;; + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; esac #DEBHELPER# - +exit 0 diff -Nru systemd-204/debian/udev.prerm systemd-204/debian/udev.prerm --- systemd-204/debian/udev.prerm 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev.prerm 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -#!/bin/sh -e - -# adapted from postinst -chrooted() { - if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; - then - return 1 - fi - return 0 -} - -kill_udevd() { - start-stop-daemon --stop --name udevd --user root --oknodo --quiet --retry 5 -} - -case "$1" in - remove|deconfigure|failed-upgrade) - if ! chrooted; then - kill_udevd - fi - ;; - - upgrade) - ;; - - *) - echo "$0 called with unknown argument '$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - diff -Nru systemd-204/debian/udev.templates systemd-204/debian/udev.templates --- systemd-204/debian/udev.templates 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev.templates 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -# These templates have been reviewed by the debian-l10n-english -# team -# -# If modifications/additions/rewording are needed, please ask -# for an advice to debian-l10n-english@lists.debian.org -# -# Even minor modifications require translation updates and such -# changes should be coordinated with translators and reviewers. - -Template: udev/title/upgrade -Type: title -_Description: Upgrading udev - -Template: udev/reboot_needed -Type: error -_Description: Reboot needed after this upgrade - You are currently upgrading udev using an incompatible kernel version. A - compatible version is installed or being installed on the system, but - you need to reboot using this new kernel as soon as the upgrade is - complete. - . - Without a reboot with this new kernel version, the system may become - UNUSABLE. - -Template: udev/sysfs_deprecated_incompatibility -Type: error -_Description: The running kernel has incompatible options enabled - The currently running kernel has the CONFIG_SYSFS_DEPRECATED option - enabled, which is incompatible with this udev release. If you are using - the standard Debian kernel packages and are in the process of upgrading - from lenny to squeeze, a compatible kernel package should be installed as - part of this upgrade. If you are not using the Debian kernel packages or - are not currently upgrading the system, you must take action to ensure your - kernel is upgraded before the next reboot. - . - Failing to upgrade to a kernel without CONFIG_SYSFS_DEPRECATED will probably - not prevent your system from booting, but will prevent certain udev rules - from being applied at boot time. In particular, all block devices will - be owned by root:root (instead of root:disk), and network interfaces may be - named differently after reboots. This latter issue may be a problem if - you are administering the machine remotely. - . - The upgrade of udev will continue after you acknowledge this message. - -Template: udev/new_kernel_needed -Type: boolean -Default: false -_Description: Proceed with the udev upgrade despite the kernel incompatibility? - You are currently upgrading udev to a version that is not - compatible with the currently running kernel. - . - You MUST install a compatible kernel version (2.6.32 or newer) before - upgrading, otherwise the system may become UNUSABLE. - Packages with a name starting with "linux-image-2.6-" provide a kernel - image usable with this new udev version. - . - If you choose to upgrade udev nevertheless, you should install a - compatible kernel and reboot with that kernel as soon as - possible. diff -Nru systemd-204/debian/udev.udev-fallback-graphics.upstart systemd-204/debian/udev.udev-fallback-graphics.upstart --- systemd-204/debian/udev.udev-fallback-graphics.upstart 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev.udev-fallback-graphics.upstart 2017-01-05 12:30:27.000000000 +0000 @@ -16,6 +16,6 @@ script if [ "$PRIMARY_DEVICE_FOR_DISPLAY" = "" ]; then - modprobe -q -b vesafb + modprobe -q -b vesafb || true fi end script diff -Nru systemd-204/debian/udev.udev-finish.upstart systemd-204/debian/udev.udev-finish.upstart --- systemd-204/debian/udev.udev-finish.upstart 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev.udev-finish.upstart 2017-01-05 12:30:27.000000000 +0000 @@ -21,7 +21,7 @@ fi # Copy any rules generated while the root filesystem was read-only - for file in /dev/.udev/tmp-rules--* + for file in /run/udev/tmp-rules--* do [ -e "$file" ] || continue cat "$file" >> "/etc/udev/rules.d/${file##*tmp-rules--}" diff -Nru systemd-204/debian/udev.upstart systemd-204/debian/udev.upstart --- systemd-204/debian/udev.upstart 2013-09-23 11:27:30.000000000 +0000 +++ systemd-204/debian/udev.upstart 2017-01-05 12:30:27.000000000 +0000 @@ -11,4 +11,4 @@ expect fork respawn -exec /sbin/udevd --daemon +exec /lib/systemd/systemd-udevd --daemon diff -Nru systemd-204/debian/units/systemd-fsck@.service systemd-204/debian/units/systemd-fsck@.service --- systemd-204/debian/units/systemd-fsck@.service 1970-01-01 00:00:00.000000000 +0000 +++ systemd-204/debian/units/systemd-fsck@.service 2017-10-03 12:31:13.000000000 +0000 @@ -0,0 +1,17 @@ +# LP: #1718966: systemd mount units need fsck units for snappy +# Slightly changed fsck@.service unit file, adapted for Trusty + +[Unit] +Description=File System Check on %f +Documentation=man:systemd-fsck@.service(8) +DefaultDependencies=no +BindsTo=%i.device +After=%i.device +Before=shutdown.target + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/lib/systemd/systemd-fsck %f +StandardOutput=journal+console +TimeoutSec=0