guowenxue
2024-07-15 bf3c1b67a4b493288310170cc22d3ea3b3e3e781
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 \
bf3c1b 26     ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston', \
G 27        bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11-base x11-sato', '', d), d)} \
281a7f 28 "
G 29
30 CONFLICT_DISTRO_FEATURES = "directfb"
31
52646c 32 CORE_IMAGE_EXTRA_INSTALL_BASE += " \
281a7f 33     packagegroup-base-wifi \
G 34     packagegroup-imx-isp \
35     packagegroup-imx-security \
36     packagegroup-fsl-tools-audio \
37     packagegroup-core-full-cmdline \
38     packagegroup-tools-bluetooth \
39     packagegroup-core-ssh-openssh \
40     packagegroup-fsl-gstreamer1.0 \
41     packagegroup-fsl-gstreamer1.0-full \
52646c 42     packagegroup-fsl-tools-benchmark \
G 43     packagegroup-fsl-opencv-imx \
281a7f 44     packagegroup-qt6-modules \
G 45     packagegroup-misc-utils \
46 "
47
52646c 48 CORE_IMAGE_EXTRA_INSTALL_BASE += " \
17e726 49     kernel-modules hello-app hello-mod \
a0be3f 50     rtl8188fu rtl8723du \
281a7f 51     firmwared linux-firmware \
G 52     powertop tzdata ppp vim \
53     xz lrzsz rsync dos2unix \
54     gnupg parted inetutils \
55     hostapd wireless-tools iw \
52646c 56     i2c-tools spidev-test spitools \
281a7f 57     libgpiod libgpiod-tools \
b96bc1 58     fb-test fbgrab libdrm ffmpeg \
281a7f 59     opencv zbar v4l-utils yavta \
G 60     alsa-state pulseaudio-server \
b89468 61     python3 python3-pip tmux \
281a7f 62     openssh-sftp openssh-sftp-server \
G 63     memtester pcsc-tools stunnel ntp \
b89468 64     curl evtest cpufrequtils iperf3 \
52646c 65     dosfstools ethtool iproute2 modemmanager \
281a7f 66     e2fsprogs-mke2fs e2fsprogs-resize2fs \
52646c 67     cryptodev-module openssl-bin \
87a2bb 68     libsocketcan can-utils canutils \
bf3c1b 69     ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'weston-xwayland xterm', '', d)} \
52646c 70 "
G 71
72 # For machine igkboard-imx6ull
73 CORE_IMAGE_EXTRA_INSTALL = " \
74     ${CORE_IMAGE_EXTRA_INSTALL_BASE} \
75 "
76
77 # For machine igkboard-imx8mp
78 CORE_IMAGE_EXTRA_INSTALL:igkboard-imx8mp = " \
79     ${CORE_IMAGE_EXTRA_INSTALL_BASE} \
80     packagegroup-fsl-tools-gpu \
81     packagegroup-fsl-tools-gpu-external \
82     ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston-init', '', d)} \
83     git gcc gcc-symlinks binutils automake cmake autoconf freerdp \
281a7f 84 "
G 85
86 modify_rootfs() {
87
88     # Modify default environment
89     echo "alias ls='ls --color=auto'" >> ${IMAGE_ROOTFS}/etc/profile
90
91     # Update wpa_supplicant service
92     sed -i "/^After=/d" ${IMAGE_ROOTFS}/lib/systemd/system/wpa_supplicant@.service
93 }
94
95 # Remove unused files in rootfs
96 doclean_rootfs() {
97
98     # remove unsed test apps
99     rm -rf ${IMAGE_ROOTFS}/unit_tests
100
101     # remove unsed firmware
102     mkdir -p ${IMAGE_ROOTFS}/lib/firmware/.bak
103
104     mv ${IMAGE_ROOTFS}/lib/firmware/imx* ${IMAGE_ROOTFS}/lib/firmware/.bak
105     mv ${IMAGE_ROOTFS}/lib/firmware/nxp* ${IMAGE_ROOTFS}/lib/firmware/.bak
106     mv ${IMAGE_ROOTFS}/lib/firmware/mediatek ${IMAGE_ROOTFS}/lib/firmware/.bak
107     mv ${IMAGE_ROOTFS}/lib/firmware/mt76* ${IMAGE_ROOTFS}/lib/firmware/.bak
108     mv ${IMAGE_ROOTFS}/lib/firmware/rtl* ${IMAGE_ROOTFS}/lib/firmware/.bak
109
110     rm -rf ${IMAGE_ROOTFS}/lib/firmware/*
111     mv ${IMAGE_ROOTFS}/lib/firmware/.bak/* ${IMAGE_ROOTFS}/lib/firmware/
52646c 112     rm -rf ${IMAGE_ROOTFS}/lib/firmware/imx*.elf
281a7f 113     rm -rf ${IMAGE_ROOTFS}/lib/firmware/.bak
G 114 }
115
116 ROOTFS_POSTPROCESS_COMMAND += "modify_rootfs; doclean_rootfs; "