Splash screen and usb mount problems when creating new image with Yocto for Apalis imx6

Hello

I am having problems when trying to build a custom Yocto image for Apalis IMX6.
The custom image mostly uses Qt5 libs with different libraries. Here is the image files in recipes-images

SUMMARY = "DV Power Apalis iMX6 Console Image"
DESCRIPTION = "Minimal Qt5-enabled image with X11"

LICENSE = "MIT"

inherit core-image

export IMAGE_BASENAME = "DV-Power-Console-Image"
MACHINE_NAME ?= "${MACHINE}"
IMAGE_NAME = "${MACHINE_NAME}_${IMAGE_BASENAME}"

SYSTEMD_DEFAULT_TARGET = "graphical.target"

IMAGE_FEATURES += " \
    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', \
       bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d), d)} \
"

IMAGE_LINGUAS = "en-us"

ROOTFS_PKGMANAGE_PKGS ?= '${@oe.utils.conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "${ROOTFS_PKGMANAGE}", d)}'

# Include only the essentials for a Qt5 X11 environment
IMAGE_INSTALL_QT5 = " \
    packagegroup-qt5 \
    qwt-qt5 \
    liberation-fonts \
    qtbase-plugins \
"

IMAGE_INSTALL += " \
    ${IMAGE_INSTALL_QT5} \
    \
    xdg-utils \
    \
    libgsf \
    libxres \
    makedevs \
    mime-support \
    xcursor-transparent-theme \
    zeroconf \
    packagegroup-boot \
    packagegroup-basic \
    udev-extra-rules \
    ${ROOTFS_PKGMANAGE_PKGS} \
    timestamp-service \
    xserver-common \
    xserver-xorg-extension-dbe \
    xserver-xorg-extension-extmod \
    xauth \
    xhost \
    xset \
    setxkbmap \
    \
    xrdb \
    xorg-minimal-fonts xserver-xorg-utils \
    unclutter \
    \
    libxdamage libxvmc libxinerama \
    libxcursor \
    \
    bash \
    make \
    \
    v4l-utils \
    libpcre \
    libpcreposix \
    libxcomposite \
    alsa-states \
    \
    source-han-sans-cn-fonts \
    source-han-sans-kr-fonts \
    source-han-sans-tw-fonts \
    dvpower-network-conf \
    libsocketcan \
    \
    xinit \
    xeyes \
    xclock \
    xterm \
    xdpyinfo \
    \
    udisks2 \
    udev dosfstools \
    exfat-utils \
    e2fsprogs \
    ntfs-3g \
    dosfstools \
    \
"


inherit populate_sdk_qt5

IMAGE_DEV_MANAGER   = "udev"
IMAGE_INIT_MANAGER  = "systemd"
IMAGE_INITSCRIPTS   = " "
IMAGE_LOGIN_MANAGER = "busybox shadow"

# Filesystem support for USB auto-mount
IMAGE_INSTALL += "ntfs-3g exfat-utils dosfstools"

# Ensure /media directory exists in rootfs for auto-mount points
create_media_dir() {
    mkdir -p "${IMAGE_ROOTFS}/media" || true
}
IMAGE_PREPROCESS_COMMAND += "create_media_dir; "

I have added the steps needed for adding a splash-screen with the Plymouth tool from this article, but when booting the Apalis board on my 7" touch screen it doesn’t show anything.

I also have a problem where when i add a USB stick I need to manually mount it instead of it mounting automatically. I use udev and have a mount.sh script in the yocto build that looks like this:

#!/bin/sh
#
# Called from udev
#
# Attempt to mount any added block devices and umount any removed devices
LOGFILE="/tmp/mount.sh.log"
exec >> "$LOGFILE" 2>&1
echo
echo "====== $(date) ======"
echo "Running with ACTION=$ACTION, DEVNAME=$DEVNAME, ID_FS_TYPE=$ID_FS_TYPE"
env | grep -E '^(ACTION|DEVNAME|ID_|MAJOR|MINOR)' || true

