mirror of
https://github.com/rosalinux/image-builder.git
synced 2025-02-23 10:22:50 +00:00
adjust uboot.py
This commit is contained in:
parent
a85802905c
commit
220ef9deb8
3 changed files with 19 additions and 6 deletions
3
build.py
3
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.")
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue