From 9cf87703eb60e121b47e6d577ea2bc6b63bd4ac4 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Fri, 26 Jul 2024 16:57:33 +0800
Subject: [PATCH] Yocto:IGKBoard-All: Update yocto-image-full

---
 yocto/meta-igkboard/images/yocto-image-full.bb |  136 ++++++++++++++++++++++++++++++---------------
 1 files changed, 90 insertions(+), 46 deletions(-)

diff --git a/yocto/meta-igkboard/images/yocto-image-full.bb b/yocto/meta-igkboard/images/yocto-image-full.bb
index c87830a..2b00cc2 100644
--- a/yocto/meta-igkboard/images/yocto-image-full.bb
+++ b/yocto/meta-igkboard/images/yocto-image-full.bb
@@ -1,74 +1,118 @@
-SUMMARY = "A console lite image for production"
+SUMMARY = "A multimedia wth full command image for production"
 LICENSE = "MIT"
 
 inherit core-image
+inherit extrausers
+inherit populate_sdk_qt6_base
 
 # additional free disk space created in Kbytes
 #IMAGE_OVERHEAD_FACTOR = "1.0"
 #IMAGE_ROOTFS_EXTRA_SPACE = "512000"
 
-## Select Image Features
+CONFLICT_DISTRO_FEATURES = "directfb"
+
+# Select Image Features
 IMAGE_FEATURES += " \
-    ssh-server-openssh \
     hwcodecs \
+    ssh-server-openssh \
     package-management \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston', \
+       bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11-base x11-sato', '', d), d)} \
 "
 
-CORE_IMAGE_EXTRA_INSTALL += " \
+CORE_IMAGE_EXTRA_INSTALL_BASE += " \
     packagegroup-base-wifi \
-    packagegroup-core-full-cmdline \
-    packagegroup-tools-bluetooth \
-    packagegroup-fsl-tools-audio \
     packagegroup-imx-isp \
     packagegroup-imx-security \
+    packagegroup-fsl-tools-audio \
+    packagegroup-core-full-cmdline \
+    packagegroup-tools-bluetooth \
+    packagegroup-core-ssh-openssh \
     packagegroup-fsl-gstreamer1.0 \
     packagegroup-fsl-gstreamer1.0-full \
-    packagegroup-core-ssh-openssh \
+    packagegroup-fsl-tools-benchmark \
+    packagegroup-fsl-opencv-imx \
+    packagegroup-qt6-essentials \
+    packagegroup-misc-utils \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'weston-xwayland xterm', '', d)} \
+"
+
+CORE_IMAGE_EXTRA_INSTALL_BASE += " \
+    kernel-modules hello-app hello-mod \
+    rtl8188fu rtl8723du \
+    firmwared linux-firmware \
+    powertop tzdata ppp vim \
+    xz lrzsz rsync dos2unix \
+    gnupg parted inetutils \
+    hostapd wireless-tools iw \
+    i2c-tools spidev-test spitools \
+    libgpiod libgpiod-tools mosquitto \
+    fb-test fbgrab libdrm ffmpeg \
+    opencv zbar v4l-utils yavta \
+    alsa-state pulseaudio-server \
+    python3 python3-pip tmux \
     openssh-sftp openssh-sftp-server \
-    firmwared \
+    memtester pcsc-tools stunnel ntp \
+    curl evtest cpufrequtils iperf3 \
+    dosfstools ethtool iproute2 modemmanager \
+    e2fsprogs-mke2fs e2fsprogs-resize2fs \
+    cryptodev-module openssl-bin \
+    libsocketcan can-utils canutils \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'weston-xwayland xterm', '', d)} \
 "
 
-inherit populate_sdk_qt6_base
-
-CONFLICT_DISTRO_FEATURES = "directfb"
-CORE_IMAGE_EXTRA_INSTALL:append = " packagegroup-qt6-imx tzdata "
-
-CORE_IMAGE_EXTRA_INSTALL:append = " \
-    opencv zbar \
-    gnupg \
-    parted \
-    v4l-utils \
-    inetutils \
-    hostapd \
-    wireless-tools \
-    spitools \
-    alsa-state \
-    expand-rootfs \
-    wpa-conf \
-    pulseaudio-server \
-    xz lrzsz \
-    yavta \
-    libgpiod libgpiod-tools \
-    powertop \
-    dos2unix \
-    rsync \
-    python3 \
-    python3-pip \
+# For machine igkboard-imx6ull
+CORE_IMAGE_EXTRA_INSTALL = " \
+    ${CORE_IMAGE_EXTRA_INSTALL_BASE} \
 "
 
-# Modify default environment
-modify_env() {
-    echo "alias ls='ls --color=auto'" >> ${IMAGE_ROOTFS}/etc/profile
-}
-ROOTFS_POSTPROCESS_COMMAND += "modify_env; "
+# For machine igkboard-imx8mp
+CORE_IMAGE_EXTRA_INSTALL:igkboard-imx8mp = " \
+    ${CORE_IMAGE_EXTRA_INSTALL_BASE} \
+    packagegroup-fsl-tools-gpu \
+    packagegroup-fsl-tools-gpu-external \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston-init', '', d)} \
+    git gcc gcc-symlinks binutils automake cmake autoconf freerdp \
+"
 
-inherit extrausers
-# Create the password hash with following command on host:
-# >> mkpasswd -m sha256crypt igkboard -S abcd6789
+# Set the root password:  >> mkpasswd -m sha256crypt 123456 -S abcd6789
 # Remember to escape the character $ in the resulting hash
-
-# Set the root password: igkboard
-#PASSWD="\$5\$abcd6789\$vlMo5CC1IJlipoXWQifbiMJ8fZqRIV26EXIi97RxPjC"
+#PASSWD="\$5\$abcd6789\$2ayD.ZPdq5xejNiyE3XC3qCpkGZ.brSE5H0zSECVBSB"
 EXTRA_USERS_PARAMS = "\
     usermod -p '${PASSWD}' root; \
 "
+
+modify_rootfs() {
+
+    # Modify default environment
+    echo "alias ls='ls --color=auto'" >> ${IMAGE_ROOTFS}/etc/profile
+
+    # Update wpa_supplicant service
+    sed -i "/^After=/d" ${IMAGE_ROOTFS}/lib/systemd/system/wpa_supplicant@.service
+}
+
+# Remove unused files in rootfs
+doclean_rootfs() {
+
+    # remove unsed test apps
+    rm -rf ${IMAGE_ROOTFS}/unit_tests
+
+    # remove unused license files
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/LICEN*
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/*.ucode
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/*.pnvm
+
+    # remove unsed firmware
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/3com*
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/[a-h]*
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/i[9ns]*
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/[j-l]*
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/me[ls]*
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/m[aiortwy]*
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/n[ev]*
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/[o-q]*
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/r[18aops]*
+    rm -rf ${IMAGE_ROOTFS}/lib/firmware/[s-z]*
+}
+
+ROOTFS_POSTPROCESS_COMMAND += " modify_rootfs; doclean_rootfs; "

--
Gitblit v1.9.1