guowenxue
2024-09-26 339eff90ac6e178432f0fa203d259fcf27886fa9
yocto/meta-igkboard/images/yocto-image-full.bb
@@ -2,21 +2,16 @@
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"
inherit extrausers
CONFLICT_DISTRO_FEATURES = "directfb"
# Set the root password:  >> mkpasswd -m sha256crypt 123456 -S abcd6789
# Remember to escape the character $ in the resulting hash
#PASSWD="\$5\$abcd6789\$2ayD.ZPdq5xejNiyE3XC3qCpkGZ.brSE5H0zSECVBSB"
EXTRA_USERS_PARAMS = "\
    usermod -p '${PASSWD}' root; \
"
## Select Image Features
# Select Image Features
IMAGE_FEATURES += " \
    hwcodecs \
    ssh-server-openssh \
@@ -24,8 +19,6 @@
    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston', \
       bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11-base x11-sato', '', d), d)} \
"
CONFLICT_DISTRO_FEATURES = "directfb"
CORE_IMAGE_EXTRA_INSTALL_BASE += " \
    packagegroup-base-wifi \
@@ -39,8 +32,9 @@
    packagegroup-fsl-gstreamer1.0-full \
    packagegroup-fsl-tools-benchmark \
    packagegroup-fsl-opencv-imx \
    packagegroup-qt6-modules \
    packagegroup-qt6-essentials \
    packagegroup-misc-utils \
    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'weston-xwayland xterm', '', d)} \
"
CORE_IMAGE_EXTRA_INSTALL_BASE += " \
@@ -52,7 +46,7 @@
    gnupg parted inetutils \
    hostapd wireless-tools iw \
    i2c-tools spidev-test spitools \
    libgpiod libgpiod-tools \
    libgpiod libgpiod-tools mosquitto \
    fb-test fbgrab libdrm ffmpeg \
    opencv zbar v4l-utils yavta \
    alsa-state pulseaudio-server \
@@ -81,6 +75,13 @@
    git gcc gcc-symlinks binutils automake cmake autoconf freerdp \
"
# Set the root password:  >> mkpasswd -m sha256crypt 123456 -S abcd6789
# Remember to escape the character $ in the resulting hash
#PASSWD="\$5\$abcd6789\$2ayD.ZPdq5xejNiyE3XC3qCpkGZ.brSE5H0zSECVBSB"
EXTRA_USERS_PARAMS = "\
    usermod -p '${PASSWD}' root; \
"
modify_rootfs() {
    # Modify default environment
@@ -96,19 +97,22 @@
    # 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
    mkdir -p ${IMAGE_ROOTFS}/lib/firmware/.bak
    mv ${IMAGE_ROOTFS}/lib/firmware/imx* ${IMAGE_ROOTFS}/lib/firmware/.bak
    mv ${IMAGE_ROOTFS}/lib/firmware/nxp* ${IMAGE_ROOTFS}/lib/firmware/.bak
    mv ${IMAGE_ROOTFS}/lib/firmware/mediatek ${IMAGE_ROOTFS}/lib/firmware/.bak
    mv ${IMAGE_ROOTFS}/lib/firmware/mt76* ${IMAGE_ROOTFS}/lib/firmware/.bak
    mv ${IMAGE_ROOTFS}/lib/firmware/rtl* ${IMAGE_ROOTFS}/lib/firmware/.bak
    rm -rf ${IMAGE_ROOTFS}/lib/firmware/*
    mv ${IMAGE_ROOTFS}/lib/firmware/.bak/* ${IMAGE_ROOTFS}/lib/firmware/
    rm -rf ${IMAGE_ROOTFS}/lib/firmware/imx*.elf
    rm -rf ${IMAGE_ROOTFS}/lib/firmware/.bak
    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; "
ROOTFS_POSTPROCESS_COMMAND += " modify_rootfs; doclean_rootfs; "