-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlaunch.py
More file actions
63 lines (49 loc) · 1.44 KB
/
launch.py
File metadata and controls
63 lines (49 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from System.Preboot import pre, chk
from System.OS.libs import errHandler, base
from System.OS import login
from System.Recovery import recover
from System import install
import time, os, sys
print("Starting up...")
time.sleep(1)
# base.clearScreen()
# print(os.getcwd())
chkFiles = chk.Check()
if chkFiles.checkIntegrity('System/users.json'):
pass # if user coniguration is present, boot into OS
else:
print("Error PxJ001: users.json is missing, booting into installer...")
Install = install.Setup() # if user not present, boot innto installer
prCheck = pre.PreBoot()
'''
Call the PKG_CHECK routine, then
Check system integrity.
Then boot if there are no problems
'''
if (prCheck.checkPkgs('pip', 'tqdm')):
print("Required packages found.")
pass
else:
errHandler.Crash('preBoot', f'PxP001')
input()
print(prCheck.missing)
exit(1)
if (prCheck.CheckOSIntegrity()):
pass
else:
errHandler.Crash('preBoot', 'PBxC001')
recovery = recover.RecoveryMode()
exit(1)
# Check if essential system files exist
files = ['System/users.json', 'System/OS/Shell/main.py']
foundFiles = 0
for File in files:
if chkFiles.checkIntegrity(file=File) == True:
foundFiles += 1
if foundFiles == 2:
print("Required files found. Starting environment...")
login.Login(loginData='System/users.json')
else:
errHandler.Crash('preBoot', 'PBxC001')
recovery = recover.RecoveryMode()
exit(1)