diff --git a/README.md b/README.md index 863dca3e74851546bc442ec0b8911f70dbcb4a6b..039426bf8c04611518ce3e573afcbba77a719398 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,6 @@ config文件是功能扩展配置文件,具体的文件及功能如下: |------------------------|--------| | linux_xxx.config | 内核配置文件,含有linux 6.6 rt内核版本 | | desktop.config | XFCE桌面 | -| desktop_gnome.config | GNOME桌面 | | e2000_optee.config | Phytium-optee | | xenomai_xxx.config | cobalt_6.6、mercury_6.6 | | ethercat.config | ethercat | @@ -72,8 +71,8 @@ config文件是功能扩展配置文件,具体的文件及功能如下: defconfig可以和config文件进行组合,用以扩展特定的功能,defconfig与config的组合关系如下: | deconfig | config | |------------------------|--------| -| phytium_ubuntu_defconfig | linux_xxx.config、desktop.config、desktop_gnome.config、e2000_optee.config、xenomai_xxx.config、ethercat.config、jailhouse.config、x100.config、openamp_xxx.config、initramfs.config、kernel_debug.config、host_arm64.config、toolchain_buildroot.config、amdgpu.config、weston.config | -| phytium_debian_defconfig | linux_xxx.config、desktop.config、desktop_gnome.config、e2000_optee.config、xenomai_xxx.config、ethercat.config、jailhouse.config、x100.config、openamp_xxx.config、initramfs.config、host_arm64.config、toolchain_buildroot.config、amdgpu.config、weston.config | +| phytium_ubuntu_defconfig | linux_xxx.config、desktop.config、e2000_optee.config、xenomai_xxx.config、ethercat.config、jailhouse.config、x100.config、openamp_xxx.config、initramfs.config、kernel_debug.config、host_arm64.config、toolchain_buildroot.config、amdgpu.config、weston.config | +| phytium_debian_defconfig | linux_xxx.config、desktop.config、e2000_optee.config、xenomai_xxx.config、ethercat.config、jailhouse.config、x100.config、openamp_xxx.config、initramfs.config、host_arm64.config、toolchain_buildroot.config、amdgpu.config、weston.config | | phytium_defconfig | linux_xxx.config、e2000_optee.config、xenomai_xxx.config、ethercat.config、jailhouse.config、openamp_xxx.config、host_arm64.config、toolchain_buildroot.config | # 编译文件系统 @@ -122,14 +121,9 @@ defconfig中的内核版本默认是linux 6.6。我们支持在编译文件系 (3)镜像的输出位置 生成的根文件系统、内核位于output/images 目录。 -### 支持GNOME桌面 -(1)使用phytium_debian_defconfig或phytium_ubuntu_defconfig作为基础配置项,合并支持desktop_gnome的配置: -`$ ./support/kconfig/merge_config.sh configs/phytium_xxx_defconfig configs/desktop_gnome.config` -注意:X100驱动不支持GNOME桌面,不要将desktop_gnome.config和x100.config合并使用。 -(2)编译 -`$ make` -(3)镜像的输出位置 -生成的根文件系统、内核位于output/images 目录。 +#### Firefox浏览器 +Ubuntu22.04和Ubuntu24.04提供的是snap版的firefox,系统启动后,需要运行`sudo snap install firefox`命令安装firefox snap软件包, +然后点击浏览器图标打开firefox。 ### 支持Phytium-optee Phytium-optee只支持E2000开发板,关于Phytium-optee的信息请参考:`https://gitee.com/phytium_embedded/phytium-optee` diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index 87701042209be04998d7b880925cf3ed49c0eaf2..1afb278f59e40ee8077b7888874e4d361f64c24f 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -103,10 +103,15 @@ do_distrorfs_second_stage() { sed -i 's/#DROPBEAR_OPTIONS=""/DROPBEAR_OPTIONS="-p 2222"/g' /etc/dropbear/initramfs/dropbear.conf fi + # enable ping for user + echo 'net.ipv4.ping_group_range=1000 1000' | tee -a /etc/sysctl.d/10-custom-ping-group.conf + + # disable net renamed + sed -i '/NAME=="", ENV{ID_NET_NAME}!="", NAME="$env{ID_NET_NAME}"/s/^/#/' /lib/udev/rules.d/80-net-setup-link.rules + # clean cached packages apt-get clean - if [ $1 = arm64 ]; then sysarch=aarch64-linux-gnu elif [ $1 = armhf ]; then diff --git a/board/phytium/common/ubuntu-additional_packages_list b/board/phytium/common/ubuntu-additional_packages_list index d0b34c3012215ba701f1084b98823cedb7006822..77b3157219788e70d07997d80ae23c12f0210f50 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 adwaita-icon-theme-full libxmuu-dev libxrender-dev libxft-dev" +additional_desktop_packages_list="network-manager-gnome adwaita-icon-theme-full libxmuu-dev libxrender-dev libxft-dev libgl1-mesa-dev libglu1-mesa-dev libxcb-dri2-0" additional_debian_desktop_packages_list="libxmuu-dev libxrender-dev libxft-dev" @@ -12,4 +12,4 @@ additional_base_packages_list="net-tools iputils-ping gcc g++ vim make autoconf libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools \ gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-pulseaudio \ dkms initramfs-tools debhelper libgles-dev libexpat1-dev libglvnd-dev ffmpeg libglib2.0-dev libxext-dev libxv-dev \ -network-manager wpasupplicant wireless-tools parted locales trace-cmd bpftrace" +network-manager wpasupplicant wireless-tools parted locales trace-cmd bpftrace fdisk cifs-utils" diff --git a/board/phytium/common/ubuntu-package-installer b/board/phytium/common/ubuntu-package-installer index e9e1e0be1d5619dcf150da2613157559b4655366..2727d12a6826d4f083fdff0b51b2a433d4e18f59 100755 --- a/board/phytium/common/ubuntu-package-installer +++ b/board/phytium/common/ubuntu-package-installer @@ -101,20 +101,6 @@ do_distrorfs_second_stage() { DEBIAN_FRONTEND=noninteractive apt remove --purge -y cloud-init && apt autoremove -y || true fi - if [[ $2 = jammy || $2 = noble ]]; then - DEBIAN_FRONTEND=noninteractive apt -y install software-properties-common || true - DEBIAN_FRONTEND=noninteractive add-apt-repository -y ppa:mozillateam/ppa || true - sed -i 's/ppa.launchpadcontent.net/launchpad.proxy.ustclug.org/g' /etc/apt/sources.list.d/mozillateam-* && \ - DEBIAN_FRONTEND=noninteractive apt -y update || true - cat <<-EOF > /etc/apt/preferences.d/mozillateamppa - Package: firefox - Pin: release o=LP-PPA-mozillateam - Pin-Priority: 1001 - EOF - echo 'Unattended-Upgrade::Package-Blacklist:: "firefox";' | tee /etc/apt/apt.conf.d/52unattended-upgrades-firefox - fi - DEBIAN_FRONTEND=noninteractive apt install -y --allow-downgrades firefox || true - usermod -a -G video,render,audio user #cups disable TLSv1.0 and TLSv1.1 @@ -147,10 +133,15 @@ do_distrorfs_second_stage() { sed -i 's/#DROPBEAR_OPTIONS=""/DROPBEAR_OPTIONS="-p 2222"/g' /etc/dropbear/initramfs/dropbear.conf fi + # enable ping for user + echo 'net.ipv4.ping_group_range=1000 1000' | tee -a /etc/sysctl.d/10-custom-ping-group.conf + + # disable net renamed + sed -i '/NAME=="", ENV{ID_NET_NAME}!="", NAME="$env{ID_NET_NAME}"/s/^/#/' /lib/udev/rules.d/80-net-setup-link.rules + # clean cached packages apt-get clean - if [ $1 = arm64 ]; then sysarch=aarch64-linux-gnu elif [ $1 = armhf ]; then diff --git a/configs/desktop_gnome.config b/configs/desktop_gnome.config deleted file mode 100644 index 70a2253781b041e28fde61e277d06ac3fa4a46b0..0000000000000000000000000000000000000000 --- a/configs/desktop_gnome.config +++ /dev/null @@ -1,5 +0,0 @@ -BR2_PACKAGE_ROOTFS_DESKTOP=y -BR2_PACKAGE_PHYTIUM_DESKTOP_TOOLS=y -# Phytium_swap -BR2_PACKAGE_PHYTIUM_SWAP=y -BR2_PACKAGE_GNOME=y diff --git a/configs/kernel_debug.config b/configs/kernel_debug.config index 8563849bea0c47477a92b70758f202e5da61f8fe..a5ce4ba6abf4d3ad71570a7d18f37b2927753770 100644 --- a/configs/kernel_debug.config +++ b/configs/kernel_debug.config @@ -1,5 +1,4 @@ # kernel 6.6 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6_v3.2" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm64/configs/phytium_debug.config" BR2_LINUX_KERNEL_NEEDS_HOST_PAHOLE=y BR2_LINUX_KERNEL_INSTALL_TARGET=y diff --git a/configs/linux_6.6_rt.config b/configs/linux_6.6_rt.config index b820076ce84c73820d1824cd1e1e2b6032801696..eb658e82d4074db4e618a3c78af4258014266c98 100644 --- a/configs/linux_6.6_rt.config +++ b/configs/linux_6.6_rt.config @@ -1,2 +1,2 @@ # kernel 6.6-rt -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6-rt_v3.2" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6-rt_v3.3" diff --git a/configs/phytium_debian_defconfig b/configs/phytium_debian_defconfig index bcf60190238892b4889cd4bede0bfe550ae0485b..9dd9cf4088568089befc56c5c47c5361439528bd 100644 --- a/configs/phytium_debian_defconfig +++ b/configs/phytium_debian_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.2" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6_v3.3" BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/pe2201-demo-ddr4 phytium/pe2202-chillipi-edu-board phytium/pe2202-demo-ddr4-local phytium/pe2202-demo-ddr4 phytium/pe2202-miniitx-board phytium/pe2202-power-board phytium/pe2204-come-board phytium/pe2204-demo-ddr4-local phytium/pe2204-demo-ddr4 phytium/pe2204-edu-board phytium/pe2204-hanwei-board phytium/pe2204-miniitx-board phytium/pe2204-vpx-board phytium/phytiumpi_firefly" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="phytium" diff --git a/configs/phytium_defconfig b/configs/phytium_defconfig index b52159caf3d73fb0d92c475fb1aa4d900bb1430c..ec816c46ea1d6b3240dc7585acc095847d47b4a7 100644 --- a/configs/phytium_defconfig +++ b/configs/phytium_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 6.6 -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6_v3.2" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6_v3.3" BR2_LINUX_KERNEL_DEFCONFIG="phytium" BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="Image" diff --git a/configs/phytium_ubuntu_defconfig b/configs/phytium_ubuntu_defconfig index 8aab55a911ba6dc9e62864790ec40b8ea93486fe..7b5dd4b9d8d91ec08ef4087e811911f8f5bd702a 100644 --- a/configs/phytium_ubuntu_defconfig +++ b/configs/phytium_ubuntu_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.2" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6_v3.3" BR2_LINUX_KERNEL_INTREE_DTS_NAME="phytium/pe2201-demo-ddr4 phytium/pe2202-chillipi-edu-board phytium/pe2202-demo-ddr4-local phytium/pe2202-demo-ddr4 phytium/pe2202-miniitx-board phytium/pe2202-power-board phytium/pe2204-come-board phytium/pe2204-demo-ddr4-local phytium/pe2204-demo-ddr4 phytium/pe2204-edu-board phytium/pe2204-hanwei-board phytium/pe2204-miniitx-board phytium/pe2204-vpx-board phytium/phytiumpi_firefly" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_DEFCONFIG="phytium" diff --git a/configs/xenomai_cobalt_6.6.config b/configs/xenomai_cobalt_6.6.config index f87195f37bee550b19b75fccf971cc5e88cd8d1f..7bc4d7bbb348124c3deb733f6ad82305613e5b3f 100644 --- a/configs/xenomai_cobalt_6.6.config +++ b/configs/xenomai_cobalt_6.6.config @@ -1,6 +1,6 @@ # cobalt kernel 6.6.y-dovetail BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://gitee.com/phytium_embedded/linux-kernel-xenomai.git" -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6.63-dovetail2_v3.2" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6.63-dovetail2_v3.3" BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(LINUX_DIR)/arch/arm64/configs/cobalt.config" # xenomai libraries and tools BR2_PACKAGE_XENOMAI=y diff --git a/configs/xenomai_mercury_6.6.config b/configs/xenomai_mercury_6.6.config index f9a59ab6a5c3bab61674400baa341a0442097030..94c7978d0edfbe320dbefc9287432461ac13d917 100644 --- a/configs/xenomai_mercury_6.6.config +++ b/configs/xenomai_mercury_6.6.config @@ -1,5 +1,5 @@ # kernel 6.6-rt -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6-rt_v3.2" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6-rt_v3.3" # xenomai libraries and tools BR2_PACKAGE_XENOMAI=y BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL=y diff --git a/package/Config.in b/package/Config.in index 58623893f59f48e7c3585f858f41f4631605c93e..3c080b6fff7bbff3a9d95ea708bd54378146560e 100644 --- a/package/Config.in +++ b/package/Config.in @@ -258,6 +258,7 @@ menu "Filesystem and flash utilities" source "package/rootfs-chown/Config.in" source "package/kernel-headers/Config.in" source "package/phytium-swap/Config.in" + source "package/phytium-tools/Config.in" endmenu menu "Fonts, cursors, icons, sounds and themes" diff --git a/package/igh-ethercat/igh-ethercat.mk b/package/igh-ethercat/igh-ethercat.mk index 7c394197c71fd2ad03cb3a3bccee49155ca6f5b6..ff863627005475d1dada984f88dd830666965641 100644 --- a/package/igh-ethercat/igh-ethercat.mk +++ b/package/igh-ethercat/igh-ethercat.mk @@ -4,7 +4,7 @@ # ################################################################################ -IGH_ETHERCAT_VERSION = stable-1.6_v4.1 +IGH_ETHERCAT_VERSION = stable-1.6_v4.2 IGH_ETHERCAT_SITE = https://gitee.com/phytium_embedded/ether-cat.git IGH_ETHERCAT_SITE_METHOD = git IGH_ETHERCAT_LICENSE = GPL-2.0 (IgH EtherCAT master), LGPL-2.1 (libraries) diff --git a/package/jailhouse/jailhouse.mk b/package/jailhouse/jailhouse.mk index 061669e6824943e3afc240b3e99adba58b8dfe36..4d1c12aa2718f493e96de574e9f5c41cae8cc51d 100644 --- a/package/jailhouse/jailhouse.mk +++ b/package/jailhouse/jailhouse.mk @@ -4,7 +4,7 @@ # ################################################################################ -JAILHOUSE_VERSION = 086b03865bea241c49efd53f5a77891637a2128e +JAILHOUSE_VERSION = jailhouse_v2.3 JAILHOUSE_SITE = https://gitee.com/phytium_embedded/phytium-jailhouse.git JAILHOUSE_SITE_METHOD = git JAILHOUSE_LICENSE = GPL-2.0 diff --git a/package/kernel-headers/kernel_headers_install.sh b/package/kernel-headers/kernel_headers_install.sh index 48b1d1f84c79e194b9675cf5e28f63b0deb1619d..3b840963d648def30d0f3251890f547bcb5311f4 100755 --- a/package/kernel-headers/kernel_headers_install.sh +++ b/package/kernel-headers/kernel_headers_install.sh @@ -27,3 +27,5 @@ deploy_kernel_headers_6_6 () { if [[ $2 = 6.6* ]];then deploy_kernel_headers_6_6 $1 $2 $3 $4 fi +# copy .config to /boot +cp $1/usr/src/linux-headers-$2/.config $1/boot/config-$2 diff --git a/package/ncurses/ncurses.mk b/package/ncurses/ncurses.mk index 00e1c0d424573d581f2989d71974c60dad092a6f..41e9af46044e76dce5906065e0158bfab0097066 100644 --- a/package/ncurses/ncurses.mk +++ b/package/ncurses/ncurses.mk @@ -161,7 +161,20 @@ HOST_NCURSES_CONF_OPTS = \ --without-ada \ --with-default-terminfo-dir=/usr/share/terminfo \ --disable-db-install \ - --without-normal + --without-normal \ + --enable-widec \ + --enable-tic \ + --with-termlib \ + --enable-termcap + +define HOST_NCURSES_INSTALL_TINFO + $(INSTALL) -d $(HOST_DIR)/share/terminfo + $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/progs tic + $(HOST_DIR)/bin/tic -xe xterm,xterm-256color,screen,screen-256color,tmux,tmux-256color,linux,vtn100,vt100,ansi,rxvt,rxvt-256color \ + -o $(HOST_DIR)/share/terminfo $(@D)/misc/terminfo.src +endef + +HOST_NCURSES_POST_INSTALL_HOOKS += HOST_NCURSES_INSTALL_TINFO $(eval $(autotools-package)) $(eval $(host-autotools-package)) diff --git a/package/phytium-free-rtos/phytium-free-rtos.mk b/package/phytium-free-rtos/phytium-free-rtos.mk index 9929dbe25807eddec70133a5fa66656d47920831..39ddfeaf0964ccfd5a1039bc46ec6c0c7e20d529 100644 --- a/package/phytium-free-rtos/phytium-free-rtos.mk +++ b/package/phytium-free-rtos/phytium-free-rtos.mk @@ -12,7 +12,7 @@ PHYTIUM_FREE_RTOS_CPU = $(call qstrip,$(BR2_PACKAGE_PHYTIUM_FREE_RTOS_CPU_NAME)) define PHYTIUM_FREE_RTOS_CONFIGURE_CMDS cd $(@D) && \ - $(TARGET_MAKE_ENV) ./install.py + PATH=$(BR_PATH) ./install.py endef define PHYTIUM_FREE_RTOS_BUILD_CMDS diff --git a/package/phytium-tools/Config.in b/package/phytium-tools/Config.in new file mode 100644 index 0000000000000000000000000000000000000000..65a3f5777ecbc2c107e3c027e2c6339d3504ba50 --- /dev/null +++ b/package/phytium-tools/Config.in @@ -0,0 +1,2 @@ +config BR2_PACKAGE_PHYTIUM_TOOLS + bool "phytium_tools" diff --git a/package/phytium-tools/phytium-tools.mk b/package/phytium-tools/phytium-tools.mk new file mode 100644 index 0000000000000000000000000000000000000000..e8c9d379280d45178248bead69bd08fde9b0f671 --- /dev/null +++ b/package/phytium-tools/phytium-tools.mk @@ -0,0 +1,19 @@ +################################################################################ +# +# phytium-tools +# +################################################################################ + +PHYTIUM_TOOLS_VERSION = 0.1 +PHYTIUM_TOOLS_SITE = package/phytium-tools/src +PHYTIUM_TOOLS_SITE_METHOD = local +PHYTIUM_TOOLS_INSTALL_TARGET = YES + +define PHYTIUM_TOOLS_INSTALL_TARGET_CMDS + mkdir -p $(TARGET_DIR)/usr/bin + + $(INSTALL) -m 755 -D $(@D)/devboardinfo $(TARGET_DIR)/usr/bin/ + $(INSTALL) -m 755 -D $(@D)/rootfs_resize.sh $(TARGET_DIR)/usr/bin/ +endef + +$(eval $(generic-package)) diff --git a/package/phytium-tools/src/devboardinfo b/package/phytium-tools/src/devboardinfo new file mode 100644 index 0000000000000000000000000000000000000000..efb827422a977d3a0374569b79908473f3c7c7ae --- /dev/null +++ b/package/phytium-tools/src/devboardinfo @@ -0,0 +1,86 @@ +#!/bin/bash + +# Some of the regex's used in sed +# Catch basic IP6 address "s/\([0-9a-fA-F]\{1,4\}:\)\{7,7\}[0-9a-fA-F]\{1,4\}/y.y.y.y.y.y.y.y/g" +# Catch y::y.y.y.y "s/[0-9a-fA-F]\{1,4\}:\(:[0-9a-fA-F]\{1,4\}\)\{1,4\}/y::y.y.y.y/g" +# IP4 d.d.d.d decimal "s/\([0-9]\{1,3\}\.\)\{3,3\}[0-9]\{1,3\}/x.x.x.x/g" +# mac address "s/\([0-9a-fA-F]\{2,2\}\:\)\{5,5\}[0-9a-fA-F]\{2,2\}/m.m.m.m/g" + +OUT=devboardinfo.txt + +rm -f $OUT + +exec > >(tee -ia $OUT) + +echo "System Information" +echo "******************" +echo + +cat /sys/firmware/devicetree/base/model | sed 's/\x0//g' +echo + +cat /etc/os-release | head -4 +echo + +cat /etc/issue +echo +uname -a + +cat /proc/cpuinfo + +echo +echo "Filesystem information" +echo "**********************" + +df +echo +cat /proc/swaps +echo +lsblk + +echo +echo "Networking Information" +echo "**********************" +echo + +ifconfig | sed -e "s/\([0-9a-fA-F]\{1,4\}:\)\{7,7\}[0-9a-fA-F]\{1,4\}/y.y.y.y.y.y.y.y/g" | sed -e "s/[0-9a-fA-F]\{1,4\}:\(:[0-9a-fA-F]\{1,4\}\)\{1,4\}/y::y.y.y.y/g" | sed -e "s/\([0-9]\{1,3\}\.\)\{3,3\}[0-9]\{1,3\}/x.x.x.x/g" | sed -e "s/\([0-9a-fA-F]\{2,2\}\:\)\{5,5\}[0-9a-fA-F]\{2,2\}/m.m.m.m/g" + + +echo +echo "USB Information" +echo "***************" +echo + +lsusb -t + + +echo +echo "Display Information" +echo "*******************" +echo + +#display_info +xrandr --verbose +echo +sudo cat /sys/kernel/debug/dri/0/state + + +echo +echo "cmdline.txt" +echo "***********" + +cat /proc/cmdline + +echo +echo "dmesg log" +echo "*********" +echo + +dmesg | sed -e "s/\([0-9a-fA-F]\{1,4\}:\)\{7,7\}[0-9a-fA-F]\{1,4\}/y.y.y.y.y.y.y.y/g" | sed -e "s/[0-9a-fA-F]\{1,4\}:\(:[0-9a-fA-F]\{1,4\}\)\{1,4\}/y::y.y.y.y/g" | sed -e "s/\([0-9a-fA-F]\{2,2\}\:\)\{5,5\}[0-9a-fA-F]\{2,2\}/m.m.m.m/g" + +echo +echo "config.txt" +echo "**********" +echo + +zcat /proc/config.gz | egrep -v "^\s*(#|^$)" diff --git a/package/phytium-tools/src/rootfs_resize.sh b/package/phytium-tools/src/rootfs_resize.sh new file mode 100755 index 0000000000000000000000000000000000000000..7f7efb1f602ff45ddc31c9dc2fbff9d46e910bb9 --- /dev/null +++ b/package/phytium-tools/src/rootfs_resize.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +# Phytium rootfs resize script +# +# Copyright (c) 2025 Phytium Technology Co., Ltd. + +echo "******WARNING: This script performs disk partition operations and may result in data loss. Make sure to back up important data before proceeding.******" +echo + +# Get root filesystem partition info +ROOT_PART="$(findmnt / -o source -n)" +ROOT_DEV="/dev/$(lsblk -no pkname "$ROOT_PART")" + +PART_NUM="$(echo "$ROOT_PART" | grep -o "[[:digit:]]*$")" + +LAST_PART_NUM=$(fdisk -l "$ROOT_DEV" | tail -n 1 | cut -f 1 -d' ' | grep -o "[[:digit:]]*$") +if [ "$LAST_PART_NUM" -ne "$PART_NUM" ]; then + whiptail --msgbox "$ROOT_PART is not the last partition. Don't know how to expand" 20 60 2 + return 0 +fi + +# Get the starting offset of the root partition +PART_START=$(fdisk -l "$ROOT_DEV" | tail -n 1 | awk '{print $2}') +[ "$PART_START" ] || exit 1 + +echo +# Show current partition details +echo "****** Current disk partition information: ******" +fdisk -l $ROOT_PART +echo +# Show the expected result +echo "****** After expansion, the partition is expected to occupy the maximum available space on the disk. ******" +echo +# Resize the partition using fdisk +read -p "Partition resizing is about to start. Continue? (y/n): " confirm +if [[ ! "$confirm" =~ ^(Y|y)$ ]]; then + echo "Operation cancelled." + exit 1 +fi +fdisk "$ROOT_DEV" <