[OS-BUILD PATCHv2 0/0] redhat: scripts: An automation script for disabling unused driver for x86

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Kate Hsuan on gitlab.com
Merge Request: https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2832
NOTE: Truncated patchset due to missing public @redhat.com email
      address on your GitLab profile at https://gitlab.com/-/profile.
      Once that is fixed, close and reopen the merge request to
      retrigger sending the emails.

Some of the drivers are not used for x86 systems but they are enabled and
shipped with Fedora kernel release. These unnecessary kernel modules increase
the package size for x86 platform. If we manually disable all unnecessary
drivers, it takes time and is difficult to address the errors. If a place can
be used to manage a list of necessary drivers and based on the list, the
unnecessary drivers can be automatically disabled, it certainly reduces a part
of the workload for the maintainer. Moreover, the package size can also be
reduced by the results of the tool. In this work, we proposed an automation
script tool that can be used to disable the drivers based on a configuration
list. The drivers that are not in the list will be disabled and reduce the
kernel module package size.

This script filters and disables the unused driver through an allow list
file in JSON format. The maintainer sets a list kernel config to the
allow list file and then runs this script. It will compare the current
setting with allow list. If the current settings aren't listed in the
allow list, the script will generate a redhat kernel config file and
disable it.

Moreover, the allow list file includes the setting of the commit title and
commit message. The maintainer can make that information according to the
requirement. The format is shown below.

{
  "name":"iio_accel",
  "driver_path":"drivers/iio/accel/",
  "redhat_config_path":"redhat/configs/fedora/generic",
  "redhat_x86_config_path":"redhat/configs/fedora/generic/x86",
  "allow_list":[
    "CONFIG_BMC150_ACCEL_I2C",
    "CONFIG_DA280",
    "CONFIG_HID_SENSOR_ACCEL_3D",
    "CONFIG_KXCJK1013",
    "CONFIG_MMA7660",
    "CONFIG_MMA8452",
    "CONFIG_MXC4005",
    "CONFIG_MXC6255",
    "CONFIG_IIO_ST_ACCEL_I2C_3AXIS",
    "CONFIG_IIO_ST_ACCEL_3AXIS",
    "CONFIG_IIO_CROS_EC_ACCEL_LEGACY",
    "CONFIG_BMC150_ACCEL"
    ],
  "commit_title":"Disable accel drivers for Fedora x86",
  "commit_msg":"Disable the following accel drivers because they are not used
on any x86 boards.\n{{ config_list }}"
}

The second commit includes the result of the script. It disabled the unused
iio accel drivers for x86 since they were not used in any x86 boards.

---
 redhat/configs/fedora/generic/x86/CONFIG_ADXL313_I2C             |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_ADXL313_SPI             |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_ADXL355_I2C             |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_ADXL355_SPI             |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_ADXL367_I2C             |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_ADXL367_SPI             |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_ADXL372_I2C             |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_ADXL372_SPI             |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_DA311                   |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_DMARD10                 |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_IIO_KX022A_I2C          |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_IIO_KX022A_SPI          |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_IIO_ST_ACCEL_SPI_3AXIS  |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_MSA311                  |    1 +
 redhat/configs/fedora/generic/x86/CONFIG_SCA3300                 |    1 +
 redhat/scripts/fedora/filter-tools/x86_allow/x86_accel_allow     |   22 +
 redhat/scripts/fedora/filter-tools/x86_disable_unused_drivers.py |  199 ++++++++++
 17 files changed, 236 insertions(+), 0 deletions(-)
--
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux