mirror of
https://github.com/rosalinux/image-builder.git
synced 2025-02-23 18:32:51 +00:00
add PRESET_CONFIG copying to kernel-build dir, minor fixes
This commit is contained in:
parent
860563dae9
commit
f6f43175b9
4 changed files with 15 additions and 5 deletions
2
build.py
2
build.py
|
@ -48,9 +48,9 @@ def main():
|
||||||
print(f"Building for {vendor}/{device} with distro {distro}...")
|
print(f"Building for {vendor}/{device} with distro {distro}...")
|
||||||
|
|
||||||
if not skip_kernel:
|
if not skip_kernel:
|
||||||
generate_spec_file(TMP_DIR, config, vendor, device)
|
|
||||||
kernel_dir = os.path.join(TMP_DIR, vendor, device, "kernel")
|
kernel_dir = os.path.join(TMP_DIR, vendor, device, "kernel")
|
||||||
clone_kernel(TMP_DIR, BASE_DIR, config, vendor, device, kernel_dir)
|
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")
|
kernel_rpm_dir = os.path.join(TMP_DIR, vendor, device, "kernel-build")
|
||||||
make_kernel_tar(kernel_dir, kernel_rpm_dir)
|
make_kernel_tar(kernel_dir, kernel_rpm_dir)
|
||||||
# Call rpmbuild to build the kernel RPM
|
# Call rpmbuild to build the kernel RPM
|
||||||
|
|
|
@ -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} ${ramdisk_addr_r} ${prefix}uInitrd
|
||||||
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${prefix}Image
|
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${prefix}Image
|
||||||
|
|
||||||
load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${fdtfile}
|
load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${fdtfile}
|
||||||
|
|
||||||
fdt addr ${fdt_addr_r}
|
fdt addr ${fdt_addr_r}
|
||||||
fdt resize 65536
|
fdt resize 65536
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ BOOT_SOC="rk3568"
|
||||||
|
|
||||||
# kernel section
|
# kernel section
|
||||||
KERNEL="https://github.com/armbian/linux-rockchip.git#rk-6.1-rkr3"
|
KERNEL="https://github.com/armbian/linux-rockchip.git#rk-6.1-rkr3"
|
||||||
KERNEL_CONFIG="kernel_ok3568_defconfig"
|
PRESET_CONFIG="kernel_ok3568_defconfig"
|
||||||
DTB="rockchip/rk3568-ok3568c"
|
DTB="dtbs/rockchip/rk3568-ok3568c"
|
||||||
|
|
||||||
# u-boot section
|
# u-boot section
|
||||||
UBOOT="https://github.com/radxa/u-boot.git"
|
UBOOT="https://github.com/radxa/u-boot.git"
|
||||||
|
@ -12,7 +12,8 @@ UBOOT_VERSION="next-dev-v2024.03"
|
||||||
UBOOT_CONFIG="rk3568-ok3568c_defconfig"
|
UBOOT_CONFIG="rk3568-ok3568c_defconfig"
|
||||||
|
|
||||||
# cmdline
|
# 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"
|
EXTRA_PKGS="uboot-tools dracut"
|
||||||
|
|
||||||
# disk section
|
# disk section
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import shutil
|
||||||
#from common import load_config
|
#from common import load_config
|
||||||
|
|
||||||
def get_kernel_version(kernel_dir):
|
def get_kernel_version(kernel_dir):
|
||||||
|
@ -97,6 +98,14 @@ def generate_spec_file(TMP_DIR, config, vendor, device):
|
||||||
# Define output directory and path
|
# Define output directory and path
|
||||||
output_dir = os.path.join(TMP_DIR, vendor, device, "kernel-build")
|
output_dir = os.path.join(TMP_DIR, vendor, device, "kernel-build")
|
||||||
os.makedirs(output_dir, exist_ok=True)
|
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
|
# Write spec file
|
||||||
spec_file_path = os.path.join(output_dir, f"kernel-{device_name}.spec")
|
spec_file_path = os.path.join(output_dir, f"kernel-{device_name}.spec")
|
||||||
|
|
Loading…
Add table
Reference in a new issue