From 17d86180642fb6e89f737802d91ce113644e5249 Mon Sep 17 00:00:00 2001 From: lindongping Date: Wed, 10 Jan 2024 17:44:11 +0800 Subject: [PATCH] update to phytiumpios-v1.2 --- Makefile | 9 ++- configs/phytiumpi_defconfig | 8 +- configs/phytiumpi_desktop_defconfig | 9 ++- configs/phytiumpi_linux_4.19.config | 2 +- configs/phytiumpi_linux_4.19_rt.config | 2 +- configs/phytiumpi_linux_5.10_rt.config | 2 +- configs/phytiumpi_optee.config | 2 +- configs/phytiumpi_xenomai_cobalt_4.19.config | 4 +- configs/phytiumpi_xenomai_cobalt_5.10.config | 4 +- configs/phytiumpi_xenomai_mercury_4.19.config | 4 +- configs/phytiumpi_xenomai_mercury_5.10.config | 4 +- package/igh-ethercat/igh-ethercat.mk | 4 +- package/util-linux/util-linux.mk | 7 ++ utils/grant_sudo_perm.sh | 77 +++++++++++++++++++ 14 files changed, 120 insertions(+), 18 deletions(-) create mode 100755 utils/grant_sudo_perm.sh diff --git a/Makefile b/Makefile index 2c52670f..494b7318 100644 --- a/Makefile +++ b/Makefile @@ -591,7 +591,7 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf $(EXTRA_ENV) $(s) $(TARGET_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) .PHONY: world -world: target-post-image +world: grant_sudo_perm target-post-image .PHONY: prepare-sdk prepare-sdk: world @@ -820,6 +820,13 @@ target-post-image: $(TARGETS_ROOTFS) target-finalize staging-finalize $(call MESSAGE,"Executing post-image script $(s)"); \ $(EXTRA_ENV) $(s) $(BINARIES_DIR) $(call qstrip,$(BR2_ROOTFS_POST_SCRIPT_ARGS))$(sep)) +.PHONY: grant_sudo_perm +grant_sudo_perm: +ifeq ($(BR2_ROOTFS_SKELETON_DEBIAN),y) + @echo "*************************" + @$(TOPDIR)/utils/grant_sudo_perm.sh || exit 1 +endif + .PHONY: source source: $(foreach p,$(PACKAGES),$(p)-all-source) diff --git a/configs/phytiumpi_defconfig b/configs/phytiumpi_defconfig index a4b413c6..d7dd9295 100644 --- a/configs/phytiumpi_defconfig +++ b/configs/phytiumpi_defconfig @@ -35,10 +35,10 @@ 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_CUSTOM_REPO_VERSION="kernel-5.10_v2.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_DEFCONFIG="phytium" BR2_LINUX_KERNEL_IMAGEGZ=y BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y BR2_ROOTFS_LINUX_HEADERS=y @@ -67,3 +67,7 @@ BR2_PACKAGE_FFMPEG=y # 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 331531d2..68ce3408 100644 --- a/configs/phytiumpi_desktop_defconfig +++ b/configs/phytiumpi_desktop_defconfig @@ -35,10 +35,10 @@ 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_CUSTOM_REPO_VERSION="kernel-5.10_v2.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_DEFCONFIG="phytium" BR2_LINUX_KERNEL_IMAGEGZ=y BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y BR2_ROOTFS_LINUX_HEADERS=y @@ -68,3 +68,8 @@ BR2_PACKAGE_BUSYBOX=n # FFmpeg BR2_PACKAGE_FFMPEG=y + +# util-linux +BR2_PACKAGE_UTIL_LINUX=y +BR2_PACKAGE_UTIL_LINUX_BINARIES=y + diff --git a/configs/phytiumpi_linux_4.19.config b/configs/phytiumpi_linux_4.19.config index 2e13a53a..99e37ac4 100644 --- a/configs/phytiumpi_linux_4.19.config +++ b/configs/phytiumpi_linux_4.19.config @@ -1,2 +1,2 @@ # kernel 4.19 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_4.19_phytiumpios-v1.0" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-4.19_v2.0" diff --git a/configs/phytiumpi_linux_4.19_rt.config b/configs/phytiumpi_linux_4.19_rt.config index 9537f121..04211358 100644 --- a/configs/phytiumpi_linux_4.19_rt.config +++ b/configs/phytiumpi_linux_4.19_rt.config @@ -1,2 +1,2 @@ # kernel 4.19-rt -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_4.19-rt_phytiumpios-v1.0" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-4.19-rt_v2.0" diff --git a/configs/phytiumpi_linux_5.10_rt.config b/configs/phytiumpi_linux_5.10_rt.config index 1dd48ba9..92bcc5ca 100644 --- a/configs/phytiumpi_linux_5.10_rt.config +++ b/configs/phytiumpi_linux_5.10_rt.config @@ -1,2 +1,2 @@ # kernel 5.10-rt -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10-rt_phytiumpios-v1.0" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-5.10-rt_v2.0" diff --git a/configs/phytiumpi_optee.config b/configs/phytiumpi_optee.config index f3521520..302da962 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="v2.3" +BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_VERSION="v3.0" BR2_PACKAGE_PHYTIUM_OPTEE_BOARD="phytiumpi" diff --git a/configs/phytiumpi_xenomai_cobalt_4.19.config b/configs/phytiumpi_xenomai_cobalt_4.19.config index 4b97dd2a..b59af630 100644 --- a/configs/phytiumpi_xenomai_cobalt_4.19.config +++ b/configs/phytiumpi_xenomai_cobalt_4.19.config @@ -1,6 +1,6 @@ # cobalt kernel 4.19.209-cip59 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/linux-kernel-xenomai.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_4.19.209-cip59_phytiumpios-v1.0" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-4.19.209-cip59_v2.0" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm64/configs/cobalt.config" # xenomai libraries and tools BR2_PACKAGE_XENOMAI=y @@ -8,7 +8,7 @@ BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL=y BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL_URL="https://source.denx.de/Xenomai/xenomai/-/archive/v3.1.3/xenomai-v3.1.3.tar.gz" BR2_PACKAGE_XENOMAI_COBALT=y BR2_PACKAGE_XENOMAI_ENABLE_SMP=y -BR2_PACKAGE_XENOMAI_ADDITIONAL_CONF_OPTS="--enable-pshared" +BR2_PACKAGE_XENOMAI_ADDITIONAL_CONF_OPTS="--enable-pshared --enable-dlopen-libs" BR2_PACKAGE_XENOMAI_TESTSUITE=y BR2_PACKAGE_XENOMAI_RTCAN=y BR2_PACKAGE_XENOMAI_ANALOGY=y diff --git a/configs/phytiumpi_xenomai_cobalt_5.10.config b/configs/phytiumpi_xenomai_cobalt_5.10.config index 05c3dace..3878a66f 100644 --- a/configs/phytiumpi_xenomai_cobalt_5.10.config +++ b/configs/phytiumpi_xenomai_cobalt_5.10.config @@ -1,6 +1,6 @@ # cobalt kernel 5.10.153-dovetail3 BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/linux-kernel-xenomai.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10.153-dovetail3_phytiumpios-v1.0" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-5.10.153-dovetail3_v2.0" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm64/configs/cobalt.config" # xenomai libraries and tools BR2_PACKAGE_XENOMAI=y @@ -8,7 +8,7 @@ BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL=y BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL_URL="https://source.denx.de/Xenomai/xenomai/-/archive/v3.2.2/xenomai-v3.2.2.tar.gz" BR2_PACKAGE_XENOMAI_COBALT=y BR2_PACKAGE_XENOMAI_ENABLE_SMP=y -BR2_PACKAGE_XENOMAI_ADDITIONAL_CONF_OPTS="--enable-pshared" +BR2_PACKAGE_XENOMAI_ADDITIONAL_CONF_OPTS="--enable-pshared --enable-dlopen-libs" BR2_PACKAGE_XENOMAI_TESTSUITE=y BR2_PACKAGE_XENOMAI_RTCAN=y BR2_PACKAGE_XENOMAI_ANALOGY=y diff --git a/configs/phytiumpi_xenomai_mercury_4.19.config b/configs/phytiumpi_xenomai_mercury_4.19.config index 801274bc..a5090d04 100644 --- a/configs/phytiumpi_xenomai_mercury_4.19.config +++ b/configs/phytiumpi_xenomai_mercury_4.19.config @@ -1,12 +1,12 @@ # kernel 4.19-rt -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_4.19-rt_phytiumpios-v1.0" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-4.19-rt_v2.0" # xenomai libraries and tools BR2_PACKAGE_XENOMAI=y BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL=y BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL_URL="https://source.denx.de/Xenomai/xenomai/-/archive/v3.1.3/xenomai-v3.1.3.tar.gz" BR2_PACKAGE_XENOMAI_MERCURY=y BR2_PACKAGE_XENOMAI_ENABLE_SMP=y -BR2_PACKAGE_XENOMAI_ADDITIONAL_CONF_OPTS="--enable-pshared" +BR2_PACKAGE_XENOMAI_ADDITIONAL_CONF_OPTS="--enable-pshared --enable-dlopen-libs" BR2_PACKAGE_XENOMAI_TESTSUITE=y BR2_PACKAGE_XENOMAI_RTCAN=y BR2_PACKAGE_XENOMAI_ANALOGY=y diff --git a/configs/phytiumpi_xenomai_mercury_5.10.config b/configs/phytiumpi_xenomai_mercury_5.10.config index 19816ee4..51c7c03e 100644 --- a/configs/phytiumpi_xenomai_mercury_5.10.config +++ b/configs/phytiumpi_xenomai_mercury_5.10.config @@ -1,12 +1,12 @@ # kernel 5.10-rt -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel_5.10-rt_phytiumpios-v1.0" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-5.10-rt_v2.0" # xenomai libraries and tools BR2_PACKAGE_XENOMAI=y BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL=y BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL_URL="https://source.denx.de/Xenomai/xenomai/-/archive/v3.2.2/xenomai-v3.2.2.tar.gz" BR2_PACKAGE_XENOMAI_MERCURY=y BR2_PACKAGE_XENOMAI_ENABLE_SMP=y -BR2_PACKAGE_XENOMAI_ADDITIONAL_CONF_OPTS="--enable-pshared" +BR2_PACKAGE_XENOMAI_ADDITIONAL_CONF_OPTS="--enable-pshared --enable-dlopen-libs" BR2_PACKAGE_XENOMAI_TESTSUITE=y BR2_PACKAGE_XENOMAI_RTCAN=y BR2_PACKAGE_XENOMAI_ANALOGY=y diff --git a/package/igh-ethercat/igh-ethercat.mk b/package/igh-ethercat/igh-ethercat.mk index 0bd2f35a..ac784e70 100644 --- a/package/igh-ethercat/igh-ethercat.mk +++ b/package/igh-ethercat/igh-ethercat.mk @@ -18,12 +18,14 @@ IGH_ETHERCAT_CONF_OPTS = \ --enable-generic \ --enable-cadence \ --enable-rtdm \ + --disable-rt-syslog \ --with-xenomai-dir=$(STAGING_DIR)/usr/xenomai else IGH_ETHERCAT_CONF_OPTS = \ --with-linux-dir=$(LINUX_DIR) \ --enable-generic \ - --enable-cadence + --enable-cadence \ + --disable-rt-syslog endif IGH_ETHERCAT_CONF_OPTS += $(if $(BR2_PACKAGE_IGH_ETHERCAT_8139TOO),--enable-8139too,--disable-8139too) diff --git a/package/util-linux/util-linux.mk b/package/util-linux/util-linux.mk index 891c17d1..358403e4 100644 --- a/package/util-linux/util-linux.mk +++ b/package/util-linux/util-linux.mk @@ -279,6 +279,13 @@ else UTIL_LINUX_CONF_OPTS += --without-libmagic endif +# Only reinstall lscpu for custom skeleton +ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y) +define UTIL_LINUX_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 0755 $(@D)/lscpu $(TARGET_DIR)/usr/bin +endef +endif + # Install PAM configuration files ifeq ($(BR2_PACKAGE_UTIL_LINUX_SU)$(BR2_PACKAGE_LINUX_PAM),yy) define UTIL_LINUX_INSTALL_PAMFILES diff --git a/utils/grant_sudo_perm.sh b/utils/grant_sudo_perm.sh new file mode 100755 index 00000000..041c0d4b --- /dev/null +++ b/utils/grant_sudo_perm.sh @@ -0,0 +1,77 @@ +#!/bin/bash +SUDO_FILE=/etc/sudoers.d/buildroot_conf +permission_grant() +{ + echo "User(${USER[@]}) is applying the sudo permission." + file=$(tempfile) + if [ "x$?" != "x0" ] + then + echo "Failed to creat a tempfile."; + return 1 + fi + + if [ -f ${SUDO_FILE} ] + then + ${SUDO} rm -rf ${SUDO_FILE} + fi + echo "Host_Alias HOST = ${HOST}" >> ${file} + echo "User_Alias USER = "${USER[0]} >> ${file} + USER_RES=(${USER[@]}) + unset USER_RES[0] + for u in "${USER_RES[@]}" + do + ${SED} -i -e "/User_Alias/ s/$/,${u}/" ${file} + done + echo "Cmnd_Alias MOUNT = ${MOUNT},${UMOUNT}" >> ${file} + echo "Cmnd_Alias CHOWN = ${CHOWN}" >> ${file} + echo "Cmnd_Alias CHROOT1 = ${CHROOT1}" >> ${file} + echo "Cmnd_Alias CHMOD = ${CHMOD}" >> ${file} + echo "Cmnd_Alias FIND = ${FIND}" >> ${file} + echo "Cmnd_Alias CP = ${CP}" >> ${file} + echo "Cmnd_Alias MV = ${MV}" >> ${file} + echo "Cmnd_Alias DEBOOTSTRAP = ${DEBOOTSTRAP}" >> ${file} + echo "Cmnd_Alias MKDIR = ${MKDIR}" >> ${file} + echo "Cmnd_Alias TEE = ${TEE}" >> ${file} + echo "Cmnd_Alias RM = ${RM}" >> ${file} + echo "USER HOST=(root) NOPASSWD:MOUNT,CHMOD,CHROOT1,FIND,CP,MV,RM,MKDIR,TEE,CHOWN,DEBOOTSTRAP" >> ${file} + ${SUDO} ${CHOWN} root:root ${file} + ${SUDO} ${CHMOD} +r ${file} + ${SUDO} ${MV} ${file} ${SUDO_FILE} + echo "Buildroot User(${USER[@]}) is granted" + return 0 +} + + +HOST=ALL +SUDO=`which sudo` +MOUNT=`which mount` +UMOUNT=`which umount` +CHROOT1=`which chroot` +CHOWN=`which chown` +CHMOD=`which chmod` +FIND=`which find` +CP=`which cp` +MV=`which mv` +SED=`which sed` +MKDIR=`which mkdir` +TEE=`which tee` +RM=`which rm` +DEBOOTSTRAP=`which debootstrap` +if [ "x${DEBOOTSTRAP}" = "x" ] +then + echo "debootstrap not found. Try running \"install debootstrap\"" + exit 1 +fi +USER=() +confirmed=false + +if [[ $# -eq 0 ]] +then + USER=($(whoami)) +fi + +if [[ ${#USER[@]} -eq 0 ]] +then + USER=($(whoami)) +fi +permission_grant -- Gitee