2024-11-15 12:32:19 +03:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2024-11-15 12:44:24 +03:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import subprocess
|
|
|
|
from utils.common import clone_repo
|
2024-11-15 13:12:28 +03:00
|
|
|
from utils.patch import apply_uboot_patches
|
2024-11-15 12:44:24 +03:00
|
|
|
|
2024-11-15 13:12:28 +03:00
|
|
|
|
|
|
|
def build_uboot(TMP_DIR, BASE_DIR, config, vendor, device):
|
2024-11-15 12:44:24 +03:00
|
|
|
uboot_git = config.get("UBOOT")
|
|
|
|
uboot_branch = config.get("UBOOT_VERSION")
|
|
|
|
|
2024-11-15 12:32:19 +03:00
|
|
|
if "UBOOT" not in config or "UBOOT_VERSION" not in config:
|
|
|
|
print("U-Boot configuration not found. Skipping U-Boot build.")
|
|
|
|
return
|
|
|
|
|
|
|
|
uboot_dir = os.path.join(TMP_DIR, vendor, device, "u-boot")
|
2024-11-15 12:44:24 +03:00
|
|
|
clone_repo(uboot_git, uboot_branch, uboot_dir, "u-boot")
|
2024-11-15 13:12:28 +03:00
|
|
|
apply_uboot_patches(BASE_DIR, vendor, device, uboot_dir)
|
2024-11-15 12:44:24 +03:00
|
|
|
|
2024-11-15 12:32:19 +03:00
|
|
|
|
2024-11-15 12:44:24 +03:00
|
|
|
#os.chdir(uboot_dir)
|
|
|
|
#subprocess.run(["make", config["UBOOT_CONFIG"]], check=True)
|
|
|
|
#subprocess.run(["make", "-j" + NUM_CORES], check=True)
|
2024-11-15 12:32:19 +03:00
|
|
|
|