Skip to content

Commit b666fbb

Browse files
testing newer pi config path
1 parent f2fd8f2 commit b666fbb

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/sysutil_camera.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,18 @@ bool copy_file_if_exists(const std::string& from, const std::string& to) {
110110
return !ec;
111111
}
112112

113+
std::string select_boot_config_path() {
114+
const std::string primary = "/boot/config.txt";
115+
if (read_file_exists(primary)) {
116+
return primary;
117+
}
118+
const std::string fallback = "/boot/firmware/config.txt";
119+
if (read_file_exists(fallback)) {
120+
return fallback;
121+
}
122+
return primary;
123+
}
124+
113125
bool run_command(const std::string& command) {
114126
int ret = std::system(command.c_str());
115127
if (ret != 0) {
@@ -142,7 +154,7 @@ void apply_rpi_tuning(int cam_id) {
142154

143155
bool update_boot_config(const std::string& dtoverlay_line,
144156
const std::string& cam_line) {
145-
const std::string path = "/boot/config.txt";
157+
const std::string path = select_boot_config_path();
146158
std::ifstream file(path);
147159
if (!file) {
148160
return false;

src/sysutil_firstboot.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ void run_firstboot_tasks() {
102102
}
103103
mount_known_partitions();
104104
sync_settings_from_files();
105+
{
106+
SysutilConfig refreshed;
107+
if (load_sysutil_config(refreshed) == ConfigLoadResult::Loaded) {
108+
config = refreshed;
109+
}
110+
}
105111
if (apply_camera_config_if_needed()) {
106112
needs_reboot = true;
107113
}

0 commit comments

Comments
 (0)