Posts mit dem Label package werden angezeigt. Alle Posts anzeigen
Posts mit dem Label package werden angezeigt. Alle Posts anzeigen

19.02.2011

Release Party!

I proudly present: video-swicher, a tool to switch betweeen the integrated and the dedicated video card on laptops that have switchable graphics cards. As far as I know, this the the first and (up to now) only tool for this job!
The package is easy to use. It comes with an upstart job that can disable the unused video card on system boot (configurable via a configuration file in /etc/default) and a binary to change the active card. It can only be run by root (or via sudo) since it needs to write into a file on /sys which is owned by root and it needs to shutdown any running display manager.
Up to now there's only one available package, video-switcher which provides the upstart job and the binary. A second package providing a GUI will follow within the next days.
Grab the package by the usual means (available in my PPA) and tell me what You think!
  1. Install
    Code:
    $ sudo apt-get install video-switcher
  2. Use
    Code:
    $ sudo video-switcher [int|ded]
That's it! You're done!

P.S.: You might ask Yourself: How come there's version 1.0.3 available if this is the release announcement? Well, I uploaded the package, found some bugs, deleted it and fixed them. When I tried to upload the fixed version as 1.0.0 again, the system rejected the code claiming that there was already a version 1.0.0 that differed. So I had to make it version 1.0.3.

17.02.2011

The end is near!

I'm about to finish work on latest package called video-switcher! I managed to write a command-line application that is able to change the video card. It has to restart the X server (closing Your session), but as far as I know, there's no getting around that.
There's only one problem left to fix. When switching back to the on-board Intel video card on my tm2-1090eg, the display often gets into a weird state where it's either showing just garbage or nothing at all. I was able to circumvent this by turning the screen off and on again. However, vbetool, the program I use for doing so, sometimes hangs up using 100% of the processor. At that point, my program hangs, too, and never gets to restart the X server. Apparently this is a known bug which hasn't been fixed yet. I'm still working on this and I hope to have a fix ready in the next few days. If You have any idea that might help, I'd be glad to hear about it!
I'll keep You posted!

P.S.: After fixing the problem it might still take some time to write a graphical user interface for the command line application. This shouldn't take more than a day, though.

14.02.2011

Yet another bugfix release (for tablet-mode)

I'm sorry! I broke it again! Shame on me!
As You might have noticed, upon upgrading from an older version of tablet-mode the upstart job disappears magically and the automatic screen rotation stops working. I failed to notice the postrm script during the last bugfix. This nasty little thing (which I wrote myself, shame even more!) deletes the upstart job when the package is removed. This is neither necessary nor useful, as it is also called when the package is upgraded, effectively breaking the automatic screen rotation.
You problably won't be surprised when I tell You what You need to do. Remove and reinstall. Just as in the last article. Make sure to grab the newest version (1.5.3), upgrading from there should finally work as expected.
I'm really sorry.

08.02.2011

Bugfix for tablet-mode

