bare-metal-setup: take command to hide/show the bootdrive

- This allows the platform to use CPLD or other mechanism to
control the boot drive.
- The GPIO approach is kept since it is simple.
- It also fails the build if none of the vars are overridden

Tested:
- in BM mode:
```
root@bmc-node:~# systemctl status -l bare-metal-setup.service
○ bare-metal-setup.service - Bare Metal Readiness Setup
     Loaded: loaded (/usr/lib/systemd/system/bare-metal-setup.service; enabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/bare-metal-setup.service.d
             └─bare-metal-setup-override.conf
     Active: inactive (dead) since Mon 2024-06-24 22:42:57 PDT; 2s ago
    Process: 26841 ExecStart=/usr/bin/bare-metal-setup.sh (code=exited, status=0/SUCCESS)
   Main PID: 26841 (code=exited, status=0/SUCCESS)
        CPU: 234ms

Jun 24 22:42:53 bmc-node.prod.google.com systemd[1]: Starting Bare Metal Readiness Setup...
Jun 24 22:42:54 bmc-node.prod.google.com bare-metal-setup.sh[26841]: hiding the boot drive with '/usr/bin/bare_metal_mode_setting.sh hide'
Jun 24 22:42:54 bmc-node.prod.google.com bare-metal-setup.sh[26842]: Configure the bare metal mode setting.
Jun 24 22:42:54 bmc-node.prod.google.com bare-metal-setup.sh[26842]: Hide the bootdrive.
Jun 24 22:42:54 bmc-node.prod.google.com bare-metal-setup.sh[26841]: Successfully set the GPIO to hide cSSD/cnSSD creating /run/bm-ready.flag
Jun 24 22:42:57 bmc-node.prod.google.com systemd[1]: bare-metal-setup.service: Deactivated successfully.
Jun 24 22:42:57 bmc-node.prod.google.com systemd[1]: Finished Bare Metal Readiness Setup.
```
- in non-BM mode
```
root@bmc-node:~# rm /var/google/config-package/enable-bm.flag
root@bmc-node:~# systemctl restart bare-metal-setup.service
root@bmc-node:~# systemctl status -l bare-metal-setup.service
○ bare-metal-setup.service - Bare Metal Readiness Setup
     Loaded: loaded (/usr/lib/systemd/system/bare-metal-setup.service; enabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/bare-metal-setup.service.d
             └─bare-metal-setup-override.conf
     Active: inactive (dead) since Mon 2024-06-24 22:44:27 PDT; 6s ago
    Process: 27658 ExecStart=/usr/bin/bare-metal-setup.sh (code=exited, status=0/SUCCESS)
   Main PID: 27658 (code=exited, status=0/SUCCESS)
        CPU: 167ms

Jun 24 22:44:24 bmc-node.prod.google.com systemd[1]: Starting Bare Metal Readiness Setup...
Jun 24 22:44:27 bmc-node.prod.google.com bare-metal-setup.sh[27658]: Powering on the cSSD/cnSSD as we are not in BM mode - remove /run/bm-ready.flag
Jun 24 22:44:27 bmc-node.prod.google.com bare-metal-setup.sh[27658]: showing the boot drive with '/usr/bin/bare_metal_mode_setting.sh show'
Jun 24 22:44:27 bmc-node.prod.google.com bare-metal-setup.sh[27781]: Configure the bare metal mode setting.
Jun 24 22:44:27 bmc-node.prod.google.com bare-metal-setup.sh[27781]: Show the bootdrive.
Jun 24 22:44:27 bmc-node.prod.google.com systemd[1]: bare-metal-setup.service: Deactivated successfully.
Jun 24 22:44:27 bmc-node.prod.google.com systemd[1]: Finished Bare Metal Readiness Setup.
```

Fusion-Link: fusion2/e5c3ce54-cb5a-35ff-b039-3592c6941189
Fusion-Link: fusion2/0889ae64-e0ed-3ee2-b484-d2a9d7515782
Goolge-Bug-Id: 283220552
Google-Bug-Id: 346888923
Change-Id: Idb2d317ffe5d10e059ae097fcfa2848eb3eb9e21
Signed-off-by: Leo Tu <leotu@google.com>
2 files changed
tree: 60992f45cc225242e4a0f19e43cb9f76bb018fdd
  1. classes/
  2. conf/
  3. dynamic-layers/
  4. recipes-bsp/
  5. recipes-connectivity/
  6. recipes-core/
  7. recipes-devtools/
  8. recipes-extended/
  9. recipes-google/
  10. recipes-kernel/
  11. recipes-phosphor/
  12. recipes-tpm1/
  13. recipes-tpm2/
  14. LICENSE
  15. README.md
README.md

meta-gbmc-staging

This repository contains additions to the openbmc/meta-google layer that are not yet ready for OpenBMC inclusion.

How to use this layer

  1. Clone openbmc/openbmc from GitHub.
  2. Clone this layer from GitHub into a subdirectory of openbmc.