guochunrong2020
1 year ago
committed by
Gitee
30 changed files with 455 additions and 39 deletions
@ -0,0 +1,24 @@ |
|||
image sdcard.img { |
|||
hdimage { |
|||
} |
|||
|
|||
partition uboot { |
|||
in-partition-table = no |
|||
offset = 0 |
|||
image = "fip-all.bin" |
|||
size = 3M |
|||
} |
|||
partition bootload { |
|||
in-partition-table = no |
|||
offset = 4M |
|||
image = "fitImage" |
|||
size = 60M |
|||
} |
|||
|
|||
partition root { |
|||
partition-type = 0x83 |
|||
image = "rootfs.ext2" |
|||
size = 16G |
|||
} |
|||
|
|||
} |
@ -0,0 +1,70 @@ |
|||
# Architecture |
|||
BR2_aarch64=y |
|||
BR2_cortex_a53=y |
|||
|
|||
# Filesystem |
|||
BR2_TARGET_ROOTFS_EXT2=y |
|||
BR2_TARGET_ROOTFS_EXT2_4=y |
|||
BR2_TARGET_ROOTFS_EXT2_SIZE="5G" |
|||
BR2_ROOTFS_CHOWN=y |
|||
|
|||
# custom skeleton |
|||
BR2_ROOTFS_SKELETON_UBUNTU=y |
|||
BR2_ROOTFS_SKELETON_CUSTOM=y |
|||
BR2_ROOTFS_SKELETON_CUSTOM_SITE="http://cdimage.ubuntu.com/ubuntu-base/releases/20.04.4/release" |
|||
BR2_ROOTFS_SKELETON_CUSTOM_SOURCE="ubuntu-base-20.04.1-base-arm64.tar.gz" |
|||
BR2_ROOTFS_SKELETON_CUSTOM_SITE_METHOD="wget" |
|||
BR2_ROOTFS_SKELETON_CUSTOM_EXTRACT="tar zxvf" |
|||
BR2_ROOTFS_SKELETON_CUSTOM_EXTRACT_IGNORE_ERROR=y |
|||
BR2_ROOTFS_POST_BUILD_SCRIPT="board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh" |
|||
BR2_INIT_NONE=y |
|||
|
|||
# Hostname and issue |
|||
BR2_TARGET_GENERIC_HOSTNAME="D2000" |
|||
BR2_TARGET_GENERIC_ISSUE="Welcome to Phytium Buildroot" |
|||
|
|||
# toolchain |
|||
BR2_TOOLCHAIN_EXTERNAL=y |
|||
BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64=y |
|||
BR2_TOOLCHAIN_USES_GLIBC=y |
|||
BR2_TOOLCHAIN_EXTERNAL_GLIBC=y |
|||
|
|||
# Linux headers same as kernel |
|||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y |
|||
|
|||
# Kernel |
|||
BR2_LINUX_KERNEL=y |
|||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y |
|||
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y |
|||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="file://$(TOPDIR)/files/linux-4.19.tar.gz" |
|||
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm64/configs/sdk.config" |
|||
BR2_LINUX_KERNEL_DTS_SUPPORT=y |
|||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/d2000-devboard-dsk phytium/ft2004-devboard-d4-dsk" |
|||
BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y |
|||
BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="Image" |
|||
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y |
|||
BR2_ROOTFS_LINUX_HEADERS=y |
|||
|
|||
# Bootloader |
|||
BR2_TARGET_GRUB2=y |
|||
BR2_TARGET_GRUB2_ARM64_EFI=y |
|||
|
|||
# Serial port config |
|||
BR2_TARGET_GENERIC_GETTY=y |
|||
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" |
|||
|
|||
# required tools to create the microSD image |
|||
BR2_PACKAGE_HOST_DOSFSTOOLS=y |
|||
BR2_PACKAGE_HOST_GENIMAGE=y |
|||
BR2_PACKAGE_HOST_MTOOLS=y |
|||
|
|||
BR2_PACKAGE_ROOTFS_DESKTOP=y |
|||
BR2_PACKAGE_XORG_ROGUE_UMLIBS=y |
|||
BR2_PACKAGE_BUSYBOX=n |
|||
|
|||
# Vpu-lib |
|||
BR2_PACKAGE_VPU_LIB=y |
|||
BR2_PACKAGE_VPU_LIB_CPU_MODEL="d2000" |
|||
|
|||
# FFmpeg |
|||
BR2_PACKAGE_FFMPEG=y |
@ -0,0 +1,82 @@ |
|||
# Architecture |
|||
BR2_aarch64=y |
|||
|
|||
# Toolchain |
|||
BR2_TOOLCHAIN_EXTERNAL=y |
|||
|
|||
# Hostname and issue |
|||
BR2_TARGET_GENERIC_HOSTNAME="phytiumpi" |
|||
BR2_TARGET_GENERIC_ISSUE="Welcome to Phytium PI" |
|||
|
|||
# system configuration |
|||
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y |
|||
BR2_SYSTEM_BIN_SH_BASH=y |
|||
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" |
|||
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_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-phytiumpi.cfg" |
|||
|
|||
|
|||
# Bootloader |
|||
BR2_TARGET_GRUB2=y |
|||
BR2_PACKAGE_PHYUBOOT=y |
|||
BR2_PACKAGE_PHYUBOOT_RAMSIZE="4GB" |
|||
|
|||
# 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="https://gitee.com/phytium_embedded/phytium-linux-kernel.git" |
|||
# kernel 5.10 |
|||
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10_phytiumpios-v1.0" |
|||
BR2_LINUX_KERNEL_DEFCONFIG="phytiumpi_firefly" |
|||
BR2_LINUX_KERNEL_DTS_SUPPORT=y |
|||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/phytiumpi_firefly" |
|||
BR2_LINUX_KERNEL_IMAGEGZ=y |
|||
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_FLICKCURL=y |
|||
BR2_PACKAGE_FLICKCURL_UTILS=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 |
@ -0,0 +1,70 @@ |
|||
# Architecture |
|||
BR2_aarch64=y |
|||
BR2_cortex_a53=y |
|||
|
|||
# Filesystem |
|||
BR2_TARGET_ROOTFS_EXT2=y |
|||
BR2_TARGET_ROOTFS_EXT2_4=y |
|||
BR2_TARGET_ROOTFS_EXT2_SIZE="15G" |
|||
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" |
|||
BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-phytiumpi.cfg" |
|||
|
|||
|
|||
# custom skeleton |
|||
BR2_ROOTFS_SKELETON_UBUNTU=y |
|||
BR2_ROOTFS_SKELETON_CUSTOM=y |
|||
BR2_ROOTFS_SKELETON_CUSTOM_SITE="http://cdimage.ubuntu.com/ubuntu-base/releases/20.04.4/release" |
|||
BR2_ROOTFS_SKELETON_CUSTOM_SOURCE="ubuntu-base-20.04.1-base-arm64.tar.gz" |
|||
BR2_ROOTFS_SKELETON_CUSTOM_SITE_METHOD="wget" |
|||
BR2_ROOTFS_SKELETON_CUSTOM_EXTRACT="tar zxvf" |
|||
BR2_ROOTFS_SKELETON_CUSTOM_EXTRACT_IGNORE_ERROR=y |
|||
BR2_ROOTFS_POST_BUILD_SCRIPT="board/phytium/common/post-custom-skeleton-ubuntu-base-20.04.sh" |
|||
BR2_INIT_NONE=y |
|||
BR2_ROOTFS_CHOWN=y |
|||
|
|||
# Hostname and issue |
|||
BR2_TARGET_GENERIC_HOSTNAME="phytiumpi" |
|||
BR2_TARGET_GENERIC_ISSUE="Welcome to Phytium PI" |
|||
|
|||
# toolchain |
|||
BR2_TOOLCHAIN_EXTERNAL=y |
|||
BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64=y |
|||
BR2_TOOLCHAIN_USES_GLIBC=y |
|||
BR2_TOOLCHAIN_EXTERNAL_GLIBC=y |
|||
|
|||
# Linux headers same as kernel |
|||
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y |
|||
|
|||
# Kernel |
|||
BR2_LINUX_KERNEL=y |
|||
BR2_LINUX_KERNEL_CUSTOM_GIT=y |
|||
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/phytium-linux-kernel.git" |
|||
# kernel 5.10 |
|||
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10_phytiumpios-v1.0" |
|||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/phytiumpi_firefly" |
|||
BR2_LINUX_KERNEL_DTS_SUPPORT=y |
|||
BR2_LINUX_KERNEL_DEFCONFIG="phytiumpi_firefly" |
|||
BR2_LINUX_KERNEL_IMAGEGZ=y |
|||
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y |
|||
BR2_ROOTFS_LINUX_HEADERS=y |
|||
|
|||
# Bootloader |
|||
BR2_TARGET_GRUB2=y |
|||
BR2_TARGET_GRUB2_ARM64_EFI=y |
|||
BR2_PACKAGE_PHYUBOOT=y |
|||
BR2_PACKAGE_PHYUBOOT_RAMSIZE="4GB" |
|||
|
|||
# Serial port config |
|||
BR2_TARGET_GENERIC_GETTY=y |
|||
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" |
|||
|
|||
# required tools to create the microSD image |
|||
BR2_PACKAGE_HOST_DOSFSTOOLS=y |
|||
BR2_PACKAGE_HOST_GENIMAGE=y |
|||
BR2_PACKAGE_HOST_MTOOLS=y |
|||
|
|||
BR2_PACKAGE_ROOTFS_DESKTOP=y |
|||
BR2_PACKAGE_BUSYBOX=n |
|||
|
|||
# Bluetooth config tools |
|||
BR2_PACKAGE_PHYTIUM_TOOLS=y |
@ -0,0 +1,33 @@ |
|||
From 0facda308510839f33c34b3416080d9e72e51440 Mon Sep 17 00:00:00 2001 |
|||
From: Chunrong Guo <guochunrong@phytium.com.cn> |
|||
Date: Wed, 14 Jun 2023 13:55:16 +0800 |
|||
Subject: [PATCH] image-hd: remove MBR space |
|||
|
|||
Signed-off-by: Chunrong Guo <guochunrong@phytium.com.cn> |
|||
---
|
|||
image-hd.c | 9 --------- |
|||
1 file changed, 9 deletions(-) |
|||
|
|||
diff --git a/image-hd.c b/image-hd.c
|
|||
index 5e3a3b4..09affcd 100644
|
|||
--- a/image-hd.c
|
|||
+++ b/image-hd.c
|
|||
@@ -859,15 +859,6 @@ static int hdimage_setup(struct image *image, cfg_t *cfg)
|
|||
part->name); |
|||
return -EINVAL; |
|||
} |
|||
- if (!part->extended) {
|
|||
- int ret = check_overlap(image, part);
|
|||
- if (ret)
|
|||
- return ret;
|
|||
- } else if (now > part->offset) {
|
|||
- image_error(image, "part %s overlaps with previous partition\n",
|
|||
- part->name);
|
|||
- return -EINVAL;
|
|||
- }
|
|||
if (part->in_partition_table && (part->size % 512)) { |
|||
image_error(image, "part %s size (%lld) must be a " |
|||
"multiple of 1 sector (512 bytes)\n", |
|||
--
|
|||
2.25.1 |
|||
|
@ -0,0 +1,2 @@ |
|||
config BR2_PACKAGE_PHYTIUM_TOOLS |
|||
bool "phytium_tools" |
@ -0,0 +1,21 @@ |
|||
################################################################################
|
|||
#
|
|||
# phytium-tools
|
|||
#
|
|||
################################################################################
|
|||
|
|||
PHYTIUM_TOOLS_VERSION = 0.1 |
|||
PHYTIUM_TOOLS_SITE = package/phytium-tools/src |
|||
PHYTIUM_TOOLS_SITE_METHOD = local |
|||
PHYTIUM_TOOLS_INSTALL_TARGET_CMDS = YES |
|||
|
|||
define PHYTIUM_TOOLS_INSTALL_TARGET_CMDS |
|||
mkdir -p $(TARGET_DIR)/usr/bin |
|||
mkdir -p $(TARGET_DIR)/lib/firmware/rtlbt |
|||
mkdir -p $(TARGET_DIR)/lib/systemd/system/ |
|||
$(INSTALL) -m 755 -D $(@D)/rtlbt/* $(TARGET_DIR)/lib/firmware/rtlbt/ |
|||
$(INSTALL) -m 755 -D $(@D)/rtk_hciattach $(TARGET_DIR)/usr/bin/ |
|||
$(INSTALL) -m 644 -D $(@D)/systemd-hciattach.service $(TARGET_DIR)/lib/systemd/system/ |
|||
endef |
|||
|
|||
$(eval $(generic-package)) |
Binary file not shown.
After Width: | Height: | Size: 3.2 MiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,11 @@ |
|||
[Unit] |
|||
Description=rtk_hciattach |
|||
DefaultDependencies=no |
|||
After=NetworkManager.service |
|||
|
|||
[Service] |
|||
ExecStart=/usr/bin/rtk_hciattach -n -s 115200 ttyAMA0 rtk_h5 |
|||
Restart=on-failure |
|||
|
|||
[Install] |
|||
WantedBy=multi-user.target |
@ -0,0 +1,12 @@ |
|||
config BR2_PACKAGE_PHYUBOOT |
|||
bool "phyuboot" |
|||
help |
|||
Phytium Pi uboot firmware |
|||
|
|||
if BR2_PACKAGE_PHYUBOOT |
|||
config BR2_PACKAGE_PHYUBOOT_RAMSIZE |
|||
string "ram size" |
|||
help |
|||
This is a comment that defines ram size is, 2G or 4g |
|||
|
|||
endif |
@ -0,0 +1,25 @@ |
|||
################################################################################
|
|||
#
|
|||
# Phytium Pi uboot
|
|||
#
|
|||
################################################################################
|
|||
|
|||
PHYUBOOT_VERSION = 1.32 |
|||
PHYUBOOT_SITE = package/phyuboot/src |
|||
PHYUBOOT_SITE_METHOD = local |
|||
PHYUBOOT_DEPENDENCIES = linux host-dtc |
|||
MKIMAGE_PI = $(HOST_DIR)/bin/mkimage_phypi |
|||
# The only available license files are in PDF and RTF formats, and we
|
|||
# support only plain text.
|
|||
|
|||
PHYUBOOT_INSTALL_IMAGES = YES |
|||
PHYUBOOT_RAMSIZE = $(BR2_PACKAGE_PHYUBOOT_RAMSIZE) |
|||
|
|||
define PHYUBOOT_INSTALL_IMAGES_CMDS |
|||
$(INSTALL) -D -m 0777 $(@D)/fip-all-$(BR2_PACKAGE_PHYUBOOT_RAMSIZE).bin $(BINARIES_DIR)/fip-all.bin |
|||
$(INSTALL) -D -m 0777 $(@D)/kernel.its $(BINARIES_DIR)/kernel.its |
|||
$(INSTALL) -D -m 755 $(@D)/mkimage $(HOST_DIR)/bin/mkimage_phypi |
|||
$(MKIMAGE_PI) -f $(BINARIES_DIR)/kernel.its $(BINARIES_DIR)/fitImage |
|||
endef |
|||
|
|||
$(eval $(generic-package)) |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,59 @@ |
|||
/* |
|||
* Compilation: |
|||
* mkimage -f fit_kernel_dtb.its fit_kernel_dtb.itb |
|||
* |
|||
* Files in linux build dir: |
|||
* - arch/arm/boot/Image (zImage-old-ok) |
|||
* - arch/arm/boot/dts/ft.dtb |
|||
* |
|||
* fatload usb 0:1 0x90100000 fit_kernel_dtb.itb |
|||
* bootm 0x90100000#e2000 |
|||
* |
|||
*/ |
|||
|
|||
/dts-v1/; |
|||
/ { |
|||
description = "U-Boot fitImage for Phytium Phytiumpi"; |
|||
#address-cells = <1>; |
|||
|
|||
images { |
|||
kernel { |
|||
description = "Linux kernel"; |
|||
data = /incbin/("Image.gz"); |
|||
type = "kernel"; |
|||
arch = "arm64"; |
|||
os = "linux"; |
|||
compression = "gzip"; |
|||
load = <0x80080000>; |
|||
entry = <0x80080000>; |
|||
hash-1 { |
|||
algo = "sha1"; |
|||
}; |
|||
}; |
|||
|
|||
fdt-phytium { |
|||
description = "FDT phytiumpi"; |
|||
data = /incbin/("phytiumpi_firefly.dtb"); |
|||
type = "flat_dt"; |
|||
arch = "arm64"; |
|||
compression = "none"; |
|||
hash-1 { |
|||
algo = "sha1"; |
|||
}; |
|||
}; |
|||
}; |
|||
|
|||
configurations { |
|||
default = "phytium@cecport"; |
|||
|
|||
phytium { |
|||
description = "phytimpi"; |
|||
kernel = "kernel"; |
|||
fdt = "fdt-phytium"; |
|||
hash-1 { |
|||
algo = "sha1"; |
|||
}; |
|||
}; |
|||
|
|||
}; |
|||
}; |
Binary file not shown.
Loading…
Reference in new issue