guowenxue
2024-07-18 a580f673d8120c96b9a854cd70ae2ebc8a048c57
commit | author | age
52646c 1 SUMMARY = "A multimedia wth full command image for production"
849fbd 2 LICENSE = "MIT"
G 3
4 inherit core-image
5
6 # additional free disk space created in Kbytes
7 #IMAGE_OVERHEAD_FACTOR = "1.0"
8 #IMAGE_ROOTFS_EXTRA_SPACE = "512000"
9
10 inherit extrausers
11
a580f6 12 # Set the root password:  >> mkpasswd -m sha256crypt 123456 -S abcd6789
G 13 # Remember to escape the character $ in the resulting hash
14 #PASSWD="\$5\$abcd6789\$2ayD.ZPdq5xejNiyE3XC3qCpkGZ.brSE5H0zSECVBSB"
849fbd 15 EXTRA_USERS_PARAMS = "\
G 16     usermod -p '${PASSWD}' root; \
17 "
281a7f 18
G 19 ## Select Image Features
20 IMAGE_FEATURES += " \
21     hwcodecs \
22     ssh-server-openssh \
23     package-management \
bf3c1b 24     ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston', \
G 25        bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11-base x11-sato', '', d), d)} \
281a7f 26 "
G 27
28 CONFLICT_DISTRO_FEATURES = "directfb"
29
52646c 30 CORE_IMAGE_EXTRA_INSTALL_BASE += " \
281a7f 31     packagegroup-base-wifi \
G 32     packagegroup-imx-isp \
33     packagegroup-imx-security \
34     packagegroup-fsl-tools-audio \
35     packagegroup-core-full-cmdline \
36     packagegroup-tools-bluetooth \
37     packagegroup-core-ssh-openssh \
38     packagegroup-fsl-gstreamer1.0 \
39     packagegroup-fsl-gstreamer1.0-full \
52646c 40     packagegroup-fsl-tools-benchmark \
G 41     packagegroup-fsl-opencv-imx \
281a7f 42     packagegroup-qt6-modules \
G 43     packagegroup-misc-utils \
44 "
45
52646c 46 CORE_IMAGE_EXTRA_INSTALL_BASE += " \
17e726 47     kernel-modules hello-app hello-mod \
a0be3f 48     rtl8188fu rtl8723du \
281a7f 49     firmwared linux-firmware \
G 50     powertop tzdata ppp vim \
51     xz lrzsz rsync dos2unix \
52     gnupg parted inetutils \
53     hostapd wireless-tools iw \
52646c 54     i2c-tools spidev-test spitools \
281a7f 55     libgpiod libgpiod-tools \
b96bc1 56     fb-test fbgrab libdrm ffmpeg \
281a7f 57     opencv zbar v4l-utils yavta \
G 58     alsa-state pulseaudio-server \
b89468 59     python3 python3-pip tmux \
281a7f 60     openssh-sftp openssh-sftp-server \
G 61     memtester pcsc-tools stunnel ntp \
b89468 62     curl evtest cpufrequtils iperf3 \
52646c 63     dosfstools ethtool iproute2 modemmanager \
281a7f 64     e2fsprogs-mke2fs e2fsprogs-resize2fs \
52646c 65     cryptodev-module openssl-bin \
87a2bb 66     libsocketcan can-utils canutils \
bf3c1b 67     ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'weston-xwayland xterm', '', d)} \
52646c 68 "
G 69
70 # For machine igkboard-imx6ull
71 CORE_IMAGE_EXTRA_INSTALL = " \
72     ${CORE_IMAGE_EXTRA_INSTALL_BASE} \
73 "
74
75 # For machine igkboard-imx8mp
76 CORE_IMAGE_EXTRA_INSTALL:igkboard-imx8mp = " \
77     ${CORE_IMAGE_EXTRA_INSTALL_BASE} \
78     packagegroup-fsl-tools-gpu \
79     packagegroup-fsl-tools-gpu-external \
80     ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston-init', '', d)} \
81     git gcc gcc-symlinks binutils automake cmake autoconf freerdp \
281a7f 82 "
G 83
84 modify_rootfs() {
85
86     # Modify default environment
87     echo "alias ls='ls --color=auto'" >> ${IMAGE_ROOTFS}/etc/profile
88
89     # Update wpa_supplicant service
90     sed -i "/^After=/d" ${IMAGE_ROOTFS}/lib/systemd/system/wpa_supplicant@.service
91 }
92
93 # Remove unused files in rootfs
94 doclean_rootfs() {
95
96     # remove unsed test apps
97     rm -rf ${IMAGE_ROOTFS}/unit_tests
98
99     # remove unsed firmware
100     mkdir -p ${IMAGE_ROOTFS}/lib/firmware/.bak
101
102     mv ${IMAGE_ROOTFS}/lib/firmware/imx* ${IMAGE_ROOTFS}/lib/firmware/.bak
103     mv ${IMAGE_ROOTFS}/lib/firmware/nxp* ${IMAGE_ROOTFS}/lib/firmware/.bak
104     mv ${IMAGE_ROOTFS}/lib/firmware/mediatek ${IMAGE_ROOTFS}/lib/firmware/.bak
105     mv ${IMAGE_ROOTFS}/lib/firmware/mt76* ${IMAGE_ROOTFS}/lib/firmware/.bak
106     mv ${IMAGE_ROOTFS}/lib/firmware/rtl* ${IMAGE_ROOTFS}/lib/firmware/.bak
107
108     rm -rf ${IMAGE_ROOTFS}/lib/firmware/*
109     mv ${IMAGE_ROOTFS}/lib/firmware/.bak/* ${IMAGE_ROOTFS}/lib/firmware/
52646c 110     rm -rf ${IMAGE_ROOTFS}/lib/firmware/imx*.elf
281a7f 111     rm -rf ${IMAGE_ROOTFS}/lib/firmware/.bak
G 112 }
113
114 ROOTFS_POSTPROCESS_COMMAND += "modify_rootfs; doclean_rootfs; "