Skip to content

Commit

Permalink
Merge pull request #15 from arighi/sshd
Browse files Browse the repository at this point in the history
ssh: support virtme.ssh
  • Loading branch information
arighi authored Dec 23, 2024
2 parents fe8484d + da8d1c4 commit 9b1e02a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,16 @@ fn setup_user_session() {
run_user_session(consdev.as_str(), uid);
}

fn run_sshd() {
if let Ok(cmdline) = std::fs::read_to_string("/proc/cmdline") {
if cmdline.contains("virtme.ssh") {
if let Some(guest_tools_dir) = get_guest_tools_dir() {
utils::run_cmd(format!("{}/virtme-sshd-script", guest_tools_dir), &[]);
}
}
}
}

fn run_snapd() {
if let Ok(cmdline) = std::fs::read_to_string("/proc/cmdline") {
if cmdline.contains("virtme.snapd") {
Expand Down Expand Up @@ -1064,6 +1074,7 @@ fn run_misc_services() -> thread::JoinHandle<()> {
mount_virtme_initmounts();
fix_packaging_files();
override_system_files();
run_sshd();
run_snapd();
})
}
Expand Down

0 comments on commit 9b1e02a

Please sign in to comment.