Skip to content
This repository was archived by the owner on Jan 12, 2025. It is now read-only.

ssh: support virtme.ssh #15

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading