Skip to contentSkip to conversation

arm-bsp: use pre-generated keys instead of haveged in FVP machines

PATCH In review Ross Burton 2 participants 3 messages Oct 16, 2020 – Oct 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 arm-bsp: use pre-generated keys instead of haveged in FVP machines

As the FVP images won't be used in production there is no need to generate unique SSH keys on the first boot, which takes a long time in a FVP.

Instead of recommending haveged (from meta-oe) we can simply install pre-generated SSH keys. These keys are static so should not be used in production!

Change-Id I6a538de6bee892a77816c1d938dd2b55c94257f4
---
 meta-arm-bsp/conf/machine/fvp-common.inc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
meta-arm-bsp/conf/machine/fvp-common.inc +5 -5
index 2279338..da45026 100644
@@ -33,8 +33,8 @@ PREFERRED_VERSION_linux-yocto ?= "5.4%"
 
 EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
 
-# Use haveged as a source of entropy instead of rng-tools (Needed for ssh).
-# rngd (Part of rng-tools) takes ~7 mins to init resulting in a slow boot time.
-PACKAGE_EXCLUDE_append = " rng-tools"
-MACHINE_EXTRA_RRECOMMENDS += "haveged"
-
+# As this is a virtual target that will not be used in the real world there is
+# no need for real SSH keys.  Disable rng-tools (which takes too long to
+# initialise) and install the pre-generated keys.
+PACKAGECONFIG_remove_pn-openssh = "rng-tools"
+MACHINE_EXTRA_RRECOMMENDS += "ssh-pregen-hostkeys"
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 gem5: use pre-generated keys instead of haveged in gem5 machine

As the gem5 image won't be used in production there is no need to generate unique SSH keys on the first boot, which takes a long time in gem5.

Instead of recommending haveged (from meta-oe) we can simply install pre-generated SSH keys. These keys are static so should not be used in production!

Change-Id I134a421d66eb2b55cf0e4f44781021ac2c96106d
---
 meta-gem5/conf/machine/gem5-arm64.conf | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
meta-gem5/conf/machine/gem5-arm64.conf +5 -4
index 9ca2bb0..3e97682 100644
@@ -47,7 +47,8 @@ GEM5_RUN_CMDLINE = ""
 
 EXTRA_IMAGEDEPENDS += "gem5-aarch64-native"
 
-# Use haveged as a source of entropy instead of rng-tools (Needed for ssh).
-# rngd (Part of rng-tools) takes ~7 mins to init resulting in a slow boot time.
-PACKAGE_EXCLUDE_append = " rng-tools"
-MACHINE_EXTRA_RRECOMMENDS += "haveged"
+# As this is a virtual target that will not be used in the real world there is
+# no need for real SSH keys.  Disable rng-tools (which takes too long to
+# initialise) and install the pre-generated keys.
+PACKAGECONFIG_remove_pn-openssh = "rng-tools"
+MACHINE_EXTRA_RRECOMMENDS += "ssh-pregen-hostkeys"
Signature · 1 line
2.25.1
#2 lore raw
In reply to Ross Burton
Quoted 10 lines · Ross Burton

As the FVP images won't be used in production there is no need to generate unique SSH keys on the first boot, which takes a long time in a FVP.

Instead of recommending haveged (from meta-oe) we can simply install pre-generated SSH keys. These keys are static so should not be used in production!

Change-Id I6a538de6bee892a77816c1d938dd2b55c94257f4

Both patches pulled into master.

Thanks,
Jon

Quoted 29 lines
---
 meta-arm-bsp/conf/machine/fvp-common.inc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
meta-arm-bsp/conf/machine/fvp-common.inc +5 -5
index 2279338..da45026 100644
@@ -33,8 +33,8 @@ PREFERRED_VERSION_linux-yocto ?= "5.4%"
 
 EXTRA_IMAGEDEPENDS += "virtual/trusted-firmware-a u-boot"
 
-# Use haveged as a source of entropy instead of rng-tools (Needed for ssh).
-# rngd (Part of rng-tools) takes ~7 mins to init resulting in a slow boot time.
-PACKAGE_EXCLUDE_append = " rng-tools"
-MACHINE_EXTRA_RRECOMMENDS += "haveged"
-
+# As this is a virtual target that will not be used in the real world there is
+# no need for real SSH keys.  Disable rng-tools (which takes too long to
+# initialise) and install the pre-generated keys.
+PACKAGECONFIG_remove_pn-openssh = "rng-tools"
+MACHINE_EXTRA_RRECOMMENDS += "ssh-pregen-hostkeys"
Signature · 1 line
2.25.1