diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-12-26 23:48:14 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2022-12-26 23:48:35 +0100 |
commit | 5c6587cfb5406a67a434e6c86e22f66a6b1ff7ae (patch) | |
tree | c5f34efe8047f832f568759d9ab46771d937e972 /src | |
parent | ee27a8113d62c1deee572f5bf8ec682061d6b2cd (diff) |
download kernel and cmdline from kernel repo
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 3c6c84e..257c4ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -125,15 +125,17 @@ fn write_boot(partition: &mut StreamSlice<File>) -> anyhow::Result<()> { fatfs::format_volume(&mut *partition, format_opts)?; - let kernel_dir = Path::new("."); - let fs = fatfs::FileSystem::new(partition, fatfs::FsOptions::new())?; let root_dir = fs.root_dir(); let copy = ["vmlinuz", "cmdline.txt"]; for path in copy { let mut file = root_dir.create_file(path)?; - io::copy(&mut File::open(kernel_dir.join(path))?, &mut file)?; + let url = "https://github.com/rustkrazy/kernel/raw/master/".to_owned() + path; + + reqwest::blocking::get(url)? + .error_for_status()? + .copy_to(&mut file)?; } println!("Boot filesystem created successfully"); |