Forum Discussion
Altera_Forum
Honored Contributor
14 years agoI came up with another solution how to run USB Blaster under modern Linux kernels, as an alternative to mounting stuff on /proc/bus or modifying paths in the jtagd binary. This is a shared library which dynamically translates paths in /proc/bus/usb to their udev counterparts. The advantage is that there are no system-wide modifications required: the library is attached to jtagd only.
I would be quite happy with modifying paths in jtagd if I could fix all of them; but since /sys/kernel/debug/usb/devices is longer than /proc/bus/usb/devices and therefore can't be placed inside jtagd, a symlink from /dev/bus/usb/devices is needed, which is, again, a system-wide modification. With this library, all that's needed is to runmake install inside the unpacked sources. This will build the library, install it into Quartus platform-specific subdirectory and patch the jtagd script to include LD_PRELOAD. Alternatively, if you prefer to give it a try before installing, run just make and then use the library like this: LD_PRELOAD=/full/path/to/libusbfsemu.so jtagd (If using with the standalone Quartus programmer on x64, change to libusbfsemu32.so above.) I tested this with Quartus II 10.0 and 10.1sp1, and glibc 2.12.1 (Ubuntu 10.10). Naturally, this solution still depends on a proper udev configuration to set up permissions under /dev/bus/usb. The one suggested by Altera is totally wrong here, because it relies on usbfs; get rid of it if it's still on your machine. I use the following rule: SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{DEVNUM}!="001", ENV{ID_USB_INTERFACES}==":ff*:", GROUP="plugdev" which assigns devices with vendor-specific interfaces to the plugdev group. This should give access to normal users and is more secure than the 0666 umask which grants full access to everybody and their dog. That's more or less what plugdev is intended for. This rule is also more universal and works with most other USB devices you may happen to plug in that require userspace (driverless) handling through /dev/bus/usb. I put this rule into /etc/udev/rules.d/41-usb-plugdev.rules on my system (Ubuntu 10.10). To summarise, getting USB Blaster to work under Linux without usbfs involves: - setting up udev rule (like above or using any of the previous suggestions in this thread, but NOT the Altera way);
- installing the library with make install.