guowenxue
2024-07-15 a0be3febef2aab84a3bc6abf49c337ee6e484118
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 # Create the password hash with following command on host:
281a7f 12 # >> mkpasswd -m sha256crypt password -S abcd6789
849fbd 13 # Remember to escape the character $ in the resulting hash
G 14
281a7f 15 # Set the root password:
G 16 #PASSWD="\$5\$abcd6789\$Vuv1aLz04ZwhxgsB3lOQbwy1XUS6PJ.8h2A7.9HoUd3"
849fbd 17 EXTRA_USERS_PARAMS = "\
G 18     usermod -p '${PASSWD}' root; \
19 "
281a7f 20
G 21 ## Select Image Features
22 IMAGE_FEATURES += " \
23     hwcodecs \
24     ssh-server-openssh \
25     package-management \
26 "
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 \
52646c 67 "
G 68
69 # For machine igkboard-imx6ull
70 CORE_IMAGE_EXTRA_INSTALL = " \
71     ${CORE_IMAGE_EXTRA_INSTALL_BASE} \
72 "
73
74 # For machine igkboard-imx8mp
75 CORE_IMAGE_EXTRA_INSTALL:igkboard-imx8mp = " \
76     ${CORE_IMAGE_EXTRA_INSTALL_BASE} \
77     packagegroup-fsl-tools-gpu \
78     packagegroup-fsl-tools-gpu-external \
79     ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston-init', '', d)} \
80     git gcc gcc-symlinks binutils automake cmake autoconf freerdp \
281a7f 81 "
G 82
83 modify_rootfs() {
84
85     # Modify default environment
86     echo "alias ls='ls --color=auto'" >> ${IMAGE_ROOTFS}/etc/profile
87
88     # Update wpa_supplicant service
89     sed -i "/^After=/d" ${IMAGE_ROOTFS}/lib/systemd/system/wpa_supplicant@.service
90 }
91
92 # Remove unused files in rootfs
93 doclean_rootfs() {
94
95     # remove unsed test apps
96     rm -rf ${IMAGE_ROOTFS}/unit_tests
97
98     # remove unsed firmware
99     mkdir -p ${IMAGE_ROOTFS}/lib/firmware/.bak
100
101     mv ${IMAGE_ROOTFS}/lib/firmware/imx* ${IMAGE_ROOTFS}/lib/firmware/.bak
102     mv ${IMAGE_ROOTFS}/lib/firmware/nxp* ${IMAGE_ROOTFS}/lib/firmware/.bak
103     mv ${IMAGE_ROOTFS}/lib/firmware/mediatek ${IMAGE_ROOTFS}/lib/firmware/.bak
104     mv ${IMAGE_ROOTFS}/lib/firmware/mt76* ${IMAGE_ROOTFS}/lib/firmware/.bak
105     mv ${IMAGE_ROOTFS}/lib/firmware/rtl* ${IMAGE_ROOTFS}/lib/firmware/.bak
106
107     rm -rf ${IMAGE_ROOTFS}/lib/firmware/*
108     mv ${IMAGE_ROOTFS}/lib/firmware/.bak/* ${IMAGE_ROOTFS}/lib/firmware/
52646c 109     rm -rf ${IMAGE_ROOTFS}/lib/firmware/imx*.elf
281a7f 110     rm -rf ${IMAGE_ROOTFS}/lib/firmware/.bak
G 111 }
112
113 ROOTFS_POSTPROCESS_COMMAND += "modify_rootfs; doclean_rootfs; "