diff --git a/repos/gems/src/app/sculpt_manager/model/usb_storage_device.h b/repos/gems/src/app/sculpt_manager/model/usb_storage_device.h index faf5428cd..a17ba269f 100644 --- a/repos/gems/src/app/sculpt_manager/model/usb_storage_device.h +++ b/repos/gems/src/app/sculpt_manager/model/usb_storage_device.h @@ -147,6 +147,8 @@ struct Sculpt::Usb_storage_device_update_policy Env &_env; Allocator &_alloc; + bool device_added_or_vanished = false; + Signal_context_capability _sigh; Usb_storage_device_update_policy(Env &env, Allocator &alloc, @@ -157,10 +159,17 @@ struct Sculpt::Usb_storage_device_update_policy typedef Usb_storage_device::Label Label; - void destroy_element(Usb_storage_device &elem) { destroy(_alloc, &elem); } + void destroy_element(Usb_storage_device &elem) + { + device_added_or_vanished = true; + + destroy(_alloc, &elem); + } Usb_storage_device &create_element(Xml_node node) { + device_added_or_vanished = true; + return *new (_alloc) Usb_storage_device(_env, _alloc, _sigh, node.attribute_value("label_suffix", Label())); diff --git a/repos/gems/src/app/sculpt_manager/storage.cc b/repos/gems/src/app/sculpt_manager/storage.cc index b5f42ff58..2563cb3f1 100644 --- a/repos/gems/src/app/sculpt_manager/storage.cc +++ b/repos/gems/src/app/sculpt_manager/storage.cc @@ -41,6 +41,9 @@ void Sculpt::Storage::handle_storage_devices_update() _storage_devices.update_usb_storage_devices_from_xml(policy, raw); + if (policy.device_added_or_vanished) + reconfigure_runtime = true; + _storage_devices.usb_storage_devices.for_each([&] (Usb_storage_device &dev) { dev.process_driver_report(); @@ -66,7 +69,12 @@ void Sculpt::Storage::handle_storage_devices_update() * target to use. */ if (_sculpt_partition.valid()) { + bool sculpt_partition_exists = false; + + if (_sculpt_partition.ram_fs()) + sculpt_partition_exists = true; + _storage_devices.for_each([&] (Storage_device const &device) { device.for_each_partition([&] (Partition const &partition) { if (device.label == _sculpt_partition.device