瀏覽代碼

package/urandom-scripts: new package

The init script S20urandom is used to preserve the kernel's RNG
seed between reboots. This functionality is not required for the
package "initscripts". Further there are use-cases where this script
should not be installed at all (e.g. systems that only have read-only
partitions), but that's currently not possible as the script is
a mandatory part of the package "initscripts".

Let's move the script into its own package "urandom-scripts" and select it,
if the default skeleton is enabled. This maintains backward-compatibility
and allows to deselect it.

Signed-off-by: Christoph Müllner <christoph.muellner@theobroma-systems.com>
[yann.morin.1998@free.fr:
  - extend help text
  - default y if initscripts (instead of skeleton default)
  - allow use with openRC, but not systemd
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Christoph Müllner 5 年之前
父節點
當前提交
2fb5886fd7

+ 1 - 0
package/Config.in

@@ -2291,6 +2291,7 @@ menu "Security"
 	source "package/selinux-python/Config.in"
 	source "package/semodule-utils/Config.in"
 	source "package/setools/Config.in"
+	source "package/urandom-scripts/Config.in"
 endmenu
 
 menu "Shell and utilities"

+ 10 - 0
package/urandom-scripts/Config.in

@@ -0,0 +1,10 @@
+config BR2_PACKAGE_URANDOM_SCRIPTS
+	bool "urandom-initscripts"
+	default y if BR2_PACKAGE_INITSCRIPTS
+	depends on !BR2_PACKAGE_SYSTEMD
+	help
+	  Initscript to preserve the random seed between reboots.
+
+	  WARNING: this is a poor fit to try and get high-quality
+	  entropy at boot. There are better ways, like haveged, or
+	  rng-tools.

+ 0 - 0
package/initscripts/init.d/S20urandom → package/urandom-scripts/S20urandom


+ 12 - 0
package/urandom-scripts/urandom-scripts.mk

@@ -0,0 +1,12 @@
+################################################################################
+#
+# urandom-scripts
+#
+################################################################################
+
+define URANDOM_SCRIPTS_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 $(URANDOM_SCRIPTS_PKGDIR)/S20urandom \
+		$(TARGET_DIR)/etc/init.d/S20urandom
+endef
+
+$(eval $(generic-package))