-
Notifications
You must be signed in to change notification settings - Fork 23
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
TrueNAS Scale #13
Comments
The instruction looks good, and don't forget to install For ZFS, I am also using it. I am curious about how the zpool is configured on TrueNAS. Could
|
I will check the zpool stuff on the ata-disk-mapping branch |
Not sure if this will work. Maybe we can skip installing a VM by building the kmod in a Debian docker with the headers from truenas? I can build such a module using the scripts in the |
@sgreiner may possible to run all this in a Debian Jail with required capabilities of https://github.com/Jip-Hop/jailmaker ? |
Today I updated my TrueNAS. I cloned this repo (master branch) to my Desktop PC (with wsl2 and docker desktop) and run your truenas build script, copied the kernel module to the new TrueNAS (24.04.2) - it worked flawlessly. This was way easier and faster than a builder VM setup. Thank you. |
I was following your tutorial above but then I got this error: modprobe: ERROR: could not insert 'led_ugreen': Invalid argument while running |
@anup-khanal 24.04.2 has a different kernel than the 24.04.1.1 (you downloaded a module for this). Run this from the master branch: (your build host has to have docker installed) With this a suitable kernel module will be created and you can replace the wrong one. |
Hi, I'm too stupid for this conversation, can someone help me? I have the UG NAS 6800 Pro and I'm running TrueNAS Scale 24.04.2. All I want to do is to turn off ALL of the LEDs (power, LAN and disks). I tried following the guide but I must be missing something, so I deleted everything and now I want to start from scratch. Can someone tell me what the easiest way to achieve my goal is? Thank you so much🙏 |
@DavidePgr let me try to give a summary:
If you have more specific questions I can try to help. |
Can we accomplish the first step in your list as scheduled GitHub Actions run in the repo here? Would make life for many a bit easier 😀 |
Thanks, tomorrow I’ll have a look👍 is it correct that I have to do this for each truenas update? |
@DavidePgr I could recommend the CLI solution With that script: https://gist.github.com/Kerryliu/c380bb6b3b69be5671105fc23e19b7e8?permalink_comment_id=5109769#gistcomment-5109769 With that you won't have trouble after upgrading TrueNAS - but I don't know how bad is to have to have i2c-dev enabled all the time... |
I tried to run that script but I can't figure out a problem: I executed Can someone help? Thanks! Edit: I copy-pasted the script that you linked, I don't know if I'm supposed to change any value... |
@Adrian-Grimm @meyergru @DavidePgr This issue is about installing and running the solution of this repository on TrueNas with its kernel mod. |
Aloha, Thank you for the nice solution. |
The color is not changed by the systemd services, so you can set it by: (copied from the main README of this project): echo 255 > /sys/class/leds/power/brightness # non-zero brightness turns it on
echo "255 0 0" > /sys/class/leds/power/color # set the color to RGB(255, 0, 0)
Are you sure, that you used the correct name of the interface during systemd service creation from the systemd slice? # change name of NIC if needed
systemctl start ugreen-netdevmon@enp88s0
systemctl enable ugreen-netdevmon@enp88s0 Maybe you put the cable into enp87s0 or enp89s0. In that case disable and stop the netdevmon on the wrong interface and use the right name after the @ symbol |
Thank you very much. |
We can now automatically check and build the kernel module for new TrueNAS versions (as a daily cron job). The pre-build modules can be found in https://github.com/miskcoo/ugreen_dx4600_leds_controller/tree/gh-actions/build-scripts/truenas/build. The build script will check https://download.truenas.com/ for new versions. |
Thanks for your amazing work - hosts: truenas
tasks:
- name: Detect current truenas version
ansible.builtin.shell: cli -c 'system version_short'
register: truenas_version
- name: Remount boot-pool
ansible.posix.mount:
path: /
fstype: zfs
src: 'boot-pool/ROOT/{{ truenas_version.stdout }}'
opts: remount,rw
state: mounted
- name: Remount boot-pool usr
ansible.posix.mount:
path: /usr/
fstype: zfs
src: 'boot-pool/ROOT/{{ truenas_version.stdout }}/usr'
opts: remount,rw
state: mounted
- name: Find apt-related binaries
ansible.builtin.find:
paths: /bin
patterns: "apt*"
register: apt_binaries
- name: Set execute permissions on apt-related binaries
ansible.builtin.file:
path: "{{ item.path }}"
mode: a+x
loop: "{{ apt_binaries.files }}"
- name: Set execute permissions on dpkg
ansible.builtin.file:
path: /usr/bin/dpkg
mode: a+x
- name: Update apt cache
environment:
PATH: "/usr/bin:/usr/sbin"
become: true
ansible.builtin.apt:
update_cache: yes
- name: Install build-essential and linux-headers-generic
environment:
PATH: "/usr/bin:/usr/sbin"
become: true
ansible.builtin.apt:
name:
- build-essential
- linux-headers-generic
state: present
- name: Ensure git repo is cloned
ansible.builtin.git:
repo: 'https://github.com/miskcoo/ugreen_dx4600_leds_controller.git'
dest: /root/ugreen_dx4600_leds_controller
force: true
- name: Copy Build scripts
ansible.builtin.copy:
remote_src: true
src: "/root/ugreen_dx4600_leds_controller/build-scripts/debian/{{ item }}"
dest: "/root/ugreen_dx4600_leds_controller/{{ item }}"
mode: '0755'
loop:
- build-dkms-deb.sh
- build-utils-deb.sh
- name: Build packages
ansible.builtin.shell:
chdir: /root/ugreen_dx4600_leds_controller/
cmd: "bash {{ item }}"
loop:
- build-dkms-deb.sh
- build-utils-deb.sh
environment:
PATH: "/usr/bin:/usr/sbin"
- name: Install packages
ansible.builtin.apt:
deb: "/root/ugreen_dx4600_leds_controller/{{ item }}"
state: present
loop:
- led-ugreen-dkms.deb
- led-ugreen-utils.deb
environment:
PATH: "/usr/bin:/usr/sbin"
- name: Enable services
ansible.builtin.systemd_service:
daemon_reload: true
enabled: true
name: "{{ item }}"
state: "started"
loop:
- ugreen-diskiomon
- ugreen-netdevmon@br0
|
The following instructions are a memory log from my successful attempt today to get the LEDs of the Ugreen NASync DXP6800 Pro running poperly on TrueNAS Scale.
I hope I haven't forgotten anything, otherwise I'll add to it when I reinstall it (probably next weekend). Big thanks to @miskcoo for your work on this repository!
I thought someone might find this useful, so I add this as issue here, hope thats ok.
Ugreen NAS LEDs on TrueNAS Scale
20.06.2024 Initial guide for 24.04.1.1
07.08.2024 updated guide for 24.04.2 and the docker based kernel mod build
(Alternative 1) Compile the kernel module with docker based build script
First install docker, for example "Docker Desktop" on Windows, or docker from your Linux Distro.
Clone this repository and run the build.sh with the exact TrueNAS version you want to use.
Copy the newly compiled kernel module (led-ugreen.ko) to your TrueNAS system somehow (with scp, or copy it to a SMB share, ...).
(Alternative 2) Compile Kernel Module with a Builder VM
Install TrueNAS Scale on a VM. These steps could be done on the target NAS, but we don't want to clutter the appliance more than necessary.
You might need to adjust the version numbers below in the future.
Execute as root (
sudo su -
) on a fresh TrueNAS VM with the exact same version as your target TrueNAS Scale.copy these two files to your target TrueNAS somehow:
# example scp /root/ugreen_dx4600_leds_controller/cli/ugreen_leds_cli root@target:/root scp /root/ugreen_dx4600_leds_controller/kmod/led-ugreen.ko root@target:/root
Target TrueNAS (e.g. on a Ugreen NASync DXP6800 Pro)
install TrueNAS Scale:
On TrueNAS Scale 24.04.2 dependencies like i2c-dev, ledtrig-oneshot, ledtrig-netdev and smartmontools and dmidecode are available.
execute as root on your target TrueNAS:
Put the previously compiled kernel module (from either Alternative 1 or 2) to its destination location. The kernel version will change with newer TrueNAS releases.
Create kernel modules load config:
insert this content:
Run depmod and modprobe:
systemd setup for leds
cd /root/ugreen_dx4600_leds_controller/
copy config and systemd units and scripts
Reboot and verify.
After a TrueNAS Scale Update you need to repeat all steps, as the boot-pool datasets are versioned and our changes will be gone in a new boot-pool dataset.
The text was updated successfully, but these errors were encountered: