summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0025-Revert-Support-new-boot-override-setting-design.patch
blob: e0664a350e1761b9e2a9604952dbffb4278dc228 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
From c6ed122a09b1e41b9eab0032ff428b8b1a999534 Mon Sep 17 00:00:00 2001
From: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
Date: Wed, 4 Aug 2021 15:50:34 -0700
Subject: [PATCH] Revert "Support new boot override setting design"

This reverts commit c21865c469cfc9dffdc15d87710293115cf6d9e4.

Change-Id: Icfd03551dd9ea2fb216519d8ab05b92521838542
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
---
 redfish-core/lib/systems.hpp | 493 +++++++++++++++++------------------
 1 file changed, 245 insertions(+), 248 deletions(-)

diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index fc6e2c78fd1f..5ad065b3518a 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -769,8 +769,11 @@ inline int assignBootParameters(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
                                 const std::string& rfSource,
                                 std::string& bootSource, std::string& bootMode)
 {
-    bootSource = "xyz.openbmc_project.Control.Boot.Source.Sources.Default";
-    bootMode = "xyz.openbmc_project.Control.Boot.Mode.Modes.Regular";
+    // The caller has initialized the bootSource and bootMode to:
+    // bootMode = "xyz.openbmc_project.Control.Boot.Mode.Modes.Regular";
+    // bootSource = "xyz.openbmc_project.Control.Boot.Source.Sources.Default";
+    // Only modify the bootSource/bootMode variable needed to achieve the
+    // desired boot action.
 
     if (rfSource == "None")
     {
@@ -917,14 +920,45 @@ inline void getBootProgress(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
 }
 
 /**
- * @brief Retrieves boot override type over DBUS and fills out the response
+ * @brief Checks if the current boot override state can be considered as
+ * Disabled
  *
  * @param[in] aResp         Shared pointer for generating response message.
  *
  * @return None.
  */
+inline void
+    checkIfOverrideIsDisabled(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
+{
+    // If the BootSourceOverrideTarget is still "None" at the end,
+    // reset the BootSourceOverrideEnabled to indicate that
+    // overrides are disabled
+    if (aResp->res.jsonValue["Boot"]["BootSourceOverrideTarget"] == "None")
+    {
+        // If the BootSourceOverrideMode is supported we should
+        // check if it is still "UEFI" too
+        if (aResp->res.jsonValue["Boot"].contains("BootSourceOverrideMode"))
+        {
+            if (aResp->res.jsonValue["Boot"]["BootSourceOverrideMode"] !=
+                "UEFI")
+            {
+                return;
+            }
+        }
+        aResp->res.jsonValue["Boot"]["BootSourceOverrideEnabled"] = "Disabled";
+    }
+}
 
-inline void getBootOverrideType(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
+/**
+ * @brief Retrieves boot type over DBUS and fills out the response
+ *
+ * @param[in] aResp         Shared pointer for generating response message.
+ * @param[in] bootDbusObj   The dbus object to query for boot properties.
+ *
+ * @return None.
+ */
+inline void getBootType(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+                        const std::string& bootDbusObj)
 {
     crow::connections::systemBus->async_method_call(
         [aResp](const boost::system::error_code ec,
@@ -932,6 +966,12 @@ inline void getBootOverrideType(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
             if (ec)
             {
                 // not an error, don't have to have the interface
+
+                // Support Disabled override state in a way:
+                // "BootSourceOverrideEnabled=Disabled" =
+                // "BootSourceOverrideMode=UEFI" +
+                // "BootSourceOverrideTarget=None"
+                checkIfOverrideIsDisabled(aResp);
                 return;
             }
 
@@ -958,26 +998,31 @@ inline void getBootOverrideType(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
             }
 
             aResp->res.jsonValue["Boot"]["BootSourceOverrideMode"] = rfType;
+
+            // Support Disabled override state in a way:
+            // "BootSourceOverrideEnabled=Disabled" =
+            // "BootSourceOverrideMode=UEFI" + "BootSourceOverrideTarget=None"
+            checkIfOverrideIsDisabled(aResp);
         },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/control/host0/boot",
+        "xyz.openbmc_project.Settings", bootDbusObj,
         "org.freedesktop.DBus.Properties", "Get",
         "xyz.openbmc_project.Control.Boot.Type", "BootType");
 }
 
 /**
- * @brief Retrieves boot override mode over DBUS and fills out the response
+ * @brief Retrieves boot mode over DBUS and fills out the response
  *
  * @param[in] aResp         Shared pointer for generating response message.
+ * @param[in] bootDbusObj   The dbus object to query for boot properties.
  *
  * @return None.
  */
-
-inline void getBootOverrideMode(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
+inline void getBootMode(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+                        const std::string& bootDbusObj)
 {
     crow::connections::systemBus->async_method_call(
-        [aResp](const boost::system::error_code ec,
-                const std::variant<std::string>& bootMode) {
+        [aResp, bootDbusObj](const boost::system::error_code ec,
+                             const std::variant<std::string>& bootMode) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
@@ -1010,27 +1055,39 @@ inline void getBootOverrideMode(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
                         rfMode;
                 }
             }
+
+            // Get BootType inside this async call as we need all of the
+            // BootSource/BootMode/BootType to support
+            // "BootSourceOverrideEnabled"="Disabled" state.
+            getBootType(aResp, bootDbusObj);
         },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/control/host0/boot",
+        "xyz.openbmc_project.Settings", bootDbusObj,
         "org.freedesktop.DBus.Properties", "Get",
         "xyz.openbmc_project.Control.Boot.Mode", "BootMode");
 }
 
 /**
- * @brief Retrieves boot override source over DBUS
+ * @brief Retrieves boot source over DBUS
  *
  * @param[in] aResp         Shared pointer for generating response message.
+ * @param[in] oneTimeEnable Boolean to indicate boot properties are one-time.
  *
  * @return None.
  */
-
-inline void
-    getBootOverrideSource(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
+inline void getBootSource(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+                          bool oneTimeEnabled)
 {
+    std::string bootDbusObj =
+        oneTimeEnabled ? "/xyz/openbmc_project/control/host0/boot/one_time"
+                       : "/xyz/openbmc_project/control/host0/boot";
+
+    BMCWEB_LOG_DEBUG << "Is one time: " << oneTimeEnabled;
+    aResp->res.jsonValue["Boot"]["BootSourceOverrideEnabled"] =
+        (oneTimeEnabled) ? "Once" : "Continuous";
+
     crow::connections::systemBus->async_method_call(
-        [aResp](const boost::system::error_code ec,
-                const std::variant<std::string>& bootSource) {
+        [aResp, bootDbusObj](const boost::system::error_code ec,
+                             const std::variant<std::string>& bootSource) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
@@ -1057,43 +1114,32 @@ inline void
 
             // Get BootMode as BootSourceOverrideTarget is constructed
             // from both BootSource and BootMode
-            getBootOverrideMode(aResp);
+            getBootMode(aResp, bootDbusObj);
         },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/control/host0/boot",
+        "xyz.openbmc_project.Settings", bootDbusObj,
         "org.freedesktop.DBus.Properties", "Get",
         "xyz.openbmc_project.Control.Boot.Source", "BootSource");
 }
 
 /**
- * @brief This functions abstracts all the logic behind getting a
- * "BootSourceOverrideEnabled" property from an overall boot override enable
- * state
+ * @brief Retrieves "One time" enabled setting over DBUS and calls function to
+ * get boot source and boot mode.
  *
  * @param[in] aResp     Shared pointer for generating response message.
  *
  * @return None.
  */
-
-inline void
-    processBootOverrideEnable(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                              const bool bootOverrideEnableSetting)
+inline void getBootProperties(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
 {
-    if (!bootOverrideEnableSetting)
-    {
-        aResp->res.jsonValue["Boot"]["BootSourceOverrideEnabled"] = "Disabled";
-        return;
-    }
+    BMCWEB_LOG_DEBUG << "Get boot information.";
 
-    // If boot source override is enabled, we need to check 'one_time'
-    // property to set a correct value for the "BootSourceOverrideEnabled"
     crow::connections::systemBus->async_method_call(
         [aResp](const boost::system::error_code ec,
                 const std::variant<bool>& oneTime) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
-                messages::internalError(aResp->res);
+                // not an error, don't have to have the interface
                 return;
             }
 
@@ -1104,19 +1150,7 @@ inline void
                 messages::internalError(aResp->res);
                 return;
             }
-
-            bool oneTimeSetting = *oneTimePtr;
-
-            if (oneTimeSetting)
-            {
-                aResp->res.jsonValue["Boot"]["BootSourceOverrideEnabled"] =
-                    "Once";
-            }
-            else
-            {
-                aResp->res.jsonValue["Boot"]["BootSourceOverrideEnabled"] =
-                    "Continuous";
-            }
+            getBootSource(aResp, *oneTimePtr);
         },
         "xyz.openbmc_project.Settings",
         "/xyz/openbmc_project/control/host0/boot/one_time",
@@ -1124,60 +1158,6 @@ inline void
         "xyz.openbmc_project.Object.Enable", "Enabled");
 }
 
-/**
- * @brief Retrieves boot override enable over DBUS
- *
- * @param[in] aResp     Shared pointer for generating response message.
- *
- * @return None.
- */
-
-inline void
-    getBootOverrideEnable(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
-{
-    crow::connections::systemBus->async_method_call(
-        [aResp](const boost::system::error_code ec,
-                const std::variant<bool>& bootOverrideEnable) {
-            if (ec)
-            {
-                BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
-                messages::internalError(aResp->res);
-                return;
-            }
-
-            const bool* bootOverrideEnablePtr =
-                std::get_if<bool>(&bootOverrideEnable);
-
-            if (!bootOverrideEnablePtr)
-            {
-                messages::internalError(aResp->res);
-                return;
-            }
-
-            processBootOverrideEnable(aResp, *bootOverrideEnablePtr);
-        },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/control/host0/boot",
-        "org.freedesktop.DBus.Properties", "Get",
-        "xyz.openbmc_project.Object.Enable", "Enabled");
-}
-
-/**
- * @brief Retrieves boot source override properties
- *
- * @param[in] aResp     Shared pointer for generating response message.
- *
- * @return None.
- */
-inline void getBootProperties(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
-{
-    BMCWEB_LOG_DEBUG << "Get boot information.";
-
-    getBootOverrideSource(aResp);
-    getBootOverrideType(aResp);
-    getBootOverrideEnable(aResp);
-}
-
 /**
  * @brief Retrieves the Last Reset Time
  *
@@ -1479,47 +1459,59 @@ inline void getTrustedModuleRequiredToBoot(
  * @brief Sets boot properties into DBUS object(s).
  *
  * @param[in] aResp           Shared pointer for generating response message.
+ * @param[in] overrideEnabled The source override "enable".
+ * @param[in] bootObj         Path to the DBUS object.
  * @param[in] bootType        The boot type to set.
  * @return Integer error code.
  */
 inline void setBootType(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+                        const bool overrideEnabled, const std::string& bootObj,
                         const std::optional<std::string>& bootType)
 {
-    std::string bootTypeStr;
-
-    if (!bootType)
-    {
-        return;
-    }
+    std::string bootTypeStr = "xyz.openbmc_project.Control.Boot.Type.Types.EFI";
 
-    // Source target specified
-    BMCWEB_LOG_DEBUG << "Boot type: " << *bootType;
-    // Figure out which DBUS interface and property to use
-    if (*bootType == "Legacy")
-    {
-        bootTypeStr = "xyz.openbmc_project.Control.Boot.Type.Types.Legacy";
-    }
-    else if (*bootType == "UEFI")
+    if (bootType && overrideEnabled)
     {
-        bootTypeStr = "xyz.openbmc_project.Control.Boot.Type.Types.EFI";
-    }
-    else
-    {
-        BMCWEB_LOG_DEBUG << "Invalid property value for "
-                            "BootSourceOverrideMode: "
-                         << *bootType;
-        messages::propertyValueNotInList(aResp->res, *bootType,
-                                         "BootSourceOverrideMode");
-        return;
+        // Source target specified
+        BMCWEB_LOG_DEBUG << "Boot type: " << *bootType;
+        // Figure out which DBUS interface and property to use
+        if (*bootType == "Legacy")
+        {
+            bootTypeStr = "xyz.openbmc_project.Control.Boot.Type.Types.Legacy";
+        }
+        else if (*bootType == "UEFI")
+        {
+            bootTypeStr = "xyz.openbmc_project.Control.Boot.Type.Types.EFI";
+        }
+        else
+        {
+            BMCWEB_LOG_DEBUG << "Invalid property value for "
+                                "BootSourceOverrideMode: "
+                             << *bootType;
+            messages::propertyValueNotInList(aResp->res, *bootType,
+                                             "BootSourceOverrideMode");
+            return;
+        }
     }
 
     // Act on validated parameters
     BMCWEB_LOG_DEBUG << "DBUS boot type: " << bootTypeStr;
 
     crow::connections::systemBus->async_method_call(
-        [aResp](const boost::system::error_code ec) {
+        [aResp, bootType](const boost::system::error_code ec) {
             if (ec)
             {
+                if (!bootType)
+                {
+                    // If bootType wasn't explicitly present in the incoming
+                    // message don't output error. The error could come from a
+                    // fact that the BootType interface may be not present in
+                    // the settings object. It could happen because this
+                    // interface is not relevant for some Host architectures
+                    // (for example POWER).
+                    return;
+                }
+
                 BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
                 if (ec.value() == boost::asio::error::host_unreachable)
                 {
@@ -1531,8 +1523,7 @@ inline void setBootType(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
             }
             BMCWEB_LOG_DEBUG << "Boot type update done.";
         },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/control/host0/boot",
+        "xyz.openbmc_project.Settings", bootObj,
         "org.freedesktop.DBus.Properties", "Set",
         "xyz.openbmc_project.Control.Boot.Type", "BootType",
         std::variant<std::string>(bootTypeStr));
@@ -1542,48 +1533,42 @@ inline void setBootType(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
  * @brief Sets boot properties into DBUS object(s).
  *
  * @param[in] aResp           Shared pointer for generating response message.
- * @param[in] bootType        The boot type to set.
+ * @param[in] overrideEnabled The source override "enable".
+ * @param[in] bootObj         Path to the DBUS object.
+ * @param[in] bootSource      The boot source to set.
+ *
  * @return Integer error code.
  */
-inline void setBootEnable(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                          const std::optional<std::string>& bootEnable)
+inline void setBootModeOrSource(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+                                const bool overrideEnabled,
+                                const std::string& bootObj,
+                                const std::optional<std::string>& bootSource)
 {
-    if (!bootEnable)
-    {
-        return;
-    }
-    // Source target specified
-    BMCWEB_LOG_DEBUG << "Boot enable: " << *bootEnable;
+    std::string bootSourceStr =
+        "xyz.openbmc_project.Control.Boot.Source.Sources.Default";
+    std::string bootModeStr =
+        "xyz.openbmc_project.Control.Boot.Mode.Modes.Regular";
 
-    bool bootOverrideEnable = false;
-    bool bootOverridePersistent = false;
-    // Figure out which DBUS interface and property to use
-    if (*bootEnable == "Disabled")
-    {
-        bootOverrideEnable = false;
-    }
-    else if (*bootEnable == "Once")
-    {
-        bootOverrideEnable = true;
-        bootOverridePersistent = false;
-    }
-    else if (*bootEnable == "Continuous")
+    if (bootSource && overrideEnabled)
     {
-        bootOverrideEnable = true;
-        bootOverridePersistent = true;
-    }
-    else
-    {
-        BMCWEB_LOG_DEBUG << "Invalid property value for "
-                            "BootSourceOverrideEnabled: "
-                         << *bootEnable;
-        messages::propertyValueNotInList(aResp->res, *bootEnable,
-                                         "BootSourceOverrideEnabled");
-        return;
+        // Source target specified
+        BMCWEB_LOG_DEBUG << "Boot source: " << *bootSource;
+        // Figure out which DBUS interface and property to use
+        if (assignBootParameters(aResp, *bootSource, bootSourceStr,
+                                 bootModeStr))
+        {
+            BMCWEB_LOG_DEBUG
+                << "Invalid property value for BootSourceOverrideTarget: "
+                << *bootSource;
+            messages::propertyValueNotInList(aResp->res, *bootSource,
+                                             "BootSourceTargetOverride");
+            return;
+        }
     }
 
     // Act on validated parameters
-    BMCWEB_LOG_DEBUG << "DBUS boot override enable: " << bootOverrideEnable;
+    BMCWEB_LOG_DEBUG << "DBUS boot source: " << bootSourceStr;
+    BMCWEB_LOG_DEBUG << "DBUS boot mode: " << bootModeStr;
 
     crow::connections::systemBus->async_method_call(
         [aResp](const boost::system::error_code ec) {
@@ -1593,23 +1578,12 @@ inline void setBootEnable(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
                 messages::internalError(aResp->res);
                 return;
             }
-            BMCWEB_LOG_DEBUG << "Boot override enable update done.";
+            BMCWEB_LOG_DEBUG << "Boot source update done.";
         },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/control/host0/boot",
+        "xyz.openbmc_project.Settings", bootObj,
         "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Object.Enable", "Enabled",
-        std::variant<bool>(bootOverrideEnable));
-
-    if (!bootOverrideEnable)
-    {
-        return;
-    }
-
-    // In case boot override is enabled we need to set correct value for the
-    // 'one_time' enable DBus interface
-    BMCWEB_LOG_DEBUG << "DBUS boot override persistent: "
-                     << bootOverridePersistent;
+        "xyz.openbmc_project.Control.Boot.Source", "BootSource",
+        std::variant<std::string>(bootSourceStr));
 
     crow::connections::systemBus->async_method_call(
         [aResp](const boost::system::error_code ec) {
@@ -1619,86 +1593,45 @@ inline void setBootEnable(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
                 messages::internalError(aResp->res);
                 return;
             }
-            BMCWEB_LOG_DEBUG << "Boot one_time update done.";
+            BMCWEB_LOG_DEBUG << "Boot mode update done.";
         },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/control/host0/boot/one_time",
+        "xyz.openbmc_project.Settings", bootObj,
         "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Object.Enable", "Enabled",
-        std::variant<bool>(!bootOverridePersistent));
+        "xyz.openbmc_project.Control.Boot.Mode", "BootMode",
+        std::variant<std::string>(bootModeStr));
 }
 
 /**
- * @brief Sets boot properties into DBUS object(s).
+ * @brief Sets "One time" enabled setting into DBUS object
  *
- * @param[in] aResp           Shared pointer for generating response message.
- * @param[in] bootSource      The boot source to set.
+ * @param[in] aResp      Shared pointer for generating response message.
+ * @param[in] oneTime    Enable property for one-time object
  *
  * @return Integer error code.
  */
-inline void setBootModeOrSource(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                                const std::optional<std::string>& bootSource)
+inline void setOneTime(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+                       bool oneTime)
 {
-    std::string bootSourceStr;
-    std::string bootModeStr;
-
-    if (!bootSource)
-    {
-        return;
-    }
-
-    // Source target specified
-    BMCWEB_LOG_DEBUG << "Boot source: " << *bootSource;
-    // Figure out which DBUS interface and property to use
-    if (assignBootParameters(aResp, *bootSource, bootSourceStr, bootModeStr))
-    {
-        BMCWEB_LOG_DEBUG
-            << "Invalid property value for BootSourceOverrideTarget: "
-            << *bootSource;
-        messages::propertyValueNotInList(aResp->res, *bootSource,
-                                         "BootSourceTargetOverride");
-        return;
-    }
-
-    // Act on validated parameters
-    BMCWEB_LOG_DEBUG << "DBUS boot source: " << bootSourceStr;
-    BMCWEB_LOG_DEBUG << "DBUS boot mode: " << bootModeStr;
-
     crow::connections::systemBus->async_method_call(
-        [aResp](const boost::system::error_code ec) {
+        [aResp{aResp}](const boost::system::error_code ec) {
             if (ec)
             {
                 BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
                 messages::internalError(aResp->res);
                 return;
             }
-            BMCWEB_LOG_DEBUG << "Boot source update done.";
+            BMCWEB_LOG_DEBUG << "Boot enable update done.";
         },
         "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/control/host0/boot",
-        "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Control.Boot.Source", "BootSource",
-        std::variant<std::string>(bootSourceStr));
-
-    crow::connections::systemBus->async_method_call(
-        [aResp](const boost::system::error_code ec) {
-            if (ec)
-            {
-                BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
-                messages::internalError(aResp->res);
-                return;
-            }
-            BMCWEB_LOG_DEBUG << "Boot mode update done.";
-        },
-        "xyz.openbmc_project.Settings",
-        "/xyz/openbmc_project/control/host0/boot",
+        "/xyz/openbmc_project/control/host0/boot/one_time",
         "org.freedesktop.DBus.Properties", "Set",
-        "xyz.openbmc_project.Control.Boot.Mode", "BootMode",
-        std::variant<std::string>(bootModeStr));
+        "xyz.openbmc_project.Object.Enable", "Enabled",
+        std::variant<bool>(oneTime));
 }
 
 /**
- * @brief Sets Boot source override properties.
+ * @brief Retrieves "One time" enabled setting over DBUS and calls function to
+ * set boot source/boot mode properties.
  *
  * @param[in] aResp      Shared pointer for generating response message.
  * @param[in] bootSource The boot source from incoming RF request.
@@ -1707,17 +1640,81 @@ inline void setBootModeOrSource(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
  *
  * @return Integer error code.
  */
-
-inline void setBootProperties(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
-                              const std::optional<std::string>& bootSource,
-                              const std::optional<std::string>& bootType,
-                              const std::optional<std::string>& bootEnable)
+inline void
+    setBootSourceProperties(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+                            std::optional<std::string> bootSource,
+                            std::optional<std::string> bootType,
+                            std::optional<std::string> bootEnable)
 {
     BMCWEB_LOG_DEBUG << "Set boot information.";
 
-    setBootModeOrSource(aResp, bootSource);
-    setBootType(aResp, bootType);
-    setBootEnable(aResp, bootEnable);
+    crow::connections::systemBus->async_method_call(
+        [aResp, bootSource{std::move(bootSource)},
+         bootType{std::move(bootType)},
+         bootEnable{std::move(bootEnable)}](const boost::system::error_code ec,
+                                            const std::variant<bool>& oneTime) {
+            if (ec)
+            {
+                BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+                messages::internalError(aResp->res);
+                return;
+            }
+
+            const bool* oneTimePtr = std::get_if<bool>(&oneTime);
+
+            if (!oneTimePtr)
+            {
+                messages::internalError(aResp->res);
+                return;
+            }
+
+            BMCWEB_LOG_DEBUG << "Got one time: " << *oneTimePtr;
+
+            bool oneTimeSetting = *oneTimePtr;
+            bool overrideEnabled = true;
+
+            // Validate incoming parameters
+            if (bootEnable)
+            {
+                if (*bootEnable == "Once")
+                {
+                    oneTimeSetting = true;
+                }
+                else if (*bootEnable == "Continuous")
+                {
+                    oneTimeSetting = false;
+                }
+                else if (*bootEnable == "Disabled")
+                {
+                    BMCWEB_LOG_DEBUG << "Boot source override will be disabled";
+                    oneTimeSetting = false;
+                    overrideEnabled = false;
+                }
+                else
+                {
+                    BMCWEB_LOG_DEBUG << "Unsupported value for "
+                                        "BootSourceOverrideEnabled: "
+                                     << *bootEnable;
+                    messages::propertyValueNotInList(
+                        aResp->res, *bootEnable, "BootSourceOverrideEnabled");
+                    return;
+                }
+            }
+
+            std::string bootObj = "/xyz/openbmc_project/control/host0/boot";
+            if (oneTimeSetting)
+            {
+                bootObj += "/one_time";
+            }
+
+            setBootModeOrSource(aResp, overrideEnabled, bootObj, bootSource);
+            setBootType(aResp, overrideEnabled, bootObj, bootType);
+            setOneTime(aResp, oneTimeSetting);
+        },
+        "xyz.openbmc_project.Settings",
+        "/xyz/openbmc_project/control/host0/boot/one_time",
+        "org.freedesktop.DBus.Properties", "Get",
+        "xyz.openbmc_project.Object.Enable", "Enabled");
 }
 
 /**
@@ -2806,11 +2803,11 @@ inline void requestRoutesSystems(App& app)
                     {
                         return;
                     }
-
                     if (bootSource || bootType || bootEnable)
                     {
-                        setBootProperties(asyncResp, bootSource, bootType,
-                                          bootEnable);
+                        setBootSourceProperties(
+                            asyncResp, std::move(bootSource),
+                            std::move(bootType), std::move(bootEnable));
                     }
                     if (automaticRetryConfig)
                     {
-- 
2.17.1