  }
  
  std::string ensure_params_path(const std::string &path = {}) {
    std::string params_path = path.empty() ? Path::params() : path;
    if (!create_params_path(params_path, params_path + "/d")) {
      throw std::runtime_error(util::string_format("Failed to ensure params path, errno=%d", errno));
    }
    return params_path;
  }
  
 
</s> remove std::string ensure_params_path(const std::string &path = {}) {
 </s> add std::string ensure_params_path(const std::string &prefix, const std::string &path = {}) { </s> remove   static std::string default_param_path = ensure_params_path();
  params_path = path.empty() ? default_param_path : ensure_params_path(path);
 </s> add   const char* env = std::getenv("OPENPILOT_PREFIX");
  prefix = env ? "/" + std::string(env) : "/d";
  std::string default_param_path = ensure_params_path(prefix);
  params_path = path.empty() ? default_param_path : ensure_params_path(prefix, path); </s> remove     return key.empty() ? params_path + "/d" : params_path + "/d/" + key;
 </s> add     return params_path + prefix + (key.empty() ? "" : "/" + key);
  if (!create_params_path(params_path, params_path + prefix)) {
  }
  
  std::string ensure_params_path(const std::string &path = {}) {
    std::string params_path = path.empty() ? Path::params() : path;
  if (!create_params_path(params_path, params_path + prefix)) {
      throw std::runtime_error(util::string_format("Failed to ensure params path, errno=%d", errno));
    }
    return params_path;
  }
  
keep keep keep keep replace keep keep keep keep keep
 params: support OPENPILOT_PREFIX (#24495)

* prefix params

* set env

* prefix in manager

* filesystem except

* dont delete manager folder

* Update selfdrive/common/params.h

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* debug same path

* remove cleanup + same default

* dont use filesystem lib

* param symlink path

* path

* spelling

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> 
selfdrive/common/params.cc