From bfd31f845335f42b468cfcec2e85245b6512b70a Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Mon, 20 Jan 2025 09:28:21 -0500 Subject: [PATCH] jjb: Create /root/.ssh in new instances if necessary Some base images don't have `/root/.ssh` as an existing directory, causing the subsequent `incus file push` to fail. Change-Id: Iab90f513582201dd0775293d6523e3f09e1633b0 Signed-off-by: Kienan Stewart --- pipelines/images/imagebuild.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/pipelines/images/imagebuild.sh b/pipelines/images/imagebuild.sh index 5943035..e5d4cbd 100644 --- a/pipelines/images/imagebuild.sh +++ b/pipelines/images/imagebuild.sh @@ -173,6 +173,7 @@ CLEANUP+=( "rm -f ${HOME}/.ssh/id_rsa.pub" "rm -f ${HOME}/.ssh/id_rsa" ) +incus exec "ci:${INSTANCE_NAME}" -- mkdir -p /root/.ssh incus file push ~/.ssh/id_rsa.pub "ci:${INSTANCE_NAME}/root/.ssh/authorized_keys2" # Some distros, eg. Rocky Linux, don't enable the use of authorized_keys2 # by default -- 2.39.5