diff --git a/src/raspberrypi/rascsi.cpp b/src/raspberrypi/rascsi.cpp index 1a697643..dfa6d483 100644 --- a/src/raspberrypi/rascsi.cpp +++ b/src/raspberrypi/rascsi.cpp @@ -477,8 +477,8 @@ void LogDeviceList(const string& device_list) set GetAvailableImages() { set available_images; - for (const auto & entry : filesystem::directory_iterator(default_image_folder)) { - available_images.insert(entry.path()); + for (const auto& entry : filesystem::directory_iterator(default_image_folder)) { + available_images.insert(entry.path().filename()); } return available_images; @@ -889,6 +889,13 @@ static void *MonThread(void *param) PbServerInfo serverInfo; serverInfo.set_rascsi_version(rascsi_get_version_string()); serverInfo.set_log_level(spdlog_log_level); + serverInfo.set_default_image_folder(default_image_folder); + set available_images = GetAvailableImages(); + set::iterator it = available_images.begin(); + while (it != available_images.end()) { + serverInfo.add_available_images(*it); + it++; + } SerializeMessage(fd, serverInfo); } else { diff --git a/src/raspberrypi/rasctl.cpp b/src/raspberrypi/rasctl.cpp index 0817ba8d..23451c37 100644 --- a/src/raspberrypi/rasctl.cpp +++ b/src/raspberrypi/rasctl.cpp @@ -179,6 +179,11 @@ void CommandServerInfo(const string& hostname, int port) cout << "rascsi version: " << serverInfo.rascsi_version() << endl; cout << "rascsi log level: " << serverInfo.log_level() << endl; + cout << "Default image folder: " << serverInfo.default_image_folder() << endl; + cout << "Available image files:" << endl; + for (int i = 0; i < serverInfo.available_images_size(); i++) { + cout << " " << serverInfo.available_images(i) << endl; + } } //---------------------------------------------------------------------------