From 1dac1e6f3cf19d73bb21b17c62f6171a3c405998 Mon Sep 17 00:00:00 2001 From: lindongping Date: Tue, 9 Jul 2024 11:41:29 +0800 Subject: [PATCH 1/6] update optee to v3.2 Signed-off-by: lindongping --- configs/phytiumpi_optee.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/phytiumpi_optee.config b/configs/phytiumpi_optee.config index b652ca81..b4ec28e4 100644 --- a/configs/phytiumpi_optee.config +++ b/configs/phytiumpi_optee.config @@ -3,5 +3,5 @@ BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm64/configs/phytium_ BR2_PACKAGE_PHYTIUM_OPTEE=y BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/phytium-optee.git" -BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_VERSION="v3.1" +BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_VERSION="v3.2" BR2_PACKAGE_PHYTIUM_OPTEE_BOARD="phytiumpi" -- Gitee From bc191cf7f1b056698f094fa733adab36d1aff907 Mon Sep 17 00:00:00 2001 From: lindongping Date: Mon, 24 Jun 2024 17:28:12 +0800 Subject: [PATCH 2/6] enable sound-recording and add sound-recording software audacity Signed-off-by: lindongping --- .../common/debian-additional_packages_list | 2 +- package/phytium-tools/phytium-tools.mk | 1 + package/phytium-tools/src/asound.state | 333 ++++++++++++++++++ 3 files changed, 335 insertions(+), 1 deletion(-) create mode 100644 package/phytium-tools/src/asound.state diff --git a/board/phytium/common/debian-additional_packages_list b/board/phytium/common/debian-additional_packages_list index 2d3d874e..7df03cb6 100644 --- a/board/phytium/common/debian-additional_packages_list +++ b/board/phytium/common/debian-additional_packages_list @@ -2,7 +2,7 @@ additional_full_packages_list=" python3-pygame python3-tk thonny python3-pgzero python3-serial debian-reference-en dillo python3-pip python3-numpy pypy alacarte rc-gui sense-hat tree libgl1-mesa-dri libgles1 libgles2-mesa xcompmgr geany python3-spidev python3-twython python3-smbus python3-flask pprompt piwiz" -additional_desktop_packages_list="tigervnc-standalone-server vlc rfkill blueman bluetooth gstreamer1.0-tools fbset" +additional_desktop_packages_list="tigervnc-standalone-server vlc rfkill blueman bluetooth gstreamer1.0-tools fbset audacity" # for Lite userland gathered from main repo additional_base_packages_list="systemd-timesyncd ssh sudo psmisc strace ncdu parted build-essential bash-completion gdb pkg-config python-is-python3 v4l-utils python3-gpiozero avahi-daemon lua5.1 luajit hardlink curl fake-hwclock nfs-common usbutils dosfstools dphys-swapfile apt-listchanges usb-modeswitch libmtp-runtime rsync htop man-db rng-tools ssh-import-id ethtool ntfs-3g pciutils udisks2 zip p7zip-full file cifs-utils mkvtoolnix wpasupplicant wireless-tools net-tools vim locales" diff --git a/package/phytium-tools/phytium-tools.mk b/package/phytium-tools/phytium-tools.mk index 395675ce..5ed13a1a 100644 --- a/package/phytium-tools/phytium-tools.mk +++ b/package/phytium-tools/phytium-tools.mk @@ -32,6 +32,7 @@ define PHYTIUM_TOOLS_INSTALL_TARGET_CMDS $(INSTALL) -m 755 -D $(@D)/rtlbt/rtl8821c_config $(TARGET_DIR)/lib/firmware/rtl_bt/rtl8821c_config.bin $(INSTALL) -m 755 -D $(@D)/rtlbt/rtl8821c_fw $(TARGET_DIR)/lib/firmware/rtl_bt/rtl8821c_fw.bin $(INSTALL) -m 755 -D $(@D)/rtw88.conf $(TARGET_DIR)/etc/modprobe.d/ + $(INSTALL) -m 644 -D $(@D)/asound.state $(TARGET_DIR)/var/lib/alsa/ endef $(eval $(generic-package)) diff --git a/package/phytium-tools/src/asound.state b/package/phytium-tools/src/asound.state new file mode 100644 index 00000000..47742d8c --- /dev/null +++ b/package/phytium-tools/src/asound.state @@ -0,0 +1,333 @@ +state.phytiumpe220xi2 { + control.1 { + iface MIXER + name 'HP Playback Volume' + value.0 3 + value.1 3 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 4' + dbmin -4800 + dbmax -1200 + dbvalue.0 -1200 + dbvalue.1 -1200 + } + } + control.2 { + iface MIXER + name 'HPMixer Gain' + value.0 0 + value.1 0 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 7' + dbmin -1200 + dbmax -150 + dbvalue.0 -1200 + dbvalue.1 -1200 + } + } + control.3 { + iface MIXER + name 'DAC Playback Volume' + value.0 152 + value.1 152 + comment { + access 'read write' + type INTEGER + count 2 + range '0 - 192' + dbmin -9999999 + dbmax 0 + dbvalue.0 -2000 + dbvalue.1 -2000 + } + } + control.4 { + iface MIXER + name 'Enable DAC Soft Ramp' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.5 { + iface MIXER + name 'DAC Soft Ramp Rate' + value 4 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 4' + } + } + control.6 { + iface MIXER + name 'Playback Polarity' + value Normal + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 Normal + item.1 'R Invert' + item.2 'L Invert' + item.3 'L + R Invert' + } + } + control.7 { + iface MIXER + name 'DAC Notch Filter' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.8 { + iface MIXER + name 'DAC Double Fs Mode' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.9 { + iface MIXER + name 'DAC Volume Control-LeR' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.10 { + iface MIXER + name 'DAC Stereo Enhancement' + value 0 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 7' + } + } + control.11 { + iface MIXER + name 'MIC Boost' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.12 { + iface MIXER + name 'Input PGA' + value 6 + comment { + access 'read write' + type INTEGER + count 1 + range '0 - 8' + dbmin 0 + dbmax 2400 + dbvalue.0 1800 + } + } + control.13 { + iface MIXER + name 'mic-in Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.14 { + iface MIXER + name 'Differential Mux' + value 'lin2-rin2 with 15db Boost' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 lin1-rin1 + item.1 lin2-rin2 + item.2 'lin1-rin1 with 15db Boost' + item.3 'lin2-rin2 with 15db Boost' + } + } + control.15 { + iface MIXER + name 'Digital Mic Mux' + value 'dmic disable' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 'dmic disable' + item.1 'dmic data at high level' + item.2 'dmic data at low level' + } + } + control.16 { + iface MIXER + name 'DAC SRC Mux' + value 'LDATA TO LDAC, RDATA TO RDAC' + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 'LDATA TO LDAC, RDATA TO RDAC' + item.1 'LDATA TO LDAC, LDATA TO RDAC' + item.2 'RDATA TO LDAC, RDATA TO RDAC' + item.3 'RDATA TO LDAC, LDATA TO RDAC' + } + } + control.17 { + iface MIXER + name 'Left Hp mux' + value lin1-rin1 + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 lin1-rin1 + item.1 lin2-rin2 + item.2 'lin-rin with Boost' + item.3 'lin-rin with Boost and PGA' + } + } + control.18 { + iface MIXER + name 'Right Hp mux' + value lin1-rin1 + comment { + access 'read write' + type ENUMERATED + count 1 + item.0 lin1-rin1 + item.1 lin2-rin2 + item.2 'lin-rin with Boost' + item.3 'lin-rin with Boost and PGA' + } + } + control.19 { + iface MIXER + name 'Left Hp mixer LLIN Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.20 { + iface MIXER + name 'Left Hp mixer Left DAC Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.21 { + iface MIXER + name 'Right Hp mixer RLIN Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } + control.22 { + iface MIXER + name 'Right Hp mixer Right DAC Switch' + value false + comment { + access 'read write' + type BOOLEAN + count 1 + } + } +} +state.PMDKI2S { + control.1 { + iface CARD + name 'HDMI/DP,pcm=0 Jack' + value true + comment { + access read + type BOOLEAN + count 1 + } + } + control.2 { + iface PCM + name 'Playback Channel Map' + value.0 0 + value.1 0 + comment { + access read + type INTEGER + count 2 + range '0 - 36' + } + } + control.3 { + iface PCM + name 'IEC958 Playback Mask' + value ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + comment { + access read + type IEC958 + count 1 + } + } + control.4 { + iface PCM + name 'IEC958 Playback Default' + value '0400000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' + comment { + access 'read write' + type IEC958 + count 1 + } + } + control.5 { + iface PCM + name ELD + value '1000070066140001000000000000000005e30124323450315731090707000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' + comment { + access 'read volatile' + type BYTES + count 128 + } + } + control.6 { + iface MIXER + name 'DP Switch' + value true + comment { + access 'read write' + type BOOLEAN + count 1 + } + } +} -- Gitee From e2630bed3105a7adfe827788a98e017a8fc16531 Mon Sep 17 00:00:00 2001 From: lindongping Date: Mon, 24 Jun 2024 17:28:58 +0800 Subject: [PATCH 3/6] modify the sound card description of the sound icon Signed-off-by: lindongping --- board/phytium/common/debian-package-installer | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index b7448dd6..028d3d70 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -84,7 +84,11 @@ do_distrorfs_second_stage() { echo 'root' >> /etc/deniedusers chmod 600 /etc/deniedusers echo 'auth required pam_listfile.so onerr=succeed item=user sense=deny file=/etc/deniedusers' >> /etc/pam.d/lightdm - + + # set the name of the sound output devices + echo 'update-sink-proplist 1 device.description=Headphone' >> /etc/pulse/default.pa + echo 'update-sink-proplist 0 device.description=HDMI' >> /etc/pulse/default.pa + echo remove packages. DEBIAN_FRONTEND=noninteractive apt-get -y remove --purge parole || exit 1 fi @@ -118,6 +122,8 @@ do_distrorfs_second_stage() { [ -d /var/lib/sddm ] && chown -R sddm:sddm /var/lib/sddm systemctl disable ModemManager.service + systemctl disable cups-browsed.service + systemctl disable cups.service systemctl disable udisks2.service systemctl disable NetworkManager-wait-online.service systemctl disable dphys-swapfile.service -- Gitee From 18971b98678ee70f074d5438dd873dacd3dbd0f1 Mon Sep 17 00:00:00 2001 From: lindongping Date: Fri, 12 Jul 2024 14:49:53 +0800 Subject: [PATCH 4/6] add the function of headset hot plug detection and automatic switching of sound output device Signed-off-by: lindongping --- board/phytium/common/debian-package-installer | 2 ++ board/phytium/common/post-build.sh | 4 +++ configs/phytiumpi_defconfig | 2 +- configs/phytiumpi_desktop_defconfig | 2 +- package/phytium-tools/phytium-tools.mk | 8 +++++ .../src/Phytium/PMDK-I2S/HiFi.conf | 16 ++++++++++ .../src/Phytium/PMDK-I2S/PMDK-I2S.conf | 6 ++++ .../src/Phytium/es8336/HiFi.conf | 31 +++++++++++++++++++ .../src/Phytium/es8336/es8336.conf | 6 ++++ .../src/sound_output_device_switching.desktop | 8 +++++ .../phytium-tools/src/switch_to_headphone.sh | 18 +++++++++++ 11 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 package/phytium-tools/src/Phytium/PMDK-I2S/HiFi.conf create mode 100644 package/phytium-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf create mode 100644 package/phytium-tools/src/Phytium/es8336/HiFi.conf create mode 100644 package/phytium-tools/src/Phytium/es8336/es8336.conf create mode 100644 package/phytium-tools/src/sound_output_device_switching.desktop create mode 100755 package/phytium-tools/src/switch_to_headphone.sh diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index 028d3d70..1fdddf9d 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -88,6 +88,8 @@ do_distrorfs_second_stage() { # set the name of the sound output devices echo 'update-sink-proplist 1 device.description=Headphone' >> /etc/pulse/default.pa echo 'update-sink-proplist 0 device.description=HDMI' >> /etc/pulse/default.pa + echo 'set-default-sink 1' >> /etc/pulse/default.pa + echo 'load-module module-switch-on-connect' >> /etc/pulse/default.pa echo remove packages. DEBIAN_FRONTEND=noninteractive apt-get -y remove --purge parole || exit 1 diff --git a/board/phytium/common/post-build.sh b/board/phytium/common/post-build.sh index 22a57bc7..ccf56c5b 100755 --- a/board/phytium/common/post-build.sh +++ b/board/phytium/common/post-build.sh @@ -22,6 +22,10 @@ main() sudo chown -R $USER:$GROUPS $1/var/cache/ldconfig/aux-cache fi + # alsa UCM + ln -sf ../../Phytium/es8336/es8336.conf $1/usr/share/alsa/ucm2/conf.d/simple-card/phytium,pe220x-i2s-audio.conf + ln -sf ../../Phytium/PMDK-I2S/PMDK-I2S.conf $1/usr/share/alsa/ucm2/conf.d/PMDK-I2S/PMDK-I2S.conf + exit $? } diff --git a/configs/phytiumpi_defconfig b/configs/phytiumpi_defconfig index f33d120c..e6347da7 100644 --- a/configs/phytiumpi_defconfig +++ b/configs/phytiumpi_defconfig @@ -34,7 +34,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 6.6 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6_v3.0" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="cafc1fab3d50c5e884a7c55df15ef0d013b94b57" BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/phytiumpi_firefly" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="phytium" diff --git a/configs/phytiumpi_desktop_defconfig b/configs/phytiumpi_desktop_defconfig index 56f7aa5c..e3862091 100644 --- a/configs/phytiumpi_desktop_defconfig +++ b/configs/phytiumpi_desktop_defconfig @@ -34,7 +34,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 6.6 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6_v3.0" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="cafc1fab3d50c5e884a7c55df15ef0d013b94b57" BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/phytiumpi_firefly" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="phytium" diff --git a/package/phytium-tools/phytium-tools.mk b/package/phytium-tools/phytium-tools.mk index 5ed13a1a..8a4c12d1 100644 --- a/package/phytium-tools/phytium-tools.mk +++ b/package/phytium-tools/phytium-tools.mk @@ -19,6 +19,11 @@ define PHYTIUM_TOOLS_INSTALL_TARGET_CMDS mkdir -p $(TARGET_DIR)/lib/firmware/rtw88/ mkdir -p $(TARGET_DIR)/lib/firmware/rtl_bt/ mkdir -p $(TARGET_DIR)/etc/modprobe.d/ + mkdir -p $(TARGET_DIR)/var/lib/alsa/ + mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/ + mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/conf.d/simple-card/ + mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/conf.d/PMDK-I2S/ + mkdir -p $(TARGET_DIR)/home/user/.config/autostart/ $(INSTALL) -m 777 -D $(@D)/dark.jpg $(TARGET_DIR)/usr/share/images/desktop-base/ $(INSTALL) -m 755 -D $(@D)/01_debian.conf $(TARGET_DIR)/usr/share/lightdm/lightdm-gtk-greeter.conf.d/ $(INSTALL) -m 755 -D $(@D)/xfce4-desktop.xml $(TARGET_DIR)/usr/share/desktop-base/profiles/xdg-config/xfce4/xfconf/xfce-perchannel-xml/ @@ -33,6 +38,9 @@ define PHYTIUM_TOOLS_INSTALL_TARGET_CMDS $(INSTALL) -m 755 -D $(@D)/rtlbt/rtl8821c_fw $(TARGET_DIR)/lib/firmware/rtl_bt/rtl8821c_fw.bin $(INSTALL) -m 755 -D $(@D)/rtw88.conf $(TARGET_DIR)/etc/modprobe.d/ $(INSTALL) -m 644 -D $(@D)/asound.state $(TARGET_DIR)/var/lib/alsa/ + cp -rf $(@D)/Phytium/ $(TARGET_DIR)/usr/share/alsa/ucm2/ + $(INSTALL) -m 755 -D $(@D)/switch_to_headphone.sh $(TARGET_DIR)/usr/bin/ + $(INSTALL) -m 644 -D $(@D)/sound_output_device_switching.desktop $(TARGET_DIR)/home/user/.config/autostart/ endef $(eval $(generic-package)) diff --git a/package/phytium-tools/src/Phytium/PMDK-I2S/HiFi.conf b/package/phytium-tools/src/Phytium/PMDK-I2S/HiFi.conf new file mode 100644 index 00000000..1845c10c --- /dev/null +++ b/package/phytium-tools/src/Phytium/PMDK-I2S/HiFi.conf @@ -0,0 +1,16 @@ +SectionDevice."HDMI Audio" { + Comment "HDMI Audio" + + EnableSequence [ + ] + + DisableSequence [ + ] + + Value { + PlaybackPriority 200 + PlaybackPCM "hw:${CardId},0" + JackControl "HDMI/DP,pcm=0 Jack" + } +} + diff --git a/package/phytium-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf b/package/phytium-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf new file mode 100644 index 00000000..14a3a45e --- /dev/null +++ b/package/phytium-tools/src/Phytium/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-tools/src/Phytium/es8336/HiFi.conf b/package/phytium-tools/src/Phytium/es8336/HiFi.conf new file mode 100644 index 00000000..e5295f0c --- /dev/null +++ b/package/phytium-tools/src/Phytium/es8336/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-tools/src/Phytium/es8336/es8336.conf b/package/phytium-tools/src/Phytium/es8336/es8336.conf new file mode 100644 index 00000000..14a3a45e --- /dev/null +++ b/package/phytium-tools/src/Phytium/es8336/es8336.conf @@ -0,0 +1,6 @@ +Syntax 3 + +SectionUseCase."HiFi" { + File "HiFi.conf" + Comment "Play HiFi quality voice." +} diff --git a/package/phytium-tools/src/sound_output_device_switching.desktop b/package/phytium-tools/src/sound_output_device_switching.desktop new file mode 100644 index 00000000..412b500d --- /dev/null +++ b/package/phytium-tools/src/sound_output_device_switching.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Exec=/usr/bin/switch_to_headphone.sh +Hidden=false +NoDisplay=false +X-GNOME-Autostart-enabled=true +Name=Switch to headphone Script +Comment=Starts switch to headphone script on login diff --git a/package/phytium-tools/src/switch_to_headphone.sh b/package/phytium-tools/src/switch_to_headphone.sh new file mode 100755 index 00000000..38791565 --- /dev/null +++ b/package/phytium-tools/src/switch_to_headphone.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Phytium phytiumpi script for automatically switching the sound output device. +# +# Copyright (c) 2024 Phytium Technology Co., Ltd. + + +while true; do + + FLAG="$(pactl list sinks | grep -oP '\[Out\] Headphones:.*?\bnot available\b' | grep -o 'not available')" + + if [ -z "$FLAG" ]; then + pacmd set-default-sink 1 + fi + + sleep 2 + +done -- Gitee From 99be6d29b9fb60c3f6977c21b0ad6c4c1df375ee Mon Sep 17 00:00:00 2001 From: lindongping Date: Wed, 10 Jul 2024 10:00:05 +0800 Subject: [PATCH 5/6] update util-linux to version 2.39.3 Signed-off-by: lindongping --- configs/phytiumpi_defconfig | 4 + configs/phytiumpi_desktop_defconfig | 4 + ...rc-gen_uuid.c-fix-cs_min-declaration.patch | 80 ------------------- package/util-linux/Config.in | 2 + .../util-linux-libs/util-linux-libs.mk | 1 + package/util-linux/util-linux.hash | 4 +- package/util-linux/util-linux.mk | 3 +- 7 files changed, 15 insertions(+), 83 deletions(-) delete mode 100644 package/util-linux/0001-libuuid-src-gen_uuid.c-fix-cs_min-declaration.patch diff --git a/configs/phytiumpi_defconfig b/configs/phytiumpi_defconfig index e6347da7..5d175e04 100644 --- a/configs/phytiumpi_defconfig +++ b/configs/phytiumpi_defconfig @@ -65,3 +65,7 @@ BR2_PACKAGE_VPU_LIB_CPU_MODEL="e2000" # Phytium_tools BR2_PACKAGE_PHYTIUM_TOOLS=y + +# util-linux +BR2_PACKAGE_UTIL_LINUX=y +BR2_PACKAGE_UTIL_LINUX_BINARIES=y diff --git a/configs/phytiumpi_desktop_defconfig b/configs/phytiumpi_desktop_defconfig index e3862091..af963f9d 100644 --- a/configs/phytiumpi_desktop_defconfig +++ b/configs/phytiumpi_desktop_defconfig @@ -66,3 +66,7 @@ BR2_PACKAGE_BUSYBOX=n # Vpu-lib BR2_PACKAGE_VPU_LIB=y BR2_PACKAGE_VPU_LIB_CPU_MODEL="e2000" + +# util-linux +BR2_PACKAGE_UTIL_LINUX=y +BR2_PACKAGE_UTIL_LINUX_BINARIES=y diff --git a/package/util-linux/0001-libuuid-src-gen_uuid.c-fix-cs_min-declaration.patch b/package/util-linux/0001-libuuid-src-gen_uuid.c-fix-cs_min-declaration.patch deleted file mode 100644 index bba4d546..00000000 --- a/package/util-linux/0001-libuuid-src-gen_uuid.c-fix-cs_min-declaration.patch +++ /dev/null @@ -1,80 +0,0 @@ -From bcd11dece7d278bb0b76b138d08dedea80fa8262 Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine -Date: Tue, 7 Nov 2023 18:43:57 +0100 -Subject: [PATCH] libuuid/src/gen_uuid.c: fix cs_min declaration - -Define cs_min through a define and not a const int to avoid the -following build failure with -O0 raised since version 2.39 and -https://github.com/util-linux/util-linux/commit/2fa4168c8bc9d5438bc1dfadda293c7c21b6fa59: - -libuuid/src/gen_uuid.c: In function 'uuid_generate_time_generic': -libuuid/src/gen_uuid.c:536:33: error: initializer element is not constant - THREAD_LOCAL int cache_size = cs_min; - ^~~~~~ - -For consistency, also use define for cs_max and cs_factor - -Fixes: - - http://autobuild.buildroot.org/results/2f80a5cdb523cc3c8c0f3693607a1be036b2ae98 - -Signed-off-by: Fabrice Fontaine -Upstream: https://github.com/util-linux/util-linux/commit/07e5c29d501c19e7af84fecb5915e0f9f94cb49f ---- - libuuid/src/gen_uuid.c | 19 ++++++++++--------- - 1 file changed, 10 insertions(+), 9 deletions(-) - -diff --git a/libuuid/src/gen_uuid.c b/libuuid/src/gen_uuid.c -index 619ef0131..db793c374 100644 ---- a/libuuid/src/gen_uuid.c -+++ b/libuuid/src/gen_uuid.c -@@ -518,6 +518,10 @@ int __uuid_generate_time_cont(uuid_t out, int *num, uint32_t cont_offset) - return __uuid_generate_time_internal(out, num, cont_offset); - } - -+#define CS_MIN (1<<6) -+#define CS_MAX (1<<18) -+#define CS_FACTOR 2 -+ - /* - * Generate time-based UUID and store it to @out - * -@@ -529,11 +533,8 @@ int __uuid_generate_time_cont(uuid_t out, int *num, uint32_t cont_offset) - static int uuid_generate_time_generic(uuid_t out) { - #ifdef HAVE_TLS - /* thread local cache for uuidd based requests */ -- const int cs_min = (1<<6); -- const int cs_max = (1<<18); -- const int cs_factor = 2; - THREAD_LOCAL int num = 0; -- THREAD_LOCAL int cache_size = cs_min; -+ THREAD_LOCAL int cache_size = CS_MIN; - THREAD_LOCAL int last_used = 0; - THREAD_LOCAL struct uuid uu; - THREAD_LOCAL time_t last_time = 0; -@@ -552,10 +553,10 @@ static int uuid_generate_time_generic(uuid_t out) { - * Start with a small cache size to cover short running applications - * and adjust the cache size over the runntime. - */ -- if ((last_used == cache_size) && (cache_size < cs_max)) -- cache_size *= cs_factor; -- else if ((last_used < (cache_size / cs_factor)) && (cache_size > cs_min)) -- cache_size /= cs_factor; -+ if ((last_used == cache_size) && (cache_size < CS_MAX)) -+ cache_size *= CS_FACTOR; -+ else if ((last_used < (cache_size / CS_FACTOR)) && (cache_size > CS_MIN)) -+ cache_size /= CS_FACTOR; - - num = cache_size; - -@@ -568,7 +569,7 @@ static int uuid_generate_time_generic(uuid_t out) { - } - /* request to daemon failed, reset cache */ - num = 0; -- cache_size = cs_min; -+ cache_size = CS_MIN; - } - if (num > 0) { /* serve uuid from cache */ - uu.time_low++; --- -2.43.0 - diff --git a/package/util-linux/Config.in b/package/util-linux/Config.in index 73fa1138..1f5dacec 100644 --- a/package/util-linux/Config.in +++ b/package/util-linux/Config.in @@ -280,6 +280,7 @@ config BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT config BR2_PACKAGE_UTIL_LINUX_NEWGRP bool "newgrp" + select BR2_PACKAGE_LIBXCRYPT if BR2_TOOLCHAIN_USES_GLIBC help Log in to a new group @@ -402,6 +403,7 @@ comment "su needs a uClibc or glibc toolchain w/ wchar, locale, dynamic library, config BR2_PACKAGE_UTIL_LINUX_SULOGIN bool "sulogin" depends on BR2_USE_MMU # fork() + select BR2_PACKAGE_LIBXCRYPT if BR2_TOOLCHAIN_USES_GLIBC help Single-user login diff --git a/package/util-linux/util-linux-libs/util-linux-libs.mk b/package/util-linux/util-linux-libs/util-linux-libs.mk index e1fe1ec1..0337e7e1 100644 --- a/package/util-linux/util-linux-libs/util-linux-libs.mk +++ b/package/util-linux/util-linux-libs/util-linux-libs.mk @@ -24,6 +24,7 @@ UTIL_LINUX_LIBS_LICENSE_FILES = README.licensing \ UTIL_LINUX_LIBS_INSTALL_STAGING = YES UTIL_LINUX_LIBS_DEPENDENCIES = \ host-pkgconf \ + $(if $(BR2_PACKAGE_LIBXCRYPT),libxcrypt) \ $(TARGET_NLS_DEPENDENCIES) UTIL_LINUX_LIBS_CONF_OPTS += \ --disable-rpath \ diff --git a/package/util-linux/util-linux.hash b/package/util-linux/util-linux.hash index 1638cd99..d47f47fd 100644 --- a/package/util-linux/util-linux.hash +++ b/package/util-linux/util-linux.hash @@ -1,7 +1,7 @@ # From https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/sha256sums.asc -sha256 87abdfaa8e490f8be6dde976f7c80b9b5ff9f301e1b67e3899e1f05a59a1531f util-linux-2.39.2.tar.xz +sha256 7b6605e48d1a49f43cc4b4cfc59f313d0dd5402fa40b96810bd572e167dfed0f util-linux-2.39.3.tar.xz # License files, locally calculated -sha256 64dfeae1519bf0e27563d905a71264310fb6a8fa74e5cf99bb36e4d30d7ef455 README.licensing +sha256 13f0ea46d12d798c095a6ad39d7ddc988e2e4d274c6494115f6b463f7bc4f702 README.licensing sha256 9b718a9460fed5952466421235bc79eb49d4e9eacc920d7a9dd6285ab8fd6c6d Documentation/licenses/COPYING.BSD-3-Clause sha256 ba7640f00d93e72e92b94b9d71f25ec53bac2f1682f5c4adcccb0018359f60f8 Documentation/licenses/COPYING.BSD-4-Clause-UC sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 Documentation/licenses/COPYING.GPL-2.0-or-later diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk index 72126adb..f2821978 100644 --- a/package/util-linux/util-linux.mk +++ b/package/util-linux/util-linux.mk @@ -8,7 +8,7 @@ # util-linux-libs/util-linux-libs.mk needs to be updated accordingly as well. UTIL_LINUX_VERSION_MAJOR = 2.39 -UTIL_LINUX_VERSION = $(UTIL_LINUX_VERSION_MAJOR).2 +UTIL_LINUX_VERSION = $(UTIL_LINUX_VERSION_MAJOR).3 UTIL_LINUX_SOURCE = util-linux-$(UTIL_LINUX_VERSION).tar.xz UTIL_LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/util-linux/v$(UTIL_LINUX_VERSION_MAJOR) @@ -37,6 +37,7 @@ UTIL_LINUX_AUTORECONF = YES UTIL_LINUX_INSTALL_STAGING = YES UTIL_LINUX_DEPENDENCIES = \ host-pkgconf \ + $(if $(BR2_PACKAGE_LIBXCRYPT),libxcrypt) \ $(if $(BR2_PACKAGE_UTIL_LINUX_LIBS),util-linux-libs) \ $(TARGET_NLS_DEPENDENCIES) UTIL_LINUX_CONF_OPTS += \ -- Gitee From 4f76e2b7609ab599fe055984cc050a8d1b06c316 Mon Sep 17 00:00:00 2001 From: lindongping Date: Fri, 12 Jul 2024 14:59:51 +0800 Subject: [PATCH 6/6] add phytium-desktop-tools package Signed-off-by: lindongping --- board/phytium/common/post-build.sh | 6 ++-- configs/phytiumpi_desktop_defconfig | 3 +- package/Config.in | 1 + package/phytium-desktop-tools/Config.in | 2 ++ .../phytium-desktop-tools.mk | 31 ++++++++++++++++++ .../src/01_debian.conf | 0 .../src/Phytium/PMDK-I2S/HiFi.conf | 0 .../src/Phytium/PMDK-I2S/PMDK-I2S.conf | 0 .../src/Phytium/es8336/HiFi.conf | 0 .../src/Phytium/es8336/es8336.conf | 0 .../src/asound.state | 0 .../src/dark.jpg | Bin .../src/sound_output_device_switching.desktop | 0 .../src/switch_to_headphone.sh | 0 .../src/xfce4-desktop.xml | 0 package/phytium-tools/phytium-tools.mk | 15 --------- 16 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 package/phytium-desktop-tools/Config.in create mode 100644 package/phytium-desktop-tools/phytium-desktop-tools.mk rename package/{phytium-tools => phytium-desktop-tools}/src/01_debian.conf (100%) rename package/{phytium-tools => phytium-desktop-tools}/src/Phytium/PMDK-I2S/HiFi.conf (100%) rename package/{phytium-tools => phytium-desktop-tools}/src/Phytium/PMDK-I2S/PMDK-I2S.conf (100%) rename package/{phytium-tools => phytium-desktop-tools}/src/Phytium/es8336/HiFi.conf (100%) rename package/{phytium-tools => phytium-desktop-tools}/src/Phytium/es8336/es8336.conf (100%) rename package/{phytium-tools => phytium-desktop-tools}/src/asound.state (100%) rename package/{phytium-tools => phytium-desktop-tools}/src/dark.jpg (100%) rename package/{phytium-tools => phytium-desktop-tools}/src/sound_output_device_switching.desktop (100%) rename package/{phytium-tools => phytium-desktop-tools}/src/switch_to_headphone.sh (100%) rename package/{phytium-tools => phytium-desktop-tools}/src/xfce4-desktop.xml (100%) diff --git a/board/phytium/common/post-build.sh b/board/phytium/common/post-build.sh index ccf56c5b..23f14fbf 100755 --- a/board/phytium/common/post-build.sh +++ b/board/phytium/common/post-build.sh @@ -23,8 +23,10 @@ main() fi # alsa UCM - ln -sf ../../Phytium/es8336/es8336.conf $1/usr/share/alsa/ucm2/conf.d/simple-card/phytium,pe220x-i2s-audio.conf - ln -sf ../../Phytium/PMDK-I2S/PMDK-I2S.conf $1/usr/share/alsa/ucm2/conf.d/PMDK-I2S/PMDK-I2S.conf + if grep -Eq "^BR2_PACKAGE_PHYTIUM_DESKTOP_TOOLS=y$" ${BR2_CONFIG}; then + ln -sf ../../Phytium/es8336/es8336.conf $1/usr/share/alsa/ucm2/conf.d/simple-card/phytium,pe220x-i2s-audio.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/phytiumpi_desktop_defconfig b/configs/phytiumpi_desktop_defconfig index af963f9d..b7e3f92d 100644 --- a/configs/phytiumpi_desktop_defconfig +++ b/configs/phytiumpi_desktop_defconfig @@ -57,8 +57,9 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_ROOTFS_CHOWN=y -# Bluetooth config tools +# Phytium_tools BR2_PACKAGE_PHYTIUM_TOOLS=y +BR2_PACKAGE_PHYTIUM_DESKTOP_TOOLS=y BR2_PACKAGE_ROOTFS_DESKTOP=y BR2_PACKAGE_BUSYBOX=n diff --git a/package/Config.in b/package/Config.in index 5501458a..3ed1096b 100644 --- a/package/Config.in +++ b/package/Config.in @@ -256,6 +256,7 @@ menu "Filesystem and flash utilities" source "package/kernel-headers/Config.in" source "package/rootfs-chown/Config.in" source "package/phytium-tools/Config.in" + source "package/phytium-desktop-tools/Config.in" source "package/kernel-headers/Config.in" endmenu diff --git a/package/phytium-desktop-tools/Config.in b/package/phytium-desktop-tools/Config.in new file mode 100644 index 00000000..e297235a --- /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 00000000..b1293231 --- /dev/null +++ b/package/phytium-desktop-tools/phytium-desktop-tools.mk @@ -0,0 +1,31 @@ +################################################################################ +# +# 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_CMDS = YES + +define PHYTIUM_DESKTOP_TOOLS_INSTALL_TARGET_CMDS + mkdir -p $(TARGET_DIR)/usr/bin + mkdir -p $(TARGET_DIR)/usr/share/images/desktop-base/ + mkdir -p $(TARGET_DIR)/usr/share/lightdm/lightdm-gtk-greeter.conf.d/ + mkdir -p $(TARGET_DIR)/usr/share/desktop-base/profiles/xdg-config/xfce4/xfconf/xfce-perchannel-xml/ + mkdir -p $(TARGET_DIR)/var/lib/alsa/ + mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/ + mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/conf.d/simple-card/ + mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/conf.d/PMDK-I2S/ + mkdir -p $(TARGET_DIR)/home/user/.config/autostart/ + $(INSTALL) -m 777 -D $(@D)/dark.jpg $(TARGET_DIR)/usr/share/images/desktop-base/ + $(INSTALL) -m 755 -D $(@D)/01_debian.conf $(TARGET_DIR)/usr/share/lightdm/lightdm-gtk-greeter.conf.d/ + $(INSTALL) -m 755 -D $(@D)/xfce4-desktop.xml $(TARGET_DIR)/usr/share/desktop-base/profiles/xdg-config/xfce4/xfconf/xfce-perchannel-xml/ + $(INSTALL) -m 644 -D $(@D)/asound.state $(TARGET_DIR)/var/lib/alsa/ + cp -rf $(@D)/Phytium/ $(TARGET_DIR)/usr/share/alsa/ucm2/ + $(INSTALL) -m 755 -D $(@D)/switch_to_headphone.sh $(TARGET_DIR)/usr/bin/ + $(INSTALL) -m 644 -D $(@D)/sound_output_device_switching.desktop $(TARGET_DIR)/home/user/.config/autostart/ +endef + +$(eval $(generic-package)) diff --git a/package/phytium-tools/src/01_debian.conf b/package/phytium-desktop-tools/src/01_debian.conf similarity index 100% rename from package/phytium-tools/src/01_debian.conf rename to package/phytium-desktop-tools/src/01_debian.conf diff --git a/package/phytium-tools/src/Phytium/PMDK-I2S/HiFi.conf b/package/phytium-desktop-tools/src/Phytium/PMDK-I2S/HiFi.conf similarity index 100% rename from package/phytium-tools/src/Phytium/PMDK-I2S/HiFi.conf rename to package/phytium-desktop-tools/src/Phytium/PMDK-I2S/HiFi.conf diff --git a/package/phytium-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf b/package/phytium-desktop-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf similarity index 100% rename from package/phytium-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf rename to package/phytium-desktop-tools/src/Phytium/PMDK-I2S/PMDK-I2S.conf diff --git a/package/phytium-tools/src/Phytium/es8336/HiFi.conf b/package/phytium-desktop-tools/src/Phytium/es8336/HiFi.conf similarity index 100% rename from package/phytium-tools/src/Phytium/es8336/HiFi.conf rename to package/phytium-desktop-tools/src/Phytium/es8336/HiFi.conf diff --git a/package/phytium-tools/src/Phytium/es8336/es8336.conf b/package/phytium-desktop-tools/src/Phytium/es8336/es8336.conf similarity index 100% rename from package/phytium-tools/src/Phytium/es8336/es8336.conf rename to package/phytium-desktop-tools/src/Phytium/es8336/es8336.conf diff --git a/package/phytium-tools/src/asound.state b/package/phytium-desktop-tools/src/asound.state similarity index 100% rename from package/phytium-tools/src/asound.state rename to package/phytium-desktop-tools/src/asound.state diff --git a/package/phytium-tools/src/dark.jpg b/package/phytium-desktop-tools/src/dark.jpg similarity index 100% rename from package/phytium-tools/src/dark.jpg rename to package/phytium-desktop-tools/src/dark.jpg diff --git a/package/phytium-tools/src/sound_output_device_switching.desktop b/package/phytium-desktop-tools/src/sound_output_device_switching.desktop similarity index 100% rename from package/phytium-tools/src/sound_output_device_switching.desktop rename to package/phytium-desktop-tools/src/sound_output_device_switching.desktop diff --git a/package/phytium-tools/src/switch_to_headphone.sh b/package/phytium-desktop-tools/src/switch_to_headphone.sh similarity index 100% rename from package/phytium-tools/src/switch_to_headphone.sh rename to package/phytium-desktop-tools/src/switch_to_headphone.sh diff --git a/package/phytium-tools/src/xfce4-desktop.xml b/package/phytium-desktop-tools/src/xfce4-desktop.xml similarity index 100% rename from package/phytium-tools/src/xfce4-desktop.xml rename to package/phytium-desktop-tools/src/xfce4-desktop.xml diff --git a/package/phytium-tools/phytium-tools.mk b/package/phytium-tools/phytium-tools.mk index 8a4c12d1..3a00fdd9 100644 --- a/package/phytium-tools/phytium-tools.mk +++ b/package/phytium-tools/phytium-tools.mk @@ -13,20 +13,9 @@ 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/ - mkdir -p $(TARGET_DIR)/usr/share/images/desktop-base/ - mkdir -p $(TARGET_DIR)/usr/share/lightdm/lightdm-gtk-greeter.conf.d/ - mkdir -p $(TARGET_DIR)/usr/share/desktop-base/profiles/xdg-config/xfce4/xfconf/xfce-perchannel-xml/ mkdir -p $(TARGET_DIR)/lib/firmware/rtw88/ mkdir -p $(TARGET_DIR)/lib/firmware/rtl_bt/ mkdir -p $(TARGET_DIR)/etc/modprobe.d/ - mkdir -p $(TARGET_DIR)/var/lib/alsa/ - mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/ - mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/conf.d/simple-card/ - mkdir -p $(TARGET_DIR)/usr/share/alsa/ucm2/conf.d/PMDK-I2S/ - mkdir -p $(TARGET_DIR)/home/user/.config/autostart/ - $(INSTALL) -m 777 -D $(@D)/dark.jpg $(TARGET_DIR)/usr/share/images/desktop-base/ - $(INSTALL) -m 755 -D $(@D)/01_debian.conf $(TARGET_DIR)/usr/share/lightdm/lightdm-gtk-greeter.conf.d/ - $(INSTALL) -m 755 -D $(@D)/xfce4-desktop.xml $(TARGET_DIR)/usr/share/desktop-base/profiles/xdg-config/xfce4/xfconf/xfce-perchannel-xml/ $(INSTALL) -m 755 -D $(@D)/rtlbt/* $(TARGET_DIR)/lib/firmware/rtlbt/ $(INSTALL) -m 755 -D $(@D)/rtk_hciattach $(TARGET_DIR)/usr/bin/ $(INSTALL) -m 755 -D $(@D)/resize.sh $(TARGET_DIR)/usr/bin/ @@ -37,10 +26,6 @@ define PHYTIUM_TOOLS_INSTALL_TARGET_CMDS $(INSTALL) -m 755 -D $(@D)/rtlbt/rtl8821c_config $(TARGET_DIR)/lib/firmware/rtl_bt/rtl8821c_config.bin $(INSTALL) -m 755 -D $(@D)/rtlbt/rtl8821c_fw $(TARGET_DIR)/lib/firmware/rtl_bt/rtl8821c_fw.bin $(INSTALL) -m 755 -D $(@D)/rtw88.conf $(TARGET_DIR)/etc/modprobe.d/ - $(INSTALL) -m 644 -D $(@D)/asound.state $(TARGET_DIR)/var/lib/alsa/ - cp -rf $(@D)/Phytium/ $(TARGET_DIR)/usr/share/alsa/ucm2/ - $(INSTALL) -m 755 -D $(@D)/switch_to_headphone.sh $(TARGET_DIR)/usr/bin/ - $(INSTALL) -m 644 -D $(@D)/sound_output_device_switching.desktop $(TARGET_DIR)/home/user/.config/autostart/ endef $(eval $(generic-package)) -- Gitee