miskcoo / ugreen_leds_controller

An LED controller of UGREEN DX4600 Pro NAS, compatible with UGREEN DXP4800/6800/8800 series.
152 stars 22 forks source link

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

Closed axelolmos closed 1 month ago

axelolmos commented 4 months ago

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

miskcoo commented 4 months ago

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.