| 228 | } |
| 229 | |
| 230 | bool 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 | |
| 270 | const fextl::string& GetMountFolder() { |
| 271 | return MountFolder; |
no test coverage detected