Aktualizr
C++ SOTA Client
bootloader.h
1 #ifndef BOOTLOADER_H_
2 #define BOOTLOADER_H_
3 
4 #include "libaktualizr/config.h"
5 
6 class INvStorage;
7 
8 class Bootloader {
9  public:
10  Bootloader(BootloaderConfig config, INvStorage& storage);
11  void setBootOK() const;
12  void updateNotify() const;
13 
14  // Reboot handling (uses storage)
15  //
16  // Note: will only flag a reboot if it was flagged for detection with
17  // `rebootFlagSet()`.
18  // Also, `rebootDetected()` will continue to return true until the flag
19  // has been cleared, so that users can make sure that appropriate actions
20  // in reaction to the reboot have been processed.
21  bool supportRebootDetection() const;
22  bool rebootDetected() const;
23  void rebootFlagSet();
24  void rebootFlagClear();
25  void reboot(bool fake_reboot = false);
26 
27  private:
28  const BootloaderConfig config_;
29 
30  INvStorage& storage_;
31  boost::filesystem::path reboot_sentinel_;
32  std::string reboot_command_;
33  bool reboot_detect_supported_{false};
34 };
35 
36 #endif // BOOTLOADER_H_
Bootloader
Definition: bootloader.h:8
BootloaderConfig
Definition: config.h:156
INvStorage
Definition: invstorage.h:43