Skip to content

Commit

Permalink
apex: cleanup apex directory bind mount names
Browse files Browse the repository at this point in the history
Change-Id: Ia120ed12f3ae551044907dfd1fd05444be78d18c
  • Loading branch information
bigbiff authored and epicX67 committed Nov 4, 2021
1 parent 79cc790 commit ed8c4de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion twrpApex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ bool twrpApex::loadApexImage(std::string fileToMount, size_t loop_device_number)
close(loop_fd);

std::string bind_mount(APEX_BASE);
bind_mount = bind_mount + basename(fileToMount.c_str());
std::string apex_cleaned_mount = fileToMount;
apex_cleaned_mount = std::regex_replace(apex_cleaned_mount, std::regex("\\.apex"), "");

bind_mount = bind_mount + basename(apex_cleaned_mount.c_str());

int ret = mkdir(bind_mount.c_str(), 0666);
if (ret != 0) {
Expand Down
1 change: 1 addition & 0 deletions twrpApex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <string>
#include <vector>
#include <filesystem>
#include <regex>
#include <sstream>

#include <sys/types.h>
Expand Down

0 comments on commit ed8c4de

Please sign in to comment.