As usual, there's a bugfix for tablet-mode shortly after there was a new version with a new feature. I'm sorry, but I messed up some things again. If You find Yourself with a broken package (something's not working), You might want to purge the package and re-install the latest version (this should be 1.5.1 or higher!). Unfortunately, a simple update from an earlier version might not fix everything, as the configuration files (in /etc) are not re-installed correctly. In order to purge and reinstall the package, do the following (as root).
Code:
$ apt-get purge tablet-mode
$ apt-get update
$ apt-get install tablet-mode
You should check Your /etc/tablet-mode/tablet-mode.conf to make sure that all entries are correct.

That's it! You're done!

07.02.2011

New feature for tablet-mode!

As You might have notices (or if not, I'm gonna tell You now anyway), there are 2 updates for tablet-mode. Version 1.5.1 ist out. Version 1.5.0 fixed some package-internal things (particularly with the config file and the postinst script) and introduced a new feature. Thanks to Nicolò's comment, the new tablet-mode package gives You the possibility to turn off Your laptop's touchpad (that mouse-replacement, not the touchscreen) when entering tablet mode (e.g. when putting Your screen onto Your keyboard). According to him, this should fix the crazy pointer movements some people might have experienced when not turning it off. After updating the package, You should have a look at the configuration file /etc/tablet-mode/tablet-mode.conf and check if the options are set they way You want them to be.
So that was the first update. What about the second? Turned out I messed up a script (again) so the postinst script would not insert the right values into tablet-mode.conf upon updating. I corrected that and everything should be working again.
Just update by the usual means.

That's it! You're done!

06.02.2011

Yet another cpufreq update

The title says it all. I've found another bug in my cpufreq package broke the ACPI handler. The script tried to execute /usr/local/bin/cpufreq which of course doesn't exist if You installed my packge. I've changed it to execute cpufreq which gives You the possibility to put a custom version of the cpufreq script into /usr/local/bin and which is then executed instead of the package version. If you stay with the packaged version, it will of course execute that.
I recommend You install the update as soon as it's available. As always, report any bugs You might find!

02.02.2011

cpufreq update

I've released version 1.1.0 of my cpufreq package. It fixes numerous bugs, including the one that made the upstart job not work at all. Unfortunately, version 1.0.0 is so broken that You can't just update to 1.1.0. The old version will break the update and You'll end up with essential files missing. Due to this, I've made it impossible to upgrade from 1.0.0 to any other version. In order to get the new version, You will have to remove (or purge) the old version first, e.g. with apt-get:
Code:
$ apt-get purge cpufreq

After that, You are safe to install the new version (make sure to update Your package list, first!):
Code:
$ apt-get update
$ apt-get upgrade cpufreq

I'm sorry for the troubles this may have caused You (or will cause You during the update). As far as I can judge, it will not happen again with this package. I fixed the control files to prevent deleting files that are being installed by a newer version of the same package (in fact, they don't delete anything anymore).

In addition to the bugfixes, I've included a configuration file: /etc/default/powersave. Using that file, You are able to control the behavior of the ACPI handler and the upstart job. You can specify which CPU governors to install and You can disable each of them completely. I hope this compensates You for the pain the bugs caused :)

A side note here: The package will not remove any files in /etc when being removed normally (not purged). The upstart job and the ACPI handler will stay, but they won't do anything, since the cpufreq executable is not present. If You want to delete those files, purge the package (called "Mark for Complete Removal" in Synaptic) or delete them manually.

Another side note: When future upgrades are being installed, You might be asked if You want to keep some configuration files or install the "package maintainer's" (that's me) version. If You haven't changed the file in question and are unsure, it's best to install the new version, since it may contain bugfixes or new features (although You shouldn't be asked if You didn't change the file).

Since this problem seems to be fixed (report any bugs that persist or came up, please!), I will focus on the package to switch the graphics card now. Stay tuned for more!

That's it! You're done!

17.01.2011

2 new packages to come!

Here's a small announcement:
I will probably create a package for automatic CPU frequency scaling based on my article here. From what I read in the forums where this blog was posted, there are many people (especially those new to Ubuntu) who have problems or difficulties setting up and installing scripts. The package will thus contain the script, the ACPI handler and the upstart job. This is nothing more and nothing less than I already posted in the article, but will of course be much easier to install and update. I hope the package will be useful for many people and I would be very happy about any feedback on this topic (there are visitor statistics available for me concerning the blog, but unfortunately there's no download counter for my PPA).
Another package I'm currently working on is based on the post about switchable graphics. It will contain a small graphical (also usable without a GUI) program which is able to switch the graphics card between the integrated (less power consuming) Intel card and the discrete (more powerful) ATI card. It will of course still restart the X server upon changing the card as there is currently no way to circumvent this. Personally I have little use for such a program (as I don't really need the graphical power of the ATI card in Linux), but I think it might be come in handy once in a while and may be even more useful for other people. As for the first announced package, I would be very happy about any feedback concerning this.

09.12.2010

Update to tablet-mode

Update: I've released yet another version of the package. It fixes the same bug as described below again (but now it really works! ;) ). The problem was a variable substitution in the Tcl "switch" statement (and some other flaws that I somehow didn't notice before). Version 1.4.0 is available via my Launchpad PPA and can be downloaded by the usual means.


I've released a new version of my tablet-mode package (see my article on my PPA if You don't know what I'm talking about).
Yesterday I wanted to use my notebook as a tablet and noticed that the touch function was not turned off as it was supposed to be. It turned out that the IDs of my Wacom devices (finger, stylus, eraser) had changed and were no longer the ones I had in my /etc/tablet-mode/tablet-mode.conf. Today I checked again and they were back to normal. Now to not have You change the values in the configuration file every now and then (and then have You change them back again shortly after), I changed the behavior of the script so that it does no longer require numeric IDs in the configuration but rather requires string identifiers like "Wacom ISDv4 E3 Pen stylus". It then looks up the corresponding numeric IDs by itself every time it is run.
Another problem that I fixed was that the script didn't even use the values from the configuration file at all. Due to a wrong variable name, the finger device always had the same numeric ID, no matter what You had in Your config file. The result was that when the device had another ID than 11 on Your system, the touch function was not turned off when entering tablet mode and the touch device was not rotated when rotating Your screen.
So, if You have the package installed, just update to the latest version and if not, You can safely install it :)

