diff --git a/.config b/.config index 524da23..ced2cee 100644 --- a/.config +++ b/.config @@ -1929,7 +1929,7 @@ CONFIG_PACKAGE_kmod-gpio-button-hotplug=y # CONFIG_PACKAGE_kmod-pwm is not set # CONFIG_PACKAGE_kmod-pwm-gpio is not set # CONFIG_PACKAGE_kmod-regmap is not set -# CONFIG_PACKAGE_kmod-rfkill is not set +CONFIG_PACKAGE_kmod-rfkill=m # CONFIG_PACKAGE_kmod-rotary-gpio-custom is not set # CONFIG_PACKAGE_kmod-serial-8250 is not set # CONFIG_PACKAGE_kmod-softdog is not set @@ -1965,7 +1965,19 @@ CONFIG_PACKAGE_kmod-usb-acm=y # CONFIG_PACKAGE_kmod-usb-cm109 is not set CONFIG_PACKAGE_kmod-usb-core=y # CONFIG_PACKAGE_kmod-usb-hid is not set -# CONFIG_PACKAGE_kmod-usb-net is not set +CONFIG_PACKAGE_kmod-usb-net=y +CONFIG_PACKAGE_kmod-usb-net-asix=m +CONFIG_PACKAGE_kmod-usb-net-cdc-ether=m +CONFIG_PACKAGE_kmod-usb-net-cdc-ncm=m +CONFIG_PACKAGE_kmod-usb-net-dm9601-ether=m +CONFIG_PACKAGE_kmod-usb-net-hso=m +# CONFIG_PACKAGE_kmod-usb-net-ipheth is not set +# CONFIG_PACKAGE_kmod-usb-net-kaweth is not set +# CONFIG_PACKAGE_kmod-usb-net-mcs7830 is not set +# CONFIG_PACKAGE_kmod-usb-net-pegasus is not set +CONFIG_PACKAGE_kmod-usb-net-qmi-wwan=m +CONFIG_PACKAGE_kmod-usb-net-rndis=m +CONFIG_PACKAGE_kmod-usb-net-sierrawireless=m # CONFIG_PACKAGE_kmod-usb-ohci is not set # CONFIG_PACKAGE_kmod-usb-printer is not set CONFIG_PACKAGE_kmod-usb-serial=y @@ -1991,7 +2003,7 @@ CONFIG_PACKAGE_kmod-usb-serial-wwan=y CONFIG_PACKAGE_kmod-usb-storage=y # CONFIG_PACKAGE_kmod-usb-storage-extras is not set # CONFIG_PACKAGE_kmod-usb-uhci is not set -# CONFIG_PACKAGE_kmod-usb-wdm is not set +CONFIG_PACKAGE_kmod-usb-wdm=m # CONFIG_PACKAGE_kmod-usb-yealink is not set CONFIG_PACKAGE_kmod-usb2=y # CONFIG_PACKAGE_kmod-usb2-pci is not set @@ -2942,6 +2954,7 @@ CONFIG_PACKAGE_iw=y # CONFIG_PACKAGE_mgen is not set # CONFIG_PACKAGE_mii-tool is not set # CONFIG_PACKAGE_mini-snmpd is not set +CONFIG_PACKAGE_modemmanager=m # CONFIG_PACKAGE_mosquitto is not set # CONFIG_PACKAGE_mosquitto-client is not set # CONFIG_PACKAGE_mosquitto-client-nossl is not set @@ -3198,7 +3211,7 @@ CONFIG_PACKAGE_libblkid=y CONFIG_PACKAGE_libblobmsg-json=y # CONFIG_PACKAGE_libboblight is not set # CONFIG_PACKAGE_libbz2 is not set -# CONFIG_PACKAGE_libcap is not set +CONFIG_PACKAGE_libcap=m # CONFIG_PACKAGE_libcares is not set # CONFIG_PACKAGE_libcelt is not set # CONFIG_PACKAGE_libcharset is not set @@ -3348,6 +3361,7 @@ CONFIG_PCAP_HAS_USB=y CONFIG_PACKAGE_libpopt=m # CONFIG_PACKAGE_libprotobuf-c is not set # CONFIG_PACKAGE_libptmalloc3 is not set +CONFIG_PACKAGE_libqmi=m # CONFIG_PACKAGE_libradiusclient-ng is not set # CONFIG_PACKAGE_libre is not set CONFIG_PACKAGE_libreadline=y @@ -3945,6 +3959,20 @@ CONFIG_PACKAGE_shadow-su=m # CONFIG_PACKAGE_strace is not set # CONFIG_PACKAGE_stress is not set # CONFIG_PACKAGE_sysstat is not set +CONFIG_PACKAGE_systemd-udev=m + +# +# Configuration +# +# CONFIG_SYSTEMD_UDEV_DISABLE_GUDEV is not set +# CONFIG_SYSTEMD_UDEV_EXTRA_ata_id is not set +CONFIG_SYSTEMD_UDEV_EXTRA_cdrom_id=y +# CONFIG_SYSTEMD_UDEV_EXTRA_collect is not set +CONFIG_SYSTEMD_UDEV_EXTRA_scsi_id=y +# CONFIG_SYSTEMD_UDEV_EXTRA_v4l_id is not set +# CONFIG_SYSTEMD_UDEV_EXTRA_accelerometer is not set +CONFIG_SYSTEMD_UDEV_EXTRA_mtd_probe=y +# CONFIG_SYSTEMD_UDEV_EXTRA_qemu is not set # CONFIG_PACKAGE_tar is not set # CONFIG_PACKAGE_taskwarrior is not set # CONFIG_PACKAGE_tcpser is not set diff --git a/package/systemd-udev/Config.in b/package/systemd-udev/Config.in new file mode 100644 index 0000000..dcc2908 --- /dev/null +++ b/package/systemd-udev/Config.in @@ -0,0 +1,64 @@ +# systemd-udev package config + +menu "Configuration" + depends on PACKAGE_systemd-udev + +config SYSTEMD_UDEV_DISABLE_GUDEV + bool "Disable libgudev" + default n + help + Disable compilation of libgudev + +config SYSTEMD_UDEV_EXTRA_ata_id + bool "Install udev ata_id callout" + default y + help + ata_id - udev callout to read product/serial number + from ATA drives + +config SYSTEMD_UDEV_EXTRA_cdrom_id + bool "Install udev cdrom_id callout" + default y + help + cdrom_id - udev callout to determine the capabilities + of optical drives and media + +config SYSTEMD_UDEV_EXTRA_collect + bool "Install udev collect" + default n + help + Adds ID to the list governed by + +config SYSTEMD_UDEV_EXTRA_scsi_id + bool "Install udev scsi_id callout" + default y + help + scsi_id - retrieve and generate a unique SCSI identifier + +config SYSTEMD_UDEV_EXTRA_v4l_id + bool "Install udev v4l_id callout" + default y + help + v4l_id - udev callout to identify Video4Linux devices + +config SYSTEMD_UDEV_EXTRA_accelerometer + bool "Install udev accelerometer callout" + default y + help + accelerometer - udev callout to export device orientation + through property + +config SYSTEMD_UDEV_EXTRA_mtd_probe + bool "Install mtd_probe callout" + default y + help + mtd_probe - udev callout to probe mtd devices + +config SYSTEMD_UDEV_EXTRA_qemu + bool "Install qemu specific rules" + default y + help + Install rules for autosuspension of QEMU emulated + USB HID devices + +endmenu diff --git a/package/systemd-udev/Makefile b/package/systemd-udev/Makefile new file mode 100644 index 0000000..104379a --- /dev/null +++ b/package/systemd-udev/Makefile @@ -0,0 +1,191 @@ +# +# Copyright (C) 2006-2103 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# Since udev 182, the sources are integrated within the systemd tree. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=systemd +PKG_VERSION:=197 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=http://www.freedesktop.org/software/systemd/ +PKG_MD5SUM:=56a860dceadfafe59f40141eb5223743 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +PKG_INSTALL=1 + +define Package/systemd-udev + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Dynamic device management subsystem + URL:=http://www.freedesktop.org/wiki/Software/systemd/ + MENU:=1 + DEPENDS:=+librt +dbus +libcap +glib2 +endef + +define Package/systemd-udev/description + udev allows Linux users to have a dynamic /dev directory and it + provides the ability to have persistent device names. +endef + +define Package/systemd-udev/conffiles +/etc/udev/udev.conf +endef + +define Package/systemd-udev/config + source "$(SOURCE)/Config.in" +endef + +# gudev args +systemd-udev-args-$(CONFIG_SYSTEMD_UDEV_DISABLE_GUDEV) += --disable-gudev + + +CONFIGURE_ARGS += \ + --prefix=/usr \ + --sysconfdir=/etc \ + --without-python \ + --disable-gtk-doc-html \ + --disable-introspection \ + --disable-kmod \ + --disable-blkid \ + --disable-ima \ + --disable-chkconfig \ + --disable-selinux \ + --disable-xz \ + --disable-tcpwrap \ + --disable-pam \ + --disable-acl \ + --disable-xattr \ + --disable-gcrypt \ + --disable-audit \ + --disable-libcryptsetup \ + --disable-qrencode \ + --disable-microhttpd \ + --disable-binfmt \ + --disable-vconsole \ + --disable-readahead \ + --disable-bootchart \ + --disable-quotacheck \ + --disable-randomseed \ + --disable-logind \ + --disable-hostnamed \ + --disable-timedated \ + --disable-localed \ + --disable-coredump \ + --disable-myhostname \ + --disable-keymap \ + --disable-manpages \ + $(systemd-udev-args-y) + +# ata_id callout +systemd-udev-extra-lib-bin-$(CONFIG_SYSTEMD_UDEV_EXTRA_ata_id) += ata_id + +# cdrom_id callout +systemd-udev-extra-lib-bin-$(CONFIG_SYSTEMD_UDEV_EXTRA_cdrom_id) += cdrom_id +systemd-udev-extra-rules-$(CONFIG_SYSTEMD_UDEV_EXTRA_cdrom_id) += 60-cdrom_id.rules + +# collect callout +systemd-udev-extra-lib-bin-$(CONFIG_SYSTEMD_UDEV_EXTRA_collect) += collect + +# scsi_id callout +systemd-udev-extra-lib-bin-$(CONFIG_SYSTEMD_UDEV_EXTRA_scsi_id) += scsi_id + +# v4l_id callout +systemd-udev-extra-lib-bin-$(CONFIG_SYSTEMD_UDEV_EXTRA_v4l_id) += v4l_id +systemd-udev-extra-rules-$(CONFIG_SYSTEMD_UDEV_EXTRA_v4l_id) += 60-persistent-v4l.rules + +# accelerometer callout +systemd-udev-extra-lib-bin-$(CONFIG_SYSTEMD_UDEV_EXTRA_accelerometer) += accelerometer +systemd-udev-extra-rules-$(CONFIG_SYSTEMD_UDEV_EXTRA_accelerometer) += 61-accelerometer.rules + +# mtd_probe callout +systemd-udev-extra-lib-bin-$(CONFIG_SYSTEMD_UDEV_EXTRA_mtd_probe) += mtd_probe +systemd-udev-extra-rules-$(CONFIG_SYSTEMD_UDEV_EXTRA_mtd_probe) += 75-probe_mtd.rules + +# qemu rules +systemd-udev-extra-rules-$(CONFIG_SYSTEMD_UDEV_EXTRA_qemu) += 42-usb-hid-pm.rules + +# TODO: keymap + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libudev.h $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/share/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/udev.pc $(1)/usr/share/pkgconfig + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libudev.so* $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsystemd-daemon.so* $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libudev.pc $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsystemd-daemon.pc $(1)/usr/lib/pkgconfig +ifneq ($(CONFIG_SYSTEMD_UDEV_DISABLE_GUDEV),y) + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgudev-1.0.so* $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/include/gudev-1.0/gudev + $(CP) $(PKG_INSTALL_DIR)/usr/include/gudev-1.0/gudev/gudev.h $(1)/usr/include/gudev-1.0/gudev/gudev.h + $(CP) $(PKG_INSTALL_DIR)/usr/include/gudev-1.0/gudev/gudevclient.h $(1)/usr/include/gudev-1.0/gudev/gudevclient.h + $(CP) $(PKG_INSTALL_DIR)/usr/include/gudev-1.0/gudev/gudevdevice.h $(1)/usr/include/gudev-1.0/gudev/gudevdevice.h + $(CP) $(PKG_INSTALL_DIR)/usr/include/gudev-1.0/gudev/gudevenumerator.h $(1)/usr/include/gudev-1.0/gudev/gudevenumerator.h + $(CP) $(PKG_INSTALL_DIR)/usr/include/gudev-1.0/gudev/gudevenums.h $(1)/usr/include/gudev-1.0/gudev/gudevenums.h + $(CP) $(PKG_INSTALL_DIR)/usr/include/gudev-1.0/gudev/gudevenumtypes.h $(1)/usr/include/gudev-1.0/gudev/gudevenumtypes.h + $(CP) $(PKG_INSTALL_DIR)/usr/include/gudev-1.0/gudev/gudevtypes.h $(1)/usr/include/gudev-1.0/gudev/gudevtypes.h + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/gudev-1.0.pc $(1)/usr/lib/pkgconfig + # for really complicated reasons we need this + sed -i -e 's%libdir=/usr%libdir=$$$${exec_prefix}%g' $(1)/usr/lib/pkgconfig/gudev-1.0.pc + sed -i -e 's%includedir=/usr%includedir=$$$${prefix}%g' $(1)/usr/lib/pkgconfig/gudev-1.0.pc +endif +endef + +define Package/systemd-udev/install + $(INSTALL_DIR) $(1)/etc/udev/rules.d + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/udev/udev.conf $(1)/etc/udev + + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/udevadm $(1)/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/systemd/systemd-udevd $(1)/sbin/udevd + + $(INSTALL_DIR) $(1)/lib/udev/rules.d + $(INSTALL_DATA) \ + $(addprefix $(PKG_INSTALL_DIR)/usr/lib/udev/rules.d/, \ + $(systemd-udev-extra-rules-y)) \ + $(addprefix $(PKG_INSTALL_DIR)/usr/lib/udev/rules.d/, \ + 50-udev-default.rules \ + 60-persistent-alsa.rules \ + 60-persistent-input.rules \ + 60-persistent-serial.rules \ + 60-persistent-storage.rules \ + 60-persistent-storage-tape.rules \ + 64-btrfs.rules \ + 75-net-description.rules \ + 75-tty-description.rules \ + 78-sound-card.rules \ + 80-net-name-slot.rules \ + 95-udev-late.rules \ + 99-systemd.rules) \ + $(1)/lib/udev/rules.d + + $(INSTALL_DIR) $(1)/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libudev.so* $(1)/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsystemd-daemon.so* $(1)/lib +ifneq ($(CONFIG_SYSTEMD_UDEV_DISABLE_GUDEV),y) + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgudev-1.0.so* $(1)/lib +endif + + $(INSTALL_DIR) $(1)/lib/udev +ifneq ($(systemd-udev-extra-lib-bin-y),) + $(INSTALL_BIN) \ + $(addprefix $(PKG_INSTALL_DIR)/usr/lib/udev/, \ + $(systemd-udev-extra-lib-bin-y)) \ + $(1)/lib/udev/ +endif +endef + +$(eval $(call BuildPackage,systemd-udev)) diff --git a/package/systemd-udev/patches/0001-missing-define-MS_REC-and-MS_SHARED-if-not-defined-a.patch b/package/systemd-udev/patches/0001-missing-define-MS_REC-and-MS_SHARED-if-not-defined-a.patch new file mode 100644 index 0000000..e519c77 --- /dev/null +++ b/package/systemd-udev/patches/0001-missing-define-MS_REC-and-MS_SHARED-if-not-defined-a.patch @@ -0,0 +1,32 @@ +From 1125071483e501023ce60f79f27601fba3098cad Mon Sep 17 00:00:00 2001 +From: Aleksander Morgado +Date: Tue, 12 Feb 2013 13:07:23 +0100 +Subject: [PATCH 1/8] missing: define MS_REC and MS_SHARED if not defined + already + +--- + src/shared/missing.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/shared/missing.h b/src/shared/missing.h +index c53579f..d4ba0d3 100644 +--- a/src/shared/missing.h ++++ b/src/shared/missing.h +@@ -196,6 +196,14 @@ static inline pid_t gettid(void) { + #define MS_STRICTATIME (1<<24) + #endif + ++#ifndef MS_REC ++#define MS_REC 16384 ++#endif ++ ++#ifndef MS_SHARED ++#define MS_SHARED (1<<20) ++#endif ++ + #ifndef PR_SET_NO_NEW_PRIVS + #define PR_SET_NO_NEW_PRIVS 38 + #endif +-- +1.8.1.2 + diff --git a/package/systemd-udev/patches/0002-uclibc-use-plain-getenv-instead.patch b/package/systemd-udev/patches/0002-uclibc-use-plain-getenv-instead.patch new file mode 100644 index 0000000..2615afe --- /dev/null +++ b/package/systemd-udev/patches/0002-uclibc-use-plain-getenv-instead.patch @@ -0,0 +1,27 @@ +From a2fbd49c5d0b73e2f6c1a0482fc7c3d40b23829e Mon Sep 17 00:00:00 2001 +From: Aleksander Morgado +Date: Mon, 11 Feb 2013 14:47:49 +0100 +Subject: [PATCH 2/8] uclibc: use plain getenv() instead + +uclibc doesn't implement secure_getenv(), fallback to getenv() instead just to +get this compiled. +--- + src/shared/missing.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/shared/missing.h b/src/shared/missing.h +index d4ba0d3..865f16b 100644 +--- a/src/shared/missing.h ++++ b/src/shared/missing.h +@@ -254,7 +254,7 @@ static inline int name_to_handle_at(int fd, const char *name, struct file_handle + # ifdef HAVE___SECURE_GETENV + # define secure_getenv __secure_getenv + # else +-# error neither secure_getenv nor __secure_getenv are available ++# define secure_getenv getenv + # endif + #endif + +-- +1.8.1.2 + diff --git a/package/systemd-udev/patches/0003-uclibc-use-execvp-instead-of-execvpe.patch b/package/systemd-udev/patches/0003-uclibc-use-execvp-instead-of-execvpe.patch new file mode 100644 index 0000000..f5c7ed1 --- /dev/null +++ b/package/systemd-udev/patches/0003-uclibc-use-execvp-instead-of-execvpe.patch @@ -0,0 +1,55 @@ +From e2d2de2ac6a60d2a1bac09dcdb09021961172e93 Mon Sep 17 00:00:00 2001 +From: Aleksander Morgado +Date: Tue, 12 Feb 2013 15:04:12 +0100 +Subject: [PATCH 3/8] uclibc: use execvp instead of execvpe + +--- + configure.ac | 1 + + src/nspawn/nspawn.c | 11 +++++++++-- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 56694ff..4a481a7 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -193,6 +193,7 @@ CAP_LIBS="$LIBS" + LIBS="$save_LIBS" + AC_SUBST(CAP_LIBS) + ++AC_CHECK_FUNCS([execvpe]) + AC_CHECK_FUNCS([fanotify_init fanotify_mark]) + AC_CHECK_FUNCS([__secure_getenv secure_getenv]) + AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include +diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c +index 4c87371..68f7436 100644 +--- a/src/nspawn/nspawn.c ++++ b/src/nspawn/nspawn.c +@@ -58,6 +58,8 @@ + #include "fdset.h" + #include "build.h" + ++#include "config.h" ++ + typedef enum LinkJournal { + LINK_NO, + LINK_AUTO, +@@ -1468,9 +1470,14 @@ int main(int argc, char *argv[]) { + + a[0] = (char*) "/sbin/init"; + execve(a[0], a, (char**) envp); +- } else if (argc > optind) ++ } else if (argc > optind) { ++#ifdef HAVE_EXECVPE + execvpe(argv[optind], argv + optind, (char**) envp); +- else { ++#else ++ environ = (char **)envp; ++ execvp(argv[optind], argv + optind); ++#endif /* HAVE_EXECVPE */ ++ }else { + chdir(home ? home : "/root"); + execle("/bin/bash", "-bash", NULL, (char**) envp); + } +-- +1.8.1.2 + diff --git a/package/systemd-udev/patches/0004-uclibc-use-mkstemp-instead-of-mkostemp.patch b/package/systemd-udev/patches/0004-uclibc-use-mkstemp-instead-of-mkostemp.patch new file mode 100644 index 0000000..e3d5b02 --- /dev/null +++ b/package/systemd-udev/patches/0004-uclibc-use-mkstemp-instead-of-mkostemp.patch @@ -0,0 +1,258 @@ +From b4f13b8f304175b8999fef41685bba73c24d3e4f Mon Sep 17 00:00:00 2001 +From: Aleksander Morgado +Date: Tue, 12 Feb 2013 15:16:16 +0100 +Subject: [PATCH 4/8] uclibc: use mkstemp instead of mkostemp + +--- + configure.ac | 2 +- + src/core/manager.c | 10 ++++++++++ + src/journal/coredumpctl.c | 6 ++++++ + src/journal/journal-send.c | 9 +++++++++ + src/journal/journal-verify.c | 23 +++++++++++++++++++++++ + src/journal/journalctl.c | 10 ++++++++++ + src/shared/ask-password-api.c | 10 ++++++++++ + src/shared/util.c | 9 +++++++++ + 8 files changed, 78 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 4a481a7..f02cfdc 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -193,7 +193,7 @@ CAP_LIBS="$LIBS" + LIBS="$save_LIBS" + AC_SUBST(CAP_LIBS) + +-AC_CHECK_FUNCS([execvpe]) ++AC_CHECK_FUNCS([execvpe mkostemp]) + AC_CHECK_FUNCS([fanotify_init fanotify_mark]) + AC_CHECK_FUNCS([__secure_getenv secure_getenv]) + AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include +diff --git a/src/core/manager.c b/src/core/manager.c +index 4bebb29..84a379b 100644 +--- a/src/core/manager.c ++++ b/src/core/manager.c +@@ -73,6 +73,8 @@ + #include "efivars.h" + #include "env-util.h" + ++#include "config.h" ++ + /* As soon as 16 units are in our GC queue, make sure to run a gc sweep */ + #define GC_QUEUE_ENTRIES_MAX 16 + +@@ -1830,7 +1832,15 @@ int manager_open_serialization(Manager *m, FILE **_f) { + return -ENOMEM; + + saved_umask = umask(0077); ++ ++#ifdef HAVE_MKOSTEMP + fd = mkostemp(path, O_RDWR|O_CLOEXEC); ++#else ++ fd = mkstemp(path); ++ if (fd >= 0) ++ fcntl(fd, F_SETFD, FD_CLOEXEC); ++#endif /* HAVE_MKOSTEMP */ ++ + umask(saved_umask); + + if (fd < 0) { +diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c +index b6e5581..74e1489 100644 +--- a/src/journal/coredumpctl.c ++++ b/src/journal/coredumpctl.c +@@ -35,6 +35,8 @@ + #include "path-util.h" + #include "pager.h" + ++#include "config.h" ++ + static enum { + ACTION_NONE, + ACTION_LIST, +@@ -472,7 +474,11 @@ static int run_gdb(sd_journal *j) { + data = (const uint8_t*) data + 9; + len -= 9; + ++#ifdef HAVE_MKOSTEMP + fd = mkostemp(path, O_WRONLY); ++#else ++ fd = mkstemp(path); ++#endif + if (fd < 0) { + log_error("Failed to create temporary file: %m"); + return -errno; +diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c +index d5ec73e..32f9eba9 100644 +--- a/src/journal/journal-send.c ++++ b/src/journal/journal-send.c +@@ -33,6 +33,8 @@ + #include "util.h" + #include "socket-util.h" + ++#include "config.h" ++ + #define SNDBUF_SIZE (8*1024*1024) + + #define ALLOCA_CODE_FUNC(f, func) \ +@@ -330,7 +332,14 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) { + * file and just pass a file descriptor of it to the other + * side */ + ++#ifdef HAVE_MKOSTEMP + buffer_fd = mkostemp(path, O_CLOEXEC|O_RDWR); ++#else ++ buffer_fd = mkstemp(path); ++ if (buffer_fd >= 0) ++ fcntl(buffer_fd, F_SETFD, FD_CLOEXEC); ++#endif /* HAVE_MKOSTEMP */ ++ + if (buffer_fd < 0) { + r = -errno; + goto finish; +diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c +index ed28b45..f9e1dba 100644 +--- a/src/journal/journal-verify.c ++++ b/src/journal/journal-verify.c +@@ -34,6 +34,8 @@ + #include "compress.h" + #include "fsprg.h" + ++#include "config.h" ++ + static int journal_file_object_verify(JournalFile *f, Object *o) { + uint64_t i; + +@@ -701,7 +703,14 @@ int journal_file_verify( + } else if (f->seal) + return -ENOKEY; + ++#ifdef HAVE_MKOSTEMP + data_fd = mkostemp(data_path, O_CLOEXEC); ++#else ++ data_fd = mkstemp(data_path); ++ if (data_fd >= 0) ++ fcntl(data_fd, F_SETFD, FD_CLOEXEC); ++#endif /* HAVE_MKOSTEMP */ ++ + if (data_fd < 0) { + log_error("Failed to create data file: %m"); + r = -errno; +@@ -709,7 +718,14 @@ int journal_file_verify( + } + unlink(data_path); + ++#ifdef HAVE_MKOSTEMP + entry_fd = mkostemp(entry_path, O_CLOEXEC); ++#else ++ entry_fd = mkstemp(entry_path); ++ if (entry_fd >= 0) ++ fcntl(entry_fd, F_SETFD, FD_CLOEXEC); ++#endif /* HAVE_MKOSTEMP */ ++ + if (entry_fd < 0) { + log_error("Failed to create entry file: %m"); + r = -errno; +@@ -717,7 +733,14 @@ int journal_file_verify( + } + unlink(entry_path); + ++#ifdef HAVE_MKOSTEMP + entry_array_fd = mkostemp(entry_array_path, O_CLOEXEC); ++#else ++ entry_array_fd = mkstemp(entry_array_path); ++ if (entry_array_fd >= 0) ++ fcntl(entry_array_fd, F_SETFD, FD_CLOEXEC); ++#endif /* HAVE_MKOSTEMP */ ++ + if (entry_array_fd < 0) { + log_error("Failed to create entry array file: %m"); + r = -errno; +diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c +index 0afeef9..a00010c 100644 +--- a/src/journal/journalctl.c ++++ b/src/journal/journalctl.c +@@ -53,6 +53,8 @@ + #include "unit-name.h" + #include "catalog.h" + ++#include "config.h" ++ + #define DEFAULT_FSS_INTERVAL_USEC (15*USEC_PER_MINUTE) + + static OutputMode arg_output = OUTPUT_SHORT; +@@ -679,7 +681,15 @@ static int setup_keys(void) { + n /= arg_interval; + + close_nointr_nofail(fd); ++ ++#ifdef HAVE_MKOSTEMP + fd = mkostemp(k, O_WRONLY|O_CLOEXEC|O_NOCTTY); ++#else ++ fd = mkstemp(k); ++ if (fd >= 0) ++ fcntl(fd, F_SETFD, FD_CLOEXEC); ++#endif /* HAVE_MKOSTEMP */ ++ + if (fd < 0) { + log_error("Failed to open %s: %m", k); + r = -errno; +diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c +index 8a0fb89..e5e9afd 100644 +--- a/src/shared/ask-password-api.c ++++ b/src/shared/ask-password-api.c +@@ -37,6 +37,8 @@ + + #include "ask-password-api.h" + ++#include "config.h" ++ + static void backspace_chars(int ttyfd, size_t p) { + + if (ttyfd < 0) +@@ -326,7 +328,15 @@ int ask_password_agent( + mkdir_p_label("/run/systemd/ask-password", 0755); + + u = umask(0022); ++ ++#ifdef HAVE_MKOSTEMP + fd = mkostemp(temp, O_CLOEXEC|O_CREAT|O_WRONLY); ++#else ++ fd = mkstemp(temp); ++ if (fd >= 0) ++ fcntl(fd, F_SETFD, FD_CLOEXEC); ++#endif /* HAVE_MKOSTEMP */ ++ + umask(u); + + if (fd < 0) { +diff --git a/src/shared/util.c b/src/shared/util.c +index 24f9e7e..35cee2a 100644 +--- a/src/shared/util.c ++++ b/src/shared/util.c +@@ -72,6 +72,8 @@ + #include "hashmap.h" + #include "env-util.h" + ++#include "config.h" ++ + int saved_argc = 0; + char **saved_argv = NULL; + +@@ -4144,7 +4146,14 @@ int fopen_temporary(const char *path, FILE **_f, char **_temp_path) { + t[k] = '.'; + stpcpy(stpcpy(t+k+1, fn), "XXXXXX"); + ++#ifdef HAVE_MKOSTEMP + fd = mkostemp(t, O_WRONLY|O_CLOEXEC); ++#else ++ fd = mkstemp(t); ++ if (fd >= 0) ++ fcntl(fd, F_SETFD, FD_CLOEXEC); ++#endif /* HAVE_MKOSTEMP */ ++ + if (fd < 0) { + free(t); + return -errno; +-- +1.8.1.2 + diff --git a/package/systemd-udev/patches/0005-uclibc-skip-using-unavailable-posix_fallocate.patch b/package/systemd-udev/patches/0005-uclibc-skip-using-unavailable-posix_fallocate.patch new file mode 100644 index 0000000..66f56a8 --- /dev/null +++ b/package/systemd-udev/patches/0005-uclibc-skip-using-unavailable-posix_fallocate.patch @@ -0,0 +1,109 @@ +From b9f0b9ba87c58a38b8c4116a5cffc5b1cfa4ff34 Mon Sep 17 00:00:00 2001 +From: Aleksander Morgado +Date: Tue, 12 Feb 2013 15:25:42 +0100 +Subject: [PATCH 5/8] uclibc: skip using unavailable posix_fallocate() + +--- + configure.ac | 2 +- + src/journal/journal-file.c | 19 ++++++++++++++++++- + src/journal/journald-kmsg.c | 16 ++++++++++++++-- + 3 files changed, 33 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index f02cfdc..dbb2680 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -193,7 +193,7 @@ CAP_LIBS="$LIBS" + LIBS="$save_LIBS" + AC_SUBST(CAP_LIBS) + +-AC_CHECK_FUNCS([execvpe mkostemp]) ++AC_CHECK_FUNCS([execvpe mkostemp posix_fallocate]) + AC_CHECK_FUNCS([fanotify_init fanotify_mark]) + AC_CHECK_FUNCS([__secure_getenv secure_getenv]) + AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include +diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c +index 13fc8ed..df4333b 100644 +--- a/src/journal/journal-file.c ++++ b/src/journal/journal-file.c +@@ -38,6 +38,8 @@ + #include "compress.h" + #include "fsprg.h" + ++#include "config.h" ++ + #define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem)) + #define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem)) + +@@ -276,7 +278,7 @@ static int journal_file_verify_header(JournalFile *f) { + + static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) { + uint64_t old_size, new_size; +- int r; ++ int r = 0; + + assert(f); + +@@ -321,10 +323,25 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) + /* Note that the glibc fallocate() fallback is very + inefficient, hence we try to minimize the allocation area + as we can. */ ++#ifdef HAVE_POSIX_ALLOCATE + r = posix_fallocate(f->fd, old_size, new_size - old_size); + if (r != 0) + return -r; + ++#else ++ /* Use good old method to write zeros into the journal file ++ perhaps very inefficient yet working. */ ++ if(new_size > old_size) { ++ char *buf = alloca(new_size - old_size); ++ off_t oldpos = lseek(f->fd, 0, SEEK_CUR); ++ bzero(buf, new_size - old_size); ++ lseek(f->fd, old_size, SEEK_SET); ++ r = write(f->fd, buf, new_size - old_size); ++ lseek(f->fd, oldpos, SEEK_SET); ++ } ++ if (r < 0) ++ return -errno; ++#endif /* HAVE_POSIX_FALLOCATE */ + if (fstat(f->fd, &f->last_stat) < 0) + return -errno; + +diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c +index b819876..0d18bba 100644 +--- a/src/journal/journald-kmsg.c ++++ b/src/journal/journald-kmsg.c +@@ -404,6 +404,7 @@ int server_open_dev_kmsg(Server *s) { + + int server_open_kernel_seqnum(Server *s) { + int fd; ++ int r = 0; + uint64_t *p; + + assert(s); +@@ -417,8 +418,19 @@ int server_open_kernel_seqnum(Server *s) { + log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m"); + return 0; + } +- +- if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) { ++#ifdef HAVE_POSIX_ALLOCATE ++ r = posix_fallocate(fd, 0, sizeof(uint64_t)); ++#else ++ /* Use good old method to write zeros into the journal file ++ perhaps very inefficient yet working. */ ++ char *buf = alloca(sizeof(uint64_t)); ++ off_t oldpos = lseek(fd, 0, SEEK_CUR); ++ bzero(buf, sizeof(uint64_t)); ++ lseek(fd, 0, SEEK_SET); ++ r = write(fd, buf, sizeof(uint64_t)); ++ lseek(fd, oldpos, SEEK_SET); ++#endif /* HAVE_POSIX_FALLOCATE */ ++ if (r < 0) { + log_error("Failed to allocate sequential number file, ignoring: %m"); + close_nointr_nofail(fd); + return 0; +-- +1.8.1.2 + diff --git a/package/systemd-udev/patches/0006-uclibc-use-dup2-instead-of-dup3.patch b/package/systemd-udev/patches/0006-uclibc-use-dup2-instead-of-dup3.patch new file mode 100644 index 0000000..92062c7 --- /dev/null +++ b/package/systemd-udev/patches/0006-uclibc-use-dup2-instead-of-dup3.patch @@ -0,0 +1,86 @@ +From 868897a6c4af2b8b27805ae097890630bfb202c4 Mon Sep 17 00:00:00 2001 +From: Aleksander Morgado +Date: Tue, 12 Feb 2013 15:35:01 +0100 +Subject: [PATCH 6/8] uclibc: use dup2() instead of dup3() + +--- + configure.ac | 2 +- + src/journal/cat.c | 11 +++++++++++ + src/shared/util.c | 6 ++++++ + 3 files changed, 18 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index dbb2680..98d9413 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -193,7 +193,7 @@ CAP_LIBS="$LIBS" + LIBS="$save_LIBS" + AC_SUBST(CAP_LIBS) + +-AC_CHECK_FUNCS([execvpe mkostemp posix_fallocate]) ++AC_CHECK_FUNCS([execvpe mkostemp posix_fallocate dup3]) + AC_CHECK_FUNCS([fanotify_init fanotify_mark]) + AC_CHECK_FUNCS([__secure_getenv secure_getenv]) + AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include +diff --git a/src/journal/cat.c b/src/journal/cat.c +index a95392c..f631f2b 100644 +--- a/src/journal/cat.c ++++ b/src/journal/cat.c +@@ -32,6 +32,8 @@ + #include "util.h" + #include "build.h" + ++#include "config.h" ++ + static char *arg_identifier = NULL; + static int arg_priority = LOG_INFO; + static bool arg_level_prefix = true; +@@ -143,8 +145,13 @@ int main(int argc, char *argv[]) { + + saved_stderr = fcntl(STDERR_FILENO, F_DUPFD_CLOEXEC, 3); + ++#if HAVE_DUP3 + if (dup3(fd, STDOUT_FILENO, 0) < 0 || + dup3(fd, STDERR_FILENO, 0) < 0) { ++#else ++ if (dup2(fd, STDOUT_FILENO) < 0 || ++ dup2(fd, STDERR_FILENO) < 0) { ++#endif /* HAVE_DUP3 */ + log_error("Failed to duplicate fd: %m"); + r = -errno; + goto finish; +@@ -164,7 +171,11 @@ int main(int argc, char *argv[]) { + + /* Let's try to restore a working stderr, so we can print the error message */ + if (saved_stderr >= 0) ++#if HAVE_DUP3 + dup3(saved_stderr, STDERR_FILENO, 0); ++#else ++ dup2(saved_stderr, STDERR_FILENO); ++#endif /* HAVE_DUP3 */ + + log_error("Failed to execute process: %s", strerror(-r)); + +diff --git a/src/shared/util.c b/src/shared/util.c +index 35cee2a..659f650 100644 +--- a/src/shared/util.c ++++ b/src/shared/util.c +@@ -2600,9 +2600,15 @@ int make_stdio(int fd) { + + assert(fd >= 0); + ++#if HAVE_DUP3 + r = dup3(fd, STDIN_FILENO, 0); + s = dup3(fd, STDOUT_FILENO, 0); + t = dup3(fd, STDERR_FILENO, 0); ++#else ++ r = dup2(fd, STDIN_FILENO); ++ s = dup2(fd, STDOUT_FILENO); ++ t = dup2(fd, STDERR_FILENO); ++#endif /* HAVE_DUP3 */ + + if (fd >= 3) + close_nointr_nofail(fd); +-- +1.8.1.2 + diff --git a/package/systemd-udev/patches/0007-test-udev-include-missing.h.patch b/package/systemd-udev/patches/0007-test-udev-include-missing.h.patch new file mode 100644 index 0000000..43a5e67 --- /dev/null +++ b/package/systemd-udev/patches/0007-test-udev-include-missing.h.patch @@ -0,0 +1,26 @@ +From c3b23153355fd3dbcf0a6be300b295c62423377b Mon Sep 17 00:00:00 2001 +From: Aleksander Morgado +Date: Tue, 12 Feb 2013 15:38:48 +0100 +Subject: [PATCH 7/8] test-udev: include missing.h + +We need MS_REC and MS_SHARED defined for a proper compilation, so get them from +'missing.h' if not defined already. +--- + src/test/test-udev.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/test/test-udev.c b/src/test/test-udev.c +index 7cb93ed..aee87f7 100644 +--- a/src/test/test-udev.c ++++ b/src/test/test-udev.c +@@ -32,6 +32,7 @@ + #include + #include + ++#include "missing.h" + #include "udev.h" + + void udev_main_log(struct udev *udev, int priority, +-- +1.8.1.2 + diff --git a/package/systemd-udev/patches/0008-uclibc-don-t-require-SSP.patch b/package/systemd-udev/patches/0008-uclibc-don-t-require-SSP.patch new file mode 100644 index 0000000..755a67c --- /dev/null +++ b/package/systemd-udev/patches/0008-uclibc-don-t-require-SSP.patch @@ -0,0 +1,27 @@ +From 156bc19bb657fe0e2fdbe6f2bd1f63450e695635 Mon Sep 17 00:00:00 2001 +From: Aleksander Morgado +Date: Wed, 13 Feb 2013 17:20:38 +0100 +Subject: [PATCH 8/8] uclibc: don't require SSP + +--- + configure.ac | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 98d9413..35646ec 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -130,9 +130,7 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ + -fno-strict-aliasing \ + -fvisibility=hidden \ + -ffunction-sections \ +- -fdata-sections \ +- -fstack-protector \ +- --param=ssp-buffer-size=4]) ++ -fdata-sections]) + AC_SUBST([OUR_CFLAGS], $with_cflags) + + AS_CASE([$CFLAGS], [*-O[[12345\ ]]*], [ +-- +1.8.1.2 + diff --git a/package/systemd-udev/patches/0009-uclibc-no-utmpx.patch b/package/systemd-udev/patches/0009-uclibc-no-utmpx.patch new file mode 100644 index 0000000..efd21f0 --- /dev/null +++ b/package/systemd-udev/patches/0009-uclibc-no-utmpx.patch @@ -0,0 +1,210 @@ +Index: systemd-197/src/shared/utmp-wtmp.c +=================================================================== +--- systemd-197.orig/src/shared/utmp-wtmp.c ++++ systemd-197/src/shared/utmp-wtmp.c +@@ -19,7 +19,7 @@ + along with systemd; If not, see . + ***/ + +-#include ++#include + #include + #include + #include +@@ -33,7 +33,7 @@ + #include "utmp-wtmp.h" + + int utmp_get_runlevel(int *runlevel, int *previous) { +- struct utmpx lookup, *found; ++ struct utmp lookup, *found; + int r; + const char *e; + +@@ -61,15 +61,15 @@ int utmp_get_runlevel(int *runlevel, int + return 0; + } + +- if (utmpxname(_PATH_UTMPX) < 0) ++ if (utmpname(_PATH_UTMP) < 0) + return -errno; + +- setutxent(); ++ setutent(); + + zero(lookup); + lookup.ut_type = RUN_LVL; + +- if (!(found = getutxid(&lookup))) ++ if (!(found = getutid(&lookup))) + r = -errno; + else { + int a, b; +@@ -88,12 +88,12 @@ int utmp_get_runlevel(int *runlevel, int + } + } + +- endutxent(); ++ endutent(); + + return r; + } + +-static void init_timestamp(struct utmpx *store, usec_t t) { ++static void init_timestamp(struct utmp *store, usec_t t) { + assert(store); + + zero(*store); +@@ -105,7 +105,7 @@ static void init_timestamp(struct utmpx + store->ut_tv.tv_usec = t % USEC_PER_SEC; + } + +-static void init_entry(struct utmpx *store, usec_t t) { ++static void init_entry(struct utmp *store, usec_t t) { + struct utsname uts; + + assert(store); +@@ -121,7 +121,7 @@ static void init_entry(struct utmpx *sto + strncpy(store->ut_id, "~~", sizeof(store->ut_id)); + } + +-static int write_entry_utmp(const struct utmpx *store) { ++static int write_entry_utmp(const struct utmp *store) { + int r; + + assert(store); +@@ -130,33 +130,33 @@ static int write_entry_utmp(const struct + * each entry type resp. user; i.e. basically a key/value + * table. */ + +- if (utmpxname(_PATH_UTMPX) < 0) ++ if (utmpname(_PATH_UTMP) < 0) + return -errno; + +- setutxent(); ++ setutent(); + +- if (!pututxline(store)) ++ if (!pututline(store)) + r = -errno; + else + r = 0; + +- endutxent(); ++ endutent(); + + return r; + } + +-static int write_entry_wtmp(const struct utmpx *store) { ++static int write_entry_wtmp(const struct utmp *store) { + assert(store); + + /* wtmp is a simple append-only file where each entry is + simply appended to * the end; i.e. basically a log. */ + + errno = 0; +- updwtmpx(_PATH_WTMPX, store); ++ updwtmp(_PATH_WTMP, store); + return -errno; + } + +-static int write_utmp_wtmp(const struct utmpx *store_utmp, const struct utmpx *store_wtmp) { ++static int write_utmp_wtmp(const struct utmp *store_utmp, const struct utmp *store_wtmp) { + int r, s; + + r = write_entry_utmp(store_utmp); +@@ -173,12 +173,12 @@ static int write_utmp_wtmp(const struct + return r; + } + +-static int write_entry_both(const struct utmpx *store) { ++static int write_entry_both(const struct utmp *store) { + return write_utmp_wtmp(store, store); + } + + int utmp_put_shutdown(void) { +- struct utmpx store; ++ struct utmp store; + + init_entry(&store, 0); + +@@ -189,7 +189,7 @@ int utmp_put_shutdown(void) { + } + + int utmp_put_reboot(usec_t t) { +- struct utmpx store; ++ struct utmp store; + + init_entry(&store, t); + +@@ -205,14 +205,14 @@ static const char *sanitize_id(const cha + assert(id); + l = strlen(id); + +- if (l <= sizeof(((struct utmpx*) NULL)->ut_id)) ++ if (l <= sizeof(((struct utmp*) NULL)->ut_id)) + return id; + +- return id + l - sizeof(((struct utmpx*) NULL)->ut_id); ++ return id + l - sizeof(((struct utmp*) NULL)->ut_id); + } + + int utmp_put_init_process(const char *id, pid_t pid, pid_t sid, const char *line) { +- struct utmpx store; ++ struct utmp store; + + assert(id); + +@@ -231,17 +231,17 @@ int utmp_put_init_process(const char *id + } + + int utmp_put_dead_process(const char *id, pid_t pid, int code, int status) { +- struct utmpx lookup, store, store_wtmp, *found; ++ struct utmp lookup, store, store_wtmp, *found; + + assert(id); + +- setutxent(); ++ setutent(); + + zero(lookup); + lookup.ut_type = INIT_PROCESS; /* looks for DEAD_PROCESS, LOGIN_PROCESS, USER_PROCESS, too */ + strncpy(lookup.ut_id, sanitize_id(id), sizeof(lookup.ut_id)); + +- if (!(found = getutxid(&lookup))) ++ if (!(found = getutid(&lookup))) + return 0; + + if (found->ut_pid != pid) +@@ -265,7 +265,7 @@ int utmp_put_dead_process(const char *id + + + int utmp_put_runlevel(int runlevel, int previous) { +- struct utmpx store; ++ struct utmp store; + int r; + + assert(runlevel > 0); +@@ -366,7 +366,7 @@ finish: + } + + int utmp_wall(const char *message, bool (*match_tty)(const char *tty)) { +- struct utmpx *u; ++ struct utmp *u; + char date[FORMAT_TIMESTAMP_MAX]; + char *text = NULL, *hn = NULL, *un = NULL, *tty = NULL; + int r; +@@ -391,11 +391,11 @@ int utmp_wall(const char *message, bool + goto finish; + } + +- setutxent(); ++ setutent(); + + r = 0; + +- while ((u = getutxent())) { ++ while ((u = getutent())) { + int q; + const char *path; + char *buf = NULL;