1extern crate systemd_boot_conf;
2
3use std::process::exit;
4use systemd_boot_conf::SystemdBootConf;
5
6pub fn main() {
7 let manager = match SystemdBootConf::new("/boot/efi") {
8 Ok(manager) => manager,
9 Err(why) => {
10 eprintln!("failed to get systemd-boot info: {}", why);
11 exit(1);
12 }
13 };
14
15 println!(
16 "loader:\n default: {:?}\n timeout: {:?}",
17 manager.loader_conf.default, manager.loader_conf.timeout
18 );
19
20 for entry in manager.entries {
21 println!(
22 " id: {}\n title: {}\n linux: {}\n initrd: {:?}\n options: {:?}",
23 entry.id, entry.title, entry.linux, entry.initrd, entry.options
24 );
25 }
26}