Showing posts with label gpib. Show all posts
Showing posts with label gpib. Show all posts

Friday, 1 October 2010

New releases

On Thursday, 23 September, openSUSE released a security and bugfix update for the Linux kernel on openSUSE 11.2. As a consequence of this I've rebuilt the gpib-linux RPM again, and also made a new release (2.41) of the pciaer driver which includes a few improvements that I've put in now and then over the past few months.

And I've made a start on pciaer 2.42, ripping out the previously deprecated debug ioctl interface (the same functionality is available via debugfs instead) and removing a few redundant initializers. The next things I want to do before the next release include deprecating a couple more ioctl calls and introducing compat_ioctl handling where necessary to ensure everything works correctly on 64 bit, which is something I never worried about up until now.

Tuesday, 21 September 2010

GPIB RPM again

Another reason to blog again is that someone read my post about GPIB
packaging and enquired whether he could download the package or spec
file from somewhere. I've now made the latest spec file plus some patch
files available at http://www.ini.uzh.ch/~amw/linux-gpib/
Note that it's only known to work for openSuse 11.2 at present.

Wednesday, 28 March 2007

Releases

Released version 2.33 of my pciaer driver today (release notes here), plus the RPM for the GPIB package I was discussing in the previous post.

Tuesday, 27 March 2007

GPIB packaging

I've been re-packaging the latest Linux GPIB Package into an RPM for our SUSE 10.0 machines. This was prompted by the desire to upgrade from kernel 2.6.13-15.11 to 2.6.13-15.15 for security reasons. And because the GPIB drivers and hence the RPM depend on a specific kernel release, upgrading the kernel means a new RPM is required. So far so good, I've done this before, I just need to rebuild the RPM. But maybe there's a new release of the GPIB package too, I thought, so I looked at that this morning, and sure enough, the latest version of linux-gpib is 3.2.09 whereas what we had previously was 3.2.07. So I downloaded 3.2.09 and tried to re-build the RPM with the new linux-gpib version.
Turns out, two important things have changed.
  1. A directory previously called driver is now called drivers
  2. The Makefile newly (and correctly) delegates the installation of the modules to the kernel build system, KBUILD
Having to change the .spec file for the first change is mildly irritating but approximately no work (more or less just s/driver/drivers/, being a little bit careful where that's done), but the second change was a bit more tricky to deal with. The RPM spec file's %install section runs make install to install the drivers which then invokes KBUILD as follows:

$(MAKE) -C $(LINUX_SRCDIR) V=1 modules_install CC="$(LINUX_CC) \
-I/usr/src/packages/BUILD/linux-gpib-3.2.09/drivers/.. \
-I/usr/src/packages/BUILD/linux-gpib-3.2.09/drivers/../driver/include \
-I/usr/src/packages/BUILD/linux-gpib-3.2.09/drivers/../include" \
SUBDIRS="$(GPIB_ABS_MODULE_SUBDIR)" INSTALL_MOD_DIR="gpib"

but this means that the RPM fails to build because KBUILD tries (as a non-root user) to install the kernel modules under the absolute path /lib/modules/2.6.13-15.15-default/gpib. What we need is to get the modules installed under the RPM build root, but there seems to be no way to tell KBUILD to install modules somewhere else other than under /lib/modules/. KBUILD's output path variable O has no effect on this, it seems. Finally, in the %prep section of the spec file I introduce a module_prefix variable in front of the INSTALL_MOD_DIR path thus:

sed -i '/INSTALL_MOD_DIR="gpib"/s/gpib/$(module_prefix)gpib/'
drivers/Makefile.in

and then override this during %install thus:

make module_prefix=../../../$RPM_BUILD_ROOT/lib/modules/%{kernel}/ install

so that the final directory to which the module is copied is, in full

/lib/modules/2.6.13-15.15-default/../../../var/tmp/linux-gpib-3.2.09/lib/modules/2.6.13-15.15-default/gpib

And that works. Phew!