mount: /sys/kernel/debug: mount point does not exist.

When running balenalib/%%BALENA_MACHINE_NAME%%-alpine-node container on an Orange Pi Zero with UDEV on:

Dockerfile:

ENV UDEV=on
COPY config/usb/udev/usb.rules /etc/udev/rules.d/usb.rules
COPY config/usb/scripts /usr/src/scripts
RUN chmod +x /usr/src/scripts/*

An error appears in the logs: mount: /sys/kernel/debug: mount point does not exist.

Connecting to the container, the folder indeed does not exist, nor does it exist on the device (BalenaOS 2.60.1+rev1).

Running this on the device to ensure a clean image: balena run -it -e UDEV='on' --privileged balenalib/orange-pi-zero-alpine-node sh

Returns the error: mount: mounting nodev on /sys/kernel/debug failed: No such file or directory

Hi,

I think it’s not mounted yet, can you please try to mount it by running this in before running anything?

mount -t debugfs nodev /sys/kernel/debug

I haven’t got the device up at the moment, but presumably the fact the folder doesn’t exist will not allow it to mount.

More importantly, it isn’t a command executing from my scripts that is causing the error, it is from within the balena image, possibly: https://github.com/balena-io-library/base-images/blob/91228b8f7785c025ac662ff38d42b119364ccdfd/balena-base-images/armv7hf/debian/buster/run/entry.sh

Hi, when you say that the folder does not exist, do you mean that the /sys folder is not present in the hostOS of your device?
Could you please ssh into the hostOS and paste the output from mount? There should be a:

sysfs on /sys type sysfs (rw,relatime)

Then you should be able to run:

mount -t debugfs nodev /sys/kernel/debug

On the hostOS. Once that works, you can reboot to make sure we start from a clean state, and then try the same thing from your container application. If your are running a multi-container app you will need to use the io.balena.features.sysfs label in your compose file so that the sys filesystem gets mounted in the container filesystem.

A little confused on which of these you wanted run on the hostOS and which inside the container, so did both:

On the hostOS:

root@b:/sys# sysfs on /sys type sysfs (rw,relatime)
-sh: syntax error near unexpected token `('
root@b:/sys# sysfs on /sys type sysfs              
-sh: sysfs: command not found

root@b:/sys# mount -t debugfs nodev /sys/kernel/debug
mount: /sys/kernel/debug: mount point does not exist.

In the container:

root@b: balena run -it -e UDEV='on' --privileged --label io.balena.features.sysfs=1 balenalib/orange-pi-zero-alpine-node sh
mount: mounting nodev on /sys/kernel/debug failed: No such file or directory

Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/):

Architecture: ARM v7

OS: Alpine Linux 3.12

Variant: run variant

Default variable(s): UDEV=off

The following software stack is preinstalled:

Node.js v15.0.1, Yarn v1.22.4

Extra features:

- Easy way to install packages with `install_packages <package-name>` command

- Run anywhere with cross-build feature (for ARM only)

- Keep the container idling with `balena-idle` command

- Show base image details with `balena-info` command

/ # sysfs on /sys type sysfs (rw,relatime)

/bin/sh: syntax error: unexpected "("

/ # sysfs on /sys type sysfs

/bin/sh: sysfs: not found

/ # mount -t debugfs nodev /sys/kernel/debug

mount: mounting nodev on /sys/kernel/debug failed: No such file or directory

/ #

To clarify my earlier comment, /sys/kernel exists inside the container and on the hostOS, but the folder debug in that location does not exist in either.

From inside the same container:

/ # mkdir /sys/kernel/debug
mkdir: can't create directory '/sys/kernel/debug': Operation not permitted

Hi, could you please paste the output of the following from the hostOS?

zcat /proc/config.gz ! grep DEBUG_FS

Correcting typo above:

zcat /proc/config.gz | grep DEBUG_FS
root@b:/sys/kernel# zcat /proc/config.gz | grep DEBUG_FS

# CONFIG_DEBUG_FS is not set

root@b:/sys/kernel# cat /etc/os-release

ID="balena-os"

NAME="balenaOS"

VERSION="2.60.1+rev1"

VERSION_ID="2.60.1+rev1"

PRETTY_NAME="balenaOS 2.60.1+rev1"

MACHINE="orange-pi-zero"

VARIANT="Development"

VARIANT_ID="dev"

META_BALENA_VERSION="2.60.1"

RESIN_BOARD_REV="58025c9"

META_RESIN_REV="9aed19a"

SLUG="orange-pi-zero"

Hi, thanks for the information. The kernel shipped with this release lacks DEBUGFS support. I have opened an issue to solve this (https://github.com/balena-os/balena-allwinner/issues/128). Please use it to track progress, and we will update this thread once it’s fixed.

1 Like