From 23c40af83b314cd883600c607ea3fbd2f5956418 Mon Sep 17 00:00:00 2001 From: weishanshan1084 Date: Mon, 29 Apr 2024 11:46:18 +0800 Subject: [PATCH] support phytium_defconfig Signed-off-by: weishanshan1084 --- .../common/busybox_init_overlay/etc/inittab | 41 +++++++ board/phytium/genimage-5.10.cfg | 52 +++++++++ board/phytium/grub.cfg | 6 + board/phytium/post-image.sh | 5 + configs/phytium_defconfig | 105 ++++++++++++++++++ 5 files changed, 209 insertions(+) create mode 100644 board/phytium/common/busybox_init_overlay/etc/inittab create mode 100644 board/phytium/genimage-5.10.cfg create mode 100644 board/phytium/grub.cfg create mode 100755 board/phytium/post-image.sh create mode 100644 configs/phytium_defconfig diff --git a/board/phytium/common/busybox_init_overlay/etc/inittab b/board/phytium/common/busybox_init_overlay/etc/inittab new file mode 100644 index 00000000..c7f49522 --- /dev/null +++ b/board/phytium/common/busybox_init_overlay/etc/inittab @@ -0,0 +1,41 @@ +# /etc/inittab +# +# Copyright (C) 2001 Erik Andersen +# +# Note: BusyBox init doesn't support runlevels. The runlevels field is +# completely ignored by BusyBox init. If you want runlevels, use +# sysvinit. +# +# Format for each entry: ::: +# +# id == tty to run on, or empty for /dev/console +# runlevels == ignored +# action == one of sysinit, respawn, askfirst, wait, and once +# process == program to run + +# Startup the system +::sysinit:/bin/mount -t proc proc /proc +::sysinit:/bin/mount -o remount,rw / +::sysinit:/bin/mkdir -p /dev/pts /dev/shm +::sysinit:/bin/mount -a +::sysinit:/bin/mkdir -p /run/lock/subsys +::sysinit:/sbin/swapon -a +null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd +null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin +null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout +null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr +::sysinit:/bin/hostname -F /etc/hostname +# now run any rc scripts +::sysinit:/etc/init.d/rcS + +# Put a getty on the serial port +ttyAMA1::respawn:/sbin/getty -L ttyAMA1 115200 vt100 # GENERIC_SERIAL +tty1::respawn:/sbin/getty 38400 tty1 + +# Stuff to do for the 3-finger salute +#::ctrlaltdel:/sbin/reboot + +# Stuff to do before rebooting +::shutdown:/etc/init.d/rcK +::shutdown:/sbin/swapoff -a +::shutdown:/bin/umount -a -r diff --git a/board/phytium/genimage-5.10.cfg b/board/phytium/genimage-5.10.cfg new file mode 100644 index 00000000..a4c2e386 --- /dev/null +++ b/board/phytium/genimage-5.10.cfg @@ -0,0 +1,52 @@ +image efi-part.vfat { + vfat { + file EFI { + image = "efi-part/EFI" + } + file Image { + image = "Image" + } + files = { + "e2000d-chillipi-edu-board.dtb", + "e2000d-demo-board.dtb", + "e2000d-miniitx-board.dtb", + "e2000d-power-board.dtb", + "e2000q-come-board.dtb", + "e2000q-demo-board.dtb", + "e2000q-edu-board.dtb", + "e2000q-hanwei-board.dtb", + "e2000q-miniitx-board.dtb", + "e2000q-vpx-board.dtb", + "e2000s-demo-board.dtb", + "pd1904-devboard-d4-dsk.dtb", + "pd2008-devboard-dsk.dtb", + "pd2308-demo-a.dtb", + "pd2308-demo-b.dtb", + "ps2316-devboard-16c-dsk.dtb", + "phytiumpi_firefly.dtb" + } + + } + + size = 400M +} + +image disk.img { + hdimage { + partition-table-type = "gpt" + } + + partition boot { + image = "efi-part.vfat" + partition-type-uuid = c12a7328-f81f-11d2-ba4b-00a0c93ec93b + offset = 32K + bootable = true + } + + partition root { + partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4 + partition-uuid = "0a52c129-7e0f-43ad-989f-d96b07ccdbb2" + image = "rootfs.ext2" + size = 11G + } +} diff --git a/board/phytium/grub.cfg b/board/phytium/grub.cfg new file mode 100644 index 00000000..482b1f82 --- /dev/null +++ b/board/phytium/grub.cfg @@ -0,0 +1,6 @@ +set default="0" +set timeout="5" + +menuentry "Buildroot" { + linux /Image root=PARTUUID="0a52c129-7e0f-43ad-989f-d96b07ccdbb2" rootwait rw console=ttyAMA0,115200 +} diff --git a/board/phytium/post-image.sh b/board/phytium/post-image.sh new file mode 100755 index 00000000..f0214dc8 --- /dev/null +++ b/board/phytium/post-image.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +BOARD_DIR="$(dirname $0)" + +cp -f ${BOARD_DIR}/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg diff --git a/configs/phytium_defconfig b/configs/phytium_defconfig new file mode 100644 index 00000000..d8a332a0 --- /dev/null +++ b/configs/phytium_defconfig @@ -0,0 +1,105 @@ +# Architecture +BR2_aarch64=y + +# Toolchain +BR2_TOOLCHAIN_EXTERNAL=y + +# Hostname and issue +BR2_TARGET_GENERIC_HOSTNAME="Phytium" +BR2_TARGET_GENERIC_ISSUE="Welcome to Phytium Buildroot" + +# system configuration +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y +BR2_SYSTEM_BIN_SH_BASH=y +BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA1" +BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y +BR2_ROOTFS_OVERLAY="board/phytium/common/busybox_init_overlay" + +# Filesystem +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_TAR_XZ=y +BR2_TARGET_ROOTFS_CPIO=y +BR2_TARGET_ROOTFS_CPIO_GZIP=y +BR2_TARGET_ROOTFS_EXT2_SIZE="2G" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-5.10.cfg" + + +# Bootloader +BR2_TARGET_GRUB2=y + +# required tools to create the microSD image +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_GIT=y +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="ssh://git@gitlab.phytium.com.cn:12022/embedded/linux/linux-kernel.git" +# kernel 5.10 +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="e2f399e2bdf6a22c70ae244c0b2c90395339e165" +BR2_LINUX_KERNEL_DEFCONFIG="phytium" +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y +BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="Image" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/e2000d-chillipi-edu-board phytium/e2000d-demo-board phytium/e2000d-miniitx-board phytium/e2000d-power-board phytium/e2000q-come-board phytium/e2000q-demo-board phytium/e2000q-edu-board phytium/e2000q-hanwei-board phytium/e2000q-miniitx-board phytium/e2000q-vpx-board phytium/e2000s-demo-board phytium/pd1904-devboard-d4-dsk phytium/pd2008-devboard-dsk phytium/pd2308-demo-a phytium/pd2308-demo-b phytium/ps2316-devboard-16c-dsk phytium/phytiumpi_firefly" +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y + +# Target packages +BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y +BR2_PACKAGE_GZIP=y +BR2_PACKAGE_GDB=y +BR2_PACKAGE_NETPERF=y +BR2_PACKAGE_RT_TESTS=y +BR2_PACKAGE_STRACE=y +BR2_PACKAGE_GREP=y +BR2_PACKAGE_CIFS_UTILS=y +BR2_PACKAGE_E2FSPROGS=y +BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y +BR2_PACKAGE_MTD=y +BR2_PACKAGE_I2C_TOOLS=y +BR2_PACKAGE_PCIUTILS=y +BR2_PACKAGE_SYSSTAT=y +BR2_PACKAGE_LIBCURL_CURL=y +BR2_PACKAGE_LIBCURL_VERBOSE=y +BR2_PACKAGE_COLLECTD=y +BR2_PACKAGE_COLLECTD_CURL=y +BR2_PACKAGE_COLLECTD_CURL_JSON=y +BR2_PACKAGE_COLLECTD_CURL_XML=y +BR2_PACKAGE_DHCPCD=y +BR2_PACKAGE_ETHTOOL=y +BR2_PACKAGE_IPERF=y +BR2_PACKAGE_IPERF3=y +BR2_PACKAGE_IPROUTE2=y +BR2_PACKAGE_OPENSSH=y +BR2_PACKAGE_TCPDUMP=y +BR2_PACKAGE_WGET=y +BR2_PACKAGE_WIRELESS_REGDB=y +BR2_PACKAGE_PROCPS_NG=y +BR2_PACKAGE_NANO=y +BR2_PACKAGE_VIM=y +# util-linux +BR2_PACKAGE_UTIL_LINUX=y +BR2_PACKAGE_UTIL_LINUX_BINARIES=y + +# core python3 modules +BR2_PACKAGE_PYTHON3_2TO3=y +BR2_PACKAGE_PYTHON3_BERKELEYDB=y +BR2_PACKAGE_PYTHON3_BZIP2=y +BR2_PACKAGE_PYTHON3_CODECSCJK=y +BR2_PACKAGE_PYTHON3_CURSES=y +BR2_PACKAGE_PYTHON3_DECIMAL=y +BR2_PACKAGE_PYTHON3_OSSAUDIODEV=y +BR2_PACKAGE_PYTHON3_READLINE=y +BR2_PACKAGE_PYTHON3_SSL=y +BR2_PACKAGE_PYTHON3_UNICODEDATA=y +BR2_PACKAGE_PYTHON3_SQLITE=y +BR2_PACKAGE_PYTHON3_PYEXPAT=y +BR2_PACKAGE_PYTHON3_XZ=y +BR2_PACKAGE_PYTHON3_ZLIB=y + +# External python modules +BR2_PACKAGE_PYTHON_PIP=y +BR2_PACKAGE_PYTHON_MAKO=y