<div dir="ltr">Thx. an After= would indeed be completely wrong (and <div>it did cause a multi minute boot-delay  and was </div><div>removed.</div><div><br></div><div>Unfortunately, apart from that there is no real rational about</div><div>why this After= was added in the first place and it is not related </div><div>to our discussion (we want to add a Before=)</div><div><br></div><div>Thx for the search, though...</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 8 juin 2020 à 23:34, Peter Seiderer <<a href="mailto:ps.report@gmx.net">ps.report@gmx.net</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Jérémy, Norbert, Alexander,<br>
<br>
On Mon, 8 Jun 2020 16:14:00 +0200, Jérémy ROSEN <<a href="mailto:jeremy.rosen@smile.fr" target="_blank">jeremy.rosen@smile.fr</a>> wrote:<br>
<br>
> Le lun. 8 juin 2020 à 10:38, Alexander Dahl <<a href="mailto:post@lespocky.de" target="_blank">post@lespocky.de</a>> a écrit :<br>
> <br>
> > Hei hei,<br>
> ><br>
> > I'd like to hook in, because I had that topic on my desk lately<br>
> > (although not with buildroot).<br>
> ><br>
> > On Sun, Jun 07, 2020 at 10:36:18PM +0200, Norbert Lange wrote:  <br>
> > > > I mean... if it's not high grade entropy, it shouldn't credit the  <br>
> > kernel entropy  <br>
> > > > pool,and if the user is ok with unreliable entropy,  <br>
> > systemd-random-seed is  <br>
> > > > probably a faster way to get some.  <br>
> > ><br>
> > ><br>
> > > haveged is barely entropy, certainly not more than the kernel<br>
> > > provides, it is a means to fake entropy. Gets you to boot faster.  <br>
> ><br>
> > Well, the system can boot faster, because haveged provides entropy<br>
> > from unpredictable internal CPU states. It's not just another PRNG.<br>
> ><br>
> > Oh. I didn't know that... interesting  <br>
> <br>
> So. haveged provides high quality entropy to the kernel.<br>
> That entropy is probably credited (unlike systemd-random-seed)<br>
> So it is even more important that it is ordered before systemd-random-seed.<br>
> <br>
> > systemd-random-seed needs a filesystem to store stuff, does not credit  <br>
> > > the entropy pool (by default).. and won't help at all when booting the<br>
> > > first time.<br>
> > >  <br>
> <br>
> <br>
> > > I think what you have in mind is more like rng-tools, which feed real,<br>
> > > quality entropy to the kernel.  <br>
> ><br>
> > rng-tools can not do that by itself, but needs a real HWRNG or<br>
> > something like jitterentropy-rng (which gets its entropy from CPU<br>
> > execution timing jitter). So rng-tools alone doesn't help you,<br>
> > especially if your hardware has no hwrng.<br>
> >  <br>
> > > The user should pick what he needs, haveged will never give you better<br>
> > > entropy over the kernel or real HW sources,  systemd-random-seed will<br>
> > > not let you boot faster (by default).  <br>
> ><br>
> > I'm curious, where do you think the kernel gets entropy from? ;-)<br>
> ><br>
> > What you all might find interesting: newer OpenSSL versions, I think<br>
> > from some 1.1.1 bugfix release onwards block until the kernel has<br>
> > initialized its crng.  The upcoming (not yet released) dropbear will<br>
> > do that, too. Both don't rely on /dev/urandom for that but on the<br>
> > getrandom(2) syscall IIRC. Without having looked in systemd source, I<br>
> > would guess they do something similar?<br>
> ><br>
> > Yes it's exactly that. systemd-random-seed will block until urng is ready  <br>
> so<br>
> other services don't have to do that themselves (it makes sense for<br>
> dropbear/openssl to do that themselves anyway, for the non-systemd case,<br>
>  but in a systemd-based distro, they won't wait because systemd-random-seed<br>
>  will already have done the waiting)<br>
> <br>
> So at this point,  I am more and more convinced that haveged must be<br>
> ordered before systemd-random-seed. Not doing so is incorrect. At best<br>
> it will work by luck and at worst the entropy provided by haveged will<br>
> arrive<br>
> too late.<br>
> <br>
> On a read-only filesystem, systemd-random-seed will not read the file and<br>
> feed<br>
> entropy (which is not credited anyway) but it will still block the boot and<br>
> thus<br>
> ensure that any "normal" (post sysinit) daemon will have proper urng.<br>
> <br>
> Please add the Before= it has no ill effect AFAICT and not doing so might<br>
> prevent faster boots in the very cases where you try to avoid it.<br>
<br>
Did not follow the thread in detail, but did a quick search for<br>
haveged and systemd, found two relevant hits [1], [2], debian<br>
(and other) had 'After=systemd-random-seed.service' but dropped<br>
it leaving only:<br>
<br>
    After=apparmor.service systemd-tmpfiles-setup.service<br>
    Before=sysinit.target shutdown.target<br>
