Skip to content
  • Matt Devillier's avatar
    Encapsulate changes to working directory inside subshells · c2c45dae
    Matt Devillier authored
    
    
    For the handful of operations which need to be done with /boot
    as the pwd, encapsulate them in subshells to ensure the pwd
    doesn't unexpectedly change for other operations, as functions
    which need to mount/unmount /boot may fail if the pwd isn't root.
    
    Also, set the pwd to root at the start of detect_boot_device as an
    added safety measure.
    
    Test: run oem-factory-reset function, ensure it doesn't fail to
    detect boot device due to incorrect working directory.
    
    Signed-off-by: default avatarMatt DeVillier <matt.devillier@puri.sm>
    c2c45dae