From 1c941fdfbb5b2162bfc9c5f10b38df94663462e4 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 1 Jun 2021 11:43:58 +0200 Subject: [PATCH] plugins: add support for disabling RTC and urandom plugins Some systems may want to handle RTC and /dev/urandom by themselves, or not at all as in the case of containers where the host does all this. Signed-off-by: Joachim Wiberg --- configure.ac | 2 ++ plugins/Makefile.am | 20 ++++++++++++++++++-- plugins/urandom.c | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index ebafbfc4..ffa8a81a 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,8 @@ AC_PLUGIN([resolvconf], [no], [Setup necessary files for resolvconf]) AC_PLUGIN([x11-common], [no], [Console setup (for X)]) AC_PLUGIN([netlink], [yes], [Basic netlink plugin for IFUP/IFDN and GW events. Can be replaced with externally built plugin that links with libnl or similar.]) AC_PLUGIN([hotplug], [yes], [Setup and start udev or mdev hotplug daemon]) +AC_PLUGIN([rtc], [yes], [Save and restore RTC using hwclock]) +AC_PLUGIN([urandom], [yes], [Setup and save random seed at boot/shutdown]) # Check for extra arguments or packages AC_ARG_WITH(heading, diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 91bb5dbf..bd50c591 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -7,7 +7,7 @@ AM_CPPFLAGS += $(lite_CFLAGS) if STATIC noinst_LTLIBRARIES = libplug.la -libplug_la_SOURCES = bootmisc.c modprobe.c rtc.c pidfile.c procps.c sys.c tty.c urandom.c usr.c +libplug_la_SOURCES = bootmisc.c modprobe.c pidfile.c procps.c sys.c tty.c usr.c if BUILD_ALSA_UTILS_PLUGIN libplug_la_SOURCES += alsa-utils.c @@ -33,12 +33,20 @@ if BUILD_RESOLVCONF_PLUGIN libplug_la_SOURCES += resolvconf.c endif +if BUILD_RTC_PLUGIN +libplug_la_SOURCES += rtc.c +endif + +if BUILD_URANDOM_PLUGIN +libplug_la_SOURCES += urandom.c +endif + if BUILD_X11_COMMON_PLUGIN libplug_la_SOURCES += x11-common.c endif else -pkglib_LTLIBRARIES = bootmisc.la modprobe.la rtc.la pidfile.la procps.la sys.la tty.la urandom.la usr.la +pkglib_LTLIBRARIES = bootmisc.la modprobe.la pidfile.la procps.la sys.la tty.la usr.la if BUILD_ALSA_UTILS_PLUGIN pkglib_LTLIBRARIES += alsa-utils.la @@ -64,6 +72,14 @@ if BUILD_RESOLVCONF_PLUGIN pkglib_LTLIBRARIES += resolvconf.la endif +if BUILD_RTC_PLUGIN +pkglib_LTLIBRARIES += rtc.la +endif + +if BUILD_URANDOM_PLUGIN +pkglib_LTLIBRARIES += urandom.la +endif + if BUILD_X11_COMMON_PLUGIN pkglib_LTLIBRARIES += x11-common.la endif diff --git a/plugins/urandom.c b/plugins/urandom.c index 1a3adbf7..59d77636 100644 --- a/plugins/urandom.c +++ b/plugins/urandom.c @@ -1,4 +1,4 @@ -/* Setup random seed +/* Setup and save random seed at boot/shutdown * * Copyright (c) 2012-2021 Joachim Wiberg *