diff --git a/_tools/lib/builds.py b/_tools/lib/builds.py new file mode 100644 index 0000000000..89ba13160b --- /dev/null +++ b/_tools/lib/builds.py @@ -0,0 +1,18 @@ +import os + +from .network import download +from .constants import tools_cache + +def builds_get(path): + url = f"http://builds.kolibrios.org/{path}" + output_path = f"{tools_cache}/builds.kolibrios.org/{path}" + output_dir = os.path.dirname(output_path) + os.makedirs(output_dir, exist_ok = True) + download(url, output_path, skip_exist = True) + return output_path + +def builds_get_contents(path): + output_path = builds_get(path) + with open(output_path, "rb") as f: + return f.read() + diff --git a/_tools/workspace/run.py b/_tools/workspace/run.py index 553252a2b2..cbe1aa4490 100644 --- a/_tools/workspace/run.py +++ b/_tools/workspace/run.py @@ -11,6 +11,7 @@ sys.path.append(path_to_tools) from workspace.build import build +from lib.builds import builds_get_contents from lib.makeflop import Floppy from lib.platform import is_win32, path from lib.logging import log @@ -57,6 +58,11 @@ if __name__ == "__main__": img.delete_path("DEMOS") img.delete_path("3D") + # Insert faster kernel if need + if len(sys.argv) > 1 and sys.argv[1] == "--fast": + new_kernel = builds_get_contents("eng/data/kernel/trunk/kernel.mnt.pretest") + img.add_file_path("KERNEL.MNT", new_kernel) + log("Moving program into kolibri image... ", end = "") with open(program_name, "rb") as file: file_data = file.read()