diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index 29fe601f69cfc7bb0a7ab51f7dfcc71caac23dc2..6b8470361ef7859048b6b35251b4e438e3e71aff 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 @@ -115,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 0000000000000000000000000000000000000000..ee7765250758d6e3870e68da3084e9325c13585c --- /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 0000000000000000000000000000000000000000..ad7693ed017873113866b8c6bf8ee64cbe10f19c --- /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 3360c509d9825bc1bfb43cc56a8b5d047bd702d1..4bc78f43b274459c44818e19f2549764d6d45d08 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/board/phytium/common/post-custom-skeleton-debian-11.sh b/board/phytium/common/post-custom-skeleton-debian-11.sh index 7ce3824061722b68c8259eb932472ff159e9c42b..38a10300fb7fce9472705953d4ba934f1607e992 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 } diff --git a/configs/phytiumpi_defconfig b/configs/phytiumpi_defconfig index 9b9738821fef5edd21478bf8176d64b31af35525..ec2eac34b872a99254b482fff0e1b1ccb5988a0a 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" @@ -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 9e98d8d77d0d5b868bb0a83ddd3651136dfea28c..fc92ffd280d2e4997b4a7b6a3a1d3d36d7a67626 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" @@ -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