Improve the disk standby check (#40)
Some checks failed
Build kernel module for TrueNAS / build-and-run (push) Has been cancelled

This commit is contained in:
Yuhao Zhou
2024-11-01 21:36:19 +08:00
committed by GitHub
parent d0c36a5f4a
commit e0bbe9ee50
11 changed files with 221 additions and 40 deletions

View 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/*

View File

@@ -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.

View File

@@ -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

View File

@@ -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/

View File

@@ -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 ..

View 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"