Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Maintenance Menu on boot #317

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on Feb 3, 2020

  1. rename reset-token, add factory maintenance-token

    Because:
    * The initial reset token system stays in place, but is extended to
      serve general maintenance purposes, including factory setup.
    * The factory token is deleted manually or on first setup.
    
    This commit:
    * renames reset-token to maintenance-token
    * adds a Shift factory token (clearly marked and to be deleted)
    Stadicus committed Feb 3, 2020
    Configuration menu
    Copy the full SHA
    4913e2d View commit details
    Browse the repository at this point in the history
  2. add Maintenance menu

    Initial implementation of a "Maintenance Menu" that is displayed
    (without the need to log in) if an authorized maintenance token
    is found on the USB flashdrive.
    
    A maintenance token can be:
    
    * a Shift factory token, its hash added in the initial build and
      removed later (either from the maintenance menu, or on initial
      setup)
    * a user token that is written to the flashdrive as part of the
      Backup process
    
    The maintenancen menu is displayed over HDMI on tty2 and allows:
    
    * creating and applying Bitcoin block snapshots
    * finishing the factory setup by deleting any temporary user files
    * Factory reset...
      * Authentication: user can reset the password from the BitBoxApp
      * Configuration reset: factory defaults are restored
        (Redis database, new SSH and SSL keys...)
      * Disk image reset: user can flash official, signed BitBoxBase
        image from USB flashdrive
    
    This commit:
    * The backup to USB flashdrive also creates a maintenance token.
    * adds /opt/shift/scripts/systemd-startup-maintenance.sh that
      contains the menu structure and calls bbb-cmd.sh
    * extends 'bbb-cmd.sh' with
      * presync create/restore
      * reset auth/config
    * during build, the packages 'console-setup' (for command 'chvt')
      and 'dialog' are no longer removed
    * adds the systemd unit 'startup-maintenance.service'
    * adds dialog configuration as '.dialogrc'
    Stadicus committed Feb 3, 2020
    Configuration menu
    Copy the full SHA
    b0ba38b View commit details
    Browse the repository at this point in the history
  3. give NVMe drive priority over USB

    Because:
    * If a unformatted NVMe is present, but a formatted USB drive is
      connected on first boot, e.g. for factory maintenance, the USB drive
      is added to /etc/fstab
    * It is necessary to give the NVMe ssd always precedence over attached
      USB drives.
    
    This commit:
    * checks if a NVMe drive is present and, if true, no longer checks for
      any USB drives, formatted or not.
    Stadicus committed Feb 3, 2020
    Configuration menu
    Copy the full SHA
    77dbe4a View commit details
    Browse the repository at this point in the history
  4. build: add MAINTENANCEMENU option

    The new maintenance menu needs to be tested in real builds but should
    not yet be enabled in production builds.
    
    By adding this feature, but disabled by default, it can be go into
    a more extensive security review.
    
    This commit:
    * adds the option BASE_MAINTENANCEMENU, default: 'false'
    * `startup-maintenance.service` is only enabled if set to true
    Stadicus committed Feb 3, 2020
    Configuration menu
    Copy the full SHA
    62bbe1f View commit details
    Browse the repository at this point in the history