[Ovmsdev] Proposed new config option

Stephen Casner casner at acm.org
Mon Jan 25 08:53:22 HKT 2021


When I'm working with my bench OVMS unit attached with USB and
frequently rebooting, I don't want to have to log in each time.

To avoid this I have patched console_async.cpp to SetSecure(true) in
the constructor.  But I have to be careful to omit that patched file
when committing my changes.  I proposed to add a Kconfig developer
option to control whether that SetSecure(true) statement is included.
Then I can commit this functionality into the code base where it will
normally be excluded but can be included for a developer build
configuration.  This is similar to OVMS_DEV_CONFIGVFS option that
allows read access to the ovms_config file.

My proposed change is attached.  Any objections?

                                                        -- Steve
-------------- next part --------------
diff --git a/vehicle/OVMS.V3/main/Kconfig b/vehicle/OVMS.V3/main/Kconfig
index 85bae8bb..1b16e190 100644
--- a/vehicle/OVMS.V3/main/Kconfig
+++ b/vehicle/OVMS.V3/main/Kconfig
@@ -661,6 +661,13 @@ endmenu # Component Options
 menu "Developer Options"
     depends on OVMS
 
+config OVMS_DEV_SECUREASYNC
+    bool "Initialize async console in enabled mode"
+    default n
+    depends on OVMS
+    help
+        Enable for async console to be automatically logged in (danger: insecure)
+
 config OVMS_DEV_CONFIGVFS
     bool "Disable the usual protections for configuration visibility in VFS"
     default n
diff --git a/vehicle/OVMS.V3/main/console_async.cpp b/vehicle/OVMS.V3/main/console_async.cpp
index 884ddce1..c0e4afeb 100644
--- a/vehicle/OVMS.V3/main/console_async.cpp
+++ b/vehicle/OVMS.V3/main/console_async.cpp
@@ -50,6 +50,9 @@ ConsoleAsync* ConsoleAsync::Instance()
 ConsoleAsync::ConsoleAsync() : TaskBase("OVMS Console", CONFIG_OVMS_SYS_COMMAND_STACK_SIZE)
   {
   m_monitoring = true;
+#ifdef CONFIG_OVMS_DEV_SECUREASYNC
+  SetSecure(true);	// Security Risk - Only for development
+#endif
   uart_config_t uart_config =
     {
     .baud_rate = 115200,


More information about the OvmsDev mailing list