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

Function main

Scripts/InstallFEX.py:343–401  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

341 sys.exit(Status)
342
343def main():
344 # Only run on supported arch
345 if not IsSupportedArch():
346 print ( "{} is not a supported architecture".format(GetArch()))
347 ExitWithStatus(-1)
348
349 if not IsSupportedDistro():
350 Distro = GetDistro()
351 print ( "'{} {}' is not a supported distro".format(Distro[0], Distro[1]))
352 ExitWithStatus(-1)
353
354 if GetDistro()[0] == "ubuntu":
355 print ("Getting PPA status: {}".format(("NotInstalled", "Installed")[GetPPAStatus()]))
356
357 if GetPPAStatus():
358 if not UpdatePPA():
359 print ("apt sources failed to update. Not continuing")
360 ExitWithStatus(-1)
361 if not CheckAndInstallPackageUpdates():
362 print ("apt packages failed to update. Not continuing")
363 ExitWithStatus(-1)
364 else:
365 if not InstallPPA():
366 print ("PPA failed to install. Not continuing")
367 ExitWithStatus(-1)
368
369 Packages = CheckPackageInstallStatus()
370 if len(Packages) > 0:
371 if not InstallPackages(Packages):
372 print ("Failed to install packages. Not continuing")
373 ExitWithStatus(-1)
374
375 if not CheckRootFSInstallStatus():
376 print ("RootFS not found. Running FEXRootFSFetcher to get rootfs")
377 if not TryInstallRootFS():
378 print ("Failed to install RootFS. Not continuing")
379 ExitWithStatus(-1)
380
381 print ("FEX is now installed. Trying basic program run")
382 if not TryBasicProgramExecution():
383 print ("FEXInterpreter failed to run. Not continuing")
384 ExitWithStatus(-1)
385
386 print ("")
387 print ("===================================================")
388 print ("FEX test run executed. You should be set to run FEX")
389 print ("===================================================")
390 print ("Usage examples:")
391 print ("# steam is a bash script. Wrap with FEXBash")
392 print ("\tFEXBash steam")
393 print ("# Full path execution execution will wrap the application if it exists in the rootfs")
394 print ("\tFEXInterpreter /usr/bin/uname")
395 print ("# Freestanding x86/x86-64 programs can be executed directly. binfmt_misc will redirect to FEX")
396 print ("\t$HOME/PetalCrashOnline.AppImage")
397 print ("# If you need a terminal that emulates everything.")
398 print ("# Run FEXBash without arguments. Double check uname to see if running under FEX")
399 print ("\tFEXBash")
400

Callers 1

InstallFEX.pyFile · 0.70

Calls 15

IsSupportedArchFunction · 0.85
printFunction · 0.85
GetArchFunction · 0.85
ExitWithStatusFunction · 0.85
IsSupportedDistroFunction · 0.85
GetDistroFunction · 0.85
GetPPAStatusFunction · 0.85
UpdatePPAFunction · 0.85
InstallPPAFunction · 0.85
InstallPackagesFunction · 0.85

Tested by

no test coverage detected