From f81bf2d724cc3309e2189b6a374a2ca188dddabd Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 29 Nov 2016 21:25:45 -0700 Subject: [PATCH] Activate orbital screen on load --- drivers/vesad/src/scheme.rs | 10 ++++++++-- filesystem/etc/init.rc | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/vesad/src/scheme.rs b/drivers/vesad/src/scheme.rs index a58e7fd..e376bf7 100644 --- a/drivers/vesad/src/scheme.rs +++ b/drivers/vesad/src/scheme.rs @@ -50,9 +50,15 @@ impl SchemeMut for DisplayScheme { Err(Error::new(EACCES)) } } else { - let path_str = str::from_utf8(path).unwrap_or(""); - let id = path_str.parse::().unwrap_or(0); + let path_str = str::from_utf8(path).unwrap_or("").trim_matches('/'); + let mut parts = path_str.split('/'); + let id = parts.next().unwrap_or("").parse::().unwrap_or(0); if self.screens.contains_key(&id) { + for cmd in parts { + if cmd == "activate" { + self.active = id; + } + } Ok(id) } else { Err(Error::new(ENOENT)) diff --git a/filesystem/etc/init.rc b/filesystem/etc/init.rc index 75b2103..f8406fb 100644 --- a/filesystem/etc/init.rc +++ b/filesystem/etc/init.rc @@ -9,4 +9,4 @@ dhcpd -b getty display:2 getty display:3 stdio debug: -/sbin/orbital display:4 /ui/bin/orblogin /ui/bin/launcher +/sbin/orbital display:4/activate /ui/bin/orblogin /ui/bin/launcher