-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathubuntu22_04.rs
30 lines (24 loc) · 1.01 KB
/
ubuntu22_04.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//! Guest OS adaptations for Ubuntu 22.04 images. These must be prepped with
//! a cloud-init disk that is configured with the appropriate user and password.
use super::{CommandSequence, CommandSequenceEntry, GuestOs};
pub(super) struct Ubuntu2204;
impl GuestOs for Ubuntu2204 {
fn get_login_sequence(&self) -> CommandSequence {
CommandSequence(vec![
CommandSequenceEntry::wait_for("ubuntu login: "),
CommandSequenceEntry::write_str("ubuntu"),
CommandSequenceEntry::wait_for("Password: "),
CommandSequenceEntry::write_str("1!Passw0rd"),
CommandSequenceEntry::wait_for(self.get_shell_prompt()),
])
}
fn get_shell_prompt(&self) -> &'static str {
"ubuntu@ubuntu:~$"
}
fn read_only_fs(&self) -> bool {
false
}
}