mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-10-30 21:43:21 +00:00 
			
		
		
		
	tools/buildroot: Add support for generating Linux target system images
Integrate buildroot into devlib in order to ease building kernel and root filesystem images via 'generate-kernel-initrd.sh' helper script. As its name suggests, the script builds kernel image which also includes an initial RAM disk per default config files located under configs/<arch>/. Provide config files for buildroot and Linux kernel as well as a post-build.sh script which tweaks (e.g., allowing root login on SSH) target's root filesystem. doc/tools.rst talks about details of kernel and rootfs configuration. Signed-off-by: Metin Kaya <metin.kaya@arm.com>
This commit is contained in:
		
							
								
								
									
										17
									
								
								tools/buildroot/configs/aarch64/arm-power_aarch64_defconfig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								tools/buildroot/configs/aarch64/arm-power_aarch64_defconfig
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | ||||
| BR2_aarch64=y | ||||
| BR2_cortex_a73_a53=y | ||||
| BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y | ||||
| BR2_TARGET_GENERIC_ROOT_PASSWD="root" | ||||
| BR2_SYSTEM_DHCP="eth0" | ||||
| BR2_ROOTFS_POST_BUILD_SCRIPT="board/arm-power/post-build.sh" | ||||
| BR2_LINUX_KERNEL=y | ||||
| BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y | ||||
| BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/arm-power/aarch64/linux.config" | ||||
| BR2_LINUX_KERNEL_XZ=y | ||||
| BR2_PACKAGE_OPENSSH=y | ||||
| # BR2_PACKAGE_OPENSSH_SANDBOX is not set | ||||
| BR2_PACKAGE_UTIL_LINUX=y | ||||
| BR2_PACKAGE_UTIL_LINUX_BINARIES=y | ||||
| BR2_TARGET_ROOTFS_CPIO_XZ=y | ||||
| BR2_TARGET_ROOTFS_INITRAMFS=y | ||||
| # BR2_TARGET_ROOTFS_TAR is not set | ||||
							
								
								
									
										36
									
								
								tools/buildroot/configs/aarch64/linux.config
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								tools/buildroot/configs/aarch64/linux.config
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| CONFIG_SCHED_MC=y | ||||
| CONFIG_UCLAMP_TASK=y | ||||
| CONFIG_SCHED_SMT=y | ||||
| CONFIG_KERNEL_XZ=y | ||||
| CONFIG_SYSVIPC=y | ||||
| CONFIG_IKCONFIG=y | ||||
| CONFIG_IKCONFIG_PROC=y | ||||
| CONFIG_CGROUPS=y | ||||
| CONFIG_BLK_DEV_INITRD=y | ||||
| CONFIG_INITRAMFS_SOURCE="${BR_BINARIES_DIR}/rootfs.cpio" | ||||
| # CONFIG_RD_GZIP is not set | ||||
| # CONFIG_RD_BZIP2 is not set | ||||
| # CONFIG_RD_LZMA is not set | ||||
| # CONFIG_RD_LZO is not set | ||||
| # CONFIG_RD_LZ4 is not set | ||||
| # CONFIG_RD_ZSTD is not set | ||||
| CONFIG_SMP=y | ||||
| # CONFIG_GCC_PLUGINS is not set | ||||
| CONFIG_MODULES=y | ||||
| CONFIG_MODULE_UNLOAD=y | ||||
| CONFIG_NET=y | ||||
| CONFIG_PACKET=y | ||||
| CONFIG_UNIX=y | ||||
| CONFIG_INET=y | ||||
| CONFIG_PCI=y | ||||
| CONFIG_PCI_HOST_GENERIC=y | ||||
| CONFIG_DEVTMPFS=y | ||||
| CONFIG_DEVTMPFS_MOUNT=y | ||||
| CONFIG_NETDEVICES=y | ||||
| CONFIG_VIRTIO_NET=y | ||||
| CONFIG_INPUT_EVDEV=y | ||||
| CONFIG_SERIAL_AMBA_PL011=y | ||||
| CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | ||||
| CONFIG_VIRTIO_CONSOLE=y | ||||
| CONFIG_VIRTIO_PCI=y | ||||
| CONFIG_TMPFS=y | ||||
							
								
								
									
										15
									
								
								tools/buildroot/configs/post-build.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										15
									
								
								tools/buildroot/configs/post-build.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| set -eux | ||||
