MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / InitializeSquashFS

Function InitializeSquashFS

Source/Tools/FEXServer/SquashFS.cpp:230–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230bool InitializeSquashFS() {
231 FEX_CONFIG_OPT(LDPath, ROOTFS);
232
233 MountFolder = LDPath();
234
235 bool IsSquashFS {false};
236 bool IsEroFS {false};
237
238 // Check if the image is an EroFS
239 IsEroFS = FEX::FormatCheck::IsEroFS(MountFolder);
240
241 if (!IsEroFS) {
242 // Check if the image is an SquashFS
243 IsSquashFS = FEX::FormatCheck::IsSquashFS(MountFolder);
244 }
245
246 if (!IsSquashFS && !IsEroFS) {
247 // If this isn't a rootfs image then we have nothing to do here
248 return true;
249 }
250
251 if (!InitializeSquashFSPipe()) {
252 LogMan::Msg::EFmt("[FEXServer] Couldn't initialize SquashFSPipe");
253 return false;
254 }
255
256 // Setup rootfs here
257 if (!MountRootFSImagePath(LDPath(), IsEroFS)) {
258 LogMan::Msg::EFmt("[FEXServer] Couldn't mount squashfs path");
259 return false;
260 }
261
262 if (!DowngradeRootFSPipeToReadLock()) {
263 LogMan::Msg::EFmt("[FEXServer] Couldn't downgrade read lock");
264 return false;
265 }
266
267 return true;
268}
269
270const fextl::string& GetMountFolder() {
271 return MountFolder;

Callers 1

mainFunction · 0.85

Calls 6

IsEroFSFunction · 0.85
IsSquashFSFunction · 0.85
InitializeSquashFSPipeFunction · 0.85
EFmtFunction · 0.85
MountRootFSImagePathFunction · 0.85

Tested by

no test coverage detected