Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I wrote a spec file to create an rpm. #16

Closed
wants to merge 2 commits into from

Conversation

axelolmos
Copy link

Hello!

Thank you so much for creating this wonderful led software!

I created a fork which has a SPECS directory. In that directory, I wrote a spec file so that your package can be distributed as an rpm. I also put the rpms in there.

The spec file is a modified version of: https://elrepo.org/linux/testing/el9/SRPMS/kmod-hello-1-0.0-13.el9_2.elrepo.src.rpm

I also think I found a bug in ugreen-diskiomon where the drive bays with no disk installed still had led lights on. Fix and diff is below.

nas:/usr/bin$ diff ugreen-diskiomon.orig ugreen-diskiomon.new
164c164,168
< fi

    else
  # turn off the led if no disk installed on this slot
        echo 0 > /sys/class/leds/$led/brightness
        echo none > /sys/class/leds/$led/trigger

fi

Feel free to use or not use anything I wrote.

Thank you again for all your work!
Axel

Added additional code to turn off extra disks.
Running the create-kmod-led-ugreen.sh script as root on an Alma Linux 9.4 system will rpm build the kmod-led-ugreen.spec file and create rpms.
@@ -161,7 +161,11 @@ for i in "${!led_map[@]}"; do
echo 0 > /sys/class/leds/$led/brightness
echo none > /sys/class/leds/$led/trigger
fi
fi
else
# turn off the led if no disk installed on this slot
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indent here seems incorrect?

@miskcoo
Copy link
Owner

miskcoo commented Jun 22, 2024

Thank you for creating this script.

I am not familiar with the rpm packaging, but it seems there are some unnecessary files in the SPEC directory (e.g., *.orig, *.new)? Can you remove them and just keep the necessary files?

For the pre-built rpm package, if I understand correctly it only applies to a specific kernel (since it is a .ko, not built with dkms), so maybe we can also remove it (or put it in the release page instead of the source files) as other users may have different kernel, and write a README.md in SPEC for how to build a rpm package.

Requires(postun): %{_sbindir}/weak-modules
Requires: kernel >= %{kmod_kernel_version}
Requires: kernel-core-uname-r >= %{kmod_kernel_version}
Requires: i2c-tools smartmontools
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script also requires dmidecode.

miskcoo added a commit that referenced this pull request Jun 27, 2024
* Bugfixes

- add missing led_map thanks @miskcoo
- implement functions for modprobe from drivers
- minor changes for logger messages
- add DXP480T and function to set static white LED

* Bugfix for DXP6800

* fix: turn off the light when no disk in a slot (#16)

* Update ugreen-leds

---------

Co-authored-by: Yuhao Zhou <miskcoo@gmail.com>
@miskcoo miskcoo closed this Sep 18, 2024
@gulikoza gulikoza mentioned this pull request Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants