diff --git a/build.py b/build.py index 2d18758..4cff4ae 100755 --- a/build.py +++ b/build.py @@ -10,6 +10,7 @@ from utils.make_disk import create_disk_image, setup_loop_device from utils.make_disk import create_partitions, mount_partitions from utils.generate_spec import generate_spec_file from utils.kernel import clone_kernel, make_kernel_tar +from utils.uboot import build_uboot BASE_DIR = os.getcwd() TMP_DIR = os.path.join(BASE_DIR, "tmp") @@ -53,7 +54,7 @@ def main(): print("Skipping kernel build.") if not skip_uboot: - build_uboot(config, vendor, device) + build_uboot(TMP_DIR, config, vendor, device) else: print("Skipping U-Boot build.") diff --git a/device/raspberry/pi4b/config b/device/raspberry/pi4b/config index 2e4ae5a..313d6b1 100644 --- a/device/raspberry/pi4b/config +++ b/device/raspberry/pi4b/config @@ -8,6 +8,9 @@ DTB="broadcom/bcm2711-rpi-4-b" CMDLINE="dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" NEED_INITRD=no +UBOOT="https://github.com/radxa/u-boot.git" +UBOOT_VERSION="next-dev-v2024.03" + # disk section # /boot is vfat partition BOOT_FSTYPE="vfat" diff --git a/utils/uboot.py b/utils/uboot.py index e02131f..f5f20d3 100644 --- a/utils/uboot.py +++ b/utils/uboot.py @@ -1,15 +1,24 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -def build_uboot(config, vendor, device): +import os +import sys +import subprocess +from utils.common import clone_repo + +def build_uboot(TMP_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(config["UBOOT"], config["UBOOT_VERSION"], uboot_dir, "U-Boot") + clone_repo(uboot_git, uboot_branch, uboot_dir, "u-boot") - os.chdir(uboot_dir) - subprocess.run(["make", config["UBOOT_CONFIG"]], check=True) - subprocess.run(["make", "-j" + NUM_CORES], check=True) + + #os.chdir(uboot_dir) + #subprocess.run(["make", config["UBOOT_CONFIG"]], check=True) + #subprocess.run(["make", "-j" + NUM_CORES], check=True)