Giter Site home page Giter Site logo

dsm7-ch341's Introduction

CH341 Driver for Synology DSM 7

CH341 Driver for Synology DSM 7

The ch431.c source is copied from the Linux source tree:

https://github.com/torvalds/linux/blob/f2950b78547ffb8475297ada6b92bc2d774d5461/drivers/usb/serial/ch341.c

This is the newest version that compiles and works, between v4.10-rc3 and v4.10-rc4. I have only tested on my RS1221+.

Build

The Synology Package build process requires root for some weird reason I don't quiet understand, so you might want do this in a virtual machine to avoid messing with your own environment.

1. Setup the build environment.

Please refer to this and this document.

After installing the toolchian, get yourself root for the whole process.

sudo su

All remaining steps assume that you are in the root shell.

2. Clone the source.

Assuming your toolkit is located at /toolkit as described in the document above, change it if yours not.

mkdir -p /toolkit/source
cd /toolkit/source
git clone https://github.com/chenzhuoyu/dsm7-ch341 ch341

The directory name MUST be ch341, NOT dsm7-ch341, and it MUST in directory /toolkit/source.

3. Build the driver.

rm -vrf /toolkit/build_env/ds.v1000-7.0/source  # clean up previous build products
/toolkit/pkgscripts-ng/PkgCreate.py -p v1000 ch341

Replace the v1000 with your actual platform. You can find out which platform your NAS is using on this page.

If successful, the build product should be at /toolkit/build_env/ds.v1000-7.0/source/ch341/ch341.ko. Again, replace v1000 with your actual platform.

4. Load the driver into kernel.

Manage to copy the ch341.ko to the /lib/modules directory on your NAS.

For example, you can scp it from your build environment to the /tmp directory on your NAS, and execute sudo mv /tmp/ch341.ko /lib/modules on your NAS to move it into place.

Once the file is in place, execute the following commands on your NAS:

sudo modprobe usbserial
sudo insmod /lib/modules/ch341.ko

And voilà, you got a working CH341 driver.

Automatically load at boot

Please ensure your driver works before rebooting or performing any of the following steps, otherwise your NAS might not be able to boot again !

All the steps below should executed on your NAS. Requires root access.

  1. Make sure your driver is in /lib/modules.

  2. Create depmod as a symlink to kmod.

DSM 7 does not ship with depmod, so we need to create one manually.

sudo ln -s /usr/bin/kmod /sbin/depmod
  1. Register your driver to the module dependency registry.
sudo echo 'ch341:' >> /lib/modules/modules.dep
sudo depmod

Ignore any warnings the depmod command might generate.

  1. Create a .conf file in /lib/modules-load.d with content:

File name is irrelevant, as long as it has the .conf extension, but conventionally it should be 70-usb-serial.conf.

usbserial
ch341
  1. Reboot.

After a successful reboot, you can use lsmod to ensure your driver was loaded.

dsm7-ch341's People

Contributors

chenzhuoyu avatar

Stargazers

 avatar Nicholas Orchard avatar Arkadii avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.