<br>
Regards,<br>
Peter<br>
<br>
[1] <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=938939" rel="noreferrer" target="_blank">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=938939</a><br>
[2] <a href="https://salsa.debian.org/debian/haveged/-/merge_requests/1?commit_id=f92a246e53de88a346a2fb6dc770a624f0660bef" rel="noreferrer" target="_blank">https://salsa.debian.org/debian/haveged/-/merge_requests/1?commit_id=f92a246e53de88a346a2fb6dc770a624f0660bef</a><br>
<br>
> <br>
> Regards.<br>
> Jeremy<br>
> <br>
> <br>
> <br>
> > So, it's complicated … ;-)<br>
> ><br>
> > Greets<br>
> > Alex<br>
> ><br>
> > --<br>
> > /"\ ASCII RIBBON | »With the first link, the chain is forged. The first<br>
> > \ / CAMPAIGN     | speech censured, the first thought forbidden, the<br>
> >  X  AGAINST      | first freedom denied, chains us all irrevocably.«<br>
> > / \ HTML MAIL    | (Jean-Luc Picard, quoting Judge Aaron Satie)<br>
> > _______________________________________________<br>
> > buildroot mailing list<br>
> > <a href="mailto:buildroot@busybox.net" target="_blank">buildroot@busybox.net</a><br>
> > <a href="http://lists.busybox.net/mailman/listinfo/buildroot" rel="noreferrer" target="_blank">http://lists.busybox.net/mailman/listinfo/buildroot</a><br>
> >  <br>
> <br>
> <br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><table border="0" style="border-collapse:collapse;border-spacing:0px;color:rgb(51,51,51);font-family:Raleway,regular;font-size:14px;padding:20px"><tbody><tr><td style="padding:0px 30px 0px 0px;font-size:13px;color:rgb(255,128,84);text-align:center"><a href="http://www.smile.eu/" style="background-color:transparent;color:rgb(221,72,20)" target="_blank"><img src="http://ftp.smile.fr/client/Communication/signature/img/Logo-new.png" alt="SMILE" style="border: 0px; vertical-align: middle; max-width: 100%; height: auto;"> </a><br><br><p style="margin:0px 0px 10px">20 rue des Jardins<br>92600 Asnières-sur-Seine</p></td><td style="padding:0px 0px 0px 20px;border-left:1px solid rgb(59,127,254);font-size:13px;color:rgb(255,128,84)"><div style="font-size:14px"><b>Jérémy ROSEN</b></div><div style="color:rgb(59,127,254)">Architecte technique<br></div><br><div style="color:rgb(59,127,254)"><span style="white-space:nowrap"><img src="http://ftp.smile.fr/client/Communication/signature/img/mail.png" alt="email" width="12" height="10" style="border: 0px; vertical-align: middle; margin-right: 5px;"> <a href="mailto:jeremy.rosen@smile.fr" style="background-color:transparent;color:rgb(59,127,254)" target="_blank">jeremy.rosen@smile.fr</a> </span><br><span style="white-space:nowrap"><img src="http://ftp.smile.fr/client/Communication/signature/img/phone.png" alt="phone" width="10" height="10" style="border: 0px; vertical-align: middle; margin-right: 5px;"></span>  +33 6 88 25 87 42 <br><span style="white-space:nowrap"><img src="http://ftp.smile.fr/client/Communication/signature/img/web.png" alt="url" width="12" height="12" style="border: 0px; vertical-align: middle; margin-right: 5px;"> <a href="http://www.smile.eu/" style="background-color:transparent;color:rgb(59,127,254)" target="_blank">http://www.smile.eu</a></span></div><br><div><span><a href="https://twitter.com/GroupeSmile" style="background-color:transparent;color:rgb(221,72,20);margin-right:5px" target="_blank"><img src="http://ftp.smile.fr/client/Communication/signature/img/rs-twitter.png" alt="Twitter" style="border: 0px; vertical-align: middle; max-width: 100%; height: auto;"></a></span> <span><a href="https://www.facebook.com/smileopensource" style="background-color:transparent;color:rgb(221,72,20);margin-right:5px" target="_blank"><img src="http://ftp.smile.fr/client/Communication/signature/img/rs-facebook.png" alt="Facebook" style="border: 0px; vertical-align: middle; max-width: 100%; height: auto;"></a></span> <span><a href="https://www.linkedin.com/company/smile" style="background-color:transparent;color:rgb(221,72,20);margin-right:5px" target="_blank"><img src="http://ftp.smile.fr/client/Communication/signature/img/rs-linkedin.png" alt="LinkedIn" style="border: 0px; vertical-align: middle; max-width: 100%; height: auto;"></a></span> <span><a href="https://github.com/Smile-SA" style="background-color:transparent;color:rgb(221,72,20);margin-right:5px" target="_blank"><img src="http://ftp.smile.fr/client/Communication/signature/img/rs-github.png" alt="Github" style="border: 0px; vertical-align: middle; max-width: 100%; height: auto;"></a></span></div></td></tr></tbody></table><br style="color:rgb(51,51,51);font-family:Raleway,regular;font-size:14px"><div style="color:rgb(51,51,51);font-family:Raleway,regular;font-size:14px"><a href="https://www.smile.eu/fr/publications/livres-blancs/yocto?utm_source=signature&utm_medium=email&utm_campaign=signature" style="background-color:transparent;color:rgb(221,72,20)" target="_blank"><img src="https://signature.smile.eu/assets/img/bandeaux_signature_mail_yocto.gif.gif" alt="Découvrez l’univers Smile, rendez-vous sur smile.eu" border="0" style="border: 0px; vertical-align: middle;"></a></div></div></div></div></div>