1,在板子加了新内核驱动,可以参考mty教程直接把分散的需要更新的文件patch打进去我们的sdk
2,. envsetup.sh 选择的是buildroot的配置控制生成EXT4,make menuconfig之后会在buildroot/output/target下生成.config文件,make savedefconfig之会把新配置内容覆盖到buildroot\configs对应的配置文件下
3,./build.sh lunch 选择的是内核配置,DTS这些
4,dts文件放在kernel\arch\arm\boot\dts目录下,一般内核驱动放在kernel\drivers\media下。内核驱动的开发需要先在这个目录下做好内核芯片驱动,之后要在buildroot根文件系统中写好上层调用驱动。
5,buildroot的配置文件在device\rockchip\.BoardConfig.mk,内容如下:
#!/bin/bash
# Target arch
export RK_ARCH=arm
# Uboot defconfig
export RK_UBOOT_DEFCONFIG=rv1126
# Uboot image format type: fit(flattened image tree)
export RK_UBOOT_FORMAT_TYPE=fit
# Kernel defconfig
export RK_KERNEL_DEFCONFIG=rv1126_defconfig
# Kernel defconfig fragment
export RK_KERNEL_DEFCONFIG_FRAGMENT=
# Kernel dts
export RK_KERNEL_DTS=rv11xx-owl-ai-box-v10
# boot image type
export RK_BOOT_IMG=zboot.img
# kernel image path
export RK_KERNEL_IMG=kernel/arch/arm/boot/zImage
# kernel image format type: fit(flattened image tree)
export RK_KERNEL_FIT_ITS=boot.its
# parameter for GPT table
export RK_PARAMETER=parameter-buildroot-fit.txt
# Buildroot config
export RK_CFG_BUILDROOT=rockchip_rv1126_rv1109
# Recovery config
export RK_CFG_RECOVERY=rockchip_rv1126_rv1109_recovery
# Recovery image format type: fit(flattened image tree)
export RK_RECOVERY_FIT_ITS=boot4recovery.its
# ramboot config
export RK_CFG_RAMBOOT=
# Pcba config
export RK_CFG_PCBA=
# Build jobs
export RK_JOBS=12
# target chip
export RK_TARGET_PRODUCT=rv1126_rv1109
# Set rootfs type, including ext2 ext4 squashfs
export RK_ROOTFS_TYPE=ext4
# rootfs image path
export RK_ROOTFS_IMG=rockdev/rootfs.${RK_ROOTFS_TYPE}
# Set ramboot image type
export RK_RAMBOOT_TYPE=
# Set oem partition type, including ext2 squashfs
export RK_OEM_FS_TYPE=ext2
# Set userdata partition type, including ext2, fat
export RK_USERDATA_FS_TYPE=ext2
#OEM config
export RK_OEM_DIR=oem_ipc
# OEM build on buildroot
export RK_OEM_BUILDIN_BUILDROOT=YES
#userdata config, if not define this, system will format by RK_USERDATA_FS_TYPE
export RK_USERDATA_DIR=userdata_normal
#misc image
export RK_MISC=wipe_all-misc.img
#choose enable distro module
export RK_DISTRO_MODULE=
# Define pre-build script for this board
export RK_BOARD_PRE_BUILD_SCRIPT=app-build.sh
6,内核驱动的开关文件在kernel/arch/arm/configs,具体是哪个配置文件,在device\rockchip\.BoardConfig.mk文件中的export RK_KERNEL_DEFCONFIG有说明。例如
# CONFIG_USB_GSPCA is not set
CONFIG_V4L_PLATFORM_DRIVERS=y
CONFIG_VIDEO_ROCKCHIP_CIF=y
CONFIG_VIDEO_ROCKCHIP_ISP=y
CONFIG_VIDEO_ROCKCHIP_ISPP=y
# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
CONFIG_VIDEO_LT6911UXC=y
# CONFIG_VIDEO_ADV7181 is not set
7,./build.sh updateimg 命令可以直接从现有的target文件打包处update.img固件,不需要重新编译整个工程,并且在target种加入的自定义内容也不会被覆盖。另外./build.sh rootfs也不会覆盖target中的自定义内容