|
1 |
| -from os import system, listdir, path, getcwd, environ, chdir |
| 1 | +from os import system, listdir, path, getcwd, environ, chdir, remove |
2 | 2 | from sys import path as spath
|
3 | 3 |
|
4 | 4 | spath.append("../scripts/CircuitMPY/")
|
|
16 | 16 | )
|
17 | 17 | exit(1)
|
18 | 18 |
|
| 19 | +low_storage = False |
| 20 | +if board in ["nice_nano"]: |
| 21 | + low_storage = True |
| 22 | + |
| 23 | +target_root = f"{boardpath}/Beryllium" |
| 24 | + |
| 25 | +if low_storage: |
| 26 | + print("Removing manual pages to save space..") |
| 27 | + for i in listdir(f"{target_root}/usr/share/man"): |
| 28 | + remove(f"{target_root}/usr/share/man/{i}") |
| 29 | + |
19 | 30 | olddir = getcwd()
|
20 | 31 | print("[-/-] Strapping core packages..")
|
21 | 32 | chdir("../scripts/jpkgstrap/")
|
22 |
| -target_root = boardpath + "/Beryllium" |
23 | 33 | if target_root.startswith("build"):
|
24 |
| - target_root = "../../source/" + target_root |
| 34 | + target_root = f"../../source/{target_root}" |
25 | 35 | target_root = path.abspath(target_root)
|
26 |
| -cmd = "python3 jpkgstrap.py " + target_root + " -U" |
27 |
| -for i in ["cptoml", "jcurses", "jz", "kernel", "manual"]: |
28 |
| - cmd += " ../../source/core_packages/" + i + ".jpk" |
| 36 | +cmd = f"python3 jpkgstrap.py {target_root} -U" |
| 37 | +core_pkgs = ["cptoml", "jcurses", "jz", "kernel"] |
| 38 | +if not low_storage: |
| 39 | + core_pkgs.append("manual") |
| 40 | +for i in core_pkgs: |
| 41 | + cmd += f" ../../source/core_packages/{i}.jpk" |
29 | 42 | system(cmd)
|
30 | 43 |
|
31 | 44 | chdir(olddir)
|
|
0 commit comments