Here is a mini-howto to get pk2cmd Linux port to work under PCLinuxOS 2007.
1) Download pk2cmdLinux from Jeff Post's website.
Download link: http://home.pacbell.net/theposts/picmicro/
Edit in 09/2009: new download link
As of this writing, the version is 0.8.
2) Preparation to get pk2cmd working is easy under PCLinuxOS 2007.
You need to have g++ (provided by package gcc-c++) and make (provided by package "make"). You also need to install libusb-devel package. You can use Synaptic (GUI) to install these packages and their dependencies. You can also use apt (apt-get install libusb-devel) as root to install this package.
3) Edit the Makefile and then build it using make.
You need to edit the Makefile to to define the proper CFLAGs.
PCLinuxOS 2007 is usingLinux kernel 2.6.x and support udev rules. So we will use the following option.
# ----- Use the following for Linux kernel 2.6.x: -----
CFLAGS=$(OPTS) -I$(LIBUSB)/include -DLINUX -DUSE_DETACH -DCLAIM_USB
Now we can build pk2cmdLinux. Just type "make".
4) Test it as root and it should just work.
5) In order to run pk2cmdLinux as a normal user, we need to set up udev rules. PCLinuxOS 2007 has done the udev rules for the users. So it is easier than other Linux distros. The only thing you need to do it to add you user name to the group "usb".
Go to PCLinuxOS Control Center and choose "Add, remove or change users of the system", right
click your user name and choose "Edit" and select "Groups". Check "usb" and you are done.
To confirm this, run "group yourusername".
[mcuee@localhost pk2cmdLinux-0.8]$ groups mcuee
mcuee : mcuee tty lp wheel uucp cdrom usb cdwriter audio video users
[mcuee@localhost pk2cmdLinux-0.8]$ lsusb
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 003: ID 04d8:000c Microchip Technology, Inc.
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID 04d8:0033 Microchip Technology, Inc.
Bus 001 Device 001: ID 0000:0000
[mcuee@localhost pk2cmdLinux-0.8]$ ls -la /dev/bus/usb/001/
drwxr-xr-x 2 root root 80 May 1 09:09 ./
drwxr-xr-x 5 root root 100 May 1 2008 ../
crw-rw---- 1 mcuee usb 189, 0 May 1 2008 001
crw-rw---- 1 mcuee root 189, 1 May 1 09:12 002
Now you can run pk2cmd as a normal user.
[mcuee@localhost pk2cmdLinux-0.8]$ ./pk2cmd -?V
Executable Version: 1.01.00 (Linux/Mac port 0.8)
Device File Version: 1.42.00
OS Firmware Version: 2.30.01
[mcuee@localhost pk2cmdLinux-0.8]$ ./pk2cmd -PPIC16F690 -I -T
Device ID = 1403
[mcuee@localhost pk2cmdLinux-0.8]$ ./pk2cmd -PPIC16F690 -GFdemo.hex
[mcuee@localhost pk2cmdLinux-0.8]$ ./pk2cmd -PPIC16F690 -Y -Fdemo.hex
PICkit 2 Verify Report
Device Type: PIC16F690