diff --git a/README.md b/README.md index 4fad48c5a02ae44280fea1a52682950342314c7a..8449bb54c97fab419b1b0b76d47e5bdf08eaf59b 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,11 @@ Buildroot被设计为在x86 Linux系统上运行,结合其他因素,本仓 • Source fetching tools: – wget – git +• Kali Linux build tools: +- systemd-container ``` 除此之外,还需要安装如下软件包: -`$ sudo apt install debootstrap qemu-user-static binfmt-support debian-archive-keyring` +`$ sudo apt install debootstrap qemu-user-static binfmt-support debian-archive-keyring eatmydata` 对于debian12系统,需要设置PATH环境变量:`PATH=$PATH:/usr/sbin` ## 下载Phytium Pi OS并切换到2024.02分支 @@ -179,6 +181,30 @@ pyjailhouse安装到/usr/lib/python3.11/site-packages, openamp_core0.elf安装到/lib/firmware,用户空间测试程序安装到/usr/bin。 关于openamp的使用方法等更多信息,请参考`https://gitee.com/phytium_embedded/phytium-embedded-docs/tree/master/open-amp` +### 支持Kali Linux +Kali Linux是基于Debian的Linux发行版,它被设计为用于数字取证的操作系统。 +本项目支持编译Kali Linux,要求编译主机为Ubuntu24或者Debian12,X86架构。 +如果需要编译Kali Linux请执行: +(1)使用phytiumpi_defconfig或者phytiumpi_desktop_defconfig作为基础配置项,合并支持Kali Linux的配置: +`./support/kconfig/merge_config.sh configs/phytiumpi_xxx_defconfig configs/kali_linux.config` +(2)编译 +`$ make` +(3)镜像的输出位置 +生成的根文件系统、内核、sdcard.img 镜像位于output/images目录。 +(4)文件的安装路径 +关于Kali Linux的更多信息,请参考`https://www.kali.org/docs/` + +### 支持weston+qlauncher +Wayland是一个用于替代X Window System(通常简称为X)的计算机显示服务器通信协议,旨在提供更现代、简化和高性能的图形用户界面(GUI)体验。 +Weston作为Wayland协议的一个示例实现,主要目的是作为Wayland协议的参考实现,但它的设计允许它运行在不同的图形环境中,包括传统的X11环境。 +weston.config实现了weston+qlauncher的简单桌面,显示服务默认使用Weston drm后端,并提供了一个简单的qt launcher应用。 +如果需要使用weston+qlauncher功能,请使用不带桌面的配置项phytiumpi_defconfig,合并weston.config配置项: +`./support/kconfig/merge_config.sh configs/phytiumpi_defconfig configs/weston.config` +(2)编译 +`$ make` +(3)镜像的输出位置 +生成的根文件系统、内核、sdcard.img 镜像位于output/images目录。 + ## 清理编译结果 (1)`$ make clean` 删除所有编译结果,包括output目录下的所有内容。当编译完一个文件系统后,编译另一个文件系统前,需要执行此命令。 diff --git a/board/phytium/common/debian-additional_packages_list b/board/phytium/common/debian-additional_packages_list index ce77cfdfbc6f67bfe34edf1e5a0e9f28d7e58b25..d44ff0acf5c8d877a88988a46b303d4d2d6e869e 100644 --- a/board/phytium/common/debian-additional_packages_list +++ b/board/phytium/common/debian-additional_packages_list @@ -1,6 +1,7 @@ # additional packages list for SDK main userland gathered from main repo 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" +additonal_weston_qlauncher_packages_list="xwayland weston qtbase5-dev qtbase5-dev-tools qtwayland5 libqt5serialport5 libqt5serialport5-dev qtwebengine5-* libqt5webengine5" additional_desktop_packages_list="tigervnc-standalone-server vlc rfkill blueman bluetooth fbset audacity" diff --git a/board/phytium/common/debian-package-installer b/board/phytium/common/debian-package-installer index eda6f5b68afe316cb2b4724ecb95b4e2ee527604..e72c0d79bb9344b5b727c98ed03af7f1026e0f4e 100755 --- a/board/phytium/common/debian-package-installer +++ b/board/phytium/common/debian-package-installer @@ -34,38 +34,40 @@ do_distrorfs_second_stage() { deb http://mirrors.tuna.tsinghua.edu.cn/debian-security $2-security main contrib non-free non-free-firmware EOF chmod +777 /tmp - apt update + eatmydata apt update DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C \ - apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update || exit 1 + eatmydata apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update || exit 1 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C \ - apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade || exit 1 + eatmydata apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade || exit 1 echo upgraded export LC_ALL=C LANGUAGE=C LANG=C - echo installing base packages: $pkglist + echo installing base packages for pkg in $additional_base_packages_list; do echo Installing $pkg ... - DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $pkg || exit 1 + DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $pkg || exit 1 done + dpkg -l | grep linux-headers | cut -d ' ' -f3 | xargs dpkg --purge + dpkg -l | grep linux-kbuild | cut -d ' ' -f3 | xargs dpkg --purge echo installed additional packages. if [ $6 = desktop ]; then for pkg in task-xfce-desktop; do - DEBIAN_FRONTEND=noninteractive apt -y install $pkg || true + DEBIAN_FRONTEND=noninteractive eatmydata apt -y install $pkg || true done rm -f /etc/systemd/system/display-manager.service - echo installing desktop packages list packages: $pkglist + echo installing desktop packages list packages for pkg in $additional_desktop_packages_list; do echo Installing $pkg ... - DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $pkg || exit 1 + DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $pkg || exit 1 done # remove plymouth - DEBIAN_FRONTEND=noninteractive apt -y remove plymouth || true + DEBIAN_FRONTEND=noninteractive eatmydata apt -y remove plymouth || true 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 @@ -88,7 +90,13 @@ do_distrorfs_second_stage() { echo 'syntax on' >> /root/.vimrc echo remove packages. - DEBIAN_FRONTEND=noninteractive apt-get -y remove --purge parole || exit 1 + DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y remove --purge parole || exit 1 + elif [ $6 = weston ]; then + echo installing weston packages list packages + for pkg in $additonal_weston_qlauncher_packages_list; do + echo Installing $pkg ... + DEBIAN_FRONTEND=noninteractive eatmydata apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $pkg || exit 1 + done fi # set timezone @@ -117,7 +125,7 @@ do_distrorfs_second_stage() { fi # clean cached packages - apt-get clean + eatmydata apt-get clean if [ $1 = arm64 ]; then @@ -155,6 +163,9 @@ do_distrorfs_second_stage() { tr "\n" " " | cut -d' ' -f2,4,6,7,9,10 >> /etc/packages.list i=$[ $i + 4 ] done + # Clean up dpkg.eatmydata + rm -f /usr/bin/dpkg + dpkg-divert --remove --rename /usr/bin/dpkg rm -f packagelist } diff --git a/board/phytium/common/kali-archive-keyring.gpg b/board/phytium/common/kali-archive-keyring.gpg new file mode 100644 index 0000000000000000000000000000000000000000..37973d92f2dae07d1de95a3381d99869653bb418 Binary files /dev/null and b/board/phytium/common/kali-archive-keyring.gpg differ diff --git a/board/phytium/common/kali-linux-additional_packages_list b/board/phytium/common/kali-linux-additional_packages_list new file mode 100644 index 0000000000000000000000000000000000000000..6afd56d9c4a3cf63c21bcbd727439348b57c37c4 --- /dev/null +++ b/board/phytium/common/kali-linux-additional_packages_list @@ -0,0 +1,16 @@ +# additional packages list for SDK main userland gathered from main repo +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 fbset audacity network-manager-gnome" + +# 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 network-manager jq git libglib2.0-dev libxext-dev libxv-dev ffmpeg dkms \ +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 gstreamer1.0-tools kali-menu kali-defaults" + diff --git a/board/phytium/common/kali-linux-package-installer b/board/phytium/common/kali-linux-package-installer new file mode 100755 index 0000000000000000000000000000000000000000..6d4b3086d0100724e63943ace633a17d6d371a96 --- /dev/null +++ b/board/phytium/common/kali-linux-package-installer @@ -0,0 +1,164 @@ +#!/bin/bash + +DISTROTYPE=$3 +DISTROSCALE=$5 +tarch=$1 + +do_distrorfs_second_stage() { + [ -f /etc/buildinfo -a ! -f /proc/uptime ] && return + packages_list=/usr/aptpkg/$4 + . $packages_list + + echo "1." $1 + echo "2." $2 + echo "3." $3 + echo "4." $4 + echo "5." $5 + echo "6." $6 + + if [ -d /etc/shadow ]; then + cd /etc + chmod u=rw,g=r,o=r shadow + fi + + # set default hostname + echo localhost > /etc/hostname + + # set apt sources list to install additional packages + asl=/etc/apt/sources.list + rm -f $asl + cat <<-EOF > $asl + deb http://mirrors.tuna.tsinghua.edu.cn/kali/ $2 main contrib non-free non-free-firmware + EOF + chmod +777 /tmp + apt update + DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C \ + apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update || exit 1 + + DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C \ + apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade || exit 1 + echo upgraded + + export LC_ALL=C LANGUAGE=C LANG=C + + echo installing base packages: $pkglist + for pkg in $additional_base_packages_list; do + echo Installing $pkg ... + DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $pkg || exit 1 + done + + + echo installed additional packages. + if [ $6 = desktop ]; then + for pkg in xfce4; do + DEBIAN_FRONTEND=noninteractive apt -y install $pkg || true + done + + rm -f /etc/systemd/system/display-manager.service + sed -i "s/gdm3/lightdm/" /etc/X11/default-display-manager + echo '[SeatDefaults]' >> /etc/lightdm/lightdm.conf + echo 'greeter-session=lightdm-gtk-greeter' >> /etc/lightdm/lightdm.conf + echo 'user-session=xfce' >> /etc/lightdm/lightdm.conf + + echo installing desktop packages list packages: $pkglist + for pkg in $additional_desktop_packages_list; do + echo Installing $pkg ... + DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $pkg || exit 1 + done + + # remove plymouth + DEBIAN_FRONTEND=noninteractive apt -y remove plymouth || true + 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 'set-default-sink 1' >> /etc/pulse/default.pa + + # touch .desktop_firstrun + touch /root/.desktop_firstlogin + + #cups disable TLSv1.0 and TLSv1.1 + if [ -f /etc/cups/cupsd.conf ]; then + echo "SSLOptions MinTLS1.2" >> /etc/cups/cupsd.conf + fi + + # set the configuration of vim + echo 'set mouse-=a' >> /root/.vimrc + echo 'syntax on' >> /root/.vimrc + + echo remove packages. + DEBIAN_FRONTEND=noninteractive apt-get -y remove --purge parole || exit 1 + fi + + # set timezone + echo "Asia/Shanghai" > /etc/timezone + rm /etc/localtime + dpkg-reconfigure -f noninteractive tzdata + + # set kernel loglevel + sed -i 's/#kernel.printk = 3 4 1 3/kernel.printk = 4 4 1 7/' /etc/sysctl.d/99-sysctl.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 + + # 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 + fi + + if dpkg -s openssh-server &> /dev/null; then + sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config + #ssh: disable weak MAC algorithm + echo "MACs hmac-sha2-256,hmac-sha2-512" >> /etc/ssh/sshd_config + fi + + # clean cached packages + apt-get clean + + + if [ $1 = arm64 ]; then + sysarch=aarch64-linux-gnu + elif [ $1 = armhf ]; then + sysarch=arm-linux-gnueabihf + fi + + + 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 + systemctl disable bluetooth.service + + # some shared libraries locate in /lib/aarch64-linux-gnu(or /lib/arm-linux-gnueabihf) and /usr/local/lib + echo export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/$sysarch:/lib/$sysarch >> /etc/profile + + tmpusr=`ls -t /home | cut -d' ' -f1 | head -1` + [ -d /home/$tmpusr -a "$tmpusr" != "user" ] && rm -rf /home/$tmpusr + + test -c /dev/pts/0 && umount /dev/pts + test -f /proc/uptime && umount /proc + + echo APT Packages List: > /etc/packages.list + echo -e "Package\t Version\t Download-Size\t APT-Sources" >> /etc/packages.list + apt list --installed | cut -d/ -f1 | xargs apt show | \ + grep -E '^Package:|^APT-Sources:|^Version:|^Download-Size:' > packagelist + lnum=`wc -l packagelist |cut -d' ' -f1` + for((i=1; i<$lnum;)); do + t=$[ $i + 3 ] + sed -n "${i},${t}p" packagelist | grep -E 'Package:|APT-Sources:|Version:|Download-Size:' | \ + tr "\n" " " | cut -d' ' -f2,4,6,7,9,10 >> /etc/packages.list + i=$[ $i + 4 ] + done + rm -f packagelist +} + +do_distrorfs_second_stage $1 $2 $3 $4 $5 $6 +# end second stage installing diff --git a/board/phytium/common/post-custom-skeleton-debian.sh b/board/phytium/common/post-custom-skeleton-debian.sh index 26e9c7c0a6da99fc0c260c0ad24455b0950bfcc2..5ad4467e49377f6775ce1ddc98a1931137f25305 100755 --- a/board/phytium/common/post-custom-skeleton-debian.sh +++ b/board/phytium/common/post-custom-skeleton-debian.sh @@ -71,12 +71,42 @@ do_distrorfs_first_stage() { if [ ! -d $RFSDIR/debootstrap ]; then echo "testdeboot" export LANG=en_US.UTF-8 - sudo debootstrap --keyring=board/phytium/common/debian-archive-$4-stable.gpg --arch=$1 --foreign $4 $RFSDIR https://mirrors.tuna.tsinghua.edu.cn/debian/ + sudo eatmydata debootstrap --foreign --keyring=board/phytium/common/debian-archive-$4-stable.gpg --include=eatmydata --arch=$1 $4 $RFSDIR https://mirrors.tuna.tsinghua.edu.cn/debian/ + + # We need to manually extract eatmydata to use it for the second stage + for archive in $RFSDIR/var/cache/apt/archives/*eatmydata*.deb; do + sudo dpkg-deb --fsys-tarfile "$archive" | sudo tee $RFSDIR/eatmydata > /dev/null + sudo tar -xkf $RFSDIR/eatmydata -C $RFSDIR + sudo rm -f $RFSDIR/eatmydata + + done + # Prepare dpkg to use eatmydata + sudo chroot $RFSDIR dpkg-divert --divert /usr/bin/dpkg-eatmydata --rename --add /usr/bin/dpkg + + lib_arch="aarch64-linux-gnu" +sudo tee $RFSDIR/usr/bin/dpkg < $tgtfile echo DISTRIB_RELEASE=1.0 >> $tgtfile echo DISTRIB_CODENAME=1.0 >> $tgtfile - echo 'DISTRIB_DESCRIPTION="Phytium Pi OS V2.1"' >> $tgtfile + echo 'DISTRIB_DESCRIPTION="Phytium Pi OS V2.2"' >> $tgtfile tgtfile=$RFSDIR/etc/update-motd.d/00-header echo '#!/bin/sh' > $tgtfile @@ -187,7 +217,11 @@ full_rtf() if grep -Eq "^BR2_PACKAGE_ROOTFS_DESKTOP=y$" ${BR2_CONFIG}; then echo "desktop" else - echo "base" + if grep -Eq "^BR2_PACKAGE_WESTON_QLAUNCHER=y$" ${BR2_CONFIG}; then + echo "weston" + else + echo "base" + fi fi } diff --git a/board/phytium/common/post-custom-skeleton-kali-linux.sh b/board/phytium/common/post-custom-skeleton-kali-linux.sh new file mode 100755 index 0000000000000000000000000000000000000000..916edb71e93f28a4466b68f64f2a243341ee5e00 --- /dev/null +++ b/board/phytium/common/post-custom-skeleton-kali-linux.sh @@ -0,0 +1,276 @@ +#!/usr/bin/env bash + +trap recover_from_ctrl_c INT + +recover_from_ctrl_c() +{ + do_recover_from_error "Interrupt caught ... exiting" + exit 1 +} + +do_recover_from_error() +{ + sudo chroot $RFSDIR /bin/umount /proc > /dev/null 2>&1; + sudo chroot $RFSDIR /bin/umount /sys > /dev/null 2>&1; + USER=$(id -u); GROUPS=${GROUPS}; \ + sudo chroot $RFSDIR /bin/chown -R ${USER}:${GROUPS} / > /dev/null 2>&1; + echo -e "\n************" + echo $1 + echo -e " Please running the below commands before re-compiling:" + echo -e " rm -rf $RFSDIR" + echo -e " make skeleton-custom-dirclean" + echo -e " Or\n make skeleton-custom-dirclean O=" +} + +do_distrorfs_first_stage() { +# $1: platform architecture, arm64 +# $2: rootfs directory, output/build/skeleton-custom +# $3: board/common/additional_packages_list +# $4: kali-last-snapshot +# $5: kali-linux + + DISTROTYPE=$5 + [ -z "$RFSDIR" ] && RFSDIR=$2 + [ -z $RFSDIR ] && echo No RootFS exist! && return + [ -f $RFSDIR/etc/.firststagedone ] && echo $RFSDIR firststage exist! && return + [ -f /etc/.firststagedone -a ! -f /proc/uptime ] && return + + if [ $1 = arm64 ]; then + tgtarch=aarch64 + elif [ $1 = armhf ]; then + tgtarch=arm + fi + + qemu-${tgtarch}-static -version > /dev/null 2>&1 + if [ "x$?" != "x0" ]; then + echo qemu-${tgtarch}-static not found + exit 1 + fi + + debootstrap --version > /dev/null 2>&1 + if [ "x$?" != "x0" ]; then + echo debootstrap not found + exit 1 + fi + + sudo chown 0:0 $RFSDIR + sudo mkdir -p $2/usr/local/bin + sudo cp -f board/phytium/common/kali-linux-package-installer $RFSDIR/usr/local/bin/ + packages_list=board/phytium/common/$3 + [ ! -f $packages_list ] && echo $packages_list not found! && exit 1 + + echo additional packages list: $packages_list + if [ ! -d $RFSDIR/usr/aptpkg ]; then + sudo mkdir -p $RFSDIR/usr/aptpkg + sudo cp -f $packages_list $RFSDIR/usr/aptpkg + fi + + sudo mkdir -p $RFSDIR/etc + sudo cp -f /etc/resolv.conf $RFSDIR/etc/resolv.conf + + if [ ! -d $RFSDIR/debootstrap ]; then + echo "testdeboot" + export LANG=en_US.UTF-8 + sudo eatmydata debootstrap --foreign --keyring=board/phytium/common/kali-archive-keyring.gpg --include=kali-archive-keyring,eatmydata --components="main,contrib,non-free,non-free-firmware" --arch $1 $4 $RFSDIR https://mirrors.tuna.tsinghua.edu.cn/kali + + # Check systemd-nspawn version + nspawn_ver=$(systemd-nspawn --version | awk '{if(NR==1) print $2}') + + if [[ $nspawn_ver -ge 245 ]]; then + extra_args="--hostname=$hostname -q -P" + + elif [[ $nspawn_ver -ge 241 ]]; then + extra_args="--hostname=$hostname -q" + + else + extra_args="-q" + + fi + + ENV1="RUNLEVEL=1" + ENV2="LANG=C" + ENV3="DEBIAN_FRONTEND=noninteractive" + ENV4="DEBCONF_NOWARNINGS=yes" + # Jenkins server doesn't have this?? + #ENV5="QEMU_CPU=max,pauth-impdef=on" + ENV5="QEMU_CPU=cortex-a72" + + # Ensure we export QEMU_CPU so its set for systemd-nspawn to use + #export QEMU_CPU=max,pauth-impdef=on + export QEMU_CPU=cortex-a72 + # Generate a random machine name to be used + machine=$(dbus-uuidgen) + qemu_bin="/usr/bin/qemu-aarch64-static" + lib_arch="aarch64-linux-gnu" + # systemd-nspawn environment + systemd_nspawn_exec() { + # LANG=C systemd-nspawn -q --bind-ro ${qemu_bin} -M ${machine} -D ${work_dir} "$@" + sudo systemd-nspawn --bind-ro "$qemu_bin" $extra_args --capability=cap_setfcap -E $ENV1 -E $ENV2 -E $ENV3 -E $ENV4 -E $ENV5 -M "$machine" -D "$RFSDIR" "$@" + } + # We need to manually extract eatmydata to use it for the second stage + for archive in $RFSDIR/var/cache/apt/archives/*eatmydata*.deb; do + sudo dpkg-deb --fsys-tarfile "$archive" | sudo tee $RFSDIR/eatmydata > /dev/null + sudo tar -xkf $RFSDIR/eatmydata -C $RFSDIR + sudo rm -f $RFSDIR/eatmydata + + done + + # Prepare dpkg to use eatmydata + systemd_nspawn_exec dpkg-divert --divert /usr/bin/dpkg-eatmydata --rename --add /usr/bin/dpkg + +sudo tee $RFSDIR/usr/bin/dpkg </dev/null + elif [ $4 = bookworm ]; then + echo debian,12 | tee $RFSDIR/etc/.firststagedone 1>/dev/null + + fi + setup_distribution_info $5 $2 $1 $4 + + #rm $RFSDIR/etc/apt/apt.conf + sudo rm $RFSDIR/dev/* -rf +} + +setup_distribution_info () { + DISTROTYPE=$1 + RFSDIR=$2 + tarch=$3 + distro=$4 + distroname=`head -1 $RFSDIR/etc/.firststagedone | cut -d, -f1` + distroversion=`head -1 $RFSDIR/etc/.firststagedone | cut -d, -f2` + releaseversion="$distroname (based on $DISTROTYPE-$distroversion-base) ${tarch}" + releasestamp="Build: `date +'%Y-%m-%d %H:%M:%S'`" + echo $releaseversion > $RFSDIR/etc/buildinfo + sed -i "1 a\\$releasestamp" $RFSDIR/etc/buildinfo + if grep U-Boot $RFSDIR/etc/.firststagedone 1>$RFSDIR/dev/null 2>&1; then + tail -1 $RFSDIR/etc/.firststagedone >> $RFSDIR/etc/buildinfo + fi + + if [ $DISTROTYPE = debian ]; then + echo Phytium Pi > $RFSDIR/etc/issue + echo phytium Pi > $RFSDIR/etc/issue.net + + tgtfile=$RFSDIR/etc/lsb-release + echo DISTRIB_ID=Phytium > $tgtfile + echo DISTRIB_RELEASE=1.0 >> $tgtfile + echo DISTRIB_CODENAME=1.0 >> $tgtfile + echo 'DISTRIB_DESCRIPTION="Phytium Pi OS V2.1"' >> $tgtfile + + tgtfile=$RFSDIR/etc/update-motd.d/00-header + echo '#!/bin/sh' > $tgtfile + echo '[ -r /etc/lsb-release ] && . /etc/lsb-release' >> $tgtfile + echo 'printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$(uname -o)" "$(uname -r)" "$(uname -m)"' >> $tgtfile + + tgtfile=$RFSDIR/etc/update-motd.d/10-help-text + echo '#!/bin/sh' > $tgtfile + echo 'printf "\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=debian >> $tgtfile + echo VERSION_ID=$distroversion >> $tgtfile + echo PRETTY_NAME=\" Phytium Pi\" >> $tgtfile + echo VERSION_CODENAME=$distro >> $tgtfile + + 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 +} + +plat_name() +{ + if grep -Eq "^BR2_TARGET_GENERIC_HOSTNAME=\"phytiumpi\"$" ${BR2_CONFIG}; then + echo "phytiumpi" + fi +} + +arch_type() +{ + if grep -Eq "^BR2_aarch64=y$" ${BR2_CONFIG}; then + echo "arm64" + elif grep -Eq "^BR2_arm=y$" ${BR2_CONFIG}; then + echo "armhf" + fi +} + +full_rtf() +{ + if grep -Eq "^BR2_PACKAGE_ROOTFS_DESKTOP=y$" ${BR2_CONFIG}; then + echo "desktop" + else + echo "base" + fi +} + +main() +{ + # $1 - the current rootfs directory, skeleton-custom or target + sudo rm -rf $1/* + + # run first stage do_distrorfs_first_stage arm64 ${1} kali-linux-additional_packages_list kali-last-snapshot kali-linux + do_distrorfs_first_stage $(arch_type) ${1} kali-linux-additional_packages_list kali-last-snapshot kali-linux $(plat_name) $(full_rtf) + + # change the hostname to "platforms-name" + echo $(plat_name) > ${1}/etc/hostname + + if ! grep -q "$(plat_name)" ${1}/etc/hosts; then + echo 127.0.0.1 $(plat_name) | sudo tee -a ${1}/etc/hosts 1>/dev/null + fi + + exit $? +} + +main $@ diff --git a/configs/kali_linux.config b/configs/kali_linux.config new file mode 100644 index 0000000000000000000000000000000000000000..37ab114b9f9c24d8f427759731068feac16de9b2 --- /dev/null +++ b/configs/kali_linux.config @@ -0,0 +1 @@ +BR2_ROOTFS_POST_CUSTOM_SKELETON_SCRIPT="board/phytium/common/post-custom-skeleton-kali-linux.sh" diff --git a/configs/phytiumpi_defconfig b/configs/phytiumpi_defconfig index ac28d8702fb105d9bee92f26a965dbd7eddff33d..62c9bc3ce4fa935120636b94b1a404b23e666a50 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.1" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6_v3.2" 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 964efeaf8417c75c442ea10719d4116ea2ad53a2..4d9b3744c51739bae3a8e0d89b113b43788d4f0a 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.1" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6_v3.2" 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_linux_6.6_rt.config b/configs/phytiumpi_linux_6.6_rt.config index 3e20455fa2554ba1b5f1fa70fae0083662dcf5c8..b820076ce84c73820d1824cd1e1e2b6032801696 100644 --- a/configs/phytiumpi_linux_6.6_rt.config +++ b/configs/phytiumpi_linux_6.6_rt.config @@ -1,2 +1,2 @@ # kernel 6.6-rt -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6-rt_v3.1" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6-rt_v3.2" diff --git a/configs/phytiumpi_optee.config b/configs/phytiumpi_optee.config index 5edcfcbc2df9c8b1d956b03d259ae1a36bb9f1b6..7ed81c7822e6992f5eb36a9f63d05b4b8e111ac4 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="v4.5.2" +BR2_PACKAGE_PHYTIUM_OPTEE_CUSTOM_REPO_VERSION="v4.6.0" BR2_PACKAGE_PHYTIUM_OPTEE_BOARD="phytiumpi" diff --git a/configs/phytiumpi_xenomai_cobalt_6.6.config b/configs/phytiumpi_xenomai_cobalt_6.6.config index a1ac2af397f8114f98d80c712b117d2f7ed557cb..f87195f37bee550b19b75fccf971cc5e88cd8d1f 100644 --- a/configs/phytiumpi_xenomai_cobalt_6.6.config +++ b/configs/phytiumpi_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.1" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6.63-dovetail2_v3.2" 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/phytiumpi_xenomai_mercury_6.6.config b/configs/phytiumpi_xenomai_mercury_6.6.config index d9f3e957a46220568abe885560acb9548597fa69..f9a59ab6a5c3bab61674400baa341a0442097030 100644 --- a/configs/phytiumpi_xenomai_mercury_6.6.config +++ b/configs/phytiumpi_xenomai_mercury_6.6.config @@ -1,5 +1,5 @@ # kernel 6.6-rt -BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6-rt_v3.1" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="kernel-6.6-rt_v3.2" # xenomai libraries and tools BR2_PACKAGE_XENOMAI=y BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL=y diff --git a/configs/weston.config b/configs/weston.config new file mode 100644 index 0000000000000000000000000000000000000000..1721ac82eb50cf4104cfe457a9c468393c216ba6 --- /dev/null +++ b/configs/weston.config @@ -0,0 +1,7 @@ +BR2_PACKAGE_WESTON_QLAUNCHER=y +BR2_PACKAGE_QLAUNCHER=y +BR2_PACKAGE_QT5=y +BR2_PACKAGE_LIBZLIB=y +BR2_PACKAGE_QT5BASE_GUI=y +BR2_PACKAGE_QT5BASE_WIDGETS=y +BR2_PACKAGE_PHYTIUM_DESKTOP_TOOLS=y diff --git a/package/Config.in b/package/Config.in index 04d5bd7c3ad36581a9d387d3fbfb9a30450a5648..63acf4fb0247170df1a040f59c9de12949fb0400 100644 --- a/package/Config.in +++ b/package/Config.in @@ -347,6 +347,7 @@ comment "Graphic applications" source "package/swaybg/Config.in" source "package/tesseract-ocr/Config.in" source "package/tinifier/Config.in" + source "package/qlauncher/Config.in" comment "Graphic libraries" source "package/cegui/Config.in" @@ -406,6 +407,7 @@ endif source "package/tekui/Config.in" source "package/weston/Config.in" source "package/x11r7/Config.in" + source "package/weston-qlauncher/Config.in" comment "X applications" depends on BR2_PACKAGE_XORG7 diff --git a/package/igh-ethercat/igh-ethercat.mk b/package/igh-ethercat/igh-ethercat.mk index 6a163431a836eb80ef198aa971c548f29ac0eea8..7c394197c71fd2ad03cb3a3bccee49155ca6f5b6 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_v3.1 +IGH_ETHERCAT_VERSION = stable-1.6_v4.1 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/phytium-firstlogin/src/phytium-firstlogin b/package/phytium-firstlogin/src/phytium-firstlogin index a78ad79cb846c3c3217762ffdda01b5d7a5bc070..bc6f39ab55333cc37e32c8b9c5b1388326699e47 100755 --- a/package/phytium-firstlogin/src/phytium-firstlogin +++ b/package/phytium-firstlogin/src/phytium-firstlogin @@ -531,8 +531,10 @@ firmware_configure(){ if [[ -f /root/.not_logged_in_yet && -n $(tty) ]]; then do_firstrun_automated_network_configuration - # disable autologin - rm -f /etc/systemd/system/getty@.service.d/override.conf + # disable autologin, reserve autologin when weston is enable + if [[ ! -f /root/.weston ]]; then + rm -f /etc/systemd/system/getty@.service.d/override.conf + fi rm -f /etc/systemd/system/serial-getty@.service.d/override.conf systemctl daemon-reload diff --git a/package/qlauncher/0001-mainwindow.cpp-only-reserve-NET-Painting-Other-panel.patch b/package/qlauncher/0001-mainwindow.cpp-only-reserve-NET-Painting-Other-panel.patch new file mode 100644 index 0000000000000000000000000000000000000000..a1bcb590580dbf789eca1353da8258e86ef16914 --- /dev/null +++ b/package/qlauncher/0001-mainwindow.cpp-only-reserve-NET-Painting-Other-panel.patch @@ -0,0 +1,101 @@ +From b43b692edb7c56bfb460463ea79ba24af6b1f3e0 Mon Sep 17 00:00:00 2001 +From: lindongping2027 +Date: Thu, 24 Apr 2025 16:58:18 +0800 +Subject: [PATCH] mainwindow.cpp: only reserve NET\Painting\Other panel + +Signed-off-by: lindongping2027 +--- + mainwindow.cpp | 62 ++++---------------------------------------------- + 1 file changed, 4 insertions(+), 58 deletions(-) + +diff --git a/mainwindow.cpp b/mainwindow.cpp +index 68dd0ae..504b2d7 100755 +--- a/mainwindow.cpp ++++ b/mainwindow.cpp +@@ -124,79 +124,25 @@ namespace ui { + + void MainWindow::initButtons() + { +- ActionButton *wifiButton = new ActionButton(0, +- QIcon(":/icons/wifi2.png"), +- QPixmap(":/icons/wifi_l.png"), +- this); +- ActionButton *blueButton = new ActionButton(1, +- QIcon(":/icons/bluetooth2.png"), +- QPixmap(":/icons/bluetooth_l.png"), +- this); + ActionButton *netButton = new ActionButton(2, + QIcon(":/icons/net2.png"), + QPixmap(":/icons/net_l.png"), + this); +- ActionButton *internetButton = new ActionButton(3, +- QIcon(":/icons/internet2.png"), +- QPixmap(":/icons/internet_l.png"), +- this); +- ActionButton *keyButton = new ActionButton(4, +- QIcon(":/icons/key2.png"), +- QPixmap(":/icons/irda_l.png"), +- this); +-#if 0 +- ActionButton *irdaButton = new ActionButton(5, +- QIcon(":/icons/irda2.png"), +- QPixmap(":/icons/irda_l.png"), +- this); +-#endif + ActionButton *paintingButton = new ActionButton(5, + QIcon(":/icons/painting2.png"), + QPixmap(":/icons/painting_l.png"), + this); +- ActionButton *cameraButton = new ActionButton(6, +- QIcon(":/icons/camera2.png"), +- QPixmap(":/icons/camera_l.png"), +- this); +- ActionButton *videoButton = new ActionButton(7, +- QIcon(":/icons/video2.png"), +- QPixmap(":/icons/video_l.png"), +- this); +- ActionButton *gameButton = new ActionButton(8, +- QIcon(":/icons/game2.png"), +- QPixmap(":/icons/game_l.png"), +- this); +- ActionButton *tfButton = new ActionButton(9, +- QIcon(":/icons/IFcard2.png"), +- QPixmap(":/icons/IFcard_l.png"), +- this); + ActionButton *otherButton = new ActionButton(10, + QIcon(":/icons/other2.png"), + QPixmap(":/icons/other_l.png"), + this); + +- mItemLayout->addWidget(wifiButton, 0, 0); +- mItemLayout->addWidget(blueButton, 0, 1); +- mItemLayout->addWidget(netButton, 0, 2); +- mItemLayout->addWidget(internetButton, 0, 3); +- mItemLayout->addWidget(keyButton, 0, 4); +- mItemLayout->addWidget(paintingButton, 1, 0); +- mItemLayout->addWidget(cameraButton, 1, 1); +- mItemLayout->addWidget(videoButton, 1, 2); +- mItemLayout->addWidget(gameButton, 1, 3); +- mItemLayout->addWidget(tfButton, 1, 4); +- mItemLayout->addWidget(otherButton, 2, 0); +- +- connect(wifiButton, SIGNAL(clicked()), SLOT(onWifiButtonClicked())); +- connect(blueButton, SIGNAL(clicked()), SLOT(onBlueButtonClicked())); ++ mItemLayout->addWidget(netButton, 0, 0); ++ mItemLayout->addWidget(paintingButton, 0, 1); ++ mItemLayout->addWidget(otherButton, 0, 2); ++ + connect(netButton, SIGNAL(clicked()), SLOT(onNetButtonClicked())); +- connect(internetButton, SIGNAL(clicked()), SLOT(onInternetButtonClicked())); +- connect(keyButton, SIGNAL(clicked()), SLOT(onKeyButtonClicked())); + connect(paintingButton, SIGNAL(clicked()), SLOT(onPaintingButtonClicked())); +- connect(cameraButton, SIGNAL(clicked()), SLOT(onCameraButtonClicked())); +- connect(videoButton, SIGNAL(clicked()), SLOT(onVideoButtonClicked())); +- connect(gameButton, SIGNAL(clicked()), SLOT(onGameButtonClicked())); +- connect(tfButton, SIGNAL(clicked()), SLOT(onTFButtonClicked())); + connect(otherButton, SIGNAL(clicked()), SLOT(onOtherButtonClicked())); + } + +-- +2.30.2 + diff --git a/package/qlauncher/Config.in b/package/qlauncher/Config.in new file mode 100644 index 0000000000000000000000000000000000000000..53902126a6f6d50404d802e1a764ee9c6b8591dd --- /dev/null +++ b/package/qlauncher/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_QLAUNCHER + bool "qlauncher" + select BR2_PACKAGE_QT5BASE + select BR2_PACKAGE_PCRE2 + help + A simple launcher for Qt applications. diff --git a/package/qlauncher/qlauncher.mk b/package/qlauncher/qlauncher.mk new file mode 100644 index 0000000000000000000000000000000000000000..cd90ed4bb9ce67abc324d5325eb0af006931302a --- /dev/null +++ b/package/qlauncher/qlauncher.mk @@ -0,0 +1,18 @@ +################################################################################ +# +# Qt Launcher +# +################################################################################ + +QLAUNCHER_VERSION = abd9b187804c60be2b34dee1917e36e5c7ab917d +QLAUNCHER_SITE = https://gitee.com/murphy-wong/qtlauncher.git +QLAUNCHER_SITE_METHOD = git + +#QLAUNCHER_DEPENDENCIES = qt5base pcre2 +QLAUNCGER_INSTALL_TARGET = YES + +define QLAUNCHER_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 755 $(@D)/launcher $(TARGET_DIR)/usr/bin/QLauncher +endef + +$(eval $(qmake-package)) diff --git a/package/qt5/qt5base/qmake.conf.in b/package/qt5/qt5base/qmake.conf.in index 024c074928f4a09a8b65c181aee2fadc65854173..a8ecfccd82a350fb40d9de5a8c4ea426306c195d 100644 --- a/package/qt5/qt5base/qmake.conf.in +++ b/package/qt5/qt5base/qmake.conf.in @@ -15,6 +15,8 @@ QMAKE_CXX = $${CROSS_COMPILE}g++ # modifications to gcc-base.conf QMAKE_CFLAGS += $${BR_COMPILER_CFLAGS} QMAKE_CXXFLAGS += $${BR_COMPILER_CXXFLAGS} +QMAKE_LIBS += -L$${BUILDROOT_STAGING_DIR}/usr/lib/aarch64-linux-gnu -lgcc_s +QMAKE_LIBS += -Wl,-rpath-link=$${BUILDROOT_STAGING_DIR}/usr/lib/aarch64-linux-gnu # Remove all optimisation flags, we really only want our own. QMAKE_CFLAGS_OPTIMIZE = QMAKE_CFLAGS_OPTIMIZE_DEBUG = diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk index e173639cca6b203c48277ee67cc59b5cee8ba194..c0455dbd998b317a0852f426563bf509df2293fc 100644 --- a/package/qt5/qt5base/qt5base.mk +++ b/package/qt5/qt5base/qt5base.mk @@ -345,6 +345,7 @@ define QT5BASE_CONFIGURE_CMDS sed 's/@EGLFS_DEVICE@/$(QT5BASE_EGLFS_DEVICE)/g' \ $(QT5BASE_PKGDIR)/qmake.conf.in > \ $(@D)/mkspecs/devices/linux-buildroot-g++/qmake.conf + sed -i '15 i BUILDROOT_STAGING_DIR = $(STAGING_DIR)' $(@D)/mkspecs/devices/linux-buildroot-g++/qmake.conf $(INSTALL) -m 0644 -D $(QT5BASE_PKGDIR)/qplatformdefs.h \ $(@D)/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h $(QT5BASE_CONFIGURE_CONFIG_FILE) diff --git a/package/weston-qlauncher/Config.in b/package/weston-qlauncher/Config.in new file mode 100644 index 0000000000000000000000000000000000000000..c4dfc14df5965b65d6c218ed8474cc48687018ff --- /dev/null +++ b/package/weston-qlauncher/Config.in @@ -0,0 +1,8 @@ +config BR2_PACKAGE_WESTON_QLAUNCHER + bool "weston-qlauncher" + depends on BR2_PACKAGE_QLAUNCHER + help + weston-qlauncher is a tool that integrates the functionality of + Weston, the Wayland compositor, and qlauncher, a simple application + launcher. It provides a seamless way to start and manage Qt-based + applications within the Weston environment. diff --git a/package/weston-qlauncher/src/.bash_profile b/package/weston-qlauncher/src/.bash_profile new file mode 100644 index 0000000000000000000000000000000000000000..dc29cf581eac1e2997dd5066d0370ddaa5dba533 --- /dev/null +++ b/package/weston-qlauncher/src/.bash_profile @@ -0,0 +1,11 @@ +if [[ -z "$DISPLAY" && "$(tty)" == "/dev/tty1" ]]; then + # set Wayland enviroment + export XDG_SESSION_TYPE=wayland + export WAYLAND_DISPLAY=wayland-0 + export XDG_RUNTIME_DIR=/run/user/$(id -u) + + mkdir -p $XDG_RUNTIME_DIR + chmod 700 $XDG_RUNTIME_DIR + + weston --tty=1 & +fi diff --git a/package/weston-qlauncher/src/qlauncher_icon.png b/package/weston-qlauncher/src/qlauncher_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f6590cfedc490059901ddf0731e2a5ab15653dc8 Binary files /dev/null and b/package/weston-qlauncher/src/qlauncher_icon.png differ diff --git a/package/weston-qlauncher/src/qtwayland.sh b/package/weston-qlauncher/src/qtwayland.sh new file mode 100644 index 0000000000000000000000000000000000000000..e0c26c9b9ac80508e27e48990d3b411685eb017b --- /dev/null +++ b/package/weston-qlauncher/src/qtwayland.sh @@ -0,0 +1,3 @@ +# The env variables below can be overridden + +export QT_QPA_PLATFORM=${QT_QPA_PLATFORM:-wayland} diff --git a/package/weston-qlauncher/src/weston.ini b/package/weston-qlauncher/src/weston.ini new file mode 100644 index 0000000000000000000000000000000000000000..002b3fe1fd6d5b083fbdfacc376e5bf2789e5582 --- /dev/null +++ b/package/weston-qlauncher/src/weston.ini @@ -0,0 +1,55 @@ +[core] +backend=drm-backend.so + +# Allow running without input devices +require-input=false + +# Disable screen idle timeout by default +idle-time=0 + +# The repaint-window is used to calculate repaint delay(ms) after flipped. +# value <= 0: delay = abs(value) +# value > 0: delay = vblank_duration - value +repaint-window=-1 + +# Allow blending with lower drm planes +# gbm-format=argb8888 + +[shell] +# top(default)|bottom|left|right|none, none to disable panel +panel-position=bottom + +panel-scale=4 + +# background-image +background-image=/usr/share/images/desktop-base/dark.jpg + +# scale|scale-crop|tile +background-type=scale-crop + +# none|minutes(default)|seconds +# clock-format=seconds + +# Disable screen locking +locking=false + +[launcher] +icon=/usr/share/weston/terminal.png +path=/usr/bin/weston-terminal + +[launcher] +icon=/usr/share/weston/qlauncher_icon.png +path=/usr/bin/QLauncher + +[libinput] +# Uncomment below to enable touch screen calibrator(weston-touch-calibrator) +# touchscreen_calibrator=true +# calibration_helper=/bin/weston-calibration-helper.sh + +[keyboard] +# Comment this to enable vt switching +vt-switching=false + +# Configs for auto key repeat +# repeat-rate=40 +# repeat-delay=400 diff --git a/package/weston-qlauncher/src/weston.sh b/package/weston-qlauncher/src/weston.sh new file mode 100644 index 0000000000000000000000000000000000000000..772da0f81111c2c172c066091fb1eb4a24daed62 --- /dev/null +++ b/package/weston-qlauncher/src/weston.sh @@ -0,0 +1,66 @@ +# The env variables below can be overridden + +# Comment out this for atomic related functions, e.g. sprites +export WESTON_DISABLE_ATOMIC=1 + +# Allow using drm modifier, e.g. ARM AFBC +# export WESTON_ALLOW_GBM_MODIFIERS=1 + +# Enable black background for fullscreen views +# export WESTON_FULLSCREEN_BLACK_BACKGROUND=1 + +# Allow disabling unused CRTCs +# WESTON_DRM_MASTER=1 + +# Override output's freezing time +# export WESTON_DRM_RESIZE_FREEZE_MS=1000 + +# Primary screen +# export WESTON_DRM_PRIMARY=eDP-1 + +# Single screen +# export WESTON_DRM_SINGLE_HEAD=1 + +# Fallback to any available connector +# export WESTON_DRM_HEAD_FALLBACK=1 + +# Connector selecting mode: +# default|primary|internal|external|external-dual +# export WESTON_DRM_HEAD_MODE=external-dual + +# Screens layout direction +# horizontal|vertical|same-as +# export WESTON_OUTPUT_FLOW=vertical + +# Virtual display size +# export WESTON_DRM_VIRTUAL_SIZE=1024x768 + +# Comment out these to disable mirror mode +export WESTON_DRM_MIRROR=1 +export WESTON_DRM_KEEP_RATIO=1 + +# Disable DRM plane hardware scale feature +# export WESTON_DRM_DISABLE_PLANE_SCALE=1 + +# Tag file for freezing weston display +export WESTON_FREEZE_DISPLAY=/tmp/.freeze_weston + +# Set dynamic config file path +# export WESTON_DRM_CONFIG=/tmp/.weston_drm.conf +# +# Dynamic config examples: +# echo "compositor:state:sleep" > /tmp/.weston_drm.conf # off + input wakeable +# echo "compositor:state:block" > /tmp/.weston_drm.conf # no input +# echo "compositor:state:freeze" > /tmp/.weston_drm.conf # no input + freeze +# echo "compositor:state:off" > /tmp/.weston_drm.conf # no input + off +# echo "compositor:state:on" > /tmp/.weston_drm.conf +# echo "output:DSI-1:off" >> /tmp/.weston_drm.conf +# echo "output:eDP-1:freeze" >> /tmp/.weston_drm.conf +# echo "output:DSI-1:on" >> /tmp/.weston_drm.conf +# echo "output:all:rotate90" >> /tmp/.weston_drm.conf +# echo "output:all:rect=<100,20,1636,2068>" >> /tmp/.weston_drm.conf +# echo "output:HDMI-A-1:mode=800x600" >> /tmp/.weston_drm.conf +# echo "output:HDMI-A-1:pos=100,200" >> /tmp/.weston_drm.conf +# echo "output:HDMI-A-1:size=1920x1080" >> /tmp/.weston_drm.conf +# echo "output:HDMI-A-1:prefer" >> /tmp/.weston_drm.conf +# echo "output:HDMI-A-1:primary" >> /tmp/.weston_drm.conf diff --git a/package/weston-qlauncher/weston-qlauncher.mk b/package/weston-qlauncher/weston-qlauncher.mk new file mode 100644 index 0000000000000000000000000000000000000000..ced856dfab9559f6bd5c7bc104ff2b3532a38485 --- /dev/null +++ b/package/weston-qlauncher/weston-qlauncher.mk @@ -0,0 +1,25 @@ +################################################################################ +# +# Weston and Qt Launcher +# +################################################################################ + +WESTON_QLAUNCHER_VERSION = 0.1 +WESTON_QLAUNCHER_SITE = package/weston-qlauncher/src +WESTON_QLAUNCHER_SITE_METHOD = local +WESTON_QLAUNCHER_INSTALL_TARGET = YES + +define WESTON_QLAUNCHER_INSTALL_TARGET_CMDS + mkdir -p $(TARGET_DIR)/etc/xdg/weston/ + mkdir -p $(TARGET_DIR)/etc/profile.d/ + mkdir -p $(TARGET_DIR)/lib/systemd/system/ + mkdir -p $(TARGET_DIR)/usr/share/weston/ + $(INSTALL) -m 644 -D $(@D)/weston.ini $(TARGET_DIR)/etc/xdg/weston/ + $(INSTALL) -m 755 -D $(@D)/weston.sh $(TARGET_DIR)/etc/profile.d/ + $(INSTALL) -m 755 -D $(@D)/qtwayland.sh $(TARGET_DIR)/etc/profile.d/ + $(INSTALL) -m 644 -D $(@D)/qlauncher_icon.png $(TARGET_DIR)/usr/share/weston/ + $(INSTALL) -m 644 -D $(@D)/.bash_profile $(TARGET_DIR)/root + touch $(TARGET_DIR)/root/.weston +endef + +$(eval $(generic-package))