13.11.2010

Fred.deb

Update: There is a note on bugs at the end of the article.

Yay, I forged my first package! And I got my own PPA (personal package archive) at Launchpad!
The first package I made is based on my article on screen rotation. It contains the script itself (an improved version), the upstart script to map the keycodes and a configuration file (/etc/tablet-mode/tablet-mode.conf) to centrally configure the needed values.
Here's what You need to do if You want to use it (You need root access for most of the tasks):
  1. Add the PPA to Your sources:
    Code:
    add-apt-repository ppa:fredfredfred/ppa
  2. Refresh Your package list:
    Code:
    apt-get update
  3. Install the package:
    Code:
    apt-get install tablet-mode
  4. As told in the message during installation, You need to take a look at the configuration file, /etc/tablet-mode/tablet-mode.conf. Either use the comments from the file or have a look at my first article on this subject to find out the values You need. The values provided in the sample should work on an HP TouchSmart tm2-1090eg notebook, You only have to uncomment the last 2 lines to enable the keycode:scancode mapping upon system start.
  5. Bind the scan codes to rotatescreen tableton and rotatescreen tabletoff, as described in the other article.
That's it! You're done!

Bugs: If You turn the screen, put it down and then hibernate Your laptop, turn the screen back and power it back on, the screen is upside down as is the tablet orientation. I will not fix this, since I cannot. Upon resuming from suspend, there is no way for me to check which position the display is in. Use the console commands rotatescreen tableton and rotatescreen tabletoff to switch between the modes manually (or use the GUI).

19.04.2010

Smartcards and SSH

The standard openssh packages shipped with Ubuntu 10.04 provide no support for smartcards. In order to get either the ssh-agent or ssh itself to accept a smartcard (such as the Aladdin eToken), I needed to recompile the whole package. I have no idea why the developers included no apparent support for smartcards in the distribution, installing the necessary packages doesn't make it possible to use them in any application I know.
Here's how to get support for smartcards in openssh:
  1. Set up a directory to download and compile the sources in.
  2. If You haven't already, make sure the "Source code" checkbox is checked in software-properties-gtk or You have the right deb-src lines in Your /etc/apt/sources.list. After doing so, don't forget to execute apt-get update to update the package lists.
  3. Install all the required packages:
    Code:
    $ apt-get install build-essential libopenct1 libopensc2 libopensc2-dev openct opensc
    $ apt-get build-dep openssh
    In order to be able to use opensc as a normal user, You have to add Your regular account to the scard user group:
    Code:
    $ adduser <username> scard
    You might have to start a new shell/terminal or even log out and back in to apply the change.
  4. Now download the package into the directory You created. You can do this as an unprivileged user (I would recommend to do so). Change into the directory and execute:
    Code:
    $ apt-get source openssh
    You should now have 2 .tar.gz files, 1 .dsc file and a source directory named openssh-<version number>. Change into the directory.
  5. Make sure openssh will be compiled with smartcard support. In the debian subdirectory, there's a file named rules. This file specifies what options are passed to configure when the package is compiled. Edit the file and insert the following line:
    Code:
    confflags += --with-opensc
    The best place would be behind the first block of confflags += ... statements, titled "Common build options.", as it's essential to insert it before the line saying
    Code:
    confflags_udeb := $(confflags)
  6. Now You can compile the package. Make sure You are in the source code root directory (openssh-<version number>) and execute
    Code:
    $ debuild -us -uc
    This will build the package without signing the package itself or the .changes file.
  7. If You now go back into the directory You created (should be 1 above Your current directory), You should see several new .deb packages. Install these (for this you need root access again)
    Code:
    $ dpkg -i *.deb
  8. You're almost done. If you use GNOME, You need to stop the gnome-keyring from breaking Your ssh-agent. Doing this from command line is a pain in the arse, so just use the "Startup Applications" menu entry under "System"->"Preferences". Use the tool to disable the "SSH Key Agent". If You don't use GNOME, You just wasted Your time reading this step.
  9. Now log out and back in to make sure Your ssh-agent is killed. If You don't use GNOME, You also need to make sure it is running at all (most desktop managers start it automatically, but if You only use a console, You need to configure it Yourself).
  10. You should now be able to list the smartcard devices with
    Code:
    $ opensc-tool -l
    Ignore any error messages that might appear, it should still work just fine. 2 OpenCT reader (detached) will appear by default and if You plugged in a smartcard, it should show up as such. Use
    Code:
    $ ssh-add -s0
    (or substitute 0 with the reader number if it is different) to add Your private key to the ssh-agent.
One last note: Upon upgrading the openssh packages, You need to do all this again, of course.

That's it! You're done!