From de98d9505cd1f2b7f508088efe68cb0a95f8ef88 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 21 Oct 2016 03:19:59 -0400 Subject: oops --- src/grp-udev/.gitignore | 1 + src/grp-udev/50-udev-default.rules | 77 +++++++++++++++++++ src/grp-udev/60-block.rules | 11 +++ src/grp-udev/60-drm.rules | 3 + src/grp-udev/60-evdev.rules | 19 +++++ src/grp-udev/60-persistent-alsa.rules | 14 ++++ src/grp-udev/60-persistent-input.rules | 40 ++++++++++ src/grp-udev/60-persistent-storage-tape.rules | 26 +++++++ src/grp-udev/60-persistent-storage.rules | 88 +++++++++++++++++++++ src/grp-udev/60-serial.rules | 26 +++++++ src/grp-udev/64-btrfs.rules | 13 ++++ src/grp-udev/70-mouse.rules | 18 +++++ src/grp-udev/70-touchpad.rules | 13 ++++ src/grp-udev/75-net-description.rules | 14 ++++ src/grp-udev/78-sound-card.rules | 89 ++++++++++++++++++++++ src/grp-udev/80-drivers.rules | 13 ++++ src/grp-udev/80-net-setup-link.rules | 13 ++++ src/grp-udev/99-systemd.rules.in | 66 ++++++++++++++++ src/grp-udev/rules/.gitignore | 1 - src/grp-udev/rules/50-udev-default.rules | 77 ------------------- src/grp-udev/rules/60-block.rules | 11 --- src/grp-udev/rules/60-drm.rules | 3 - src/grp-udev/rules/60-evdev.rules | 19 ----- src/grp-udev/rules/60-persistent-alsa.rules | 14 ---- src/grp-udev/rules/60-persistent-input.rules | 40 ---------- .../rules/60-persistent-storage-tape.rules | 26 ------- src/grp-udev/rules/60-persistent-storage.rules | 88 --------------------- src/grp-udev/rules/60-serial.rules | 26 ------- src/grp-udev/rules/64-btrfs.rules | 13 ---- src/grp-udev/rules/70-mouse.rules | 18 ----- src/grp-udev/rules/70-touchpad.rules | 13 ---- src/grp-udev/rules/75-net-description.rules | 14 ---- src/grp-udev/rules/78-sound-card.rules | 89 ---------------------- src/grp-udev/rules/80-drivers.rules | 13 ---- src/grp-udev/rules/80-net-setup-link.rules | 13 ---- src/grp-udev/rules/99-systemd.rules.in | 66 ---------------- src/libsystemd-microhttpd/Makefile | 8 +- .../include/systemd-microhttpd/microhttpd-util.h | 14 ++-- src/libsystemd-microhttpd/src/Makefile | 8 +- src/libsystemd-microhttpd/src/microhttpd-util.c | 42 +++++----- src/systemd-remount-fs/remount-fs.c | 48 ++++++------ .../systemd-remount-fs.service.in | 8 +- .../systemd-remount-fs.service.xml | 84 ++++++++++---------- src/systemd-reply-password/Makefile | 12 +-- src/systemd-reply-password/reply-password.c | 24 +++--- 45 files changed, 668 insertions(+), 668 deletions(-) create mode 100644 src/grp-udev/50-udev-default.rules create mode 100644 src/grp-udev/60-block.rules create mode 100644 src/grp-udev/60-drm.rules create mode 100644 src/grp-udev/60-evdev.rules create mode 100644 src/grp-udev/60-persistent-alsa.rules create mode 100644 src/grp-udev/60-persistent-input.rules create mode 100644 src/grp-udev/60-persistent-storage-tape.rules create mode 100644 src/grp-udev/60-persistent-storage.rules create mode 100644 src/grp-udev/60-serial.rules create mode 100644 src/grp-udev/64-btrfs.rules create mode 100644 src/grp-udev/70-mouse.rules create mode 100644 src/grp-udev/70-touchpad.rules create mode 100644 src/grp-udev/75-net-description.rules create mode 100644 src/grp-udev/78-sound-card.rules create mode 100644 src/grp-udev/80-drivers.rules create mode 100644 src/grp-udev/80-net-setup-link.rules create mode 100644 src/grp-udev/99-systemd.rules.in delete mode 100644 src/grp-udev/rules/.gitignore delete mode 100644 src/grp-udev/rules/50-udev-default.rules delete mode 100644 src/grp-udev/rules/60-block.rules delete mode 100644 src/grp-udev/rules/60-drm.rules delete mode 100644 src/grp-udev/rules/60-evdev.rules delete mode 100644 src/grp-udev/rules/60-persistent-alsa.rules delete mode 100644 src/grp-udev/rules/60-persistent-input.rules delete mode 100644 src/grp-udev/rules/60-persistent-storage-tape.rules delete mode 100644 src/grp-udev/rules/60-persistent-storage.rules delete mode 100644 src/grp-udev/rules/60-serial.rules delete mode 100644 src/grp-udev/rules/64-btrfs.rules delete mode 100644 src/grp-udev/rules/70-mouse.rules delete mode 100644 src/grp-udev/rules/70-touchpad.rules delete mode 100644 src/grp-udev/rules/75-net-description.rules delete mode 100644 src/grp-udev/rules/78-sound-card.rules delete mode 100644 src/grp-udev/rules/80-drivers.rules delete mode 100644 src/grp-udev/rules/80-net-setup-link.rules delete mode 100644 src/grp-udev/rules/99-systemd.rules.in (limited to 'src') diff --git a/src/grp-udev/.gitignore b/src/grp-udev/.gitignore index f5d8be3dc1..f8e0aae978 100644 --- a/src/grp-udev/.gitignore +++ b/src/grp-udev/.gitignore @@ -2,3 +2,4 @@ /keyboard-keys-from-name.gperf /keyboard-keys-from-name.h /keyboard-keys-list.txt +/99-systemd.rules diff --git a/src/grp-udev/50-udev-default.rules b/src/grp-udev/50-udev-default.rules new file mode 100644 index 0000000000..e9eeb8518e --- /dev/null +++ b/src/grp-udev/50-udev-default.rules @@ -0,0 +1,77 @@ +# do not edit this file, it will be overwritten on update + +# run a command on remove events +ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}" +ACTION=="remove", GOTO="default_end" + +SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" + +# select "system RTC" or just use the first one +SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc" +SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100" + +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb" +SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id" +ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}" + +ACTION!="add", GOTO="default_end" + +SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666" +SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666" +SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620" +SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620" +SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620" +SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620" +SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty" +KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout" + +SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640" + +SUBSYSTEM=="input", GROUP="input" +SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0664" + +SUBSYSTEM=="video4linux", GROUP="video" +SUBSYSTEM=="graphics", GROUP="video" +SUBSYSTEM=="drm", GROUP="video" +SUBSYSTEM=="dvb", GROUP="video" + +SUBSYSTEM=="sound", GROUP="audio", \ + OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer" + +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664" + +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=="parport[0-9]*", GROUP="lp" +SUBSYSTEM=="printer", KERNEL=="lp*", GROUP="lp" +SUBSYSTEM=="ppdev", GROUP="lp" +KERNEL=="lp[0-9]*", GROUP="lp" +KERNEL=="irlpt[0-9]*", GROUP="lp" +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp" + +SUBSYSTEM=="block", GROUP="disk" +SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="cdrom" +SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom" +KERNEL=="sch[0-9]*", GROUP="cdrom" +KERNEL=="pktcdvd[0-9]*", GROUP="cdrom" +KERNEL=="pktcdvd", GROUP="cdrom" + +SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape" +SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk" +KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk" +KERNEL=="loop-control", GROUP="disk", OPTIONS+="static_node=loop-control" +KERNEL=="btrfs-control", GROUP="disk" +KERNEL=="rawctl", GROUP="disk" +SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", GROUP="disk" +SUBSYSTEM=="aoe", GROUP="disk", MODE="0220" +SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440" + +KERNEL=="rfkill", MODE="0664" +KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun" + +KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse" + +LABEL="default_end" diff --git a/src/grp-udev/60-block.rules b/src/grp-udev/60-block.rules new file mode 100644 index 0000000000..42c75974a5 --- /dev/null +++ b/src/grp-udev/60-block.rules @@ -0,0 +1,11 @@ +# do not edit this file, it will be overwritten on update + +# 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" + +# forward scsi device event to corresponding block device +ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" + +# watch metadata changes, caused by tools closing the device node which was opened for writing +ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*", OPTIONS+="watch" diff --git a/src/grp-udev/60-drm.rules b/src/grp-udev/60-drm.rules new file mode 100644 index 0000000000..1ed3e445f2 --- /dev/null +++ b/src/grp-udev/60-drm.rules @@ -0,0 +1,3 @@ +# do not edit this file, it will be overwritten on update + +ACTION!="remove", SUBSYSTEM=="drm", SUBSYSTEMS=="pci|usb|platform", IMPORT{builtin}="path_id" diff --git a/src/grp-udev/60-evdev.rules b/src/grp-udev/60-evdev.rules new file mode 100644 index 0000000000..ade7e7f646 --- /dev/null +++ b/src/grp-udev/60-evdev.rules @@ -0,0 +1,19 @@ +# do not edit this file, it will be overwritten on update + +ACTION=="remove", GOTO="evdev_end" +KERNEL!="event*", GOTO="evdev_end" + +# skip later rules when we find something for this input device +IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=evdev:", \ + RUN{builtin}+="keyboard", GOTO="evdev_end" + +# AT keyboard matching by the machine's DMI data +ENV{ID_INPUT_KEY}=="?*", DRIVERS=="atkbd", \ + IMPORT{builtin}="hwdb 'evdev:atkbd:$attr{[dmi/id]modalias}'", \ + RUN{builtin}+="keyboard", GOTO="evdev_end" + +# device matching the input device name and the machine's DMI data +KERNELS=="input*", IMPORT{builtin}="hwdb 'evdev:name:$attr{name}:$attr{[dmi/id]modalias}'", \ + RUN{builtin}+="keyboard", GOTO="evdev_end" + +LABEL="evdev_end" diff --git a/src/grp-udev/60-persistent-alsa.rules b/src/grp-udev/60-persistent-alsa.rules new file mode 100644 index 0000000000..8154e2dbb5 --- /dev/null +++ b/src/grp-udev/60-persistent-alsa.rules @@ -0,0 +1,14 @@ +# do not edit this file, it will be overwritten on update + +ACTION=="remove", GOTO="persistent_alsa_end" +SUBSYSTEM!="sound", GOTO="persistent_alsa_end" +KERNEL!="controlC[0-9]*", GOTO="persistent_alsa_end" + +SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{builtin}="usb_id" +ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="?*", SYMLINK+="snd/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_USB_INTERFACE_NUM}" +ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="", SYMLINK+="snd/by-id/$env{ID_BUS}-$env{ID_SERIAL}" + +IMPORT{builtin}="path_id" +ENV{ID_PATH}=="?*", SYMLINK+="snd/by-path/$env{ID_PATH}" + +LABEL="persistent_alsa_end" diff --git a/src/grp-udev/60-persistent-input.rules b/src/grp-udev/60-persistent-input.rules new file mode 100644 index 0000000000..607144bf8a --- /dev/null +++ b/src/grp-udev/60-persistent-input.rules @@ -0,0 +1,40 @@ +# do not edit this file, it will be overwritten on update + +ACTION=="remove", GOTO="persistent_input_end" +SUBSYSTEM!="input", GOTO="persistent_input_end" +SUBSYSTEMS=="bluetooth", ENV{ID_BUS}="bluetooth", GOTO="persistent_input_end" +SUBSYSTEMS=="rmi4", ENV{ID_BUS}="rmi", GOTO="persistent_input_end" +SUBSYSTEMS=="serio", ENV{ID_BUS}="i8042", GOTO="persistent_input_end" + +SUBSYSTEMS=="usb", ENV{ID_BUS}=="", IMPORT{builtin}="usb_id" + +# determine class name for persistent symlinks +ENV{ID_INPUT_KEYBOARD}=="?*", ENV{.INPUT_CLASS}="kbd" +ENV{ID_INPUT_MOUSE}=="?*", ENV{.INPUT_CLASS}="mouse" +ENV{ID_INPUT_TOUCHPAD}=="?*", ENV{.INPUT_CLASS}="mouse" +ENV{ID_INPUT_TABLET}=="?*", ENV{.INPUT_CLASS}="mouse" +ENV{ID_INPUT_JOYSTICK}=="?*", ENV{.INPUT_CLASS}="joystick" +DRIVERS=="pcspkr", ENV{.INPUT_CLASS}="spkr" +ATTRS{name}=="*dvb*|*DVB*|* IR *", ENV{.INPUT_CLASS}="ir" + +# fill empty serial number +ENV{.INPUT_CLASS}=="?*", ENV{ID_SERIAL}=="", ENV{ID_SERIAL}="noserial" + +# by-id links +KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="|00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{.INPUT_CLASS}" +KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-$env{.INPUT_CLASS}" +KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="|00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-$env{.INPUT_CLASS}" +KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-event-$env{.INPUT_CLASS}" +# allow empty class for USB devices, by appending the interface number +SUBSYSTEMS=="usb", ENV{ID_BUS}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", ATTRS{bInterfaceNumber}=="?*", \ + SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-if$attr{bInterfaceNumber}" + +# by-path +SUBSYSTEMS=="pci|usb|platform|acpi", IMPORT{builtin}="path_id" +ENV{ID_PATH}=="?*", KERNEL=="mouse*|js*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{.INPUT_CLASS}" +ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{.INPUT_CLASS}" +# allow empty class for platform and usb devices; platform supports only a single interface that way +SUBSYSTEMS=="usb|platform", ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", \ + SYMLINK+="input/by-path/$env{ID_PATH}-event" + +LABEL="persistent_input_end" diff --git a/src/grp-udev/60-persistent-storage-tape.rules b/src/grp-udev/60-persistent-storage-tape.rules new file mode 100644 index 0000000000..b604864ee8 --- /dev/null +++ b/src/grp-udev/60-persistent-storage-tape.rules @@ -0,0 +1,26 @@ +# do not edit this file, it will be overwritten on update + +# persistent storage links: /dev/tape/{by-id,by-path} + +ACTION=="remove", GOTO="persistent_storage_tape_end" +ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_tape_end" + +# type 8 devices are "Medium Changers" +SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{program}="scsi_id --sg-version=3 --export --whitelisted -d $devnode", \ + 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_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394" +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}!="?*", IMPORT{program}="scsi_id --whitelisted --export --device=$env{.BSG_DEV}", ENV{ID_BUS}="scsi" +KERNEL=="st*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}" +KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst" + +# by-path (parent device path) +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" + +LABEL="persistent_storage_tape_end" diff --git a/src/grp-udev/60-persistent-storage.rules b/src/grp-udev/60-persistent-storage.rules new file mode 100644 index 0000000000..d7bbbf9866 --- /dev/null +++ b/src/grp-udev/60-persistent-storage.rules @@ -0,0 +1,88 @@ +# do not edit this file, it will be overwritten on update + +# persistent storage links: /dev/disk/{by-id,by-uuid,by-label,by-path} +# scheme based on "Linux persistent device names", 2004, Hannes Reinecke + +ACTION=="remove", GOTO="persistent_storage_end" +ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end" + +SUBSYSTEM!="block", GOTO="persistent_storage_end" +KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*", GOTO="persistent_storage_end" + +# ignore partitions that span the entire disk +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" + +# ATA +KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $devnode" + +# ATAPI devices (SPC-3 or later) +KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", IMPORT{program}="ata_id --export $devnode" + +# Run ata_id on non-removable USB Mass Storage (SATA/PATA disks in enclosures) +KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", ATTR{removable}=="0", SUBSYSTEMS=="usb", IMPORT{program}="ata_id --export $devnode" + +# Fall back usb_id for USB devices +KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id" + +# SCSI devices +KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="scsi" +KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="cciss" +KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" +KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" + +# FireWire +KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}" +KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n" + +# MMC +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" + +# Memstick +KERNEL=="msblk[0-9]|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=="msblk[0-9]p[0-9]|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" + +# by-path +ENV{DEVTYPE}=="disk", DEVPATH!="*/virtual/*", IMPORT{builtin}="path_id" +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" + +# probe filesystem metadata of optical drives which have a media inserted +KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", \ + IMPORT{builtin}="blkid --offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}" +# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET +KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \ + IMPORT{builtin}="blkid --noraid" + +# probe filesystem metadata of disks +KERNEL!="sr*", IMPORT{builtin}="blkid" + +# by-label/by-uuid links (filesystem metadata) +ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" + +# by-id (World Wide Name) +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_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}" + +# add symlink to GPT root disk +ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_GPT_AUTO_ROOT}=="1", SYMLINK+="gpt-auto-root" + +LABEL="persistent_storage_end" diff --git a/src/grp-udev/60-serial.rules b/src/grp-udev/60-serial.rules new file mode 100644 index 0000000000..f303e27fd5 --- /dev/null +++ b/src/grp-udev/60-serial.rules @@ -0,0 +1,26 @@ +# do not edit this file, it will be overwritten on update + +ACTION=="remove", GOTO="serial_end" +SUBSYSTEM!="tty", GOTO="serial_end" + +SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}" +SUBSYSTEMS=="pci", IMPORT{builtin}="hwdb --subsystem=pci" +SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb" + +# /dev/serial/by-path/, /dev/serial/by-id/ for USB devices +KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="serial_end" + +SUBSYSTEMS=="usb-serial", ENV{.ID_PORT}="$attr{port_number}" + +IMPORT{builtin}="path_id" +ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="", SYMLINK+="serial/by-path/$env{ID_PATH}" +ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-path/$env{ID_PATH}-port$env{.ID_PORT}" + +IMPORT{builtin}="usb_id" +ENV{ID_SERIAL}=="", GOTO="serial_end" +SUBSYSTEMS=="usb", ENV{ID_USB_INTERFACE_NUM}="$attr{bInterfaceNumber}" +ENV{ID_USB_INTERFACE_NUM}=="", GOTO="serial_end" +ENV{.ID_PORT}=="", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_USB_INTERFACE_NUM}" +ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_USB_INTERFACE_NUM}-port$env{.ID_PORT}" + +LABEL="serial_end" diff --git a/src/grp-udev/64-btrfs.rules b/src/grp-udev/64-btrfs.rules new file mode 100644 index 0000000000..fe0100131e --- /dev/null +++ b/src/grp-udev/64-btrfs.rules @@ -0,0 +1,13 @@ +# do not edit this file, it will be overwritten on update + +SUBSYSTEM!="block", GOTO="btrfs_end" +ACTION=="remove", GOTO="btrfs_end" +ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end" + +# let the kernel know about this btrfs filesystem, and check if it is complete +IMPORT{builtin}="btrfs ready $devnode" + +# mark the device as not ready to be used by the system +ENV{ID_BTRFS_READY}=="0", ENV{SYSTEMD_READY}="0" + +LABEL="btrfs_end" diff --git a/src/grp-udev/70-mouse.rules b/src/grp-udev/70-mouse.rules new file mode 100644 index 0000000000..3ea743aff9 --- /dev/null +++ b/src/grp-udev/70-mouse.rules @@ -0,0 +1,18 @@ +# do not edit this file, it will be overwritten on update + +ACTION=="remove", GOTO="mouse_end" +KERNEL!="event*", GOTO="mouse_end" +ENV{ID_INPUT_MOUSE}=="", GOTO="mouse_end" + +# mouse::vp:name::* +KERNELS=="input*", ENV{ID_BUS}=="usb", \ + IMPORT{builtin}="hwdb 'mouse:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \ + GOTO="mouse_end" +KERNELS=="input*", ENV{ID_BUS}=="bluetooth", \ + IMPORT{builtin}="hwdb 'mouse:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \ + GOTO="mouse_end" +DRIVERS=="psmouse", SUBSYSTEMS=="serio", \ + IMPORT{builtin}="hwdb 'mouse:ps2::name:$attr{device/name}:'", \ + GOTO="mouse_end" + +LABEL="mouse_end" diff --git a/src/grp-udev/70-touchpad.rules b/src/grp-udev/70-touchpad.rules new file mode 100644 index 0000000000..7bede02dec --- /dev/null +++ b/src/grp-udev/70-touchpad.rules @@ -0,0 +1,13 @@ +# do not edit this file, it will be overwritten on update + +ACTION=="remove", GOTO="touchpad_end" +ENV{ID_INPUT}=="", GOTO="touchpad_end" +ENV{ID_INPUT_TOUCHPAD}=="", GOTO="touchpad_end" +KERNEL!="event*", GOTO="touchpad_end" + +# touchpad::vp:name::* +KERNELS=="input*", ENV{ID_BUS}!="", \ + IMPORT{builtin}="hwdb 'touchpad:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \ + GOTO="touchpad_end" + +LABEL="touchpad_end" diff --git a/src/grp-udev/75-net-description.rules b/src/grp-udev/75-net-description.rules new file mode 100644 index 0000000000..7e62f8b26b --- /dev/null +++ b/src/grp-udev/75-net-description.rules @@ -0,0 +1,14 @@ +# do not edit this file, it will be overwritten on update + +ACTION=="remove", GOTO="net_end" +SUBSYSTEM!="net", GOTO="net_end" + +IMPORT{builtin}="net_id" + +SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb" +SUBSYSTEMS=="usb", GOTO="net_end" + +SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}" +SUBSYSTEMS=="pci", IMPORT{builtin}="hwdb --subsystem=pci" + +LABEL="net_end" diff --git a/src/grp-udev/78-sound-card.rules b/src/grp-udev/78-sound-card.rules new file mode 100644 index 0000000000..04740e8b97 --- /dev/null +++ b/src/grp-udev/78-sound-card.rules @@ -0,0 +1,89 @@ +# do not edit this file, it will be overwritten on update + +SUBSYSTEM!="sound", GOTO="sound_end" + +ACTION=="add|change", KERNEL=="controlC*", ATTR{../uevent}="change" +ACTION!="change", GOTO="sound_end" + +# Ok, we probably need a little explanation here for what the two lines above +# are good for. +# +# The story goes like this: when ALSA registers a new sound card it emits a +# series of 'add' events to userspace, for the main card device and for all the +# child device nodes that belong to it. udev relays those to applications, +# however only maintains the order between father and child, but not between +# the siblings. The control device node creation can be used as synchronization +# point. All other devices that belong to a card are created in the kernel +# before it. However unfortunately due to the fact that siblings are forwarded +# out of order by udev this fact is lost to applications. +# +# OTOH before an application can open a device it needs to make sure that all +# its device nodes are completely created and set up. +# +# As a workaround for this issue we have added the udev rule above which will +# generate a 'change' event on the main card device from the 'add' event of the +# card's control device. Due to the ordering semantics of udev this event will +# only be relayed after all child devices have finished processing properly. +# When an application needs to listen for appearing devices it can hence look +# for 'change' events only, and ignore the actual 'add' events. +# +# When the application is initialized at the same time as a device is plugged +# in it may need to figure out if the 'change' event has already been triggered +# or not for a card. To find that out we store the flag environment variable +# SOUND_INITIALIZED on the device which simply tells us if the card 'change' +# event has already been processed. + +KERNEL!="card*", GOTO="sound_end" + +ENV{SOUND_INITIALIZED}="1" + +IMPORT{builtin}="hwdb" +SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id" +SUBSYSTEMS=="usb", GOTO="skip_pci" + +SUBSYSTEMS=="firewire", ATTRS{guid}=="?*", \ + ENV{ID_BUS}="firewire", ENV{ID_SERIAL}="$attr{guid}", ENV{ID_SERIAL_SHORT}="$attr{guid}", \ + ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{model}", \ + ENV{ID_VENDOR}="$attr{vendor_name}", ENV{ID_MODEL}="$attr{model_name}" +SUBSYSTEMS=="firewire", GOTO="skip_pci" + +SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}" +LABEL="skip_pci" + +# Define ID_ID if ID_BUS and ID_SERIAL are set. This will work for both +# USB and firewire. +ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="?*", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_USB_INTERFACE_NUM}" +ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}" + +IMPORT{builtin}="path_id" + +# The values used here for $SOUND_FORM_FACTOR and $SOUND_CLASS should be kept +# in sync with those defined for PulseAudio's src/pulse/proplist.h +# PA_PROP_DEVICE_FORM_FACTOR, PA_PROP_DEVICE_CLASS properties. + +# If the first PCM device of this card has the pcm class 'modem', then the card is a modem +ATTR{pcmC%nD0p/pcm_class}=="modem", ENV{SOUND_CLASS}="modem", GOTO="sound_end" + +# Identify cards on the internal PCI bus as internal +SUBSYSTEMS=="pci", DEVPATH=="*/0000:00:??.?/sound/*", ENV{SOUND_FORM_FACTOR}="internal", GOTO="sound_end" + +# Devices that also support Image/Video interfaces are most likely webcams +SUBSYSTEMS=="usb", ENV{ID_USB_INTERFACES}=="*:0e????:*", ENV{SOUND_FORM_FACTOR}="webcam", GOTO="sound_end" + +# Matching on the model strings is a bit ugly, I admit +ENV{ID_MODEL}=="*[Ss]peaker*", ENV{SOUND_FORM_FACTOR}="speaker", GOTO="sound_end" +ENV{ID_MODEL_FROM_DATABASE}=="*[Ss]peaker*", ENV{SOUND_FORM_FACTOR}="speaker", GOTO="sound_end" + +ENV{ID_MODEL}=="*[Hh]eadphone*", ENV{SOUND_FORM_FACTOR}="headphone", GOTO="sound_end" +ENV{ID_MODEL_FROM_DATABASE}=="*[Hh]eadphone*", ENV{SOUND_FORM_FACTOR}="headphone", GOTO="sound_end" + +ENV{ID_MODEL}=="*[Hh]eadset*", ENV{SOUND_FORM_FACTOR}="headset", GOTO="sound_end" +ENV{ID_MODEL_FROM_DATABASE}=="*[Hh]eadset*", ENV{SOUND_FORM_FACTOR}="headset", GOTO="sound_end" + +ENV{ID_MODEL}=="*[Hh]andset*", ENV{SOUND_FORM_FACTOR}="handset", GOTO="sound_end" +ENV{ID_MODEL_FROM_DATABASE}=="*[Hh]andset*", ENV{SOUND_FORM_FACTOR}="handset", GOTO="sound_end" + +ENV{ID_MODEL}=="*[Mm]icrophone*", ENV{SOUND_FORM_FACTOR}="microphone", GOTO="sound_end" +ENV{ID_MODEL_FROM_DATABASE}=="*[Mm]icrophone*", ENV{SOUND_FORM_FACTOR}="microphone", GOTO="sound_end" + +LABEL="sound_end" diff --git a/src/grp-udev/80-drivers.rules b/src/grp-udev/80-drivers.rules new file mode 100644 index 0000000000..8551f47a4b --- /dev/null +++ b/src/grp-udev/80-drivers.rules @@ -0,0 +1,13 @@ +# do not edit this file, it will be overwritten on update + +ACTION=="remove", GOTO="drivers_end" + +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" +SUBSYSTEM=="i2o", RUN{builtin}+="kmod load i2o_block" +SUBSYSTEM=="module", KERNEL=="parport_pc", RUN{builtin}+="kmod load ppdev" +KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN{builtin}+="kmod load sm_ftl" + +LABEL="drivers_end" diff --git a/src/grp-udev/80-net-setup-link.rules b/src/grp-udev/80-net-setup-link.rules new file mode 100644 index 0000000000..6e411a91f0 --- /dev/null +++ b/src/grp-udev/80-net-setup-link.rules @@ -0,0 +1,13 @@ +# do not edit this file, it will be overwritten on update + +SUBSYSTEM!="net", GOTO="net_setup_link_end" + +IMPORT{builtin}="path_id" + +ACTION!="add", GOTO="net_setup_link_end" + +IMPORT{builtin}="net_setup_link" + +NAME=="", ENV{ID_NET_NAME}!="", NAME="$env{ID_NET_NAME}" + +LABEL="net_setup_link_end" diff --git a/src/grp-udev/99-systemd.rules.in b/src/grp-udev/99-systemd.rules.in new file mode 100644 index 0000000000..ca52cf165b --- /dev/null +++ b/src/grp-udev/99-systemd.rules.in @@ -0,0 +1,66 @@ +# This file is part of systemd. +# +# 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. + +ACTION=="remove", GOTO="systemd_end" + +SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*", TAG+="systemd" +KERNEL=="vport*", TAG+="systemd" + +SUBSYSTEM=="block", TAG+="systemd" +SUBSYSTEM=="block", ACTION=="add", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0" + +# Ignore encrypted devices with no identified superblock on it, since +# we are probably still calling mke2fs or mkswap on it. +SUBSYSTEM=="block", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0" + +# Ignore raid devices that are not yet assembled and started +SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0" +SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0" + +# Ignore loop devices that don't have any file attached +SUBSYSTEM=="block", KERNEL=="loop[0-9]*", ENV{DEVTYPE}=="disk", TEST!="loop/backing_file", ENV{SYSTEMD_READY}="0" + +# Ignore nbd devices until the PID file exists (which signals a connected device) +SUBSYSTEM=="block", KERNEL=="nbd*", ENV{DEVTYPE}=="disk", TEST!="pid", ENV{SYSTEMD_READY}="0" + +# We need a hardware independent way to identify network devices. We +# use the /sys/subsystem/ path for this. Kernel "bus" and "class" names +# should be treated as one namespace, like udev handles it. This is mostly +# just an identification string for systemd, so whether the path actually is +# accessible or not does not matter as long as it is unique and in the +# filesystem namespace. +# +# http://cgit.freedesktop.org/systemd/systemd/tree/src/libudev/libudev-enumerate.c#n955 + +SUBSYSTEM=="net", KERNEL!="lo", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/subsystem/net/devices/$name" +SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/subsystem/bluetooth/devices/%k" + +SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_WANTS}+="bluetooth.target" +ENV{ID_SMARTCARD_READER}=="?*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="smartcard.target" +SUBSYSTEM=="sound", KERNEL=="card*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sound.target" + +SUBSYSTEM=="printer", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target" +SUBSYSTEM=="usb", KERNEL=="lp*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target" +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target" + +# Apply sysctl variables to network devices (and only to those) as they appear. +ACTION=="add", SUBSYSTEM=="net", KERNEL!="lo", RUN+="@rootlibexecdir@/systemd-sysctl --prefix=/net/ipv4/conf/$name --prefix=/net/ipv4/neigh/$name --prefix=/net/ipv6/conf/$name --prefix=/net/ipv6/neigh/$name" + +# Pull in backlight save/restore for all backlight devices and +# keyboard backlights +SUBSYSTEM=="backlight", TAG+="systemd", IMPORT{builtin}="path_id", ENV{SYSTEMD_WANTS}+="systemd-backlight@backlight:$name.service" +SUBSYSTEM=="leds", KERNEL=="*kbd_backlight", TAG+="systemd", IMPORT{builtin}="path_id", ENV{SYSTEMD_WANTS}+="systemd-backlight@leds:$name.service" + +# Pull in rfkill save/restore for all rfkill devices +SUBSYSTEM=="rfkill", ENV{SYSTEMD_RFKILL}="1", IMPORT{builtin}="path_id" +SUBSYSTEM=="misc", KERNEL=="rfkill", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-rfkill.socket" + +# Asynchronously mount file systems implemented by these modules as soon as they are loaded. +SUBSYSTEM=="module", KERNEL=="fuse", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-fs-fuse-connections.mount" +SUBSYSTEM=="module", KERNEL=="configfs", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-kernel-config.mount" + +LABEL="systemd_end" diff --git a/src/grp-udev/rules/.gitignore b/src/grp-udev/rules/.gitignore deleted file mode 100644 index 93a50ddd80..0000000000 --- a/src/grp-udev/rules/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/99-systemd.rules diff --git a/src/grp-udev/rules/50-udev-default.rules b/src/grp-udev/rules/50-udev-default.rules deleted file mode 100644 index e9eeb8518e..0000000000 --- a/src/grp-udev/rules/50-udev-default.rules +++ /dev/null @@ -1,77 +0,0 @@ -# do not edit this file, it will be overwritten on update - -# run a command on remove events -ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}" -ACTION=="remove", GOTO="default_end" - -SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" - -# select "system RTC" or just use the first one -SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc" -SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100" - -SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb" -SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id" -ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}" - -ACTION!="add", GOTO="default_end" - -SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666" -SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666" -SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620" -SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620" -SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620" -SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620" -SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty" -KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout" - -SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640" - -SUBSYSTEM=="input", GROUP="input" -SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0664" - -SUBSYSTEM=="video4linux", GROUP="video" -SUBSYSTEM=="graphics", GROUP="video" -SUBSYSTEM=="drm", GROUP="video" -SUBSYSTEM=="dvb", GROUP="video" - -SUBSYSTEM=="sound", GROUP="audio", \ - OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer" - -SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664" - -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=="parport[0-9]*", GROUP="lp" -SUBSYSTEM=="printer", KERNEL=="lp*", GROUP="lp" -SUBSYSTEM=="ppdev", GROUP="lp" -KERNEL=="lp[0-9]*", GROUP="lp" -KERNEL=="irlpt[0-9]*", GROUP="lp" -SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp" - -SUBSYSTEM=="block", GROUP="disk" -SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="cdrom" -SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom" -KERNEL=="sch[0-9]*", GROUP="cdrom" -KERNEL=="pktcdvd[0-9]*", GROUP="cdrom" -KERNEL=="pktcdvd", GROUP="cdrom" - -SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape" -SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk" -KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk" -KERNEL=="loop-control", GROUP="disk", OPTIONS+="static_node=loop-control" -KERNEL=="btrfs-control", GROUP="disk" -KERNEL=="rawctl", GROUP="disk" -SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", GROUP="disk" -SUBSYSTEM=="aoe", GROUP="disk", MODE="0220" -SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440" - -KERNEL=="rfkill", MODE="0664" -KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun" - -KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse" - -LABEL="default_end" diff --git a/src/grp-udev/rules/60-block.rules b/src/grp-udev/rules/60-block.rules deleted file mode 100644 index 42c75974a5..0000000000 --- a/src/grp-udev/rules/60-block.rules +++ /dev/null @@ -1,11 +0,0 @@ -# do not edit this file, it will be overwritten on update - -# 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" - -# forward scsi device event to corresponding block device -ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" - -# watch metadata changes, caused by tools closing the device node which was opened for writing -ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*", OPTIONS+="watch" diff --git a/src/grp-udev/rules/60-drm.rules b/src/grp-udev/rules/60-drm.rules deleted file mode 100644 index 1ed3e445f2..0000000000 --- a/src/grp-udev/rules/60-drm.rules +++ /dev/null @@ -1,3 +0,0 @@ -# do not edit this file, it will be overwritten on update - -ACTION!="remove", SUBSYSTEM=="drm", SUBSYSTEMS=="pci|usb|platform", IMPORT{builtin}="path_id" diff --git a/src/grp-udev/rules/60-evdev.rules b/src/grp-udev/rules/60-evdev.rules deleted file mode 100644 index ade7e7f646..0000000000 --- a/src/grp-udev/rules/60-evdev.rules +++ /dev/null @@ -1,19 +0,0 @@ -# do not edit this file, it will be overwritten on update - -ACTION=="remove", GOTO="evdev_end" -KERNEL!="event*", GOTO="evdev_end" - -# skip later rules when we find something for this input device -IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=evdev:", \ - RUN{builtin}+="keyboard", GOTO="evdev_end" - -# AT keyboard matching by the machine's DMI data -ENV{ID_INPUT_KEY}=="?*", DRIVERS=="atkbd", \ - IMPORT{builtin}="hwdb 'evdev:atkbd:$attr{[dmi/id]modalias}'", \ - RUN{builtin}+="keyboard", GOTO="evdev_end" - -# device matching the input device name and the machine's DMI data -KERNELS=="input*", IMPORT{builtin}="hwdb 'evdev:name:$attr{name}:$attr{[dmi/id]modalias}'", \ - RUN{builtin}+="keyboard", GOTO="evdev_end" - -LABEL="evdev_end" diff --git a/src/grp-udev/rules/60-persistent-alsa.rules b/src/grp-udev/rules/60-persistent-alsa.rules deleted file mode 100644 index 8154e2dbb5..0000000000 --- a/src/grp-udev/rules/60-persistent-alsa.rules +++ /dev/null @@ -1,14 +0,0 @@ -# do not edit this file, it will be overwritten on update - -ACTION=="remove", GOTO="persistent_alsa_end" -SUBSYSTEM!="sound", GOTO="persistent_alsa_end" -KERNEL!="controlC[0-9]*", GOTO="persistent_alsa_end" - -SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{builtin}="usb_id" -ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="?*", SYMLINK+="snd/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_USB_INTERFACE_NUM}" -ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="", SYMLINK+="snd/by-id/$env{ID_BUS}-$env{ID_SERIAL}" - -IMPORT{builtin}="path_id" -ENV{ID_PATH}=="?*", SYMLINK+="snd/by-path/$env{ID_PATH}" - -LABEL="persistent_alsa_end" diff --git a/src/grp-udev/rules/60-persistent-input.rules b/src/grp-udev/rules/60-persistent-input.rules deleted file mode 100644 index 607144bf8a..0000000000 --- a/src/grp-udev/rules/60-persistent-input.rules +++ /dev/null @@ -1,40 +0,0 @@ -# do not edit this file, it will be overwritten on update - -ACTION=="remove", GOTO="persistent_input_end" -SUBSYSTEM!="input", GOTO="persistent_input_end" -SUBSYSTEMS=="bluetooth", ENV{ID_BUS}="bluetooth", GOTO="persistent_input_end" -SUBSYSTEMS=="rmi4", ENV{ID_BUS}="rmi", GOTO="persistent_input_end" -SUBSYSTEMS=="serio", ENV{ID_BUS}="i8042", GOTO="persistent_input_end" - -SUBSYSTEMS=="usb", ENV{ID_BUS}=="", IMPORT{builtin}="usb_id" - -# determine class name for persistent symlinks -ENV{ID_INPUT_KEYBOARD}=="?*", ENV{.INPUT_CLASS}="kbd" -ENV{ID_INPUT_MOUSE}=="?*", ENV{.INPUT_CLASS}="mouse" -ENV{ID_INPUT_TOUCHPAD}=="?*", ENV{.INPUT_CLASS}="mouse" -ENV{ID_INPUT_TABLET}=="?*", ENV{.INPUT_CLASS}="mouse" -ENV{ID_INPUT_JOYSTICK}=="?*", ENV{.INPUT_CLASS}="joystick" -DRIVERS=="pcspkr", ENV{.INPUT_CLASS}="spkr" -ATTRS{name}=="*dvb*|*DVB*|* IR *", ENV{.INPUT_CLASS}="ir" - -# fill empty serial number -ENV{.INPUT_CLASS}=="?*", ENV{ID_SERIAL}=="", ENV{ID_SERIAL}="noserial" - -# by-id links -KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="|00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{.INPUT_CLASS}" -KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-$env{.INPUT_CLASS}" -KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="|00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-$env{.INPUT_CLASS}" -KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-event-$env{.INPUT_CLASS}" -# allow empty class for USB devices, by appending the interface number -SUBSYSTEMS=="usb", ENV{ID_BUS}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", ATTRS{bInterfaceNumber}=="?*", \ - SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-if$attr{bInterfaceNumber}" - -# by-path -SUBSYSTEMS=="pci|usb|platform|acpi", IMPORT{builtin}="path_id" -ENV{ID_PATH}=="?*", KERNEL=="mouse*|js*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{.INPUT_CLASS}" -ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{.INPUT_CLASS}" -# allow empty class for platform and usb devices; platform supports only a single interface that way -SUBSYSTEMS=="usb|platform", ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", \ - SYMLINK+="input/by-path/$env{ID_PATH}-event" - -LABEL="persistent_input_end" diff --git a/src/grp-udev/rules/60-persistent-storage-tape.rules b/src/grp-udev/rules/60-persistent-storage-tape.rules deleted file mode 100644 index b604864ee8..0000000000 --- a/src/grp-udev/rules/60-persistent-storage-tape.rules +++ /dev/null @@ -1,26 +0,0 @@ -# do not edit this file, it will be overwritten on update - -# persistent storage links: /dev/tape/{by-id,by-path} - -ACTION=="remove", GOTO="persistent_storage_tape_end" -ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_tape_end" - -# type 8 devices are "Medium Changers" -SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{program}="scsi_id --sg-version=3 --export --whitelisted -d $devnode", \ - 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_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394" -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}!="?*", IMPORT{program}="scsi_id --whitelisted --export --device=$env{.BSG_DEV}", ENV{ID_BUS}="scsi" -KERNEL=="st*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}" -KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst" - -# by-path (parent device path) -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" - -LABEL="persistent_storage_tape_end" diff --git a/src/grp-udev/rules/60-persistent-storage.rules b/src/grp-udev/rules/60-persistent-storage.rules deleted file mode 100644 index d7bbbf9866..0000000000 --- a/src/grp-udev/rules/60-persistent-storage.rules +++ /dev/null @@ -1,88 +0,0 @@ -# do not edit this file, it will be overwritten on update - -# persistent storage links: /dev/disk/{by-id,by-uuid,by-label,by-path} -# scheme based on "Linux persistent device names", 2004, Hannes Reinecke - -ACTION=="remove", GOTO="persistent_storage_end" -ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end" - -SUBSYSTEM!="block", GOTO="persistent_storage_end" -KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*", GOTO="persistent_storage_end" - -# ignore partitions that span the entire disk -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" - -# ATA -KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $devnode" - -# ATAPI devices (SPC-3 or later) -KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", IMPORT{program}="ata_id --export $devnode" - -# Run ata_id on non-removable USB Mass Storage (SATA/PATA disks in enclosures) -KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", ATTR{removable}=="0", SUBSYSTEMS=="usb", IMPORT{program}="ata_id --export $devnode" - -# Fall back usb_id for USB devices -KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id" - -# SCSI devices -KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="scsi" -KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="cciss" -KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" -KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" - -# FireWire -KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}" -KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n" - -# MMC -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" - -# Memstick -KERNEL=="msblk[0-9]|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=="msblk[0-9]p[0-9]|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" - -# by-path -ENV{DEVTYPE}=="disk", DEVPATH!="*/virtual/*", IMPORT{builtin}="path_id" -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" - -# probe filesystem metadata of optical drives which have a media inserted -KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", \ - IMPORT{builtin}="blkid --offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}" -# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET -KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \ - IMPORT{builtin}="blkid --noraid" - -# probe filesystem metadata of disks -KERNEL!="sr*", IMPORT{builtin}="blkid" - -# by-label/by-uuid links (filesystem metadata) -ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" - -# by-id (World Wide Name) -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_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}" - -# add symlink to GPT root disk -ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_GPT_AUTO_ROOT}=="1", SYMLINK+="gpt-auto-root" - -LABEL="persistent_storage_end" diff --git a/src/grp-udev/rules/60-serial.rules b/src/grp-udev/rules/60-serial.rules deleted file mode 100644 index f303e27fd5..0000000000 --- a/src/grp-udev/rules/60-serial.rules +++ /dev/null @@ -1,26 +0,0 @@ -# do not edit this file, it will be overwritten on update - -ACTION=="remove", GOTO="serial_end" -SUBSYSTEM!="tty", GOTO="serial_end" - -SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}" -SUBSYSTEMS=="pci", IMPORT{builtin}="hwdb --subsystem=pci" -SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb" - -# /dev/serial/by-path/, /dev/serial/by-id/ for USB devices -KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="serial_end" - -SUBSYSTEMS=="usb-serial", ENV{.ID_PORT}="$attr{port_number}" - -IMPORT{builtin}="path_id" -ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="", SYMLINK+="serial/by-path/$env{ID_PATH}" -ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-path/$env{ID_PATH}-port$env{.ID_PORT}" - -IMPORT{builtin}="usb_id" -ENV{ID_SERIAL}=="", GOTO="serial_end" -SUBSYSTEMS=="usb", ENV{ID_USB_INTERFACE_NUM}="$attr{bInterfaceNumber}" -ENV{ID_USB_INTERFACE_NUM}=="", GOTO="serial_end" -ENV{.ID_PORT}=="", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_USB_INTERFACE_NUM}" -ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_USB_INTERFACE_NUM}-port$env{.ID_PORT}" - -LABEL="serial_end" diff --git a/src/grp-udev/rules/64-btrfs.rules b/src/grp-udev/rules/64-btrfs.rules deleted file mode 100644 index fe0100131e..0000000000 --- a/src/grp-udev/rules/64-btrfs.rules +++ /dev/null @@ -1,13 +0,0 @@ -# do not edit this file, it will be overwritten on update - -SUBSYSTEM!="block", GOTO="btrfs_end" -ACTION=="remove", GOTO="btrfs_end" -ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end" - -# let the kernel know about this btrfs filesystem, and check if it is complete -IMPORT{builtin}="btrfs ready $devnode" - -# mark the device as not ready to be used by the system -ENV{ID_BTRFS_READY}=="0", ENV{SYSTEMD_READY}="0" - -LABEL="btrfs_end" diff --git a/src/grp-udev/rules/70-mouse.rules b/src/grp-udev/rules/70-mouse.rules deleted file mode 100644 index 3ea743aff9..0000000000 --- a/src/grp-udev/rules/70-mouse.rules +++ /dev/null @@ -1,18 +0,0 @@ -# do not edit this file, it will be overwritten on update - -ACTION=="remove", GOTO="mouse_end" -KERNEL!="event*", GOTO="mouse_end" -ENV{ID_INPUT_MOUSE}=="", GOTO="mouse_end" - -# mouse::vp:name::* -KERNELS=="input*", ENV{ID_BUS}=="usb", \ - IMPORT{builtin}="hwdb 'mouse:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \ - GOTO="mouse_end" -KERNELS=="input*", ENV{ID_BUS}=="bluetooth", \ - IMPORT{builtin}="hwdb 'mouse:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \ - GOTO="mouse_end" -DRIVERS=="psmouse", SUBSYSTEMS=="serio", \ - IMPORT{builtin}="hwdb 'mouse:ps2::name:$attr{device/name}:'", \ - GOTO="mouse_end" - -LABEL="mouse_end" diff --git a/src/grp-udev/rules/70-touchpad.rules b/src/grp-udev/rules/70-touchpad.rules deleted file mode 100644 index 7bede02dec..0000000000 --- a/src/grp-udev/rules/70-touchpad.rules +++ /dev/null @@ -1,13 +0,0 @@ -# do not edit this file, it will be overwritten on update - -ACTION=="remove", GOTO="touchpad_end" -ENV{ID_INPUT}=="", GOTO="touchpad_end" -ENV{ID_INPUT_TOUCHPAD}=="", GOTO="touchpad_end" -KERNEL!="event*", GOTO="touchpad_end" - -# touchpad::vp:name::* -KERNELS=="input*", ENV{ID_BUS}!="", \ - IMPORT{builtin}="hwdb 'touchpad:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \ - GOTO="touchpad_end" - -LABEL="touchpad_end" diff --git a/src/grp-udev/rules/75-net-description.rules b/src/grp-udev/rules/75-net-description.rules deleted file mode 100644 index 7e62f8b26b..0000000000 --- a/src/grp-udev/rules/75-net-description.rules +++ /dev/null @@ -1,14 +0,0 @@ -# do not edit this file, it will be overwritten on update - -ACTION=="remove", GOTO="net_end" -SUBSYSTEM!="net", GOTO="net_end" - -IMPORT{builtin}="net_id" - -SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb" -SUBSYSTEMS=="usb", GOTO="net_end" - -SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}" -SUBSYSTEMS=="pci", IMPORT{builtin}="hwdb --subsystem=pci" - -LABEL="net_end" diff --git a/src/grp-udev/rules/78-sound-card.rules b/src/grp-udev/rules/78-sound-card.rules deleted file mode 100644 index 04740e8b97..0000000000 --- a/src/grp-udev/rules/78-sound-card.rules +++ /dev/null @@ -1,89 +0,0 @@ -# do not edit this file, it will be overwritten on update - -SUBSYSTEM!="sound", GOTO="sound_end" - -ACTION=="add|change", KERNEL=="controlC*", ATTR{../uevent}="change" -ACTION!="change", GOTO="sound_end" - -# Ok, we probably need a little explanation here for what the two lines above -# are good for. -# -# The story goes like this: when ALSA registers a new sound card it emits a -# series of 'add' events to userspace, for the main card device and for all the -# child device nodes that belong to it. udev relays those to applications, -# however only maintains the order between father and child, but not between -# the siblings. The control device node creation can be used as synchronization -# point. All other devices that belong to a card are created in the kernel -# before it. However unfortunately due to the fact that siblings are forwarded -# out of order by udev this fact is lost to applications. -# -# OTOH before an application can open a device it needs to make sure that all -# its device nodes are completely created and set up. -# -# As a workaround for this issue we have added the udev rule above which will -# generate a 'change' event on the main card device from the 'add' event of the -# card's control device. Due to the ordering semantics of udev this event will -# only be relayed after all child devices have finished processing properly. -# When an application needs to listen for appearing devices it can hence look -# for 'change' events only, and ignore the actual 'add' events. -# -# When the application is initialized at the same time as a device is plugged -# in it may need to figure out if the 'change' event has already been triggered -# or not for a card. To find that out we store the flag environment variable -# SOUND_INITIALIZED on the device which simply tells us if the card 'change' -# event has already been processed. - -KERNEL!="card*", GOTO="sound_end" - -ENV{SOUND_INITIALIZED}="1" - -IMPORT{builtin}="hwdb" -SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id" -SUBSYSTEMS=="usb", GOTO="skip_pci" - -SUBSYSTEMS=="firewire", ATTRS{guid}=="?*", \ - ENV{ID_BUS}="firewire", ENV{ID_SERIAL}="$attr{guid}", ENV{ID_SERIAL_SHORT}="$attr{guid}", \ - ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{model}", \ - ENV{ID_VENDOR}="$attr{vendor_name}", ENV{ID_MODEL}="$attr{model_name}" -SUBSYSTEMS=="firewire", GOTO="skip_pci" - -SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}" -LABEL="skip_pci" - -# Define ID_ID if ID_BUS and ID_SERIAL are set. This will work for both -# USB and firewire. -ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="?*", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_USB_INTERFACE_NUM}" -ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}" - -IMPORT{builtin}="path_id" - -# The values used here for $SOUND_FORM_FACTOR and $SOUND_CLASS should be kept -# in sync with those defined for PulseAudio's src/pulse/proplist.h -# PA_PROP_DEVICE_FORM_FACTOR, PA_PROP_DEVICE_CLASS properties. - -# If the first PCM device of this card has the pcm class 'modem', then the card is a modem -ATTR{pcmC%nD0p/pcm_class}=="modem", ENV{SOUND_CLASS}="modem", GOTO="sound_end" - -# Identify cards on the internal PCI bus as internal -SUBSYSTEMS=="pci", DEVPATH=="*/0000:00:??.?/sound/*", ENV{SOUND_FORM_FACTOR}="internal", GOTO="sound_end" - -# Devices that also support Image/Video interfaces are most likely webcams -SUBSYSTEMS=="usb", ENV{ID_USB_INTERFACES}=="*:0e????:*", ENV{SOUND_FORM_FACTOR}="webcam", GOTO="sound_end" - -# Matching on the model strings is a bit ugly, I admit -ENV{ID_MODEL}=="*[Ss]peaker*", ENV{SOUND_FORM_FACTOR}="speaker", GOTO="sound_end" -ENV{ID_MODEL_FROM_DATABASE}=="*[Ss]peaker*", ENV{SOUND_FORM_FACTOR}="speaker", GOTO="sound_end" - -ENV{ID_MODEL}=="*[Hh]eadphone*", ENV{SOUND_FORM_FACTOR}="headphone", GOTO="sound_end" -ENV{ID_MODEL_FROM_DATABASE}=="*[Hh]eadphone*", ENV{SOUND_FORM_FACTOR}="headphone", GOTO="sound_end" - -ENV{ID_MODEL}=="*[Hh]eadset*", ENV{SOUND_FORM_FACTOR}="headset", GOTO="sound_end" -ENV{ID_MODEL_FROM_DATABASE}=="*[Hh]eadset*", ENV{SOUND_FORM_FACTOR}="headset", GOTO="sound_end" - -ENV{ID_MODEL}=="*[Hh]andset*", ENV{SOUND_FORM_FACTOR}="handset", GOTO="sound_end" -ENV{ID_MODEL_FROM_DATABASE}=="*[Hh]andset*", ENV{SOUND_FORM_FACTOR}="handset", GOTO="sound_end" - -ENV{ID_MODEL}=="*[Mm]icrophone*", ENV{SOUND_FORM_FACTOR}="microphone", GOTO="sound_end" -ENV{ID_MODEL_FROM_DATABASE}=="*[Mm]icrophone*", ENV{SOUND_FORM_FACTOR}="microphone", GOTO="sound_end" - -LABEL="sound_end" diff --git a/src/grp-udev/rules/80-drivers.rules b/src/grp-udev/rules/80-drivers.rules deleted file mode 100644 index 8551f47a4b..0000000000 --- a/src/grp-udev/rules/80-drivers.rules +++ /dev/null @@ -1,13 +0,0 @@ -# do not edit this file, it will be overwritten on update - -ACTION=="remove", GOTO="drivers_end" - -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" -SUBSYSTEM=="i2o", RUN{builtin}+="kmod load i2o_block" -SUBSYSTEM=="module", KERNEL=="parport_pc", RUN{builtin}+="kmod load ppdev" -KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN{builtin}+="kmod load sm_ftl" - -LABEL="drivers_end" diff --git a/src/grp-udev/rules/80-net-setup-link.rules b/src/grp-udev/rules/80-net-setup-link.rules deleted file mode 100644 index 6e411a91f0..0000000000 --- a/src/grp-udev/rules/80-net-setup-link.rules +++ /dev/null @@ -1,13 +0,0 @@ -# do not edit this file, it will be overwritten on update - -SUBSYSTEM!="net", GOTO="net_setup_link_end" - -IMPORT{builtin}="path_id" - -ACTION!="add", GOTO="net_setup_link_end" - -IMPORT{builtin}="net_setup_link" - -NAME=="", ENV{ID_NET_NAME}!="", NAME="$env{ID_NET_NAME}" - -LABEL="net_setup_link_end" diff --git a/src/grp-udev/rules/99-systemd.rules.in b/src/grp-udev/rules/99-systemd.rules.in deleted file mode 100644 index ca52cf165b..0000000000 --- a/src/grp-udev/rules/99-systemd.rules.in +++ /dev/null @@ -1,66 +0,0 @@ -# This file is part of systemd. -# -# 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. - -ACTION=="remove", GOTO="systemd_end" - -SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*", TAG+="systemd" -KERNEL=="vport*", TAG+="systemd" - -SUBSYSTEM=="block", TAG+="systemd" -SUBSYSTEM=="block", ACTION=="add", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0" - -# Ignore encrypted devices with no identified superblock on it, since -# we are probably still calling mke2fs or mkswap on it. -SUBSYSTEM=="block", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0" - -# Ignore raid devices that are not yet assembled and started -SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0" -SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0" - -# Ignore loop devices that don't have any file attached -SUBSYSTEM=="block", KERNEL=="loop[0-9]*", ENV{DEVTYPE}=="disk", TEST!="loop/backing_file", ENV{SYSTEMD_READY}="0" - -# Ignore nbd devices until the PID file exists (which signals a connected device) -SUBSYSTEM=="block", KERNEL=="nbd*", ENV{DEVTYPE}=="disk", TEST!="pid", ENV{SYSTEMD_READY}="0" - -# We need a hardware independent way to identify network devices. We -# use the /sys/subsystem/ path for this. Kernel "bus" and "class" names -# should be treated as one namespace, like udev handles it. This is mostly -# just an identification string for systemd, so whether the path actually is -# accessible or not does not matter as long as it is unique and in the -# filesystem namespace. -# -# http://cgit.freedesktop.org/systemd/systemd/tree/src/libudev/libudev-enumerate.c#n955 - -SUBSYSTEM=="net", KERNEL!="lo", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/subsystem/net/devices/$name" -SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/subsystem/bluetooth/devices/%k" - -SUBSYSTEM=="bluetooth", TAG+="systemd", ENV{SYSTEMD_WANTS}+="bluetooth.target" -ENV{ID_SMARTCARD_READER}=="?*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="smartcard.target" -SUBSYSTEM=="sound", KERNEL=="card*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sound.target" - -SUBSYSTEM=="printer", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target" -SUBSYSTEM=="usb", KERNEL=="lp*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target" -SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target" - -# Apply sysctl variables to network devices (and only to those) as they appear. -ACTION=="add", SUBSYSTEM=="net", KERNEL!="lo", RUN+="@rootlibexecdir@/systemd-sysctl --prefix=/net/ipv4/conf/$name --prefix=/net/ipv4/neigh/$name --prefix=/net/ipv6/conf/$name --prefix=/net/ipv6/neigh/$name" - -# Pull in backlight save/restore for all backlight devices and -# keyboard backlights -SUBSYSTEM=="backlight", TAG+="systemd", IMPORT{builtin}="path_id", ENV{SYSTEMD_WANTS}+="systemd-backlight@backlight:$name.service" -SUBSYSTEM=="leds", KERNEL=="*kbd_backlight", TAG+="systemd", IMPORT{builtin}="path_id", ENV{SYSTEMD_WANTS}+="systemd-backlight@leds:$name.service" - -# Pull in rfkill save/restore for all rfkill devices -SUBSYSTEM=="rfkill", ENV{SYSTEMD_RFKILL}="1", IMPORT{builtin}="path_id" -SUBSYSTEM=="misc", KERNEL=="rfkill", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-rfkill.socket" - -# Asynchronously mount file systems implemented by these modules as soon as they are loaded. -SUBSYSTEM=="module", KERNEL=="fuse", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-fs-fuse-connections.mount" -SUBSYSTEM=="module", KERNEL=="configfs", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-kernel-config.mount" - -LABEL="systemd_end" diff --git a/src/libsystemd-microhttpd/Makefile b/src/libsystemd-microhttpd/Makefile index 1bc47eb5f1..15370638f2 100644 --- a/src/libsystemd-microhttpd/Makefile +++ b/src/libsystemd-microhttpd/Makefile @@ -19,10 +19,10 @@ # 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 $(dir $(lastword $(MAKEFILE_LIST))../../config.mk -include $(topsrcdirbuild-aux/Makefile.head.mk +# along with systemd; If not, see . +include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk nested.subdirs += src -include $(topsrcdirbuild-aux/Makefile.tail.mk +include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/libsystemd-microhttpd/include/systemd-microhttpd/microhttpd-util.h b/src/libsystemd-microhttpd/include/systemd-microhttpd/microhttpd-util.h index b238054556..a84bdc234a 100644 --- a/src/libsystemd-microhttpd/include/systemd-microhttpd/microhttpd-util.h +++ b/src/libsystemd-microhttpd/include/systemd-microhttpd/microhttpd-util.h @@ -5,7 +5,7 @@ Copyright 2012 Zbigniew Jędrzejewski-Szmek - systemd is free software; you can redistribute it anor modify it + 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. @@ -16,15 +16,15 @@ 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 . -** + along with systemd; If not, see . +***/ #include #include -#include "systemd-basimacro.h" +#include "systemd-basic/macro.h" -/* Compatiblity with libmicrohttpd < 0.9.38 +/* Compatiblity with libmicrohttpd < 0.9.38 */ #ifndef MHD_HTTP_NOT_ACCEPTABLE #define MHD_HTTP_NOT_ACCEPTABLE MHD_HTTP_METHOD_NOT_ACCEPTABLE #endif @@ -35,7 +35,7 @@ void microhttpd_logger(void *arg, const char *fmt, va_list ap) _printf_(2, 0); -/* respond_oom() must be usable with return, hence this form. +/* respond_oom() must be usable with return, hence this form. */ #define respond_oom(connection) log_oom(), mhd_respond_oom(connection) int mhd_respondf(struct MHD_Connection *connection, @@ -56,5 +56,5 @@ int check_permissions(struct MHD_Connection *connection, int *code, char **hostn * gnutls categories are additionally filtered by our internal log * level, so it should be set fairly high to capture all potentially * interesting events without overwhelming detail. - + */ int setup_gnutls_logger(char **categories); diff --git a/src/libsystemd-microhttpd/src/Makefile b/src/libsystemd-microhttpd/src/Makefile index 077f7392da..f3552b2e9a 100644 --- a/src/libsystemd-microhttpd/src/Makefile +++ b/src/libsystemd-microhttpd/src/Makefile @@ -19,9 +19,9 @@ # 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 $(dir $(lastword $(MAKEFILE_LIST))../../../config.mk -include $(topsrcdirbuild-aux/Makefile.head.mk +# along with systemd; If not, see . +include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk ifneq ($(HAVE_MICROHTTPD),) @@ -46,4 +46,4 @@ endif # HAVE_GNUTLS endif # HAVE_MICROHTTPD -include $(topsrcdirbuild-aux/Makefile.tail.mk +include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/libsystemd-microhttpd/src/microhttpd-util.c b/src/libsystemd-microhttpd/src/microhttpd-util.c index 4bf0fe2fb3..2dc73e75e3 100644 --- a/src/libsystemd-microhttpd/src/microhttpd-util.c +++ b/src/libsystemd-microhttpd/src/microhttpd-util.c @@ -4,7 +4,7 @@ Copyright 2012 Lennart Poettering Copyright 2012 Zbigniew Jędrzejewski-Szmek - systemd is free software; you can redistribute it anor modify it + 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. @@ -15,25 +15,25 @@ 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 . -** + along with systemd; If not, see . +***/ #include #include #include #ifdef HAVE_GNUTLS -#include -#include +#include +#include #endif -#include "systemd-basialloc-util.h" -#include "systemd-basilog.h" -#include "systemd-basimacro.h" -#include "systemd-basistring-util.h" -#include "systemd-basistrv.h" -#include "systemd-basiutil.h" -#include "systemd-microhttpmicrohttpd-util.h" +#include "systemd-basic/alloc-util.h" +#include "systemd-basic/log.h" +#include "systemd-basic/macro.h" +#include "systemd-basic/string-util.h" +#include "systemd-basic/strv.h" +#include "systemd-basic/util.h" +#include "systemd-microhttpd/microhttpd-util.h" void microhttpd_logger(void *arg, const char *fmt, va_list ap) { char *f; @@ -61,7 +61,7 @@ static int mhd_respond_internal(struct MHD_Connection *connection, return MHD_NO; log_debug("Queueing response %u: %s", code, buffer); - MHD_add_response_header(response, "Content-Type", "texplain"); + MHD_add_response_header(response, "Content-Type", "text/plain"); r = MHD_queue_response(connection, code, response); MHD_destroy_response(response); @@ -110,11 +110,11 @@ static struct { bool enabled; } gnutls_log_map[] = { { {"0"}, LOG_DEBUG }, - { {"1", "audit"}, LOG_WARNING, true},* gnutls session audit */ - { {"2", "assert"}, LOG_DEBUG }, * gnutls assert log */ - { {"3", "hsk", "ext"}, LOG_DEBUG }, * gnutls handshake log */ - { {"4", "rec"}, LOG_DEBUG }, * gnutls record log */ - { {"5", "dtls"}, LOG_DEBUG }, * gnutls DTLS log */ + { {"1", "audit"}, LOG_WARNING, true}, /* gnutls session audit */ + { {"2", "assert"}, LOG_DEBUG }, /* gnutls assert log */ + { {"3", "hsk", "ext"}, LOG_DEBUG }, /* gnutls handshake log */ + { {"4", "rec"}, LOG_DEBUG }, /* gnutls record log */ + { {"5", "dtls"}, LOG_DEBUG }, /* gnutls DTLS log */ { {"6", "buf"}, LOG_DEBUG }, { {"7", "write", "read"}, LOG_DEBUG }, { {"8"}, LOG_DEBUG }, @@ -126,7 +126,7 @@ static void log_func_gnutls(int level, const char *message) { if (0 <= level && level < (int) ELEMENTSOF(gnutls_log_map)) { if (gnutls_log_map[level].enabled) - log_internal(gnutls_log_map[level].level, 0, NULL, 0, NULL, "gnutls %%s: %s", level, gnutls_log_map[level].names[1], message); + log_internal(gnutls_log_map[level].level, 0, NULL, 0, NULL, "gnutls %d/%s: %s", level, gnutls_log_map[level].names[1], message); } else { log_debug("Received GNUTLS message with unknown level %d.", level); log_internal(LOG_DEBUG, 0, NULL, 0, NULL, "gnutls: %s", message); @@ -223,8 +223,8 @@ static int get_client_cert(gnutls_session_t session, gnutls_x509_crt_t *client_c return r; } - * Note that by passing values between 0 and listsize here, you - can get access to the CA's certs + /* Note that by passing values between 0 and listsize here, you + can get access to the CA's certs */ r = gnutls_x509_crt_import(cert, &pcert[0], GNUTLS_X509_FMT_DER); if (r < 0) { log_error("Failed to import client certificate"); diff --git a/src/systemd-remount-fs/remount-fs.c b/src/systemd-remount-fs/remount-fs.c index cae9248477..116c370ef7 100644 --- a/src/systemd-remount-fs/remount-fs.c +++ b/src/systemd-remount-fs/remount-fs.c @@ -3,7 +3,7 @@ Copyright 2010 Lennart Poettering - systemd is free software; you can redistribute it anor modify it + 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. @@ -14,31 +14,31 @@ 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 . -** + along with systemd; If not, see . +***/ #include #include #include -#include -#include -#include +#include +#include +#include #include -#include "systemd-basiexit-status.h" -#include "systemd-basilog.h" -#include "systemd-basimount-util.h" -#include "systemd-basipath-util.h" -#include "systemd-basiprocess-util.h" -#include "systemd-basisignal-util.h" -#include "systemd-basistrv.h" -#include "systemd-basiutil.h" +#include "basic/exit-status.h" +#include "basic/log.h" +#include "basic/mount-util.h" +#include "basic/path-util.h" +#include "basic/process-util.h" +#include "basic/signal-util.h" +#include "basic/strv.h" +#include "basic/util.h" #include "mount-setup.h" -/* Goes throughetc/fstab and remounts all API file systems, applying - * options that are inetc/fstab that systemd might not have - * respected +/* Goes through /etc/fstab and remounts all API file systems, applying + * options that are in /etc/fstab that systemd might not have + * respected */ int main(int argc, char *argv[]) { _cleanup_hashmap_free_free_ Hashmap *pids = NULL; @@ -57,14 +57,14 @@ int main(int argc, char *argv[]) { umask(0022); - f = setmntent(etc/fstab", "r"); + f = setmntent("/etc/fstab", "r"); if (!f) { if (errno == ENOENT) { r = 0; goto finish; } - r = log_error_errno(errno, "Failed to openetc/fstab: %m"); + r = log_error_errno(errno, "Failed to open /etc/fstab: %m"); goto finish; } @@ -79,10 +79,10 @@ int main(int argc, char *argv[]) { int k; char *s; - * Remount the root fs, /usr and all API VFS */ + /* Remount the root fs, /usr and all API VFS */ if (!mount_point_is_api(me->mnt_dir) && - !path_equal(me->mnt_dir, ") && - !path_equal(me->mnt_dir, usr")) + !path_equal(me->mnt_dir, "/") && + !path_equal(me->mnt_dir, "/usr")) continue; log_debug("Remounting %s", me->mnt_dir); @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) { } if (pid == 0) { - * Child */ + /* Child */ (void) reset_all_signal_handlers(); (void) reset_signal_mask(); @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) { _exit(EXIT_FAILURE); } - * Parent */ + /* Parent */ s = strdup(me->mnt_dir); if (!s) { diff --git a/src/systemd-remount-fs/systemd-remount-fs.service.in b/src/systemd-remount-fs/systemd-remount-fs.service.in index ffc81b2691..8d9daacaa5 100644 --- a/src/systemd-remount-fs/systemd-remount-fs.service.in +++ b/src/systemd-remount-fs/systemd-remount-fs.service.in @@ -1,6 +1,6 @@ # This file is part of systemd. # -# systemd is free software; you can redistribute it anor modify it +# 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. @@ -8,15 +8,15 @@ [Unit] Description=Remount Root and Kernel File Systems Documentation=man:systemd-remount-fs.service(8) -Documentation=http/www.freedesktop.org/wiki/Software/systemd/APIFileSystems +Documentation=http://www.freedesktop.org/wiki/Software/systemd/APIFileSystems DefaultDependencies=no Conflicts=shutdown.target After=systemd-fsck-root.service Before=local-fs-pre.target local-fs.target shutdown.target Wants=local-fs-pre.target -ConditionPathExistsetc/fstab +ConditionPathExists=/etc/fstab [Service] Type=oneshot RemainAfterExit=yes -ExecStart=@rootlibexecdirsystemd-remount-fs +ExecStart=@rootlibexecdir@/systemd-remount-fs diff --git a/src/systemd-remount-fs/systemd-remount-fs.service.xml b/src/systemd-remount-fs/systemd-remount-fs.service.xml index c2e9f0c721..176f2b2d20 100644 --- a/src/systemd-remount-fs/systemd-remount-fs.service.xml +++ b/src/systemd-remount-fs/systemd-remount-fs.service.xml @@ -1,12 +1,12 @@ - + - systemd-remount-fs.servicetitle> - <productname>systemdproductname> + <title>systemd-remount-fs.service + systemd - Developercontrib> - Lennartfirstname> - Poetteringsurname> - lennart@poettering.netemail> - author> - authorgroup> - refentryinfo> + Developer + Lennart + Poettering + lennart@poettering.net + + + - systemd-remount-fs.servicerefentrytitle> - 8manvolnum> - refmeta> + systemd-remount-fs.service + 8 + - systemd-remount-fs.servicerefname> - systemd-remount-fsrefname> - Remount root and kernel file systemsrefpurpose> - refnamediv> + systemd-remount-fs.service + systemd-remount-fs + Remount root and kernel file systems + - systemd-remount-fs.servicefilename> - - refsynopsisdiv> + systemd-remount-fs.service + /usr/lib/systemd/systemd-remount-fs + - Descriptiontitle> + <title>Description - systemd-remount-fs.servicefilename> is an + systemd-remount-fs.service is an early boot service that applies mount options listed in - fstabrefentrytitle>5 - to the root file system, the file system, + fstab5 + to the root file system, the /usr file system, and the kernel API file systems. This is required so that the mount options of these file systems — which are pre-mounted by the kernel, the initial RAM disk, container environments or system manager code — are updated to those listed in - . This service ignores normal file + /etc/fstab. This service ignores normal file systems and only changes the root file system (i.e. - ), /usr and the virtual - kernel API file systems such as , - or /dev. This - service executes no operation if + /), /usr and the virtual + kernel API file systems such as /proc, + /sys or /dev. This + service executes no operation if /etc/fstab does not exist or lists no entries for the mentioned file - systems.para> + systems. For a longer discussion of kernel API file systems see - API - File Systemsulink>. - refsect1> + API + File Systems. + - See Alsotitle> + <title>See Also - systemdrefentrytitle>1, - fstabrefentrytitle>5, - mountrefentrytitle>8 - para> - refsect1> + systemd1, + fstab5, + mount8 + + -refentry> + diff --git a/src/systemd-reply-password/Makefile b/src/systemd-reply-password/Makefile index affcbb8ec4..18514df027 100644 --- a/src/systemd-reply-password/Makefile +++ b/src/systemd-reply-password/Makefile @@ -8,7 +8,7 @@ # Copyright 2013 David Strauss # Copyright 2016 Luke Shumaker # -# systemd is free software; you can redistribute it anor modify it +# 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. @@ -19,15 +19,15 @@ # 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 $(dir $(lastword $(MAKEFILE_LIST))../../config.mk -include $(topsrcdirbuild-aux/Makefile.head.mk +# along with systemd; If not, see . +include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk rootlibexec_PROGRAMS += systemd-reply-password systemd_reply_password_SOURCES = \ - srreply-password/reply-password.c + src/reply-password/reply-password.c systemd_reply_password_LDADD = \ libsystemd-shared.la -include $(topsrcdirbuild-aux/Makefile.tail.mk +include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/systemd-reply-password/reply-password.c b/src/systemd-reply-password/reply-password.c index f2d95c58bb..7a5cea0e1e 100644 --- a/src/systemd-reply-password/reply-password.c +++ b/src/systemd-reply-password/reply-password.c @@ -3,7 +3,7 @@ Copyright 2010 Lennart Poettering - systemd is free software; you can redistribute it anor modify it + 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. @@ -14,21 +14,21 @@ 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 . -** + along with systemd; If not, see . +***/ #include #include #include -#include -#include - -#include "systemd-basifd-util.h" -#include "systemd-basilog.h" -#include "systemd-basimacro.h" -#include "systemd-basisocket-util.h" -#include "systemd-basistring-util.h" -#include "systemd-basiutil.h" +#include +#include + +#include "basic/fd-util.h" +#include "basic/log.h" +#include "basic/macro.h" +#include "basic/socket-util.h" +#include "basic/string-util.h" +#include "basic/util.h" static int send_on_socket(int fd, const char *socket_name, const void *packet, size_t size) { union sockaddr_union sa = { -- cgit v1.2.3-54-g00ecf