@@ -140,6 +140,7 @@ pub struct Rauc {
140
140
pub reload : Arc < Topic < bool > > ,
141
141
pub should_reboot : Arc < Topic < bool > > ,
142
142
pub enable_polling : Arc < Topic < bool > > ,
143
+ pub enable_auto_install : Arc < Topic < bool > > ,
143
144
}
144
145
145
146
#[ cfg( not( feature = "demo_mode" ) ) ]
@@ -205,15 +206,18 @@ async fn channel_list_update_task(
205
206
conn : Arc < Connection > ,
206
207
reload : Arc < Topic < bool > > ,
207
208
enable_polling : Arc < Topic < bool > > ,
209
+ enable_auto_install : Arc < Topic < bool > > ,
208
210
channels : Arc < Topic < Channels > > ,
209
211
rauc_service : Service ,
210
212
) -> Result < ( ) > {
211
213
let poller = PollerProxy :: new ( & conn) . await . unwrap ( ) ;
212
214
213
215
let ( reload_stream, _) = reload. subscribe_unbounded ( ) ;
214
216
let ( mut enable_polling_stream, _) = enable_polling. subscribe_unbounded ( ) ;
217
+ let ( mut enable_auto_install_stream, _) = enable_auto_install. subscribe_unbounded ( ) ;
215
218
216
219
let mut enable_polling = enable_polling_stream. next ( ) . await . unwrap_or ( false ) ;
220
+ let mut enable_auto_install = enable_auto_install_stream. next ( ) . await . unwrap_or ( false ) ;
217
221
218
222
' reload_loop: loop {
219
223
futures:: select! {
@@ -225,6 +229,9 @@ async fn channel_list_update_task(
225
229
enable_polling_new = enable_polling_stream. recv( ) . fuse( ) => {
226
230
enable_polling = enable_polling_new?;
227
231
}
232
+ enable_auto_install_new = enable_auto_install_stream. recv( ) . fuse( ) => {
233
+ enable_auto_install = enable_auto_install_new?;
234
+ }
228
235
} ;
229
236
230
237
// Read the list of available update channels
@@ -236,7 +243,8 @@ async fn channel_list_update_task(
236
243
}
237
244
} ;
238
245
239
- let should_reload = update_system_conf ( new_channels. primary ( ) , enable_polling) ?;
246
+ let should_reload =
247
+ update_system_conf ( new_channels. primary ( ) , enable_polling, enable_auto_install) ?;
240
248
241
249
channels. set ( new_channels) ;
242
250
@@ -302,6 +310,14 @@ impl Rauc {
302
310
Some ( false ) ,
303
311
1 ,
304
312
) ,
313
+ enable_auto_install : bb. topic (
314
+ "/v1/tac/update/enable_auto_install" ,
315
+ true ,
316
+ true ,
317
+ true ,
318
+ Some ( false ) ,
319
+ 1 ,
320
+ ) ,
305
321
}
306
322
}
307
323
@@ -325,6 +341,7 @@ impl Rauc {
325
341
Arc :: new ( Connection ) ,
326
342
inst. reload . clone ( ) ,
327
343
inst. enable_polling . clone ( ) ,
344
+ inst. enable_auto_install . clone ( ) ,
328
345
inst. channels . clone ( ) ,
329
346
rauc_service,
330
347
) ,
@@ -593,6 +610,7 @@ impl Rauc {
593
610
conn. clone ( ) ,
594
611
inst. reload . clone ( ) ,
595
612
inst. enable_polling . clone ( ) ,
613
+ inst. enable_auto_install . clone ( ) ,
596
614
inst. channels . clone ( ) ,
597
615
rauc_service,
598
616
) ,
0 commit comments