From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mout.kundenserver.de ([217.72.192.73]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1dQqDH-0007ks-VU for ptxdist@pengutronix.de; Fri, 30 Jun 2017 09:19:36 +0200 Received: from idefix.home.lespocky.de ([79.205.212.181]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MPa4X-1dM9Fg3RiL-004kos for ; Fri, 30 Jun 2017 09:19:30 +0200 Received: from falbala.home.lespocky.de ([192.168.243.94]) by idefix.home.lespocky.de with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1dQqD2-00019U-0d for ptxdist@pengutronix.de; Fri, 30 Jun 2017 09:19:29 +0200 Date: Fri, 30 Jun 2017 09:19:18 +0200 From: Alexander Dahl Message-ID: <20170630071917.GF27745@falbala.home.lespocky.de> References: <20170629214926.2295-1-r.schwebel@pengutronix.de> MIME-Version: 1.0 In-Reply-To: <20170629214926.2295-1-r.schwebel@pengutronix.de> Subject: Re: [ptxdist] [PATCH] haveged: add entropy daemon List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: multipart/mixed; boundary="===============1569132178==" Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de --===============1569132178== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xo44VMWPx7vlQ2+2" Content-Disposition: inline --xo44VMWPx7vlQ2+2 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hei hei, tested this without systemd on top of a recent ptxdist 2017.06.0 based BSP with the sysv init script from buildroot. The usual 'random: crng init done' message on the serial konsole comes a lot earlier now, so I guess it works. ;-) Besides: is there any way to have this random generator stuff certainly ready before generating dropbear keys (rc-once)? Greets Alex Tested-by: Alexander Dahl On Thu, Jun 29, 2017 at 11:49:26PM +0200, Robert Schwebel wrote: > Add the haveged package. >=20 > Signed-off-by: Robert Schwebel > --- > ....ac-fix-handling-for-enable-clock_gettime.patch | 26 ++++++++ > .../0002-init-fix-path-for-systemd-unit-dir.patch | 24 +++++++ > ...nstallation-of-systemd-unit-file-DESTDIR-.patch | 28 ++++++++ > ...akefile.am-create-nonexisting-directories.patch | 31 +++++++++ > ...file.am-do-not-call-systemd-during-compil.patch | 29 +++++++++ > patches/haveged-1.9.1/autogen.sh | 1 + > patches/haveged-1.9.1/series | 8 +++ > rules/haveged.in | 7 ++ > rules/haveged.make | 76 ++++++++++++++++= ++++++ > 9 files changed, 230 insertions(+) > create mode 100644 patches/haveged-1.9.1/0001-configure.ac-fix-handling-= for-enable-clock_gettime.patch > create mode 100644 patches/haveged-1.9.1/0002-init-fix-path-for-systemd-= unit-dir.patch > create mode 100644 patches/haveged-1.9.1/0003-init-make-installation-of-= systemd-unit-file-DESTDIR-.patch > create mode 100644 patches/haveged-1.9.1/0004-init.d-Makefile.am-create-= nonexisting-directories.patch > create mode 100644 patches/haveged-1.9.1/0005-init.d-Makefile.am-do-not-= call-systemd-during-compil.patch > create mode 120000 patches/haveged-1.9.1/autogen.sh > create mode 100644 patches/haveged-1.9.1/series > create mode 100644 rules/haveged.in > create mode 100644 rules/haveged.make >=20 > diff --git a/patches/haveged-1.9.1/0001-configure.ac-fix-handling-for-ena= ble-clock_gettime.patch b/patches/haveged-1.9.1/0001-configure.ac-fix-handl= ing-for-enable-clock_gettime.patch > new file mode 100644 > index 000000000..20a34b466 > --- /dev/null > +++ b/patches/haveged-1.9.1/0001-configure.ac-fix-handling-for-enable-clo= ck_gettime.patch > @@ -0,0 +1,26 @@ > +From: Robert Schwebel > +Date: Thu, 29 Jun 2017 22:30:34 +0200 > +Subject: [PATCH] configure.ac: fix handling for --enable-clock_gettime > + > +The logic for this configure option is broken; on ARM, we fall into the > +*) path and the logic decides that this option is not set, no matter if > +we set it or not. > + > +Signed-off-by: Robert Schwebel > +--- > + configure.ac | 2 ++ > + 1 file changed, 2 insertions(+) > + > +diff --git a/configure.ac b/configure.ac > +index f8d76c106014..e4f17a80d876 100644 > +--- a/configure.ac > ++++ b/configure.ac > +@@ -175,6 +175,8 @@ case "$host" in > + *) > + if test "x$enable_clock_gettime" =3D "xx"; then > + enable_clock_gettime=3D"yes" > ++ elif test "x$enable_clock_gettime" =3D "xyes"; then > ++ enable_clock_gettime=3D"yes" > + else > + AC_MSG_ERROR([no timer source for host :"$host".]) > + fi > diff --git a/patches/haveged-1.9.1/0002-init-fix-path-for-systemd-unit-di= r.patch b/patches/haveged-1.9.1/0002-init-fix-path-for-systemd-unit-dir.pat= ch > new file mode 100644 > index 000000000..6ae95fbb5 > --- /dev/null > +++ b/patches/haveged-1.9.1/0002-init-fix-path-for-systemd-unit-dir.patch > @@ -0,0 +1,24 @@ > +From: Robert Schwebel > +Date: Thu, 29 Jun 2017 22:53:16 +0200 > +Subject: [PATCH] init: fix path for systemd unit dir > + > +This branch was obviously not tested. > + > +Signed-off-by: Robert Schwebel > +--- > + init.d/Makefile.am | 2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/init.d/Makefile.am b/init.d/Makefile.am > +index ca3ad1c1e854..bf86773176a6 100644 > +--- a/init.d/Makefile.am > ++++ b/init.d/Makefile.am > +@@ -37,7 +37,7 @@ install-data-hook: > + if ENABLE_SYSTEMD_LOOKUP > + install -p -m644 haveged.service `pkg-config --variable=3Dsystemdsyste= munitdir systemd`/haveged.service; > + else > +- install -p -m644 haveged.service ($unit_dir)/haveged.service; > ++ install -p -m644 haveged.service $(unit_dir)/haveged.service; > + endif > + systemctl enable haveged.service; > +=20 > diff --git a/patches/haveged-1.9.1/0003-init-make-installation-of-systemd= -unit-file-DESTDIR-.patch b/patches/haveged-1.9.1/0003-init-make-installati= on-of-systemd-unit-file-DESTDIR-.patch > new file mode 100644 > index 000000000..5a536871a > --- /dev/null > +++ b/patches/haveged-1.9.1/0003-init-make-installation-of-systemd-unit-f= ile-DESTDIR-.patch > @@ -0,0 +1,28 @@ > +From: Robert Schwebel > +Date: Thu, 29 Jun 2017 22:54:11 +0200 > +Subject: [PATCH] init: make installation of systemd unit file DESTDIR aw= are > + > +The installation currently does not care about a DESTDIR, which is > +imporant when cross compiling. > + > +Signed-off-by: Robert Schwebel > +--- > + init.d/Makefile.am | 4 ++-- > + 1 file changed, 2 insertions(+), 2 deletions(-) > + > +diff --git a/init.d/Makefile.am b/init.d/Makefile.am > +index bf86773176a6..2f92cb7fdde4 100644 > +--- a/init.d/Makefile.am > ++++ b/init.d/Makefile.am > +@@ -35,9 +35,9 @@ install-exec-hook: > +=20 > + install-data-hook: > + if ENABLE_SYSTEMD_LOOKUP > +- install -p -m644 haveged.service `pkg-config --variable=3Dsystemdsyste= munitdir systemd`/haveged.service; > ++ install -p -m644 haveged.service $(DESTDIR)`pkg-config --variable=3Dsy= stemdsystemunitdir systemd`/haveged.service; > + else > +- install -p -m644 haveged.service $(unit_dir)/haveged.service; > ++ install -p -m644 haveged.service $(DESTDIR)$(unit_dir)/haveged.service; > + endif > + systemctl enable haveged.service; > +=20 > diff --git a/patches/haveged-1.9.1/0004-init.d-Makefile.am-create-nonexis= ting-directories.patch b/patches/haveged-1.9.1/0004-init.d-Makefile.am-crea= te-nonexisting-directories.patch > new file mode 100644 > index 000000000..6f693b000 > --- /dev/null > +++ b/patches/haveged-1.9.1/0004-init.d-Makefile.am-create-nonexisting-di= rectories.patch > @@ -0,0 +1,31 @@ > +From: Robert Schwebel > +Date: Thu, 29 Jun 2017 22:59:46 +0200 > +Subject: [PATCH] init.d/Makefile.am: create nonexisting directories > + > +install can't assume that all leading directories do already exist. > +While this will in most cases be true on normal desktop/server > +distributions, cross build systems or systems that build single packages > +will build into a fresh hierarchy. Add -D to install, in order to create > +the leading directories. > + > +Signed-off-by: Robert Schwebel > +--- > + init.d/Makefile.am | 4 ++-- > + 1 file changed, 2 insertions(+), 2 deletions(-) > + > +diff --git a/init.d/Makefile.am b/init.d/Makefile.am > +index 2f92cb7fdde4..4a6e551f0b51 100644 > +--- a/init.d/Makefile.am > ++++ b/init.d/Makefile.am > +@@ -35,9 +35,9 @@ install-exec-hook: > +=20 > + install-data-hook: > + if ENABLE_SYSTEMD_LOOKUP > +- install -p -m644 haveged.service $(DESTDIR)`pkg-config --variable=3Dsy= stemdsystemunitdir systemd`/haveged.service; > ++ install -p -D -m644 haveged.service $(DESTDIR)`pkg-config --variable= =3Dsystemdsystemunitdir systemd`/haveged.service; > + else > +- install -p -m644 haveged.service $(DESTDIR)$(unit_dir)/haveged.service; > ++ install -p -D -m644 haveged.service $(DESTDIR)$(unit_dir)/haveged.serv= ice; > + endif > + systemctl enable haveged.service; > +=20 > diff --git a/patches/haveged-1.9.1/0005-init.d-Makefile.am-do-not-call-sy= stemd-during-compil.patch b/patches/haveged-1.9.1/0005-init.d-Makefile.am-d= o-not-call-systemd-during-compil.patch > new file mode 100644 > index 000000000..359708a18 > --- /dev/null > +++ b/patches/haveged-1.9.1/0005-init.d-Makefile.am-do-not-call-systemd-d= uring-compil.patch > @@ -0,0 +1,29 @@ > +From: Robert Schwebel > +Date: Thu, 29 Jun 2017 23:03:06 +0200 > +Subject: [PATCH] init.d/Makefile.am: do not call systemd during compilat= ion > + > +Remove systemd call: we can not assume that the user is allowed to do > +so: he might not if he compiles the software as non-root. > + > +When cross-compiling, the intended systemd might not even run on the > +same hardware. > + > +We better leave the decision whether or not to call systemd to the > +administrator. > + > +Signed-off-by: Robert Schwebel > +--- > + init.d/Makefile.am | 2 -- > + 1 file changed, 2 deletions(-) > + > +diff --git a/init.d/Makefile.am b/init.d/Makefile.am > +index 4a6e551f0b51..efb01e3c8aab 100644 > +--- a/init.d/Makefile.am > ++++ b/init.d/Makefile.am > +@@ -39,6 +39,4 @@ if ENABLE_SYSTEMD_LOOKUP > + else > + install -p -D -m644 haveged.service $(DESTDIR)$(unit_dir)/haveged.serv= ice; > + endif > +- systemctl enable haveged.service; > +- > + endif > diff --git a/patches/haveged-1.9.1/autogen.sh b/patches/haveged-1.9.1/aut= ogen.sh > new file mode 120000 > index 000000000..9f8a4cb7d > --- /dev/null > +++ b/patches/haveged-1.9.1/autogen.sh > @@ -0,0 +1 @@ > +../autogen.sh > \ No newline at end of file > diff --git a/patches/haveged-1.9.1/series b/patches/haveged-1.9.1/series > new file mode 100644 > index 000000000..0e24f4d6b > --- /dev/null > +++ b/patches/haveged-1.9.1/series > @@ -0,0 +1,8 @@ > +# generated by git-ptx-patches > +#tag:base --start-number 1 > +0001-configure.ac-fix-handling-for-enable-clock_gettime.patch > +0002-init-fix-path-for-systemd-unit-dir.patch > +0003-init-make-installation-of-systemd-unit-file-DESTDIR-.patch > +0004-init.d-Makefile.am-create-nonexisting-directories.patch > +0005-init.d-Makefile.am-do-not-call-systemd-during-compil.patch > +# d6dc334689ded00c3e697eb3fe83b57a - git-ptx-patches magic > diff --git a/rules/haveged.in b/rules/haveged.in > new file mode 100644 > index 000000000..9a8a59702 > --- /dev/null > +++ b/rules/haveged.in > @@ -0,0 +1,7 @@ > +## SECTION=3Dnetworking > + > +config HAVEGED > + tristate > + prompt "haveged" > + help > + haveged is a simple entropy daemon > diff --git a/rules/haveged.make b/rules/haveged.make > new file mode 100644 > index 000000000..0ef3559e6 > --- /dev/null > +++ b/rules/haveged.make > @@ -0,0 +1,76 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2017 by Robert Schwebel > +# > +# See CREDITS for details about who has contributed to this project. > +# > +# For further information about the PTXdist project and license conditio= ns > +# see the README file. > +# > + > +# > +# We provide this package > +# > +PACKAGES-$(PTXCONF_HAVEGED) +=3D haveged > + > +# > +# Paths and names > +# > +HAVEGED_VERSION :=3D 1.9.1 > +HAVEGED_MD5 :=3D 015ff58cd10607db0e0de60aeca2f5f8 > +HAVEGED :=3D haveged-$(HAVEGED_VERSION) > +HAVEGED_SUFFIX :=3D tar.gz > +HAVEGED_URL :=3D http://www.issihosts.com/haveged/$(HAVEGED).$(HAVEGED_S= UFFIX) > +HAVEGED_SOURCE :=3D $(SRCDIR)/$(HAVEGED).$(HAVEGED_SUFFIX) > +HAVEGED_DIR :=3D $(BUILDDIR)/$(HAVEGED) > +HAVEGED_LICENSE :=3D GPL-3.0=20 > + > +# ----------------------------------------------------------------------= ------ > +# Prepare > +# ----------------------------------------------------------------------= ------ > + > +# > +# autoconf > +# > +HAVEGED_CONF_TOOL :=3D autoconf > +HAVEGED_CONF_OPT :=3D \ > + $(CROSS_AUTOCONF_USR) \ > + --enable-clock_gettime \ > + --enable-daemon=3Dyes \ > + --enable-diagnostic=3Dno \ > + --enable-init=3Dservice.fedora \ > + --enable-initdir=3D? \ > + --enable-nistest=3Dno \ > + --enable-olt=3Dno \ > + --enable-threads=3Dno \ > + --enable-tune=3Dyes > + > +# ----------------------------------------------------------------------= ------ > +# Target-Install > +# ----------------------------------------------------------------------= ------ > + > +$(STATEDIR)/haveged.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, haveged) > + @$(call install_fixup, haveged,PRIORITY,optional) > + @$(call install_fixup, haveged,SECTION,base) > + @$(call install_fixup, haveged,AUTHOR,"Robert Schwebel ") > + @$(call install_fixup, haveged,DESCRIPTION,missing) > + > + @$(call install_lib, haveged, 0, 0, 0644, libhavege) > + @$(call install_copy, haveged, 0, 0, 0755, -, /usr/sbin/haveged) > + > +ifdef PTXCONF_INITMETHOD_SYSTEMD > + @$(call install_copy, haveged, 0, 0, 0644, -, /usr/lib/systemd/system/h= aveged.service) > + @$(call install_link, haveged, \ > + ../haveged.service, \ > + /usr/lib/systemd/system/multi-user.target.wants/haveged.service \ > + ) > +endif > + > + @$(call install_finish, haveged) > + > + @$(call touch) > + > +# vim: syntax=3Dmake > --=20 > 2.13.2 >=20 >=20 > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de --=20 =BBWith the first link, the chain is forged. The first speech censured,=20 the first thought forbidden, the first freedom denied, chains us all=20 irrevocably.=AB (Jean-Luc Picard, quoting Judge Aaron Satie) *** GnuPG-FP: C28E E6B9 0263 95CF 8FAF 08FA 34AD CD00 7221 5CC6 *** --xo44VMWPx7vlQ2+2 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJZVft1AAoJEDStzQByIVzGY1MP/j51sAHLsCj1s61urv5rUYS7 FqxObVxtceHCld7VEHJbW2iQTEJ6dmzGL34q1Gq6HolXVKxn3gfXVOBMWK8K78Hw aXFHkYV6XryBxvIMdW3gNm/eFL+NXd+SUfuHmzRS40xV9M6qMHM/nt1ZnoCFbvoZ BeCz4eUTgXb5iyuw//8HKSJ8XKTvJDuRflSrwSEIKcScZ2grggS9otlNYzkk/qZj 85uJwaqcioMTNLtNK044m62S54AFzhi7FFSikFNc4huYP7At3ujn29sy9Q7jUn9U 6bf1uXFbVK6sth+baGWW4D/Ch1XPe6PgUtPPlSJG5bPll45IOZtbNx5jSsYdiIqd a7F8xQhEFP0Hx3T9L/6AO99d2Wjl5u5GX8NrEUdkXrqYdC0AYh0MpKphonGoz4Ow GVxRbTQSazS0zgAW76T45pEkLuKRiE4dorWm2Vc44d/TGHJffaU8A3R1WPY7x8mk jUrMAAWrN5Fh2U7UIC2gDSvqjhCTxpwcpGj4jTx8zUvqe9pfRNX7yeCY+6b8Q9T2 OZqveitokOhIMd9PKWO+MRBZKjUPLR2xumbQkEnI+EPsV2C8xiBcKZH5Vjdpx4gd xB+G2bYkGLF3PHr10IIGVilDoTfmvga37E1i7Dl9RXiIjT96w/tFxqCCnOa/VfmG Fvexfsl3RqbCPCiKmNd2 =tTON -----END PGP SIGNATURE----- --xo44VMWPx7vlQ2+2-- --===============1569132178== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KcHR4ZGlzdCBt YWlsaW5nIGxpc3QKcHR4ZGlzdEBwZW5ndXRyb25peC5kZQ== --===============1569132178==--