MOUNT="/bin/mount"
PMOUNT="/usr/bin/pmount"
UMOUNT="/bin/umount"
BLACKLIST="/etc/udev/mount.blacklist"
MOUNTBASE="/media"

# Check if blacklisted
if [ -f "$BLACKLIST" ]; then
    while read -r line; do
        case "$line" in
            ""|\#*) continue ;;  # Skip comments and empty lines
        esac
        echo "$DEVNAME" | grep -q "^$line" && {
            logger -t udev/mount.sh "$DEVNAME is blacklisted, ignoring"
            exit 0
        }
    done < "$BLACKLIST"
fi

automount() {
    name="$(basename "$DEVNAME")"
    mount_point="$MOUNTBASE/$name"

    [ ! -d "$mount_point" ] && mkdir -p "$mount_point"

    case "$ID_FS_TYPE" in
        vfat|fat)
            OPTIONS="-o umask=007,sync,gid=$(getent group disk | cut -d: -f3)"
            ;;
        ntfs)
            MOUNT="/bin/ntfs-3g"
            OPTIONS=""
            ;;
        exfat)
            MOUNT="/bin/mount.exfat-fuse"
            OPTIONS=""
            ;;
        *)
            OPTIONS=""
            ;;
    esac

    if ! $MOUNT -t auto $OPTIONS "$DEVNAME" "$mount_point"; then
        logger -t udev/mount.sh "Mount failed: $DEVNAME -> $mount_point"
        rm_dir "$mount_point"
    else
        logger -t udev/mount.sh "Auto-mount successful: $DEVNAME -> $mount_point"
        touch "/tmp/.automount-$(basename "$DEVNAME")"
    fi
}
	
rm_dir() {
    dir="$1"
    [ -d "$dir" ] && [ "$(find "$dir" -type f | wc -l)" -eq 0 ] && rm -r "$dir"
}

# Detect CD-ROMs without ID_FS_TYPE
name="$(basename "$DEVNAME")"
[ -e /sys/block/$name/device/media ] && media_type=$(cat /sys/block/$name/device/media)

if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && { [ -n "$ID_FS_TYPE" ] || [ "$media_type" = "cdrom" ]; }; then
    if [ -x "$PMOUNT" ]; then
        $PMOUNT "$DEVNAME" 2>/dev/null
    elif [ -x "$MOUNT" ]; then
        $MOUNT "$DEVNAME" 2>/dev/null
    fi

    grep -q "^$DEVNAME " /proc/mounts || automount
fi

if [ "$ACTION" = "remove" ] || { [ "$ACTION" = "change" ] && [ -x "$UMOUNT" ]; }; then
    for mnt in $(grep "$DEVNAME" /proc/mounts | awk '{print $2}'); do
        $UMOUNT "$mnt"
    done

    name="$(basename "$DEVNAME")"
    [ -e "/tmp/.automount-$name" ] && rm_dir "$MOUNTBASE/$name"
fi

When i mount the stick manually I don’t get no problems.

Generally we used a custom built Toradex image with thud and now I am trying to make it work with scarthgap. I replaced and modified the files that gave me conflicts and the libs installed correctly the only two problems so far that I have found are the splash screen and mount.
Help would be appreciated.

Thank you in advance,

Tarik

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello Tarik,

Let’s address your two main issues: the Plymouth splash screen not showing, and USB auto-mount not working as expected. Below are targeted solutions and points to check for both based on your setup and the latest Toradex guidelines.


1. Plymouth Splash Screen Not Displaying

For the Plymouth splash screen to work on your Apalis iMX6 (with X11 and systemd), please review these key steps:

a) Ensure Plymouth is Included in the Image

You need to explicitly add Plymouth to your image recipe. In your local.conf or directly in your image .bb file, add:

CORE_IMAGE_EXTRA_INSTALL += "plymouth"

Reference:

b) Set Up a Custom Plymouth Theme

  • Place your custom images (e.g., torizonlogo-white.png) and theme files (e.g., spinner.plymouth) under your custom Yocto layer in the directory (usually recipes-graphics/plymouth/files/).

  • Add a .bbappend for Plymouth with appropriate file installation, for example:

    FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
    SRC_URI += " \
        file://torizonlogo-white.png \
        file://spinner.plymouth \
    "
    
    do_install:append () {
        install -m 0644 ${WORKDIR}/torizonlogo-white.png ${D}${datadir}/plymouth/themes/spinner/watermark.png
        install -m 0644 ${WORKDIR}/spinner.plymouth ${D}${datadir}/plymouth/themes/spinner/spinner.plymouth
    }
    

c) Verify Installation

  • After building, verify Plymouth is correctly included:

    bitbake -e <your-image-name> | grep plymouth
    
  • Make sure the theme files are placed correctly in the build output before flashing to the board.

d) Check Kernel Command Line

  • On many platforms, Plymouth expects a framebuffer to be enabled. Confirm your kernel command line (in U-Boot, check cat /proc/cmdline) includes the right framebuffer (e.g., video=mxcfb0:dev=hdmi,1280x720M@60,bpp=32 or adjusted for your display).
  • If needed, adjust uEnv.txt or U-Boot environment to match your display.
  • Plymouth may require splash to be present as a boot argument.

More details:

e) Enable Plymouth Service

  • Make sure plymouth-start.service is enabled and not masked:
    systemctl status plymouth-start.service
    

2. USB Auto-Mount Not Working

Your approach using a udev script is generally correct, but there are some common causes for failure in auto-mount. Here are improvement tips:

a) Directory Creation

Make sure /media always exists at boot (you’ve added this via create_media_dir, which should suffice).

  • Check after boot:
    ls -ld /media
    

b) Udev Rule Details

  • Your script needs to be invoked properly from a udev rule. Make sure you have, for example, a rule like:

    ACTION=="add|remove", KERNEL=="sd[a-z][0-9]", RUN+="/usr/local/bin/mount.sh"
    

    (Adjust path as needed for your Yocto install.)

  • Permissions: Your script will run as root, but environmental variables (like $ACTION and $DEVNAME) must be provided by udev. Double check your rule.

Reference discussion and examples:

c) Ensure All Dependencies Are Present

  • Confirm file system tools (ntfs-3g, exfat-utils, dosfstools, etc.) are installed, which your image appears to provide.

d) Debugging

  • Log output is directed to /tmp/mount.sh.log. Check this file immediately after you plug in a USB stick—look for mount failures or missing variables.
  • Also check dmesg and journalctl for other errors.

e) Udisks2 (Optional)

If you install and enable udisks2, it can handle auto-mounting for you, especially when using a desktop-style environment, though you can stick with your custom script if you prefer more control.

Example Reference:


Summary of Next Steps:

  1. Confirm Plymouth and its services are included and enabled; adjust U-Boot/cmdline as needed.
  2. Double check your udev rule, the presence of /media, and examine your log file for any error details the custom script outputs.
  3. Reboot and observe kernel and application logs for both issues.

If you share the output of your /tmp/mount.sh.log when you insert/remove a USB stick, or the logs from systemctl status plymouth-start.service, I can provide more tailored troubleshooting.

Best regards,
Toradex AI Assistant.

Dear @tarik-dvpower,

Thank you for bringing up the encountered hurdle.
You mentioned that when booting the Apalis module you do not get any output on the 7" display. May I ask what display specifically you are using?
Furthermore I want to ask you to share your dmesg logs, so that we have a better insight into what is going on.

Best regards,
Collin

I am using a MI0700S6T-25RP-B 7`` display.

These are also the dmesg logs below in a .txt file.
dmesg_logs.txt (31.5 KB)