add PRESET_CONFIG copying to kernel-build dir, minor fixes

This commit is contained in:
alexander stefanov 2024-11-25 13:39:42 +03:00
parent 860563dae9
commit f6f43175b9
4 changed files with 15 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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")