From 1fc0d70f658da30091bcd49f9bf29aecd6b99ba7 Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Thu, 6 Jan 2022 13:50:19 -0800 Subject: Update to internal 0.86 Signed-off-by: Jason M. Bills --- ...-mux-setting-before-SOL-activation-via-SS.patch | 43 ++++++++++++++++++++++ .../recipes-core/dropbear/files/enable-ssh.sh | 33 ++++------------- 2 files changed, 51 insertions(+), 25 deletions(-) create mode 100644 meta-openbmc-mods/meta-common/recipes-core/dropbear/files/0001-Enable-UART-mux-setting-before-SOL-activation-via-SS.patch (limited to 'meta-openbmc-mods/meta-common/recipes-core/dropbear/files') diff --git a/meta-openbmc-mods/meta-common/recipes-core/dropbear/files/0001-Enable-UART-mux-setting-before-SOL-activation-via-SS.patch b/meta-openbmc-mods/meta-common/recipes-core/dropbear/files/0001-Enable-UART-mux-setting-before-SOL-activation-via-SS.patch new file mode 100644 index 000000000..22aed3a07 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/dropbear/files/0001-Enable-UART-mux-setting-before-SOL-activation-via-SS.patch @@ -0,0 +1,43 @@ +From 41a43e4b149af0bbfa82ca1b9479dd7dfb2455de Mon Sep 17 00:00:00 2001 +From: Chalapathi Venkataramashetty +Date: Wed, 13 Oct 2021 22:52:34 +0000 +Subject: [PATCH] Enable UART mux setting before SOL activation via SSH + +Switching UART routing when starting obmc-service introduces garbled +character printing out on physical host serial output and it's +inevitable so this commit moves the routing logic into host console +connection flow in SSH SOL to avoid the issue until SOL is actually +activated. + +Tested: SOL activation is working fine via SSH + +Signed-off-by: Chalapathi Venkataramashetty +--- + svr-runopts.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/svr-runopts.c b/svr-runopts.c +index 2c905dd..6fc25e8 100644 +--- a/svr-runopts.c ++++ b/svr-runopts.c +@@ -414,6 +414,17 @@ void svr_getopts(int argc, char ** argv) { + } + + if (svr_opts.forced_command) { ++ if (strcmp(svr_opts.forced_command, "/usr/bin/obmc-console-client") == 0) { ++ FILE *fp; ++ fp = fopen("/sys/bus/platform/drivers/aspeed-uart-routing/" ++ "1e789098.uart-routing/hicra", ++ "w"); ++ if (fp != NULL) { ++ char *uartMuxCtrlVal = "0x03450003"; ++ fprintf(fp, "%s", uartMuxCtrlVal); ++ fclose(fp); ++ } ++ } + dropbear_log(LOG_INFO, "Forced command set to '%s'", svr_opts.forced_command); + } + #if DROPBEAR_PLUGIN +-- +2.17.1 + diff --git a/meta-openbmc-mods/meta-common/recipes-core/dropbear/files/enable-ssh.sh b/meta-openbmc-mods/meta-common/recipes-core/dropbear/files/enable-ssh.sh index 922aa09f5..01ebe098f 100755 --- a/meta-openbmc-mods/meta-common/recipes-core/dropbear/files/enable-ssh.sh +++ b/meta-openbmc-mods/meta-common/recipes-core/dropbear/files/enable-ssh.sh @@ -1,38 +1,21 @@ #!/bin/sh -usage="$(basename "$0") [-h] [-d] -- Enable/Disable ssh for root user +usage="$(basename $0) [-h] [-d] -- Enable/Disable ssh for root user where: -h help -d disable ssh and remove priv-admin permission for root user" enable_ssh() { - if [ -e /etc/systemd/system/dropbear@.service ] && - [ -e /etc/systemd/system/sockets.target.wants/dropbear.socket ]; then - echo "SSH is already enabled" - else - cp /usr/share/misc/dropbear@.service /etc/systemd/system/dropbear@.service - cp /usr/share/misc/dropbear.socket /etc/systemd/system/dropbear.socket - ln -s /etc/systemd/system/dropbear.socket /etc/systemd/system/sockets.target.wants/dropbear.socket - groupmems -g priv-admin -a root - systemctl daemon-reload - systemctl restart dropbear.socket - echo "Enabled SSH service for root user successful" - fi + systemctl enable --now dropbear.socket + groupmems -g priv-admin -a root + echo "Enabled SSH service for root user successful" } disable_ssh() { - if [ -e /etc/systemd/system/dropbear@.service ] && - [ -e /etc/systemd/system/sockets.target.wants/dropbear.socket ]; then - systemctl stop dropbear.socket - systemctl stop dropbear@*.service - rm -rf /etc/systemd/system/sockets.target.wants/dropbear.socket - rm -rf /etc/systemd/system/dropbear.socket - rm -rf /etc/systemd/system/dropbear@.service - groupmems -g priv-admin -d root - echo "SSH disabled" - else - echo "SSH is already disabled" - fi + systemctl disable --now dropbear.socket + systemctl stop dropbear@*.service + groupmems -g priv-admin -d root + echo "Disabled SSH service" } case "$1" in -- cgit v1.2.3