image-builder/utils/uboot.py
alexander stefanov d509a1ba76 add patch.py
2024-11-15 13:12:28 +03:00

27 lines
803 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import subprocess
from utils.common import clone_repo
from utils.patch import apply_uboot_patches
def build_uboot(TMP_DIR, BASE_DIR, config, vendor, device):
uboot_git = config.get("UBOOT")
uboot_branch = config.get("UBOOT_VERSION")
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")
clone_repo(uboot_git, uboot_branch, uboot_dir, "u-boot")
apply_uboot_patches(BASE_DIR, vendor, device, uboot_dir)
#os.chdir(uboot_dir)
#subprocess.run(["make", config["UBOOT_CONFIG"]], check=True)
#subprocess.run(["make", "-j" + NUM_CORES], check=True)