Skip to content
Snippets Groups Projects
Verified Commit 6ff9ce99 authored by Karel Koci's avatar Karel Koci :metal:
Browse files

atsha204: go back from feeding entropy in preinit to init

Now we feed entropy as soon as possible but in init. The reason is
because in preinit the kernel modules are not yet loaded and atsha204
requires I2C to communicate. This is loaded later on and thus can't be
in preinit. It also makes sense to load it at the same as we other
services providing the same functionality (such as haveged).
parent cd50b989
Branches
Tags
2 merge requests!697Turris OS 5.2 merge,!675atsha204: go back from feeding entropy in preinit to init
......@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libatsha204
PKG_VERSION:=29.2
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gitlab.nic.cz/turris/libatsha204.git
......@@ -65,8 +65,8 @@ endef
define Package/libatsha204/install
$(call Common/install,$(1))
$(INSTALL_DIR) $(1)/lib/preinit
$(INSTALL_DATA) ./files/atsha204-feed-entropy.preinit $(1)/lib/preinit/81_atsha204_feed_entropy
$(INSTALL_DIR) $(1)/init.d
$(INSTALL_DATA) ./files/atsha204-feed-entropy.init $(1)/etc/init.d/atsha204-feed-entropy
# Note: This script is here for libatsha204-emul. When this package is
# replaced with emul version then this config is used.
......
#!/bin/sh
#!/bin/sh /etc/rc.common
preinit_atsha204_feed_entropy() {
START=01
start() {
for i in $(seq 1 16); do
/usr/bin/atsha204cmd feed-entropy
done
}
boot_hook_add preinit_main preinit_atsha204_feed_entropy
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment