Preconfigure SSH server on test image
* This allows logging in to freshly built image using ssh. Change-Id: I15baeee455827b73f12e1a222b166bd7975786dd Reviewed-on: https://review.haiku-os.org/c/haiku/+/10426 Tested-by: Commit checker robot <[email protected]> Reviewed-by: Kacper Kasper <[email protected]> Reviewed-by: Priyanshu Gupta <[email protected]>
This commit is contained in:
@@ -189,16 +189,23 @@ rule DefineDefaultBuildProfiles
|
|||||||
|
|
||||||
case "test-*" : {
|
case "test-*" : {
|
||||||
Echo Building Haiku UnitTest Target ;
|
Echo Building Haiku UnitTest Target ;
|
||||||
|
HAIKU_ROOT_USER_NAME = user ;
|
||||||
|
HAIKU_ROOT_USER_REAL_NAME = "Tester" ;
|
||||||
HAIKU_IMAGE_HOST_NAME ?= shredder ;
|
HAIKU_IMAGE_HOST_NAME ?= shredder ;
|
||||||
if $(DEBUG) != 0 {
|
if $(DEBUG) != 0 {
|
||||||
HAIKU_IMAGE_SIZE ?= 450 ;
|
HAIKU_IMAGE_SIZE ?= 450 ;
|
||||||
|
} else {
|
||||||
|
HAIKU_IMAGE_SIZE ?= 300 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddHaikuImageSystemPackages
|
AddHaikuImageSystemPackages
|
||||||
openssh
|
openssh
|
||||||
openssl3
|
openssl3
|
||||||
!gcc2 @{ python3.10 }@
|
!gcc2 @{ python3.10 nano }@
|
||||||
gcc2 @{ python3.10_x86@secondary_x86 }@
|
gcc2 @{
|
||||||
|
python3.10_x86@secondary_x86
|
||||||
|
nano_x86@secondary_x86
|
||||||
|
}@
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ if $(HAIKU_BUILD_TYPE) = bootstrap {
|
|||||||
} else if $(HAIKU_BUILD_TYPE) = minimum {
|
} else if $(HAIKU_BUILD_TYPE) = minimum {
|
||||||
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images definitions minimum ] ;
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images definitions minimum ] ;
|
||||||
} else if $(HAIKU_BUILD_TYPE) = test {
|
} else if $(HAIKU_BUILD_TYPE) = test {
|
||||||
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images definitions minimum ] ;
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images definitions test ] ;
|
||||||
} else {
|
} else {
|
||||||
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images definitions regular ] ;
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images definitions regular ] ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# This file defines the content of the test Haiku image.
|
||||||
|
|
||||||
|
# import everything from the minimum image
|
||||||
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images definitions minimum ] ;
|
||||||
|
|
||||||
|
SYSTEM_APPS = [ FFilterByBuildFeatures
|
||||||
|
NetworkStatus
|
||||||
|
ProcessController
|
||||||
|
SerialConnect
|
||||||
|
Terminal
|
||||||
|
Workspaces ] ;
|
||||||
|
|
||||||
|
DESKBAR_APPLICATIONS = SerialConnect Terminal ;
|
||||||
@@ -265,6 +265,9 @@ AddFilesToPackage data user_launch : $(userLaunchScripts) ;
|
|||||||
|
|
||||||
# first login scripts
|
# first login scripts
|
||||||
local firstLoginFiles = default_deskbar_items.sh ;
|
local firstLoginFiles = default_deskbar_items.sh ;
|
||||||
|
if $(HAIKU_BUILD_TYPE) = test {
|
||||||
|
firstLoginFiles += test_image.sh ;
|
||||||
|
}
|
||||||
firstLoginFiles = $(firstLoginFiles:G=first-login) ;
|
firstLoginFiles = $(firstLoginFiles:G=first-login) ;
|
||||||
SEARCH on $(firstLoginFiles)
|
SEARCH on $(firstLoginFiles)
|
||||||
= [ FDirName $(HAIKU_TOP) data system boot first_login ] ;
|
= [ FDirName $(HAIKU_TOP) data system boot first_login ] ;
|
||||||
|
|||||||
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
sshd_config_path=/system/settings/ssh/sshd_config
|
||||||
|
/bin/sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/;' $sshd_config_path
|
||||||
|
/bin/sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/;' $sshd_config_path
|
||||||
|
/bin/sed -i 's/#PermitEmptyPasswords no/PermitEmptyPasswords yes/' $sshd_config_path
|
||||||
|
/bin/passwd -d user
|
||||||
|
/bin/sshd -D & # sshd fails to start on first boot
|
||||||
Reference in New Issue
Block a user