From 65b7a5d066abb7e33795dbba0f733db99f9de138 Mon Sep 17 00:00:00 2001 From: lindongping Date: Fri, 9 Aug 2024 15:02:32 +0800 Subject: [PATCH 1/4] debian-package-installer: enable ping for user and add .vimrc Signed-off-by: lindongping --- board/phytium/common/debian-package-installer | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index 29fe601f..117f4604 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -89,6 +89,10 @@ do_distrorfs_second_stage() { echo 'set-default-sink 1' >> /etc/pulse/default.pa echo 'load-module module-switch-on-connect' >> /etc/pulse/default.pa + # set the configuration of vim + echo 'set mouse-=a' >> /home/user/.vimrc + echo 'syntax on' >> /home/user/.vimrc + echo remove packages. DEBIAN_FRONTEND=noninteractive apt-get -y remove --purge parole || exit 1 fi @@ -100,7 +104,10 @@ do_distrorfs_second_stage() { # set kernel loglevel sed -i 's/#kernel.printk = 3 4 1 3/kernel.printk = 4 4 1 7/' /etc/sysctl.d/99-sysctl.conf - + + # enable ping for user + echo 'net.ipv4.ping_group_range=1000 1000' | tee -a /etc/sysctl.d/10-custom-ping-group.conf + if [ $5 = 'phytiumpi' ]; then echo 'defaults.pcm.!card phytiumpe220xi2' >> /etc/asound.conf echo 'defaults.ctl.!card phytiumpe220xi2' >> /etc/asound.conf -- Gitee From e64d8fd3cc662bd02107cd8c8a8f441eeb3923e0 Mon Sep 17 00:00:00 2001 From: lindongping Date: Fri, 9 Aug 2024 18:40:36 +0800 Subject: [PATCH 2/4] post-custom-skeleton-debian-11.sh: update setup_distribution_info function Signed-off-by: lindongping --- .../common/post-custom-skeleton-debian-11.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/board/phytium/common/post-custom-skeleton-debian-11.sh b/board/phytium/common/post-custom-skeleton-debian-11.sh index 7ce38240..38a10300 100755 --- a/board/phytium/common/post-custom-skeleton-debian-11.sh +++ b/board/phytium/common/post-custom-skeleton-debian-11.sh @@ -134,7 +134,7 @@ setup_distribution_info () { echo DISTRIB_ID=Phytium > $tgtfile echo DISTRIB_RELEASE=1.0 >> $tgtfile echo DISTRIB_CODENAME=1.0 >> $tgtfile - echo DISTRIB_DESCRIPTION="Phytium Pi OS" >> $tgtfile + echo 'DISTRIB_DESCRIPTION="Phytium Pi OS V1.5"' >> $tgtfile tgtfile=$RFSDIR/etc/update-motd.d/00-header echo '#!/bin/sh' > $tgtfile @@ -144,18 +144,22 @@ setup_distribution_info () { tgtfile=$RFSDIR/etc/update-motd.d/10-help-text echo '#!/bin/sh' > $tgtfile echo 'printf "\n"' >> $tgtfile - echo 'printf " * Support: https://www.phytium.com.cn\n"' >> $tgtfile + echo 'printf " * Support: https://gitee.com/phytium_embedded/phytium-pi-os\n"' >> $tgtfile tgtfile=$RFSDIR/usr/lib/os-release echo NAME=\"$distroname\" > $tgtfile echo VERSION=${DISTROTYPE}-$distroversion >> $tgtfile - echo ID=Phytium >> $tgtfile + echo ID=debian >> $tgtfile echo VERSION_ID=$distroversion >> $tgtfile echo PRETTY_NAME=\" Phytium Pi\" >> $tgtfile echo VERSION_CODENAME=$distro >> $tgtfile - rm -f $RFSDIR/etc/default/motd-news - rm -f $RFSDIR/etc/update-motd.d/50-motd-news + chmod +x $RFSDIR/etc/update-motd.d/00-header + chmod +x $RFSDIR/etc/update-motd.d/10-help-text + #rm -f $RFSDIR/etc/default/motd-news + #rm -f $RFSDIR/etc/update-motd.d/50-motd-news + chmod -x $RFSDIR/etc/update-motd.d/10-uname + echo -n > $RFSDIR/etc/motd fi } -- Gitee From a112c151b75a474153ce3feb72da83e9a78fe29c Mon Sep 17 00:00:00 2001 From: lindongping Date: Fri, 9 Aug 2024 18:45:47 +0800 Subject: [PATCH 3/4] use permission tables instead of rootfs-chown package to specify permissions or ownership of files Signed-off-by: weishanshan1084 Signed-off-by: lindongping --- board/phytium/common/debian-package-installer | 6 +----- board/phytium/common/desktop_device_table.txt | 4 ++++ board/phytium/common/device_table.txt | 3 +++ board/phytium/common/post-build.sh | 4 ---- configs/phytiumpi_defconfig | 2 +- configs/phytiumpi_desktop_defconfig | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 board/phytium/common/desktop_device_table.txt create mode 100644 board/phytium/common/device_table.txt diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index 117f4604..6b847036 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -122,11 +122,7 @@ do_distrorfs_second_stage() { elif [ $1 = armhf ]; then sysarch=arm-linux-gnueabihf fi - - - [ -f /usr/bin/sudo -a ! -u /usr/bin/sudo ] && chmod +s /usr/bin/sudo - [ -d /var/cache/man ] && chown -R man:root /var/cache/man - [ -d /var/lib/sddm ] && chown -R sddm:sddm /var/lib/sddm + systemctl disable ModemManager.service systemctl disable cups-browsed.service diff --git a/board/phytium/common/desktop_device_table.txt b/board/phytium/common/desktop_device_table.txt new file mode 100644 index 00000000..ee776525 --- /dev/null +++ b/board/phytium/common/desktop_device_table.txt @@ -0,0 +1,4 @@ +# +/var/cache/man r 755 man man - - - - - +/var/lib/lightdm r 755 lightdm lightdm - - - - - +/home/user r 755 user user - - - - - diff --git a/board/phytium/common/device_table.txt b/board/phytium/common/device_table.txt new file mode 100644 index 00000000..ad7693ed --- /dev/null +++ b/board/phytium/common/device_table.txt @@ -0,0 +1,3 @@ +# +/var/cache/man r 755 man man - - - - - +/home/user r 755 user user - - - - - diff --git a/board/phytium/common/post-build.sh b/board/phytium/common/post-build.sh index 3360c509..4bc78f43 100755 --- a/board/phytium/common/post-build.sh +++ b/board/phytium/common/post-build.sh @@ -102,10 +102,6 @@ main() fi fi - if grep -Eq "^BR2_PACKAGE_ROOTFS_CHOWN=y$" ${BR2_CONFIG}; then - sudo chroot ${1} systemctl enable systemd-rootfs-chown.service - fi - if grep -Eq "^BR2_PACKAGE_PHYTIUM_OPTEE=y$" ${BR2_CONFIG}; then # add tee-supplicant systemd service cp -dpf package/phytium-optee/phytium-tee-supplicant.service $1/lib/systemd/system/phytium-tee-supplicant.service diff --git a/configs/phytiumpi_defconfig b/configs/phytiumpi_defconfig index 9b973882..70c3819b 100644 --- a/configs/phytiumpi_defconfig +++ b/configs/phytiumpi_defconfig @@ -57,7 +57,7 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" # required tools to create the microSD image BR2_PACKAGE_HOST_GENIMAGE=y -BR2_PACKAGE_ROOTFS_CHOWN=y +BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt board/phytium/common/device_table.txt" BR2_PACKAGE_BUSYBOX=n diff --git a/configs/phytiumpi_desktop_defconfig b/configs/phytiumpi_desktop_defconfig index 9e98d8d7..4ab1eaea 100644 --- a/configs/phytiumpi_desktop_defconfig +++ b/configs/phytiumpi_desktop_defconfig @@ -57,13 +57,13 @@ BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" # required tools to create the microSD image BR2_PACKAGE_HOST_GENIMAGE=y -BR2_PACKAGE_ROOTFS_CHOWN=y # Phytium_tools BR2_PACKAGE_PHYTIUM_TOOLS=y BR2_PACKAGE_PHYTIUM_DESKTOP_TOOLS=y BR2_PACKAGE_ROOTFS_DESKTOP=y +BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt board/phytium/common/desktop_device_table.txt" BR2_PACKAGE_BUSYBOX=n # FFmpeg -- Gitee From fa609bac4ee8ad7cfe9b56a1a6e0d8bfd688d492 Mon Sep 17 00:00:00 2001 From: lindongping Date: Fri, 9 Aug 2024 18:47:18 +0800 Subject: [PATCH 4/4] defconfig: rm BR2_TARGET_GRUB2 Signed-off-by: lindongping --- configs/phytiumpi_defconfig | 6 +++--- configs/phytiumpi_desktop_defconfig | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configs/phytiumpi_defconfig b/configs/phytiumpi_defconfig index 70c3819b..ec2eac34 100644 --- a/configs/phytiumpi_defconfig +++ b/configs/phytiumpi_defconfig @@ -7,7 +7,7 @@ BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y BR2_TARGET_ROOTFS_TAR_XZ=y BR2_TARGET_ROOTFS_EXT2_SIZE="2G" -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-phytiumpi.cfg" # custom skeleton @@ -45,8 +45,8 @@ BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y BR2_ROOTFS_LINUX_HEADERS=y # Bootloader -BR2_TARGET_GRUB2=y -BR2_TARGET_GRUB2_ARM64_EFI=y +#BR2_TARGET_GRUB2=y +#BR2_TARGET_GRUB2_ARM64_EFI=y BR2_PACKAGE_PHYUBOOT=y BR2_PACKAGE_PHYUBOOT_RAMSIZE="4GB" diff --git a/configs/phytiumpi_desktop_defconfig b/configs/phytiumpi_desktop_defconfig index 4ab1eaea..fc92ffd2 100644 --- a/configs/phytiumpi_desktop_defconfig +++ b/configs/phytiumpi_desktop_defconfig @@ -7,7 +7,7 @@ BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y BR2_TARGET_ROOTFS_TAR_XZ=y BR2_TARGET_ROOTFS_EXT2_SIZE="5G" -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/phytium/post-image.sh support/scripts/genimage.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/phytium/genimage-phytiumpi.cfg" # custom skeleton @@ -45,8 +45,8 @@ BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y BR2_ROOTFS_LINUX_HEADERS=y # Bootloader -BR2_TARGET_GRUB2=y -BR2_TARGET_GRUB2_ARM64_EFI=y +#BR2_TARGET_GRUB2=y +#BR2_TARGET_GRUB2_ARM64_EFI=y BR2_PACKAGE_PHYUBOOT=y BR2_PACKAGE_PHYUBOOT_RAMSIZE="4GB" -- Gitee