mirror of
https://github.com/miskcoo/ugreen_dx4600_leds_controller.git
synced 2025-07-23 12:23:09 +02:00
Improve the disk standby check (#40)
Some checks failed
Build kernel module for TrueNAS / build-and-run (push) Has been cancelled
Some checks failed
Build kernel module for TrueNAS / build-and-run (push) Has been cancelled
This commit is contained in:
17
build-scripts/debian/Dockerfile
Normal file
17
build-scripts/debian/Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
FROM debian:bookworm
|
||||
|
||||
RUN set -ex \
|
||||
&& sed -i -- 's/Types: deb/Types: deb deb-src/g' /etc/apt/sources.list.d/debian.sources \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
cdbs \
|
||||
devscripts \
|
||||
equivs \
|
||||
fakeroot \
|
||||
wget \
|
||||
git \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /tmp/* /var/tmp/*
|
||||
|
||||
|
@@ -1,2 +1,8 @@
|
||||
|
||||
To build a deb, run `sudo bash build.sh`.
|
||||
Build it in docker:
|
||||
|
||||
```
|
||||
bash docker-run.sh
|
||||
```
|
||||
|
||||
The outputs can be found in `./build` directory.
|
||||
|
@@ -15,7 +15,7 @@ Version: $pkgver
|
||||
Architecture: amd64
|
||||
Maintainer: Yuhao Zhou <miskcoo@gmail.com>
|
||||
Depends: dkms
|
||||
Homepage: https://github.com/miskcoo/ugreen_dx4600_leds_controller
|
||||
Homepage: https://github.com/miskcoo/ugreen_leds_controller
|
||||
Description: UGREEN NAS LED driver
|
||||
A reverse-engineered LED driver of UGREEN NAS.
|
||||
EOF
|
||||
|
@@ -15,7 +15,7 @@ Version: $pkgver
|
||||
Architecture: amd64
|
||||
Maintainer: Yuhao Zhou <miskcoo@gmail.com>
|
||||
Depends: dmidecode, smartmontools
|
||||
Homepage: https://github.com/miskcoo/ugreen_dx4600_leds_controller
|
||||
Homepage: https://github.com/miskcoo/ugreen_leds_controller
|
||||
Description: UGREEN NAS LED tools
|
||||
A reverse-engineered LED tools of UGREEN NAS.
|
||||
EOF
|
||||
@@ -35,11 +35,18 @@ done
|
||||
mkdir -p $pkgname/etc/systemd/system
|
||||
cp scripts/*.service $pkgname/etc/systemd/system/
|
||||
# cp scripts/ugreen-ledmon@.service $pkgname/etc/systemd/system/
|
||||
#
|
||||
|
||||
# example config file
|
||||
cp scripts/ugreen-leds.conf $pkgname/etc/ugreen-leds.example.conf
|
||||
|
||||
# compile the disk activities monitor
|
||||
g++ -std=c++17 -O2 scripts/blink-disk.cpp -o ugreen-blink-disk
|
||||
cp ugreen-blink-disk $pkgname/usr/bin
|
||||
|
||||
# compile the disk standby monitor
|
||||
g++ -std=c++17 -O2 scripts/check-standby.cpp -o ugreen-check-standby
|
||||
cp ugreen-check-standby $pkgname/usr/bin
|
||||
|
||||
# change to root
|
||||
chown -R root:root $pkgname/
|
||||
|
||||
|
@@ -1,14 +1,16 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
git clone https://github.com/miskcoo/ugreen_dx4600_leds_controller.git
|
||||
set -x
|
||||
|
||||
cp build-dkms-deb.sh ugreen_dx4600_leds_controller
|
||||
cp build-utils-deb.sh ugreen_dx4600_leds_controller
|
||||
git clone https://github.com/miskcoo/ugreen_leds_controller.git
|
||||
cd ugreen_leds_controller
|
||||
|
||||
cd ugreen_dx4600_leds_controller
|
||||
bash build-dkms-deb.sh
|
||||
bash build-utils-deb.sh
|
||||
if [ ! -z $1 ]; then
|
||||
git checkout $1
|
||||
fi
|
||||
|
||||
bash build-scripts/debian/build-dkms-deb.sh
|
||||
bash build-scripts/debian/build-utils-deb.sh
|
||||
dpkg-name led-ugreen-dkms.deb
|
||||
dpkg-name led-ugreen-utils.deb
|
||||
mv *.deb ../
|
||||
mv *.deb ..
|
||||
|
15
build-scripts/debian/docker-run.sh
Normal file
15
build-scripts/debian/docker-run.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
set -x
|
||||
|
||||
if [[ ! -d ./build ]]; then
|
||||
mkdir build
|
||||
fi
|
||||
|
||||
docker build --tag bookworm-build .
|
||||
docker run \
|
||||
--rm \
|
||||
--mount type=bind,source=$(pwd)/build,target=/build \
|
||||
--mount type=bind,source=$(pwd)/build.sh,target=/build.sh \
|
||||
bookworm-build \
|
||||
bash -c "cd /build && bash /build.sh $1"
|
Reference in New Issue
Block a user