From f6f43175b93abd81052a9cfae824ed2ea564c1bb Mon Sep 17 00:00:00 2001 From: alexander stefanov Date: Mon, 25 Nov 2024 13:39:42 +0300 Subject: [PATCH] add PRESET_CONFIG copying to kernel-build dir, minor fixes --- build.py | 2 +- device/rockchip/ok3568c/boot.cmd | 2 +- device/rockchip/ok3568c/config | 7 ++++--- utils/generate_spec.py | 9 +++++++++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index 488aaa6..366cac2 100755 --- a/build.py +++ b/build.py @@ -48,9 +48,9 @@ def main(): print(f"Building for {vendor}/{device} with distro {distro}...") if not skip_kernel: - generate_spec_file(TMP_DIR, config, vendor, device) kernel_dir = os.path.join(TMP_DIR, vendor, device, "kernel") clone_kernel(TMP_DIR, BASE_DIR, config, vendor, device, kernel_dir) + generate_spec_file(TMP_DIR, config, vendor, device) kernel_rpm_dir = os.path.join(TMP_DIR, vendor, device, "kernel-build") make_kernel_tar(kernel_dir, kernel_rpm_dir) # Call rpmbuild to build the kernel RPM diff --git a/device/rockchip/ok3568c/boot.cmd b/device/rockchip/ok3568c/boot.cmd index 34b9184..93bbd80 100644 --- a/device/rockchip/ok3568c/boot.cmd +++ b/device/rockchip/ok3568c/boot.cmd @@ -8,8 +8,8 @@ echo "Boot script loaded from ${devtype} ${devnum}:${distro_bootpart}" load ${devtype} ${devnum}:${distro_bootpart} ${ramdisk_addr_r} ${prefix}uInitrd load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${prefix}Image - load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${fdtfile} + fdt addr ${fdt_addr_r} fdt resize 65536 diff --git a/device/rockchip/ok3568c/config b/device/rockchip/ok3568c/config index 26f7dce..6e088ed 100644 --- a/device/rockchip/ok3568c/config +++ b/device/rockchip/ok3568c/config @@ -3,8 +3,8 @@ BOOT_SOC="rk3568" # kernel section KERNEL="https://github.com/armbian/linux-rockchip.git#rk-6.1-rkr3" -KERNEL_CONFIG="kernel_ok3568_defconfig" -DTB="rockchip/rk3568-ok3568c" +PRESET_CONFIG="kernel_ok3568_defconfig" +DTB="dtbs/rockchip/rk3568-ok3568c" # u-boot section UBOOT="https://github.com/radxa/u-boot.git" @@ -12,7 +12,8 @@ UBOOT_VERSION="next-dev-v2024.03" UBOOT_CONFIG="rk3568-ok3568c_defconfig" # cmdline -CMDLINE="earlycon=uart8250,mmio32,0xfeb50000 console=ttyFIQ0 console=tty1 consoleblank=0 irqchip.gicv3_pseudo_nmi=0 switolb=1 coherent_pool=2M cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1" +# root=/dev/mmcblk1p2 rootwait rootfstype=ext4 splash=verbose console=ttyS2,1500000 console=tty1 consoleblank=0 loglevel=1 earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0 cma=256M androidboot.fwver=bl31-v1.44,uboot-rmbian-201-11/11/2024 +CMDLINE="earlycon=uart8250,mmio32,0xfeb50000 console=ttyFIQ0 console=tty1 consoleblank=0" EXTRA_PKGS="uboot-tools dracut" # disk section diff --git a/utils/generate_spec.py b/utils/generate_spec.py index 3086490..62d0aeb 100644 --- a/utils/generate_spec.py +++ b/utils/generate_spec.py @@ -4,6 +4,7 @@ import os import sys import subprocess +import shutil #from common import load_config def get_kernel_version(kernel_dir): @@ -97,6 +98,14 @@ def generate_spec_file(TMP_DIR, config, vendor, device): # Define output directory and path output_dir = os.path.join(TMP_DIR, vendor, device, "kernel-build") os.makedirs(output_dir, exist_ok=True) + # Copy PRESET_CONFIG file if it exists + if preset_config: + preset_config_path = os.path.join("device", vendor, device, preset_config) + if os.path.exists(preset_config_path): + shutil.copy(preset_config_path, output_dir) + print(f"Copied {preset_config} to {output_dir}") + else: + print(f"Warning: PRESET_CONFIG file {preset_config_path} not found.") # Write spec file spec_file_path = os.path.join(output_dir, f"kernel-{device_name}.spec")