guowenxue
2024-06-16 b96bc188ee00b4ccfb80e5af4fd2f67df22e88fc
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 += " \
281a7f 47     kernel-modules \
G 48     firmwared linux-firmware \
49     powertop tzdata ppp vim \
50     xz lrzsz rsync dos2unix \
51     gnupg parted inetutils \
52     hostapd wireless-tools iw \
52646c 53     i2c-tools spidev-test spitools \
281a7f 54     libgpiod libgpiod-tools \
b96bc1 55     fb-test fbgrab libdrm ffmpeg \
281a7f 56     opencv zbar v4l-utils yavta \
G 57     alsa-state pulseaudio-server \
b89468 58     python3 python3-pip tmux \
281a7f 59     openssh-sftp openssh-sftp-server \
G 60     memtester pcsc-tools stunnel ntp \
b89468 61     curl evtest cpufrequtils iperf3 \
52646c 62     dosfstools ethtool iproute2 modemmanager \
281a7f 63     e2fsprogs-mke2fs e2fsprogs-resize2fs \
52646c 64     cryptodev-module openssl-bin \
87a2bb 65     libsocketcan can-utils canutils \
52646c 66 "
G 67
68 # For machine igkboard-imx6ull
69 CORE_IMAGE_EXTRA_INSTALL = " \
70     ${CORE_IMAGE_EXTRA_INSTALL_BASE} \
71 "
72
73 # For machine igkboard-imx8mp
74 CORE_IMAGE_EXTRA_INSTALL:igkboard-imx8mp = " \
75     ${CORE_IMAGE_EXTRA_INSTALL_BASE} \
76     packagegroup-fsl-tools-gpu \
77     packagegroup-fsl-tools-gpu-external \
78     ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston-init', '', d)} \
79     git gcc gcc-symlinks binutils automake cmake autoconf freerdp \
281a7f 80 "
G 81
82 modify_rootfs() {
83
84     # Modify default environment
85     echo "alias ls='ls --color=auto'" >> ${IMAGE_ROOTFS}/etc/profile
86
87     # Update wpa_supplicant service
88     sed -i "/^After=/d" ${IMAGE_ROOTFS}/lib/systemd/system/wpa_supplicant@.service
89 }
90
91 # Remove unused files in rootfs
92 doclean_rootfs() {
93
94     # remove unsed test apps
95     rm -rf ${IMAGE_ROOTFS}/unit_tests
96
97     # remove unsed firmware
98     mkdir -p ${IMAGE_ROOTFS}/lib/firmware/.bak
99
100     mv ${IMAGE_ROOTFS}/lib/firmware/imx* ${IMAGE_ROOTFS}/lib/firmware/.bak
101     mv ${IMAGE_ROOTFS}/lib/firmware/nxp* ${IMAGE_ROOTFS}/lib/firmware/.bak
102     mv ${IMAGE_ROOTFS}/lib/firmware/mediatek ${IMAGE_ROOTFS}/lib/firmware/.bak
103     mv ${IMAGE_ROOTFS}/lib/firmware/mt76* ${IMAGE_ROOTFS}/lib/firmware/.bak
104     mv ${IMAGE_ROOTFS}/lib/firmware/rtl* ${IMAGE_ROOTFS}/lib/firmware/.bak
105
106     rm -rf ${IMAGE_ROOTFS}/lib/firmware/*
107     mv ${IMAGE_ROOTFS}/lib/firmware/.bak/* ${IMAGE_ROOTFS}/lib/firmware/
52646c 108     rm -rf ${IMAGE_ROOTFS}/lib/firmware/imx*.elf
281a7f 109     rm -rf ${IMAGE_ROOTFS}/lib/firmware/.bak
G 110 }
111
112 ROOTFS_POSTPROCESS_COMMAND += "modify_rootfs; doclean_rootfs; "