From 363e68a7e5992cb6bb449a25a9e661971ffa52d3 Mon Sep 17 00:00:00 2001 From: lindongping2027 Date: Tue, 15 Oct 2024 18:58:21 +0800 Subject: [PATCH 01/15] support arm64 host Signed-off-by: lindongping2027 --- arch/Config.in | 15 +++++++++++++++ configs/host_arm64.config | 3 +++ package/Makefile.in | 10 +++++++++- package/gcc/gcc.mk | 9 ++++++++- system/Config.in | 1 + toolchain/toolchain-buildroot/Config.in | 9 +++++++++ 6 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 configs/host_arm64.config diff --git a/arch/Config.in b/arch/Config.in index 98b0e40d5..c6e0f9843 100644 --- a/arch/Config.in +++ b/arch/Config.in @@ -492,3 +492,18 @@ source "arch/Config.in.xtensa" endif endmenu # Target options + +choice + prompt "Host_arch options" + default BR2_HOST_ARCH_IS_x86_64 + help + Select the host architecture. + +config BR2_HOST_ARCH_IS_aarch64 + bool "aarch64" + +config BR2_HOST_ARCH_IS_x86_64 + bool "x86_64" + +endchoice + diff --git a/configs/host_arm64.config b/configs/host_arm64.config new file mode 100644 index 000000000..eca981d08 --- /dev/null +++ b/configs/host_arm64.config @@ -0,0 +1,3 @@ +BR2_HOST_ARCH_IS_aarch64=y +BR2_TOOLCHAIN_BUILDROOT=y +BR2_TOOLCHAIN_BUILDROOT_NONE=y diff --git a/package/Makefile.in b/package/Makefile.in index 508ea7c36..cae247f4c 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -47,12 +47,20 @@ else TARGET_OS = linux endif +ifeq ($(BR2_HOST_ARCH_IS_aarch64),y) +LIBC = gnu +else ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y) LIBC = uclibc else ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) LIBC = musl -else +else ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y) LIBC = gnu +else ifeq ($(BR_BUILDING),y) +# This happens if there is a bug in Buildroot that allows an +# architecture configuration that isn't supported by any library. +$(error No C library enabled, this is not possible.) +endif endif # The ABI suffix is a bit special on ARM, as it needs to be diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk index 128cf8421..cf770d7b2 100644 --- a/package/gcc/gcc.mk +++ b/package/gcc/gcc.mk @@ -65,6 +65,7 @@ HOST_GCC_COMMON_DEPENDENCIES = \ host-gmp \ host-mpc \ host-mpfr \ + $(if $(BR2_HOST_ARCH_IS_aarch64),skeleton-custom) \ $(if $(BR2_BINFMT_FLAT),host-elf2flt) HOST_GCC_COMMON_CONF_OPTS = \ @@ -73,7 +74,6 @@ HOST_GCC_COMMON_CONF_OPTS = \ --enable-__cxa_atexit \ --with-gnu-ld \ --disable-libssp \ - --disable-multilib \ --disable-decimal-float \ --with-gmp=$(HOST_DIR) \ --with-mpc=$(HOST_DIR) \ @@ -82,6 +82,13 @@ HOST_GCC_COMMON_CONF_OPTS = \ --with-bugurl="http://bugs.buildroot.net/" \ --without-zstd +#if Host is arm64, enable multilib +ifeq ($(BR2_HOST_ARCH_IS_aarch64),y) +HOST_GCC_COMMON_CONF_OPTS += --enable-multilib +else +HOST_GCC_COMMON_CONF_OPTS += --disable-multilib +endif + # Don't build documentation. It takes up extra space / build time, # and sometimes needs specific makeinfo versions to work HOST_GCC_COMMON_CONF_ENV = \ diff --git a/system/Config.in b/system/Config.in index 491d94247..971462e79 100644 --- a/system/Config.in +++ b/system/Config.in @@ -15,6 +15,7 @@ config BR2_ROOTFS_SKELETON_DEFAULT config BR2_ROOTFS_SKELETON_CUSTOM bool "custom target skeleton" + select BR2_TOOLCHAIN_USES_GLIBC select BR2_PACKAGE_SKELETON_CUSTOM help Use custom target skeleton. diff --git a/toolchain/toolchain-buildroot/Config.in b/toolchain/toolchain-buildroot/Config.in index 4004c0edf..5b2864115 100644 --- a/toolchain/toolchain-buildroot/Config.in +++ b/toolchain/toolchain-buildroot/Config.in @@ -98,6 +98,15 @@ config BR2_TOOLCHAIN_BUILDROOT_MUSL https://www.musl-libc.org/ +config BR2_TOOLCHAIN_BUILDROOT_NONE + bool "none" + help + This option is visible if no C library is available for the + currently selected configuration. If you select this option, + the build will refuse to start as Buildroot needs a C + library to build a toolchain. Change your configuration + settings to make sure one of the C libraries is selected. + endchoice config BR2_TOOLCHAIN_BUILDROOT_LIBC -- Gitee From a50689d677408937727755d1d43297a005b68093 Mon Sep 17 00:00:00 2001 From: lindongping Date: Fri, 8 Nov 2024 16:42:37 +0800 Subject: [PATCH 02/15] host_arm64: support phytium_defconfig Signed-off-by: lindongping --- board/phytium/common/debian-package-installer | 2 +- board/phytium/common/ubuntu-package-installer | 2 +- configs/phytium_debian_defconfig | 4 ++-- configs/phytium_defconfig | 3 +++ configs/phytium_ubuntu_defconfig | 4 ++-- package/gcc/gcc.mk | 3 ++- system/Config.in | 1 - toolchain/Config.in | 1 + 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index 424b5842f..33394c93f 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -101,7 +101,7 @@ do_distrorfs_second_stage() { fi # some shared libraries locate in /lib/aarch64-linux-gnu(or /lib/arm-linux-gnueabihf) and /usr/local/lib - echo export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/$sysarch:/lib/$sysarch >> /etc/profile + #echo export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/$sysarch:/lib/$sysarch >> /etc/profile tmpusr=`ls -t /home | cut -d' ' -f1 | head -1` [ -d /home/$tmpusr -a "$tmpusr" != "user" ] && rm -rf /home/$tmpusr diff --git a/board/phytium/common/ubuntu-package-installer b/board/phytium/common/ubuntu-package-installer index e092509b4..7b0bf275a 100755 --- a/board/phytium/common/ubuntu-package-installer +++ b/board/phytium/common/ubuntu-package-installer @@ -138,7 +138,7 @@ do_distrorfs_second_stage() { # some shared libraries locate in /lib/aarch64-linux-gnu(or /lib/arm-linux-gnueabihf) and /usr/local/lib - echo export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/$sysarch:/lib/$sysarch >> /etc/profile + # echo export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/$sysarch:/lib/$sysarch >> /etc/profile tmpusr=`ls -t /home | cut -d' ' -f1 | head -1` [ -d /home/$tmpusr -a "$tmpusr" != "user" ] && rm -rf /home/$tmpusr diff --git a/configs/phytium_debian_defconfig b/configs/phytium_debian_defconfig index e953a6553..e3019b08a 100644 --- a/configs/phytium_debian_defconfig +++ b/configs/phytium_debian_defconfig @@ -30,8 +30,8 @@ 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 +# Linux headers same as kernel or older +BR2_KERNEL_HEADERS_4_19=y # Kernel BR2_LINUX_KERNEL=y diff --git a/configs/phytium_defconfig b/configs/phytium_defconfig index a113420f3..dc70c8362 100644 --- a/configs/phytium_defconfig +++ b/configs/phytium_defconfig @@ -34,6 +34,9 @@ BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y +# Linux headers same as kernel or older +BR2_KERNEL_HEADERS_4_19=y + # Kernel BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_GIT=y diff --git a/configs/phytium_ubuntu_defconfig b/configs/phytium_ubuntu_defconfig index 001082aed..ed1918688 100644 --- a/configs/phytium_ubuntu_defconfig +++ b/configs/phytium_ubuntu_defconfig @@ -30,8 +30,8 @@ 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 +# Linux headers same as kernel or older +BR2_KERNEL_HEADERS_4_19=y # Kernel BR2_LINUX_KERNEL=y diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk index cf770d7b2..55a41aa41 100644 --- a/package/gcc/gcc.mk +++ b/package/gcc/gcc.mk @@ -65,7 +65,8 @@ HOST_GCC_COMMON_DEPENDENCIES = \ host-gmp \ host-mpc \ host-mpfr \ - $(if $(BR2_HOST_ARCH_IS_aarch64),skeleton-custom) \ + $(if $(and $(BR2_ROOTFS_SKELETON_CUSTOM),$(BR2_HOST_ARCH_IS_aarch64)),skeleton-custom) \ + $(if $(and $(BR2_PACKAGE_SKELETON_INIT_COMMON),$(BR2_HOST_ARCH_IS_aarch64)),glibc) \ $(if $(BR2_BINFMT_FLAT),host-elf2flt) HOST_GCC_COMMON_CONF_OPTS = \ diff --git a/system/Config.in b/system/Config.in index 971462e79..491d94247 100644 --- a/system/Config.in +++ b/system/Config.in @@ -15,7 +15,6 @@ config BR2_ROOTFS_SKELETON_DEFAULT config BR2_ROOTFS_SKELETON_CUSTOM bool "custom target skeleton" - select BR2_TOOLCHAIN_USES_GLIBC select BR2_PACKAGE_SKELETON_CUSTOM help Use custom target skeleton. diff --git a/toolchain/Config.in b/toolchain/Config.in index d2c81217c..4515e32cf 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -49,6 +49,7 @@ choice config BR2_TOOLCHAIN_BUILDROOT bool "Buildroot toolchain" depends on BR2_ARCH_HAS_TOOLCHAIN_BUILDROOT + select BR2_TOOLCHAIN_USES_GLIBC config BR2_TOOLCHAIN_EXTERNAL bool "External toolchain" -- Gitee From b3db07ded900e2fda5e68262892ec03cafacd4b6 Mon Sep 17 00:00:00 2001 From: lindongping Date: Mon, 18 Nov 2024 11:31:50 +0800 Subject: [PATCH 03/15] add alsa-ucm-conf Signed-off-by: lindongping --- board/phytium/common/post-build.sh | 6 ++++ configs/desktop.config | 1 + configs/phytium_ubuntu_defconfig | 2 +- package/Config.in | 1 + package/phytium-desktop-tools/Config.in | 2 ++ .../phytium-desktop-tools.mk | 20 ++++++++++++ .../src/PMDK-I2S/HiFi.conf | 32 +++++++++++++++++++ .../src/PMDK-I2S/PMDK-I2S.conf | 6 ++++ .../src/Phytium/PMDK-I2S/HiFi.conf | 32 +++++++++++++++++++ .../src/Phytium/PMDK-I2S/PMDK-I2S.conf | 6 ++++ .../src/Phytium/phytium_pe220x-/HiFi.conf | 31 ++++++++++++++++++ .../phytium_pe220x-/phytium_pe220x-.conf | 6 ++++ .../src/phytium_pe220x-/HiFi.conf | 31 ++++++++++++++++++ .../src/phytium_pe220x-/phytium_pe220x-.conf | 6 ++++ 14 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 package/phytium-desktop-tools/Config.in create mode 100644 package/phytium-desktop-tools/phytium-desktop-tools.mk create mode 100644 package/phytium-desktop-tools/src/PMDK-I2S/HiFi.conf create mode 100644 package/phytium-desktop-tools/src/PMDK-I2S/PMDK-I2S.conf create mode 100644 package/phytium-desktop-tools/src/Phytium/PMDK-I2S/HiFi.conf create mode 100644 package/phytium-desktop-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf create mode 100644 package/phytium-desktop-tools/src/Phytium/phytium_pe220x-/HiFi.conf create mode 100644 package/phytium-desktop-tools/src/Phytium/phytium_pe220x-/phytium_pe220x-.conf create mode 100644 package/phytium-desktop-tools/src/phytium_pe220x-/HiFi.conf create mode 100644 package/phytium-desktop-tools/src/phytium_pe220x-/phytium_pe220x-.conf diff --git a/board/phytium/common/post-build.sh b/board/phytium/common/post-build.sh index 0d8cfa34e..d13115f17 100755 --- a/board/phytium/common/post-build.sh +++ b/board/phytium/common/post-build.sh @@ -119,6 +119,12 @@ main() sudo chroot ${1} systemctl enable phytium-swap-config.service fi + # ubtun22 alsa UCM + if grep -Eq "^BR2_PACKAGE_PHYTIUM_DESKTOP_TOOLS=y$" ${BR2_CONFIG} && grep -Eq "^BR2_ROOTFS_SKELETON_UBUNTU_JAMMY=y$" ${BR2_CONFIG}; then + ln -sf ../../Phytium/phytium_pe220x-/phytium_pe220x-.conf $1/usr/share/alsa/ucm2/conf.d/phytium_pe220x-/phytium_pe220x-.conf + ln -sf ../../Phytium/PMDK-I2S/PMDK-I2S.conf $1/usr/share/alsa/ucm2/conf.d/PMDK-I2S/PMDK-I2S.conf + fi + exit $? } diff --git a/configs/desktop.config b/configs/desktop.config index 5de218216..2a47bb28a 100644 --- a/configs/desktop.config +++ b/configs/desktop.config @@ -1,4 +1,5 @@ BR2_PACKAGE_ROOTFS_DESKTOP=y +BR2_PACKAGE_PHYTIUM_DESKTOP_TOOLS=y BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt board/phytium/common/desktop_device_table.txt" # Phytium_swap BR2_PACKAGE_PHYTIUM_SWAP=y diff --git a/configs/phytium_ubuntu_defconfig b/configs/phytium_ubuntu_defconfig index ed1918688..f1acb0280 100644 --- a/configs/phytium_ubuntu_defconfig +++ b/configs/phytium_ubuntu_defconfig @@ -38,7 +38,7 @@ 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_v2.2" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="7b787a8c53e522e122d35912c830849321aa9ae4" 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/phytiumpi_firefly" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="phytium" diff --git a/package/Config.in b/package/Config.in index e355288de..dbfd9ba8a 100644 --- a/package/Config.in +++ b/package/Config.in @@ -63,6 +63,7 @@ menu "Audio and video applications" source "package/yavta/Config.in" source "package/ympd/Config.in" source "package/zynaddsubfx/Config.in" + source "package/phytium-desktop-tools/Config.in" endmenu menu "Compressors and decompressors" diff --git a/package/phytium-desktop-tools/Config.in b/package/phytium-desktop-tools/Config.in new file mode 100644 index 000000000..e297235a3 --- /dev/null +++ b/package/phytium-desktop-tools/Config.in @@ -0,0 +1,2 @@ +config BR2_PACKAGE_PHYTIUM_DESKTOP_TOOLS + bool "phytium_desktop_tools" diff --git a/package/phytium-desktop-tools/phytium-desktop-tools.mk b/package/phytium-desktop-tools/phytium-desktop-tools.mk new file mode 100644 index 000000000..4cc245b78 --- /dev/null +++ b/package/phytium-desktop-tools/phytium-desktop-tools.mk @@ -0,0 +1,20 @@ +################################################################################ +# +# phytium-desktop-tools +# +################################################################################ + +PHYTIUM_DESKTOP_TOOLS_VERSION = 0.1 +PHYTIUM_DESKTOP_TOOLS_SITE = package/phytium-desktop-tools/src +PHYTIUM_DESKTOP_TOOLS_SITE_METHOD = local +PHYTIUM_DESKTOP_TOOLS_INSTALL_TARGET = YES + +define PHYTIUM_DESKTOP_TOOLS_INSTALL_TARGET_CMDS + $(if $(BR2_ROOTFS_SKELETON_UBUNTU_JAMMY),mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/conf.d/phytium_pe220x-/) + $(if $(BR2_ROOTFS_SKELETON_UBUNTU_JAMMY),mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/conf.d/PMDK-I2S/) + $(if $(BR2_ROOTFS_SKELETON_UBUNTU_JAMMY),cp -rf $(@D)/Phytium/ $(TARGET_DIR)/usr/share/alsa/ucm2/) + $(if $(BR2_ROOTFS_SKELETON_UBUNTU_FOCAL),cp -rf $(@D)/PMDK-I2S/ $(TARGET_DIR)/usr/share/alsa/ucm2/) + $(if $(BR2_ROOTFS_SKELETON_UBUNTU_FOCAL),cp -rf $(@D)/phytium_pe220x-/ $(TARGET_DIR)/usr/share/alsa/ucm2/) +endef + +$(eval $(generic-package)) diff --git a/package/phytium-desktop-tools/src/PMDK-I2S/HiFi.conf b/package/phytium-desktop-tools/src/PMDK-I2S/HiFi.conf new file mode 100644 index 000000000..3675046ed --- /dev/null +++ b/package/phytium-desktop-tools/src/PMDK-I2S/HiFi.conf @@ -0,0 +1,32 @@ +SectionDevice."DP0 Audio" { + Comment "DP0 Audio" + + EnableSequence [ + ] + + DisableSequence [ + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + JackControl "HDMI/DP,pcm=0 Jack" + } +} + +SectionDevice."DP1 Audio" { + Comment "DP1 Audio" + + EnableSequence [ + ] + + DisableSequence [ + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},1" + JackControl "HDMI/DP,pcm=1 Jack" + } +} + diff --git a/package/phytium-desktop-tools/src/PMDK-I2S/PMDK-I2S.conf b/package/phytium-desktop-tools/src/PMDK-I2S/PMDK-I2S.conf new file mode 100644 index 000000000..14a3a45ed --- /dev/null +++ b/package/phytium-desktop-tools/src/PMDK-I2S/PMDK-I2S.conf @@ -0,0 +1,6 @@ +Syntax 3 + +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Play HiFi quality voice." +} diff --git a/package/phytium-desktop-tools/src/Phytium/PMDK-I2S/HiFi.conf b/package/phytium-desktop-tools/src/Phytium/PMDK-I2S/HiFi.conf new file mode 100644 index 000000000..3675046ed --- /dev/null +++ b/package/phytium-desktop-tools/src/Phytium/PMDK-I2S/HiFi.conf @@ -0,0 +1,32 @@ +SectionDevice."DP0 Audio" { + Comment "DP0 Audio" + + EnableSequence [ + ] + + DisableSequence [ + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + JackControl "HDMI/DP,pcm=0 Jack" + } +} + +SectionDevice."DP1 Audio" { + Comment "DP1 Audio" + + EnableSequence [ + ] + + DisableSequence [ + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},1" + JackControl "HDMI/DP,pcm=1 Jack" + } +} + diff --git a/package/phytium-desktop-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf b/package/phytium-desktop-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf new file mode 100644 index 000000000..0164193f1 --- /dev/null +++ b/package/phytium-desktop-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf @@ -0,0 +1,6 @@ +Syntax 3 + +SectionUseCase."HiFi" { + File "/Phytium/PMDK-I2S/HiFi.conf" + Comment "Play HiFi quality voice." +} diff --git a/package/phytium-desktop-tools/src/Phytium/phytium_pe220x-/HiFi.conf b/package/phytium-desktop-tools/src/Phytium/phytium_pe220x-/HiFi.conf new file mode 100644 index 000000000..e5295f0cb --- /dev/null +++ b/package/phytium-desktop-tools/src/Phytium/phytium_pe220x-/HiFi.conf @@ -0,0 +1,31 @@ +SectionDevice."Headphones" { + Comment "Headphones" + + EnableSequence [ + ] + + DisableSequence [ + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + JackControl "Headphones Jack" + } +} + +SectionDevice."Microphone" { + Comment "Microphone" + + EnableSequence [ + cset "name='Differential Mux' lin2-rin2" + ] + + DisableSequence [ + ] + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},0" + } +} diff --git a/package/phytium-desktop-tools/src/Phytium/phytium_pe220x-/phytium_pe220x-.conf b/package/phytium-desktop-tools/src/Phytium/phytium_pe220x-/phytium_pe220x-.conf new file mode 100644 index 000000000..8be9dbf76 --- /dev/null +++ b/package/phytium-desktop-tools/src/Phytium/phytium_pe220x-/phytium_pe220x-.conf @@ -0,0 +1,6 @@ +Syntax 3 + +SectionUseCase."HiFi" { + File "/Phytium/es8336/HiFi.conf" + Comment "Play HiFi quality voice." +} diff --git a/package/phytium-desktop-tools/src/phytium_pe220x-/HiFi.conf b/package/phytium-desktop-tools/src/phytium_pe220x-/HiFi.conf new file mode 100644 index 000000000..e5295f0cb --- /dev/null +++ b/package/phytium-desktop-tools/src/phytium_pe220x-/HiFi.conf @@ -0,0 +1,31 @@ +SectionDevice."Headphones" { + Comment "Headphones" + + EnableSequence [ + ] + + DisableSequence [ + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + JackControl "Headphones Jack" + } +} + +SectionDevice."Microphone" { + Comment "Microphone" + + EnableSequence [ + cset "name='Differential Mux' lin2-rin2" + ] + + DisableSequence [ + ] + + Value { + CapturePriority 200 + CapturePCM "hw:${CardId},0" + } +} diff --git a/package/phytium-desktop-tools/src/phytium_pe220x-/phytium_pe220x-.conf b/package/phytium-desktop-tools/src/phytium_pe220x-/phytium_pe220x-.conf new file mode 100644 index 000000000..14a3a45ed --- /dev/null +++ b/package/phytium-desktop-tools/src/phytium_pe220x-/phytium_pe220x-.conf @@ -0,0 +1,6 @@ +Syntax 3 + +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Play HiFi quality voice." +} -- Gitee From f2269e98e876aff82f5e3176816586dc723d8dc0 Mon Sep 17 00:00:00 2001 From: weishanshan1084 Date: Mon, 18 Nov 2024 18:16:24 +0800 Subject: [PATCH 04/15] ubuntu: install adwaita cursor theme Signed-off-by: weishanshan1084 --- board/phytium/common/ubuntu-additional_packages_list | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/phytium/common/ubuntu-additional_packages_list b/board/phytium/common/ubuntu-additional_packages_list index 4dd592fa5..87ff7a031 100644 --- a/board/phytium/common/ubuntu-additional_packages_list +++ b/board/phytium/common/ubuntu-additional_packages_list @@ -1,7 +1,7 @@ # additional packages list for SDK main userland gathered from main repo additional_full_packages_list=" " -additional_desktop_packages_list="network-manager-gnome xfce4-screenshooter" +additional_desktop_packages_list="network-manager-gnome xfce4-screenshooter adwaita-icon-theme-full" # for Lite userland gathered from main repo additional_base_packages_list="net-tools iputils-ping gcc g++ vim make autoconf automake libtool pkg-config bison bc flex libssl-dev openssh-server python-is-python3 \ -- Gitee From 3f1421b50ce97292ac951cf9e7edbd2f6e84c2e3 Mon Sep 17 00:00:00 2001 From: weishanshan1084 Date: Fri, 29 Nov 2024 18:00:24 +0800 Subject: [PATCH 05/15] firefox: increase the priority of the firefox in the mozillateam PPA Signed-off-by: weishanshan1084 --- board/phytium/common/ubuntu-package-installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/phytium/common/ubuntu-package-installer b/board/phytium/common/ubuntu-package-installer index 7b0bf275a..2dbd42016 100755 --- a/board/phytium/common/ubuntu-package-installer +++ b/board/phytium/common/ubuntu-package-installer @@ -76,7 +76,7 @@ do_distrorfs_second_stage() { cat <<-EOF > /etc/apt/preferences.d/mozillateamppa Package: firefox Pin: release o=LP-PPA-mozillateam - Pin-Priority: 501 + Pin-Priority: 1001 EOF fi DEBIAN_FRONTEND=noninteractive apt -y install firefox || true -- Gitee From 0adedbc5dbd67ceb3a0238df24d37828997fcf18 Mon Sep 17 00:00:00 2001 From: weishanshan1084 Date: Mon, 2 Dec 2024 10:59:22 +0800 Subject: [PATCH 06/15] x11perf: add x11perf for ubuntu22.04_desktop Signed-off-by: weishanshan1084 --- .../phytium/common/ubuntu-additional_packages_list | 2 +- configs/phytium_ubuntu_defconfig | 4 ++++ package/x11r7/xapp_x11perf/Config.in | 5 ++--- package/x11r7/xapp_x11perf/xapp_x11perf.hash | 8 +++----- package/x11r7/xapp_x11perf/xapp_x11perf.mk | 14 ++++++++++---- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/board/phytium/common/ubuntu-additional_packages_list b/board/phytium/common/ubuntu-additional_packages_list index 87ff7a031..ab9867809 100644 --- a/board/phytium/common/ubuntu-additional_packages_list +++ b/board/phytium/common/ubuntu-additional_packages_list @@ -1,7 +1,7 @@ # additional packages list for SDK main userland gathered from main repo additional_full_packages_list=" " -additional_desktop_packages_list="network-manager-gnome xfce4-screenshooter adwaita-icon-theme-full" +additional_desktop_packages_list="network-manager-gnome xfce4-screenshooter adwaita-icon-theme-full libxmuu-dev libxrender-dev libxft-dev" # for Lite userland gathered from main repo additional_base_packages_list="net-tools iputils-ping gcc g++ vim make autoconf automake libtool pkg-config bison bc flex libssl-dev openssh-server python-is-python3 \ diff --git a/configs/phytium_ubuntu_defconfig b/configs/phytium_ubuntu_defconfig index f1acb0280..76ffecab9 100644 --- a/configs/phytium_ubuntu_defconfig +++ b/configs/phytium_ubuntu_defconfig @@ -65,3 +65,7 @@ BR2_PACKAGE_BUSYBOX=n # util-linux BR2_PACKAGE_UTIL_LINUX=y BR2_PACKAGE_UTIL_LINUX_BINARIES=y + +# x11perf +BR2_PACKAGE_XORG7=y +BR2_PACKAGE_XAPP_X11PERF=y diff --git a/package/x11r7/xapp_x11perf/Config.in b/package/x11r7/xapp_x11perf/Config.in index 0f1eca893..1e55c7b15 100644 --- a/package/x11r7/xapp_x11perf/Config.in +++ b/package/x11r7/xapp_x11perf/Config.in @@ -1,7 +1,6 @@ config BR2_PACKAGE_XAPP_X11PERF bool "x11perf" - select BR2_PACKAGE_XLIB_LIBX11 - select BR2_PACKAGE_XLIB_LIBXMU - select BR2_PACKAGE_XLIB_LIBXFT + depends on BR2_PACKAGE_ROOTFS_DESKTOP + depends on BR2_ROOTFS_SKELETON_UBUNTU_JAMMY help summarize x11perf results diff --git a/package/x11r7/xapp_x11perf/xapp_x11perf.hash b/package/x11r7/xapp_x11perf/xapp_x11perf.hash index b472c21b1..ab34a2fdb 100644 --- a/package/x11r7/xapp_x11perf/xapp_x11perf.hash +++ b/package/x11r7/xapp_x11perf/xapp_x11perf.hash @@ -1,7 +1,5 @@ -# From https://lists.x.org/archives/xorg-announce/2019-March/002983.html -md5 e96b56756990c56c24d2d02c2964456b x11perf-1.6.1.tar.bz2 -sha1 c54ebef80b6cb565397fe2e3069e0d7470027e5a x11perf-1.6.1.tar.bz2 -sha256 1c7e0b8ffc2794b4ccf11e04d551823abe0ea47b4f7db0637390db6fbe817c34 x11perf-1.6.1.tar.bz2 -sha512 b386151bfe3d7c04ab9953ae1882f3c5b627d6d1afb9a8cfe87c58236a88883fc11bbadb2226b9aa61df84b4fce625a1c9e3d146a124ac17e8d7d605b35d9c0b x11perf-1.6.1.tar.bz2 +# From https://lists.x.org/archives/xorg-announce/2024-August/003526.html +sha256 24f80d84b0e96171a998932ff007698fd1776da9975ed42e51d57b9cfca91828 x11perf-1.7.0.tar.xz +sha512 de8185bfbac15fb5eb15c18ba8450d8e383e1356675e0368c9a443d4c2d14245fab87ac0aa4ddcc5ebf731af0ad1173f53c6937104c1be824bfda5b58112fd5e x11perf-1.7.0.tar.xz # Locally computed sha256 f467ff659142e2eb4cb7275c48c789d249af398b09a405d3e181dcc339b3b922 COPYING diff --git a/package/x11r7/xapp_x11perf/xapp_x11perf.mk b/package/x11r7/xapp_x11perf/xapp_x11perf.mk index ec10590b7..df1d10ac9 100644 --- a/package/x11r7/xapp_x11perf/xapp_x11perf.mk +++ b/package/x11r7/xapp_x11perf/xapp_x11perf.mk @@ -4,11 +4,17 @@ # ################################################################################ -XAPP_X11PERF_VERSION = 1.6.1 -XAPP_X11PERF_SOURCE = x11perf-$(XAPP_X11PERF_VERSION).tar.bz2 -XAPP_X11PERF_SITE = http://xorg.freedesktop.org/releases/individual/app +XAPP_X11PERF_VERSION = 1.7.0 +XAPP_X11PERF_SOURCE = x11perf-$(XAPP_X11PERF_VERSION).tar.xz +XAPP_X11PERF_SITE = https://xorg.freedesktop.org/archive/individual/test XAPP_X11PERF_LICENSE = MIT XAPP_X11PERF_LICENSE_FILES = COPYING -XAPP_X11PERF_DEPENDENCIES = xlib_libX11 xlib_libXmu xlib_libXft +XAPP_X11PERF_CONF_OPTS = --datarootdir=/usr/lib --mandir=/usr/share/man + +define XAPP_X11PERF_GZIP_MAN_FILES + cd $(TARGET_DIR)/usr/share/man/man1/ && \ + gzip -f x11perf.1 x11perfcomp.1 Xmark.1 +endef +XAPP_X11PERF_POST_INSTALL_TARGET_HOOKS += XAPP_X11PERF_GZIP_MAN_FILES $(eval $(autotools-package)) -- Gitee From c6335214f368f9695cbef1161fdd5264b41308f0 Mon Sep 17 00:00:00 2001 From: weishanshan1084 Date: Mon, 23 Dec 2024 11:19:38 +0800 Subject: [PATCH 07/15] change the default pkg-config search path Signed-off-by: weishanshan1084 --- package/pkgconf/pkg-config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/pkgconf/pkg-config.in b/package/pkgconf/pkg-config.in index e5a23a10f..d932b49f6 100644 --- a/package/pkgconf/pkg-config.in +++ b/package/pkgconf/pkg-config.in @@ -1,6 +1,6 @@ #!/bin/sh PKGCONFDIR=$(dirname $0) -DEFAULT_PKG_CONFIG_LIBDIR=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib/pkgconfig:${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/share/pkgconfig +DEFAULT_PKG_CONFIG_LIBDIR=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib/pkgconfig:${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/share/pkgconfig:${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib/aarch64-linux-gnu/pkgconfig DEFAULT_PKG_CONFIG_SYSROOT_DIR=${PKGCONFDIR}/../@STAGING_SUBDIR@ DEFAULT_PKG_CONFIG_SYSTEM_INCLUDE_PATH=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/include DEFAULT_PKG_CONFIG_SYSTEM_LIBRARY_PATH=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib -- Gitee From 9f1f47af651e749a7404fdd9e12e26c986f95fbc Mon Sep 17 00:00:00 2001 From: weishanshan1084 Date: Wed, 25 Dec 2024 09:25:57 +0800 Subject: [PATCH 08/15] fix the issue of linking dependent libraries Signed-off-by: weishanshan1084 --- package/Makefile.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/Makefile.in b/package/Makefile.in index cae247f4c..0355525f2 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -160,6 +160,10 @@ endif TARGET_LDFLAGS = $(call qstrip,$(BR2_TARGET_LDFLAGS)) +ifeq ($(BR2_ROOTFS_SKELETON_UBUNTU)$(BR2_ROOTFS_SKELETON_DEBIAN),y) +TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib/aarch64-linux-gnu +endif + # By design, _FORTIFY_SOURCE requires gcc optimization to be enabled. # Therefore, we need to pass _FORTIFY_SOURCE and the optimization level # through the same mechanism, i.e currently through CFLAGS. Passing -- Gitee From 329b5cf2b7dc20f8cd883c03183e7073322de91c Mon Sep 17 00:00:00 2001 From: weishanshan1084 Date: Thu, 5 Dec 2024 16:58:24 +0800 Subject: [PATCH 09/15] toolchain-external-arm-aarch64: support versions 11.3.rel1 and 10.2-2020.11 ubuntu22.04 uses 11.3.rel1, ubuntu20.04 and debian11 use 10.2-2020.11. Signed-off-by: weishanshan1084 --- .../toolchain-external-arm-aarch64/Config.in | 46 +++++++++++++++++-- .../toolchain-external-arm-aarch64.hash | 3 ++ .../toolchain-external-arm-aarch64.mk | 12 +++-- 3 files changed, 52 insertions(+), 9 deletions(-) diff --git a/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in b/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in index b6062846a..fbe2de6cc 100644 --- a/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in +++ b/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in @@ -1,5 +1,37 @@ config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64 - bool "Arm AArch64 2020.11" + bool "Arm AArch64 Toolchain" + help + Arm toolchain for the AArch64 architecture. + + This toolchain (x86 cross-compile for AArch64) is from ARM official web site + https://developer.arm.com/open-source/gnu-toolchain + +if BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64 + +choice + prompt "Arm AArch64 Version" + default BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64_11.3 if BR2_ROOTFS_SKELETON_UBUNTU_JAMMY + default BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64_10.2 if BR2_ROOTFS_SKELETON_UBUNTU_FOCAL || BR2_ROOTFS_SKELETON_DEBIAN + help + Select the version of arm aarch64 toolchain you wish to use. + +config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64_11.3 + bool "Arm AArch64 11.3.rel1" + depends on BR2_aarch64 + depends on BR2_HOSTARCH = "x86_64" + depends on !BR2_STATIC_LIBS + select BR2_TOOLCHAIN_EXTERNAL_GLIBC + select BR2_TOOLCHAIN_HAS_SSP + select BR2_INSTALL_LIBSTDCPP + select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20 + select BR2_TOOLCHAIN_GCC_AT_LEAST_11 + select BR2_TOOLCHAIN_HAS_FORTRAN + select BR2_TOOLCHAIN_HAS_OPENMP + help + Official toolchain (x86 cross-compile for AArch64) from ARM web site, version 11.3.rel1. + +config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64_10.2 + bool "Arm AArch64 10.2-2020.11" depends on BR2_aarch64 depends on BR2_HOSTARCH = "x86_64" depends on !BR2_STATIC_LIBS @@ -12,9 +44,13 @@ config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64 select BR2_TOOLCHAIN_HAS_FORTRAN select BR2_TOOLCHAIN_HAS_OPENMP help - Arm toolchain for the AArch64 architecture. + Official toolchain (x86 cross-compile for AArch64) from ARM web site, version 10.2-2020.11. - This is the same toolchain that was previously distributed by - Linaro. +endchoice - https://developer.arm.com/open-source/gnu-toolchain +config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION + string + default "11.3.rel1" if BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64_11.3 + default "10.2-2020.11" if BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64_10.2 + +endif diff --git a/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.hash b/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.hash index 90abe56d6..2e308ec7c 100644 --- a/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.hash +++ b/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.hash @@ -1,3 +1,6 @@ +# From https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz.sha256asc +sha256 50cdef6c5baddaa00f60502cc8b59cc11065306ae575ad2f51e412a9b2a90364 arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz + # From https://developer.arm.com/-/media/Files/downloads/gnu-a/10.2-2020.11/binrel/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu.tar.xz.asc md5 d6e6676d31c51405ae0fc7687ef0a224 gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu.tar.xz # locally calculated diff --git a/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.mk b/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.mk index 583e4a763..7cb77ba92 100644 --- a/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.mk +++ b/toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.mk @@ -4,9 +4,13 @@ # ################################################################################ -TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION = 2020.11 -TOOLCHAIN_EXTERNAL_ARM_AARCH64_SITE = https://developer.arm.com/-/media/Files/downloads/gnu-a/10.2-$(TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION)/binrel - -TOOLCHAIN_EXTERNAL_ARM_AARCH64_SOURCE = gcc-arm-10.2-$(TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION)-x86_64-aarch64-none-linux-gnu.tar.xz +TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION = $(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION)) +ifeq ($(TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION),11.3.rel1) +TOOLCHAIN_EXTERNAL_ARM_AARCH64_SITE = https://developer.arm.com/-/media/Files/downloads/gnu/$(TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION)/binrel +TOOLCHAIN_EXTERNAL_ARM_AARCH64_SOURCE = arm-gnu-toolchain-$(TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION)-x86_64-aarch64-none-linux-gnu.tar.xz +else ifeq ($(TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION),10.2-2020.11) +TOOLCHAIN_EXTERNAL_ARM_AARCH64_SITE = https://developer.arm.com/-/media/Files/downloads/gnu-a/$(TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION)/binrel +TOOLCHAIN_EXTERNAL_ARM_AARCH64_SOURCE = gcc-arm-$(TOOLCHAIN_EXTERNAL_ARM_AARCH64_VERSION)-x86_64-aarch64-none-linux-gnu.tar.xz +endif $(eval $(toolchain-external-package)) -- Gitee From d4007ee23802138ab2567ca38f4d202edf54b416 Mon Sep 17 00:00:00 2001 From: weishanshan1084 Date: Mon, 9 Dec 2024 17:40:12 +0800 Subject: [PATCH 10/15] README: qt5 support ubuntu22.04 Signed-off-by: weishanshan1084 --- README.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1438adb97..57e198a54 100644 --- a/README.md +++ b/README.md @@ -223,24 +223,21 @@ pyjailhouse安装到/usr/local/lib/python3.x/dist-packages;上述的python3.x 在Ubuntu和Debian系统中安装了linux-headers和dkms,从而支持使用dkms来构建内核模块。 在配置及编译文件系统时,需要合并x100.config: ``` -$ ./support/kconfig/merge_config.sh configs/phytium_ubuntu_defconfig configs/desktop.config configs/x100.config +$ ./support/kconfig/merge_config.sh configs/phytium_xxx_defconfig configs/desktop.config configs/x100.config $ make ``` 系统启动后,可以使用dpkg命令安装X100的deb包。 ### 支持无桌面qt5 eglfs -支持将qt5 eglfs编译安装到无桌面的Ubuntu20.04和Debian11系统,用来运行在带x100的开发板上。 +支持将qt5 eglfs编译安装到无桌面的Ubuntu20.04、Ubuntu22.04和Debian11系统,用来运行在带x100的开发板上。 如果需要编译qt5 eglfs请执行: ``` -Ubuntu20.04系统: -$ ./support/kconfig/merge_config.sh configs/phytium_ubuntu_defconfig configs/ubuntu_20.04.config configs/qt5_eglfs.config configs/x100.config -$ make -Debian11系统: -$ ./support/kconfig/merge_config.sh configs/phytium_debian_defconfig configs/qt5_eglfs.config configs/x100.config +$ ./support/kconfig/merge_config.sh configs/phytium_xxx_defconfig configs/qt5_eglfs.config configs/x100.config $ make ``` qt5相关的文件被安装到根文件系统的/usr目录: -头文件安装到/usr/include/qt5,库安装到/usr/lib,plugins安装到/usr/lib/qt/plugins,examples安装到/usr/lib/qt/examples。 +头文件安装到/usr/include/qt5,库安装到/usr/lib,plugins安装到/usr/lib/qt/plugins,examples安装到/usr/lib/qt/examples。 +系统启动后,可以使用dpkg命令安装X100的deb包。 ### 支持OpenAMP 本项目还支持编译OpenAMP,手动编译OpenAMP裸跑二进制镜像请参考:`https://gitee.com/phytium_embedded/phytium-standalone-sdk` , -- Gitee From ebc6d879d2ba28605b5d410bb8948e69bd5f332d Mon Sep 17 00:00:00 2001 From: Konstantin Menyaev Date: Mon, 5 Sep 2022 04:09:13 +0300 Subject: [PATCH 11/15] package/dhcpcd: fix pid path From the README: dhcpcd-9 defaults the run directory to `/var/run/dhcpcd` instead of `/var/run` and the prefix of dhcpcd has been removed from the files. Make it so. Signed-off-by: Konstantin Menyaev Signed-off-by: Yann E. MORIN --- package/dhcpcd/S41dhcpcd | 2 +- package/dhcpcd/dhcpcd.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/dhcpcd/S41dhcpcd b/package/dhcpcd/S41dhcpcd index 3e5c22f71..55794f407 100644 --- a/package/dhcpcd/S41dhcpcd +++ b/package/dhcpcd/S41dhcpcd @@ -5,7 +5,7 @@ DAEMON=/sbin/dhcpcd CONFIG=/etc/dhcpcd.conf -PIDFILE=/var/run/dhcpcd.pid +PIDFILE=/var/run/dhcpcd/pid [ -f $CONFIG ] || exit 0 diff --git a/package/dhcpcd/dhcpcd.service b/package/dhcpcd/dhcpcd.service index e648092c9..4da49818a 100644 --- a/package/dhcpcd/dhcpcd.service +++ b/package/dhcpcd/dhcpcd.service @@ -5,7 +5,7 @@ After=network.target [Service] Type=forking EnvironmentFile=-/etc/default/dhcpcd -PIDFile=/run/dhcpcd.pid +PIDFile=/run/dhcpcd/pid ExecStart=/sbin/dhcpcd $DAEMON_ARGS Restart=always -- Gitee From f4f36a3762042c2487219b6b7dbbfa797bd26c1d Mon Sep 17 00:00:00 2001 From: weishanshan1084 Date: Tue, 31 Dec 2024 14:28:38 +0800 Subject: [PATCH 12/15] dhcpcd: deny dhcp on can interface Signed-off-by: weishanshan1084 --- package/dhcpcd/dhcpcd.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/dhcpcd/dhcpcd.mk b/package/dhcpcd/dhcpcd.mk index 922d289b2..e7c6e0981 100644 --- a/package/dhcpcd/dhcpcd.mk +++ b/package/dhcpcd/dhcpcd.mk @@ -50,6 +50,11 @@ define DHCPCD_INSTALL_TARGET_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR) endef +define DHCPCD_DENY_CAN_INTERFACE + echo "denyinterfaces can*" >> $(TARGET_DIR)/etc/dhcpcd.conf +endef +DHCPCD_POST_INSTALL_TARGET_HOOKS += DHCPCD_DENY_CAN_INTERFACE + # When network-manager is enabled together with dhcpcd, it will use # dhcpcd as a DHCP client, and will be in charge of running, so we # don't want the init script or service file to be installed. -- Gitee From 95d73a274cff978cb7266ecfc3c9cde74ec82af6 Mon Sep 17 00:00:00 2001 From: weishanshan1084 Date: Tue, 31 Dec 2024 15:36:09 +0800 Subject: [PATCH 13/15] README: add notes for busybox minimal system using uefi boot Signed-off-by: weishanshan1084 --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 57e198a54..143fc5b14 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,10 @@ phytium_defconfig (3)镜像的输出位置 生成的根文件系统、内核、img 镜像位于output/images目录。 +### UEFI启动基于BusyBox的最小系统 +UEFI启动时,UART1串口对应的设备文件是ttyAMA0,所以如果要编译基于BusyBox的最小系统,需要将`phytium-linux-buildroot/board/phytium/common/busybox_init_overlay/etc/inittab`中的 +`#ttyAMA0::respawn:/sbin/getty -L ttyAMA0 115200 vt100`一行,取消注释,再执行编译。 + ### cpio文件 将基于busybox的系统,进行cpio打包和压缩生成了rootfs.cpio.gz,使用bootloader可以把它加载到内存中,从内存启动这个根文件系统。 -- Gitee From 118951dbae87f05ced361ffd0a109b426d6b4724 Mon Sep 17 00:00:00 2001 From: lindongping Date: Thu, 2 Jan 2025 19:46:14 +0800 Subject: [PATCH 14/15] support toolchain buildroot Signed-off-by: lindongping --- README.md | 24 ++++++++++--- .../common/post-custom-skeleton-debian-11.sh | 1 + .../common/post-custom-skeleton-ubuntu.sh | 1 + board/phytium/post-image.sh | 1 + configs/host_arm64.config | 1 + configs/toolchain_buildroot.config | 3 ++ package/gcc/gcc.mk | 4 +-- package/skeleton-custom/skeleton-custom.mk | 36 +++++++++++++++++++ 8 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 configs/toolchain_buildroot.config diff --git a/README.md b/README.md index 143fc5b14..934d9a110 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Buildroot涉及了rootfs、make、Kconfig、Linux command、Shell scripts、U-Bo # 开发环境 ## 系统要求 -Buildroot被设计为在x86 Linux系统上运行,我们只支持在Ubuntu20.04、Ubuntu22.04、Debian11这三种x86主机上运行phytium-linux-buildroot,不支持其他系统。 +我们只支持在Ubuntu20.04、Ubuntu22.04、Debian11这三种主机上运行phytium-linux-buildroot,不支持其他系统。 Buildroot需要主机系统上安装以下依赖包: ``` $ sudo apt update @@ -56,13 +56,15 @@ config文件是功能扩展配置文件,具体的文件及功能如下: | ros2.config | ros2 | | phytiumpi_sdcard.config | 飞腾派配置文件 | | kernel_debug.config | 内核debug配置文件 | +| host_arm64.config | 支持编译主机为arm64主机 | +| toolchain_buildroot.config | 支持buildroot使用内部工具链 | ## 配置文件的组合 defconfig可以和config文件进行组合,用以扩展特定的功能,defconfig与config的组合关系如下: | deconfig | config | |------------------------|--------| -| phytium_ubuntu_defconfig | linux_xxx.config、ubuntu_20.04.config、desktop.config、e2000_optee.config、xenomai_xxx.config、ethercat.config、jailhouse.config、x100.config、qt5_eglfs.config、openamp_xxx.config、initramfs.config、ros2.config、phytiumpi_sdcard.config、kernel_debug.config | -| phytium_debian_defconfig | linux_xxx.config、desktop.config、e2000_optee.config、xenomai_xxx.config、ethercat.config、jailhouse.config、x100.config、qt5_eglfs.config、openamp_xxx.config、initramfs.config、phytiumpi_sdcard.config | -| phytium_defconfig | linux_xxx.config、e2000_optee.config、phytiumpi_sdcard.config、xenomai_xxx.config、ethercat.config、jailhouse.config、openamp_xxx.config | +| phytium_ubuntu_defconfig | linux_xxx.config、ubuntu_20.04.config、desktop.config、e2000_optee.config、xenomai_xxx.config、ethercat.config、jailhouse.config、x100.config、qt5_eglfs.config、openamp_xxx.config、initramfs.config、ros2.config、phytiumpi_sdcard.config、kernel_debug.config、host_arm64.config、toolchain_buildroot.config | +| phytium_debian_defconfig | linux_xxx.config、desktop.config、e2000_optee.config、xenomai_xxx.config、ethercat.config、jailhouse.config、x100.config、qt5_eglfs.config、openamp_xxx.config、initramfs.config、phytiumpi_sdcard.config 、host_arm64.config、toolchain_buildroot.config | +| phytium_defconfig | linux_xxx.config、e2000_optee.config、phytiumpi_sdcard.config、xenomai_xxx.config、ethercat.config、jailhouse.config、openamp_xxx.config 、host_arm64.config、toolchain_buildroot.config | # 编译文件系统 ## 编译默认配置的文件系统 @@ -307,6 +309,20 @@ BR2_ROOTFS_INITRAMFS_SSH_KEY="/home/xxx/id_rsa.pub" 生成的根文件系统、内核位于 output/images 目录。 sdcard.img 就是 SD 的镜像文件。 后续部署及使用方法,请参考`https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/phytiumpi/linux` +### 支持host_arm64 +Buildroot默认采用x86机器作为编译主机,如果需要支持arm64机器作为编译主机,请执行: +(1)使用phytium_xxx_defconfig作为基础配置项,合并支持host_arm64的配置: +`$ ./support/kconfig/merge_config.sh configs/phytium_xxx_defconfig configs/host_arm64.config` +(2)编译 +`$ make` + +### 支持内部工具链 +phytium-linux-buildroot默认使用外部工具链(预先构建好的交叉编译工具链),如果需要使用内部工具链(Buildroot从源码构建交叉编译工具链),请执行: +(1)使用phytium_xxx_defconfig作为基础配置项,合并支持toolchain_buildroot的配置: +`$ ./support/kconfig/merge_config.sh configs/phytium_xxx_defconfig configs/toolchain_buildroot.config` +(2)编译 +`$ make` + ## 清理编译结果 (1)`$ make clean` 删除所有编译结果,包括output目录下的所有内容。当编译完一个文件系统后,编译另一个文件系统前,需要执行此命令。 diff --git a/board/phytium/common/post-custom-skeleton-debian-11.sh b/board/phytium/common/post-custom-skeleton-debian-11.sh index 5661abf87..8ad94e28d 100755 --- a/board/phytium/common/post-custom-skeleton-debian-11.sh +++ b/board/phytium/common/post-custom-skeleton-debian-11.sh @@ -102,6 +102,7 @@ do_distrorfs_first_stage() { do_recover_from_error "debian-package-installer failed" exit 1 fi + sudo rm -f $RFSDIR/usr/bin/qemu-${tgtarch}-static # sudo chroot $RFSDIR systemctl enable systemd-rootfs-resize file_s=$(sudo find $RFSDIR -perm -4000) diff --git a/board/phytium/common/post-custom-skeleton-ubuntu.sh b/board/phytium/common/post-custom-skeleton-ubuntu.sh index ef38cc4ae..f49975013 100755 --- a/board/phytium/common/post-custom-skeleton-ubuntu.sh +++ b/board/phytium/common/post-custom-skeleton-ubuntu.sh @@ -107,6 +107,7 @@ do_distrorfs_first_stage() { do_recover_from_error "ubuntu-package-installer failed" exit 1 fi + sudo rm -f $RFSDIR/usr/bin/qemu-${tgtarch}-static # sudo chroot $RFSDIR systemctl enable systemd-rootfs-resize file_s=$(sudo find $RFSDIR -perm -4000) diff --git a/board/phytium/post-image.sh b/board/phytium/post-image.sh index f3242ed92..53996cb63 100755 --- a/board/phytium/post-image.sh +++ b/board/phytium/post-image.sh @@ -11,6 +11,7 @@ if grep -Eq "^BR2_ROOTFS_INITRAMFS=y$" ${BR2_CONFIG} && grep -Eq "^BR2_ROOTFS_SK sudo tar xf ${BINARIES_DIR}/rootfs.tar -C ${ROOTFS_DIR} sudo cp ${ROOTFS_DIR}/usr/src/linux-headers-${KERNEL_VERSION}/.config ${ROOTFS_DIR}/boot/config-${KERNEL_VERSION} sudo sed -i 's/FSTYPE=auto/FSTYPE=ext4/g' ${ROOTFS_DIR}/etc/initramfs-tools/initramfs.conf + sudo cp $(which qemu-aarch64-static) ${ROOTFS_DIR}/usr/bin sudo chroot ${ROOTFS_DIR} update-initramfs -c -k ${KERNEL_VERSION} sudo mv ${ROOTFS_DIR}/boot/initrd.img-${KERNEL_VERSION} ${BINARIES_DIR}/initrd.img sudo chown -R $USER:$GROUPS ${BINARIES_DIR}/initrd.img diff --git a/configs/host_arm64.config b/configs/host_arm64.config index eca981d08..7289452ac 100644 --- a/configs/host_arm64.config +++ b/configs/host_arm64.config @@ -1,3 +1,4 @@ BR2_HOST_ARCH_IS_aarch64=y BR2_TOOLCHAIN_BUILDROOT=y +BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_TOOLCHAIN_BUILDROOT_NONE=y diff --git a/configs/toolchain_buildroot.config b/configs/toolchain_buildroot.config new file mode 100644 index 000000000..817b6b01a --- /dev/null +++ b/configs/toolchain_buildroot.config @@ -0,0 +1,3 @@ +BR2_TOOLCHAIN_BUILDROOT=y +BR2_TOOLCHAIN_BUILDROOT_CXX=y +BR2_TOOLCHAIN_BUILDROOT_NONE=y diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk index 55a41aa41..9b032ecfd 100644 --- a/package/gcc/gcc.mk +++ b/package/gcc/gcc.mk @@ -65,8 +65,8 @@ HOST_GCC_COMMON_DEPENDENCIES = \ host-gmp \ host-mpc \ host-mpfr \ - $(if $(and $(BR2_ROOTFS_SKELETON_CUSTOM),$(BR2_HOST_ARCH_IS_aarch64)),skeleton-custom) \ - $(if $(and $(BR2_PACKAGE_SKELETON_INIT_COMMON),$(BR2_HOST_ARCH_IS_aarch64)),glibc) \ + $(if $(and $(BR2_ROOTFS_SKELETON_CUSTOM),$(BR2_TOOLCHAIN_BUILDROOT)),skeleton-custom) \ + $(if $(and $(BR2_PACKAGE_SKELETON_INIT_COMMON),$(BR2_TOOLCHAIN_BUILDROOT)),glibc) \ $(if $(BR2_BINFMT_FLAT),host-elf2flt) HOST_GCC_COMMON_CONF_OPTS = \ diff --git a/package/skeleton-custom/skeleton-custom.mk b/package/skeleton-custom/skeleton-custom.mk index b6ee59745..396ab7008 100644 --- a/package/skeleton-custom/skeleton-custom.mk +++ b/package/skeleton-custom/skeleton-custom.mk @@ -23,6 +23,41 @@ define SKELETON_CUSTOM_BUILD_CMDS $(EXTRA_ENV) $(s) $(@D) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) endef + +# Given a path, determine the relative prefix (../) needed to return to the +# root level. Note that the last component is treated as a file component; use a +# trailing slash to force treating it as a directory. Examples: +# relpath_prefix(lib32) = "" +# relpath_prefix(lib32/octeon2) = "../" +# relpath_prefix(lib32/octeon2/) = "../../" +# +# $1: input path +define relpath_prefix +$$( \ + prefix="" ; \ + nbslashs=`printf $1 | sed 's%[^/]%%g' | wc -c` ; \ + for slash in `seq 1 $${nbslashs}` ; do \ + prefix=$${prefix}"../" ; \ + done ; \ + printf "$$prefix" ; \ +) +endef + + +ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y) +define TOOLCHAIN_BUILDROOT_FIX_SYMLINK_IN_STAGING + for link in $$(find $(STAGING_DIR)/usr/lib/aarch64-linux-gnu/ -type l); do \ + target=$$(readlink $${link}) ; \ + if [ "$${target}" == "$${target$(SHARP_SIGN)/}" ] ; then \ + continue ; \ + fi ; \ + relpath="$(call relpath_prefix,$${target$(SHARP_SIGN)/})" ; \ + echo "Fixing symlink $${link} from $${target} to $${relpath}$${target$(SHARP_SIGN)/}" ; \ + ln -sf $${relpath}$${target$(SHARP_SIGN)/} $${link} ; \ + done +endef +endif + define SKELETON_CUSTOM_INSTALL_TARGET_CMDS $(call SYSTEM_RSYNC,$(@D),$(TARGET_DIR)) $(INSTALL) -m 0644 support/misc/target-dir-warning.txt \ @@ -32,6 +67,7 @@ endef define SKELETON_CUSTOM_INSTALL_STAGING_CMDS $(call SYSTEM_RSYNC,$(@D),$(STAGING_DIR)) + $(call TOOLCHAIN_BUILDROOT_FIX_SYMLINK_IN_STAGING) cd $(STAGING_DIR)/var && rm run && ln -sf ../run run && rm lock && ln -sf ../run/lock lock endef -- Gitee From 4f212577b49ad5e433f9f75b5644ad557fa6ab5a Mon Sep 17 00:00:00 2001 From: weishanshan1084 Date: Wed, 22 Jan 2025 16:49:31 +0800 Subject: [PATCH 15/15] update kernel version due to alsa ucm Signed-off-by: weishanshan1084 --- configs/linux_4.19.config | 2 +- configs/phytium_debian_defconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/linux_4.19.config b/configs/linux_4.19.config index 80985cb8b..deb7af558 100644 --- a/configs/linux_4.19.config +++ b/configs/linux_4.19.config @@ -1,5 +1,5 @@ # Filesystem BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-4.19.cfg" # kernel 4.19 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-4.19_v2.2" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="b96cb86c663b65a684cb5aed3a379a0598f775f7" 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/phytiumpi_firefly" diff --git a/configs/phytium_debian_defconfig b/configs/phytium_debian_defconfig index e3019b08a..2190909ee 100644 --- a/configs/phytium_debian_defconfig +++ b/configs/phytium_debian_defconfig @@ -38,7 +38,7 @@ 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_v2.2" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="7b787a8c53e522e122d35912c830849321aa9ae4" 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/phytiumpi_firefly" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="phytium" -- Gitee