Skip to content

Commit

Permalink
fix: make start_android.sh script executable
Browse files Browse the repository at this point in the history
  • Loading branch information
Xtr126 committed Aug 12, 2023
1 parent 361e3fd commit 330f8ba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src-tauri/src/qemu_install.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use std::path::Path;
use std::os::unix::fs::OpenOptionsExt;
use std::fs;

#[tauri::command]
pub fn install_qemu(
Expand Down Expand Up @@ -66,7 +68,12 @@ fi
-kernel "{install_dir}/kernel" -append "root=/dev/ram0 quiet SRC=/ DATA=/dev/vdb video={x_res}x{y_res} {console} VIRT_WIFI=1" \
-initrd "{install_dir}/initrd.img"
"#);
std::fs::write(Path::new(&install_dir).join("start_android.sh"), contents).map_err(|err| err.to_string())?;

let script_path = Path::new(&install_dir).join("start_android.sh");
// make file executable
fs::OpenOptions::new().create(true).write(true).mode(0o770)
.open(script_path.clone()).unwrap();
std::fs::write(script_path, contents).map_err(|err| err.to_string())?;
Ok(format!("qemu script written to {install_dir}/start_android.sh
-m {memsize_mb} -smp {cpus} res: {x_res}x{y_res} -display {display_type} use-gl={use_gl} input: {device_type} {input_type} serial_console: {enable_serial_console} e2fsck: {perform_e2fsck} forwardport: {forward_port} {forward_port_no} override_sdl_videodriver: {override_sdl_videodriver} {sdl_videodriver} "))
}

0 comments on commit 330f8ba

Please sign in to comment.