Subversion Repositories Kolibri OS

Compare Revisions

Ignore whitespace Rev 9372 → Rev 9373

54,10 → 54,13
os.makedirs("workspace", exist_ok = True)
if not os.path.exists("workspace/kolibri.img"):
if not os.path.exists("workspace/kolibri.unmodified.img"):
img_url = ""
download(img_url, "workspace/kolibri.img")
download(img_url, "workspace/kolibri.unmodified.img")
# Create a copy of IMG
shutil.copyfile("workspace/kolibri.unmodified.img", "workspace/kolibri.img")
# Open the IMG
with open("workspace/kolibri.img", "rb") as img:
img_data =
72,10 → 75,23
for file_name in program_files:
with open(file_name, "rb") as file:
file_data =
if not img.add_file_path(file_name, file_data):
if not img.add_file_path(file_name.upper(), file_data):
print(f"Coudn't move {file_name} into IMG")"workspace/kolibri.img")
# TODO: Autorun
# TODO: Figure out which of compiled files is a program executable and only run it
log("Adding program to autorun.dat", end = "")
lines_to_add = b""
for file_name in program_files:
lines_to_add += bytes(f"\r\n/SYS/{file_name.upper()}\t\t""\t0\t# Your program", "ascii")
autorun_dat = img.extract_file_path("SETTINGS\AUTORUN.DAT")
place_for_new_lines = autorun_dat.index(b"\r\n/SYS/@TASKBAR")# b"\r\n### Hello, ASM World! ###")
autorun_dat = autorun_dat[:place_for_new_lines] + lines_to_add + autorun_dat[place_for_new_lines:]
img.add_file_path("SETTINGS\AUTORUN.DAT", autorun_dat)