Build Fail On Linux 6.12.* Aarch64: /var/lib/dkms/sharp-drm/1.5/build/src/drm_iface.c:36:10: Fatal Error: Drm/drm_fbdev_generic.h: No Such File Or Directory

by ADMIN 157 views

Build Fail on Linux 6.12. aarch64: /var/lib/dkms/sharp-drm/1.5/build/src/drm_iface.c:36:10: fatal error: drm/drm_fbdev_generic.h: No such file or directory*

When upgrading to Linux 6.12.20 on aarch64 architecture, users may encounter a build failure with the sharp-drm-driver. This issue is particularly evident when attempting to recompile the sharp-drm-driver after upgrading to Linux 6.12.20. In this article, we will delve into the root cause of this problem and provide a step-by-step guide to resolve it.

The sharp-drm-driver is a kernel module that provides a DRM (Direct Rendering Manager) interface for the Sharp LCD display. It is designed to work with the Linux kernel and is commonly used on Raspberry Pi devices. The driver is built using the DKMS (Dynamic Kernel Module Support) system, which allows it to be easily compiled and installed on the kernel.

Symptoms

When attempting to recompile the sharp-drm-driver after upgrading to Linux 6.12.20, users may encounter the following error message:

/var/lib/dkms/sharp-drm/1.5/build/src/drm_iface.c:36:10: fatal error: drm/drm_fbdev_generic.h: No such file or directory
   36 | #include <drm/drm_fbdev_generic.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~

This error indicates that the compiler is unable to find the drm/drm_fbdev_generic.h header file, which is required by the sharp-drm-driver.

Analysis

After analyzing the build log, it appears that the issue is caused by a change in the Linux kernel version. The sharp-drm-driver is designed to work with older kernel versions, and the new kernel version (6.12.20) has introduced changes that are not compatible with the driver.

Solution

To resolve this issue, we need to modify the sharp-drm-driver to work with the new kernel version. One possible solution is to update the driver to use the new kernel headers. However, this may require significant changes to the driver code.

Alternative Solution

Another possible solution is to downgrade the Linux kernel to a version that is compatible with the sharp-drm-driver. This can be achieved by installing an older kernel version using the apt package manager.

Step-by-Step Guide

To resolve this issue, follow these steps:

  1. Backup your system: Before making any changes, it is essential to backup your system to prevent any data loss.
  2. Downgrade the Linux kernel: Use the apt package manager to downgrade the Linux kernel to a version that is compatible with the sharp-drm-driver. For example:
sudo apt install linux-image-6.6.1
  1. Recompile the sharp-drm-driver: Once the kernel has been downgraded, recompile the sharp-drm-driver using the following command:
sudo dkms install sharp-drm/1.5
  1. Verify the driver: After recompiling the driver, verify that it is working correctly by checking the kernel logs:
sudo dmesg | grep sharp-drm
  1. Upgrade the kernel: If the driver is working correctly, you can upgrade the kernel to the latest version using the apt package manager.

In conclusion, the build failure with the sharp-drm-driver on Linux 6.12.* aarch64 is caused by a change in the kernel version. To resolve this issue, we can either update the driver to work with the new kernel version or downgrade the kernel to a version that is compatible with the driver. By following the step-by-step guide outlined in this article, users can resolve this issue and continue to use the sharp-drm-driver on their Raspberry Pi devices.

For users who are experiencing issues with the sharp-drm-driver on Linux 6.12.* aarch64, it is recommended to check the official GitHub repository for the driver for any updates or patches. Additionally, users can try using the dkms package manager to manage the driver and kernel versions.

Q: What is the sharp-drm-driver?

A: The sharp-drm-driver is a kernel module that provides a DRM (Direct Rendering Manager) interface for the Sharp LCD display. It is designed to work with the Linux kernel and is commonly used on Raspberry Pi devices.

Q: What is the cause of the build failure?

A: The build failure is caused by a change in the Linux kernel version. The sharp-drm-driver is designed to work with older kernel versions, and the new kernel version (6.12.20) has introduced changes that are not compatible with the driver.

Q: How can I resolve the build failure?

A: There are two possible solutions to resolve the build failure:

  1. Update the driver to work with the new kernel version: This may require significant changes to the driver code.
  2. Downgrade the Linux kernel to a version that is compatible with the sharp-drm-driver: This can be achieved by installing an older kernel version using the apt package manager.

Q: How do I downgrade the Linux kernel?

A: To downgrade the Linux kernel, use the apt package manager to install an older kernel version. For example:

sudo apt install linux-image-6.6.1

Q: How do I recompile the sharp-drm-driver after downgrading the kernel?

A: After downgrading the kernel, recompile the sharp-drm-driver using the following command:

sudo dkms install sharp-drm/1.5

Q: How do I verify that the driver is working correctly?

A: To verify that the driver is working correctly, check the kernel logs:

sudo dmesg | grep sharp-drm

Q: Can I upgrade the kernel after resolving the build failure?

A: Yes, if the driver is working correctly, you can upgrade the kernel to the latest version using the apt package manager.

Q: Where can I find more information about the sharp-drm-driver?

A: For more information about the sharp-drm-driver, visit the official GitHub repository: https://github.com/ardangelo/sharp-drm-driver

Q: Can I use the dkms package manager to manage the driver and kernel versions?

A: Yes, you can use the dkms package manager to manage the driver and kernel versions. This can help simplify the process of resolving build failures and upgrading the kernel.

Q: What are some common issues that may occur when using the sharp-drm-driver?

A: Some common issues that may occur when using the sharp-drm-driver include:

  • Build failures: As described in this article, build failures can occur when the kernel version is updated.
  • Driver compatibility issues: The sharp-drm-driver may not be compatible all kernel versions or architectures.
  • Kernel crashes: In some cases, the sharp-drm-driver may cause kernel crashes or other stability issues.

In conclusion, the build failure with the sharp-drm-driver on Linux 6.12.* aarch64 is caused by a change in the kernel version. By downgrading the kernel to a version that is compatible with the driver, users can resolve this issue and continue to use the sharp-drm-driver on their Raspberry Pi devices.