Edd debug tweaks for terminal access

This commit is contained in:
geens 2025-07-07 21:15:45 +02:00
parent 4420a323db
commit a12a49192f
2 changed files with 64 additions and 0 deletions

View File

@ -33,3 +33,6 @@ VIRTUAL-RUNTIME_initscripts = ""
# Add GUI packages to image # Add GUI packages to image
CORE_IMAGE_EXTRA_INSTALL += "gui-app weston liberation-fonts" CORE_IMAGE_EXTRA_INSTALL += "gui-app weston liberation-fonts"
# Needed to enable terminal on tty2
EXTRA_IMAGE_FEATURES += "debug-tweaks"

View File

@ -6,6 +6,7 @@ pub async fn collect() {
collect_dir_output("osc", "../collect_osc.txt").await; collect_dir_output("osc", "../collect_osc.txt").await;
collect_dir_output("simulator", "../collect_simulator.txt").await; collect_dir_output("simulator", "../collect_simulator.txt").await;
collect_dir_output("xtask", "../collect_xtask.txt").await; collect_dir_output("xtask", "../collect_xtask.txt").await;
collect_image_output("./collect_image.txt").await;
} }
pub async fn collect_dir_output(dir: &str, output: &str) { pub async fn collect_dir_output(dir: &str, output: &str) {
@ -22,3 +23,63 @@ pub async fn collect_dir_output(dir: &str, output: &str) {
.await .await
.expect("Failed to collect audio_engine sources"); .expect("Failed to collect audio_engine sources");
} }
pub async fn collect_image_output(output: &str) {
use std::fs;
let mut content = String::new();
content.push_str("File Contents:\n");
// Collect specific files mentioned by user
let files_to_collect = vec![
"image/conf/bblayers.conf",
"image/conf/local.conf",
"image/conf/templateconf.cfg",
"image/docker-compose.yml",
"image/Dockerfile",
"image/implementation_plan.md",
"image/run",
];
for file_path in files_to_collect {
if let Ok(file_content) = fs::read_to_string(file_path) {
content.push_str(&format!("\n===== FILE: {} =====\n", file_path));
content.push_str(&file_content);
}
}
// Collect meta-fcb-looper files
if fs::read_dir("image/meta-layers/meta-fcb-looper").is_ok() {
collect_directory_recursive("image/meta-layers/meta-fcb-looper", &mut content);
}
// Write to output file
if let Err(e) = fs::write(output, content) {
eprintln!("Failed to write output file: {}", e);
} else {
println!("Successfully collected image files to {}", output);
}
}
fn collect_directory_recursive(dir_path: &str, content: &mut String) {
use std::fs;
if let Ok(entries) = fs::read_dir(dir_path) {
for entry in entries.flatten() {
let path = entry.path();
if path.is_file() {
let file_path = path.to_string_lossy();
if file_path.ends_with(".bb") || file_path.ends_with(".bbappend") ||
file_path.ends_with(".conf") || file_path.ends_with(".wks") ||
file_path.ends_with(".service") {
if let Ok(file_content) = fs::read_to_string(&path) {
content.push_str(&format!("\n===== FILE: {} =====\n", file_path));
content.push_str(&file_content);
}
}
} else if path.is_dir() {
collect_directory_recursive(&path.to_string_lossy(), content);
}
}
}
}