Blog

Creating Debian Packages from source with checkinstall

21.10.2005 at 20:38

With APT package installation in Debian is really easy. But sometimes you simply can't avoid to install a package from source probably because there is no *.deb package available, it is outdated or you would like to compile it with specific compiler options.

This causes some problems because when you install packages from source the package management software doesn't know about them and therefore you can't really upgrade or remove them in a smooth way. The usual approach to this problem is to install all packages in /usr/local but it actually doesn't really solve the problem either, if you install lots of such packages you will almost certainly end up in a mess.

Here comes checkinstall in, it will observe all modification to the system during package installation and then create a distribuation specific package which can be installed as usual.

Below is an usage example, the -D options tells checkinstall to create a *.deb package. See the documentation for more options.

configure --prefix=/usr
make
checkinstall -D

Instead of make install you just type checkinstall or if the build command differs

checkinstall -D make install_command_or_whatever

Checkinstall will ask you a few question and then create and install a regular *.deb file which means that the package is now fully integrated into the package management system and can be removed as usual with apt or dpkg.

Marc

read more comments

Source Controll Management with bazaar-ng

14.10.2005 at 12:09

I recently took a look at bazaar-ng and i am quite impressed, the installation is plain simple (well on debian anyway it's just apt-get install bzr) and the user interface is straight forward either (commands are more or less named as expected).

As an introduction i recommend reading through their wiki. To get started just initialize a new branch and then add further files. With bzr help [command] you get some information about the specified command.

cd your_project_dir
bzr init
bzr add your_file
bzr status
bzr commit your_file -m "Initional commit." # make some changes
bzr status
bzr diff
bzr commit your_file -m "Your comment."
bzr log

So i hope you see how easy it is to handle your source files with bazaar-ng i will use it for a new project and probably blog about my experience with it in daily use later on.

If you have to choose a SCM-System then this comparison might be useful although some newly created ones such as bazaar-ng or git are not yet listed there.

Marc.

read more comments

Compiling Qemu with Kqemu to run Windows 98 on Debian Sid

02.10.2005 at 14:09

For those of you who don't already know qemu is a fast and free emulator comparable with VMWare. Of course there are Debian packages available which you could just install as usual but they do not include the closed source kernel modul (kqemu) which provides major performance enhancements. So we will compile qemu from source.

Compiling qemu from source

Fetch the qemu source code from the webpage and compile it according to the documentation. Adjust the configure flag as you like, for example i basically just need support for i386 and since debian sid is now using GCC 4.x but qemu doesn't compile with it yet i had to point it to an older version so i did the following

cd /tmp
tar zxvf qemu-0.7.2.tar.gz
cd qemu-0.7.2
tar zxvf /tmp/kqemu-0.7.2.tar.gz
./configure --cc=/usr/bin/gcc-3.3 --target-list=i386-softmmu
make

# and as root
make install

To meet a few dependencies i had to further install the two following packages.

apt-get  install libsdl1.2-dev
apt-get install zlib1g-dev

Per default qemu will be installed in /usr/local, a new device node /dev/kqemu should automatically be created if this is not the case you should do it manually.

mknod --mode=0666 /dev/kqemu c 250 0

Preparing the kernel for network support via tun/tap devices

If you want your virtual machine connected to the host there are two different ways to accomplish this. One is with the -user-net command line switch which will set up a dhcp server for you (refer to the documentation for further information), the other is to use tun/tap devices. For the latter you obviously need tun/tap support activated in your kernel, below are the relevant settings.

 Symbol: TUN [=y]
 Prompt: Universal TUN/TAP device driver support
   Defined at drivers/net/Kconfig:85
   Depends on: NETDEVICES
   Location:
     -> Device Drivers
       -> Network device support
         -> Network device support (NETDEVICES [=y])
   Selects: CRC32

Afterwards you may have to set appropriate permissions for your /dev/net/tun device.

chgrp users /dev/net/tun
chmod 660 /dev/net/tun

Creating a virutal disk image

Qemu uses a file to represent the content of the virutal harddisk which can be created as follows.

qemu-img create -f raw win98.img 1000M

The file will grow as more software gets installed to the system.

Installing Windows 98 from a bootable CD

To install Windows you can either boot from the CD or use a boot floppy if you don't have one download one from here. Then run qemu with the floppy drive and virtual disk image connected and let it boot from floopy (-boot a). Make sure that you launch the newly compiled qemu which per default is located in /usr/local/bin.

qemu -hda win98.img -fda /dev/fd0 -boot a

With slightly different options qemu boots from CD.

qemu -hda win98.img -cdrom /dev/hdc -boot d

Additionally you can add an option for your keyboard layout for example

-k de-ch

take a look in /usr/locale/share/qemu/keymaps for valid values.

When Windows first boots up go to the command line by pressing SHIFT + F5 and create a empty primary partion on the harddisk with fdisk, then reboot and process the installation from CD-ROM as you would do it on a normal computer.

I would recommend to keep the cdrom drive connected to the VM until you successfully logged in the system for the first time, because Windows will need various drivers from it.

When the installation is completed you can boot your image with the command below.

qemu -hda win98.img -boot c

You will probably notice that with Windows 98 as guest the cpu load is very high even if you do nothing special in your VM, this is a known problem and here is the solution.

Qemu monitor

If you want to change the cdrom while your VM is running then switch to the QEMU monitor by pressing CTRL+ALT+2 and issue the following command.

eject cdrom
change cdrom /dev/cdrom

you can see the changes with

info block

to switch back to the VM use CTRL+ALT+1

Set up networking for the virual machine

My network looks like this.

+-------------------------+                 +----------------------+
| host pc with debian/sid | ==============> | Router with NAT/DHCP |
|  eth0: 192.168.1.2/24   |                 |   192.168.1.1/24     |
|  tun0: 192.168.2.1/24   |                 +----------------------+
|  gw:   192.168.1.1/24   |                            ||
|  dns:  192.168.1.1/24   |                            ||
+-------------------------+                            \/
            /\                                    +----------+
            ||                                    | Internet |
            ||                                    +----------+
+-------------------------+
| qemu with windows 98    |
|  eth0: 192.168.2.2/24   |
|  gw:   192.168.2.1/24   |
|  dns:  192.168.1.1/24   |
+-------------------------+

So i had to set up a iptables rule to translate the 192.168.2.x IPs so that the internet is accessible from the Windows box.

Qemu will try to execute /etc/qemu-ifup on startup to configure the tun device. The commands in there need root privilleges so i created another file called /etc/qemu-net-config containing the following.

#!/bin/sh
# $1 => tun0

/sbin/ifconfig $1 192.168.2.1 up
echo "1" >/proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Then i configured sudo to allow the user to execute this file without prompting for a password. Therefore my /etc/qemu-ifup (which gets executed by qemu) look like this.

#!/bin/sh

sudo /etc/qemu-net-config $1

As a last step i had to configure the network in Windows ip: 192.168.2.2 gateway: 192.168.2.1 and finally dns: 192.168.1.1.

With this setup everything worked as expected. After the initional configuration of your VM i would recommend making a copy of your disk image so you can always switch back to a clean install.

Hope you get it to work too. As a last point i would like to mention http://free.oszoo.org/ which provides various ready-to-run qemu images.

Marc.

read more comments

Opera without Ads

20.09.2005 at 21:08

To today Opera released their browser for free (as in beer) without advertisement. This is really good news for me because Opera is my favorite browser and a great piece of software.

And before someone is arguing that i should use Firefox instead because Opera is not opensource (free as in speech), i _am_ a supporter of Free Software but Opera is just an exception. Out of curiosity i have even installed vrms to show the non-free packages on my system and here is the result.

Non-free packages installed on mydebian

opera                     The Opera Web Browser

  1 non-free packages, 0.2% of 617 installed packages.

So you see it is really just opera but i can't actually describe why i like it. It is simpy the best internet experience, (except lynx of course ;). A quote from Slashdot illustrates it quite well.

So thanks Opera for releasing your great browser.

read more comments

XPM Icons for the fluxbox menu

18.09.2005 at 18:24

I recently needed some xpm icons for my fluxbox menu, i found the following recources quite useful.

Integrating the icons into the fluxbox menu is straight forward.

[exec] (text) { command } <~/.fluxbox/icons/icon.xpm>

Below is a screenshot of my current menu.

read more comments

<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 >>