|  | ||||
| # Enable root login on SSH | ||||
| sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/' "${TARGET_DIR}/etc/ssh/sshd_config" | ||||
|  | ||||
| # Increase the number of available channels so that devlib async code can | ||||
| # exploit concurrency better. | ||||
| sed -i 's/#MaxSessions.*/MaxSessions 100/' "${TARGET_DIR}/etc/ssh/sshd_config" | ||||
| sed -i 's/#MaxStartups.*/MaxStartups 100/' "${TARGET_DIR}/etc/ssh/sshd_config" | ||||
|  | ||||
| # To test Android bindings of ChromeOsTarget | ||||
| mkdir -p "${TARGET_DIR}/opt/google/containers/android" | ||||
|  | ||||
							
								
								
									
										16
									
								
								tools/buildroot/configs/x86_64/arm-power_x86_64_defconfig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								tools/buildroot/configs/x86_64/arm-power_x86_64_defconfig
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| BR2_x86_64=y | ||||
| BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y | ||||
| BR2_TARGET_GENERIC_ROOT_PASSWD="root" | ||||
| BR2_SYSTEM_DHCP="eth0" | ||||
| BR2_ROOTFS_POST_BUILD_SCRIPT="board/arm-power/post-build.sh" | ||||
| BR2_LINUX_KERNEL=y | ||||
| BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y | ||||
| BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/arm-power/x86_64/linux.config" | ||||
| BR2_LINUX_KERNEL_XZ=y | ||||
| BR2_PACKAGE_OPENSSH=y | ||||
| # BR2_PACKAGE_OPENSSH_SANDBOX is not set | ||||
| BR2_PACKAGE_UTIL_LINUX=y | ||||
| BR2_PACKAGE_UTIL_LINUX_BINARIES=y | ||||
| BR2_TARGET_ROOTFS_CPIO_XZ=y | ||||
| BR2_TARGET_ROOTFS_INITRAMFS=y | ||||
| # BR2_TARGET_ROOTFS_TAR is not set | ||||
							
								
								
									
										31
									
								
								tools/buildroot/configs/x86_64/linux.config
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								tools/buildroot/configs/x86_64/linux.config
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| CONFIG_KERNEL_XZ=y | ||||
| CONFIG_SYSVIPC=y | ||||
| CONFIG_IKCONFIG=y | ||||
| CONFIG_IKCONFIG_PROC=y | ||||
| CONFIG_CGROUPS=y | ||||
| CONFIG_BLK_DEV_INITRD=y | ||||
| CONFIG_INITRAMFS_SOURCE="${BR_BINARIES_DIR}/rootfs.cpio" | ||||
| # CONFIG_RD_GZIP is not set | ||||
| # CONFIG_RD_BZIP2 is not set | ||||
| # CONFIG_RD_LZMA is not set | ||||
| # CONFIG_RD_LZO is not set | ||||
| # CONFIG_RD_LZ4 is not set | ||||
| # CONFIG_RD_ZSTD is not set | ||||
| CONFIG_SMP=y | ||||
| # CONFIG_GCC_PLUGINS is not set | ||||
| CONFIG_MODULES=y | ||||
| CONFIG_MODULE_UNLOAD=y | ||||
| CONFIG_NET=y | ||||
| CONFIG_PACKET=y | ||||
| CONFIG_UNIX=y | ||||
| CONFIG_INET=y | ||||
| CONFIG_PCI=y | ||||
| CONFIG_DEVTMPFS=y | ||||
| CONFIG_DEVTMPFS_MOUNT=y | ||||
| CONFIG_NETDEVICES=y | ||||
| CONFIG_VIRTIO_NET=y | ||||
| CONFIG_INPUT_EVDEV=y | ||||
| CONFIG_SERIAL_8250=y | ||||
| CONFIG_SERIAL_8250_CONSOLE=y | ||||
| CONFIG_VIRTIO_PCI=y | ||||
| CONFIG_TMPFS=y | ||||
		Reference in New Issue
	
	Block a user