Index ¦ Archives ¦ RSS > Category: frugalware ¦ RSS

amtterm

Estimated read time: 3 minutes

So we have two machines next to each other: genesis and helicon. The original idea years ago was to put a serial cable between the two so that it’s possible to manage the machines even in case ssh dies for some reason. Of course we never did that, because we were lazy - but in the meantime both machines were replaced by a newer mainboard, supporting Intel AMT.

In short, this is a poor man’s IP console, it supports serial-over-lan, so with a bit of configuration and a special client tool you can control grub, watch the bootup process (will you miss the risky few minutes after a reboot till it turned out if a remote machine boots up after a kernel upgrade or not?) and finally can even log in when ssh is not running.

First you need to set up grub to listen on the serial port as well. To do this, you need to know the device name and I/O port of your serial-over-lan port. The boxes mentioned above have one physical and one virtual serial port, so we need the later - that will be /dev/ttyS1. Now let’s grep in dmesg to get the port:

$ dmesg|grep 'ttyS1 at'
0000:00:03.3: ttyS1 at I/O 0xf1c0 (irq = 17) is a 16550A

Now we know everything to set up grub. Just prepend the following lines to your /boot/grub/menu.lst:

serial --port=0xf1c0 --speed=115200
terminal --timeout=30 console serial

The speed is AFAIK the same for each SoL port, so you can just copy&paste it.

It’s also recommended to change the timeout line to 30 as well, this way you will have half minute to press any key to tell grub you want to control is on the serial port and you’ll again have half minute to hit any key to edit the kernel parameters, etc. (The whole grub part is useful because this way in case you upgraded the machine and it fails to boot up, you can still boot using init=/bin/sh and fix the system.)

Second, you want to see the boot process, this way you can fix the system remotely, even if fsck fails and asks for root password, etc.

For this, you need to change your kernel parameters, so that messages sent to /dev/console will end up on the serial port.

I changed

root=/dev/md0 ro quiet vga=791

to

root=/dev/md0 ro vga=normal nomodeset console=ttyS1,115200

and that achieved this.

Third, you want to start a getty on ttyS1 once the machine booted up, in case ssh fails to start up. If you don’t use systemd yet, add the following line to /etc/inittab:

s1:12345:respawn:/sbin/agetty ttyS1 115200 vt100-nav

(Don’t forget to run init q to reload the config!)

Finally, you need amtterm on the client side - I plan to package it for Frugalware once 1.4pre2 is out. Till then you can just download, unpack and build the source tarball using make - no installation is necessary, you can run amtterm in-place. In my case I can’t connect directly to the machine as (for obvious reasons) the AMT is reachable from the local subnet only. So I build an ssh tunnel to the other machine and use socksify to pretend I run amtterm on the local subnet. The commandline I use is:

$ socksify ./amtterm -p <pass> <ip>

And that’s it - enjoy editing your kernel parameters, watching your boot process and login to the box even if ssh is not running and you don’t have IP console. :)

If you can’t try it out right now but you want to see it in action: grub in amtterm and boot in amtterm - without any virtualization! ;)


tgt is now available as a package

Estimated read time: 1 minutes

Today I packaged tgt an iSCSI target (server). The upstream package provides a large number of examples, though I thought it’s a good idea to note what I used for testing:

# egrep -v '#|^$' /etc/tgt/targets.conf
default-driver iscsi
<target iqn.2010-11.local.test:storage>
    backing-store /dev/sdb
</target>

Something offtopic: a rejourn patch accepted and a LibreOffice bug fixed today.


A song mentioning Frugalware!

Estimated read time: 1 minutes

chee on #frugalware linked a song and its lyrics, mentioning Frugalware. Please don’t compare it to an OpenBSD professional release song, then you’ll like it! :)


LibreOffice: even on ppc

Estimated read time: 1 minutes

You probably have read that ooo-build has been renamed to LibreOffice (technically it's just a rename).

Test packages for i686 available here if you want to test it on Frugalware.

Aaand this time, as a very special gift, ppc packages are available as well! :)

I just built it, but Bouleetbil was kind enough to provide a screenshot when he tested it.


gammu-1.28 issue

Estimated read time: 1 minutes

I recently upgraded gammu from 1.27 to 1.28 in -current and I noticed that the backup of my phone is now way slower than before. The fix was trivial (already backported to the Frugalware package as well) for the maintainer so it's now fine again.

Well done, mcihar! :)


Playing with libvirt

Estimated read time: 4 minutes

I've been playing with libvirt in the last two days. My motivation was that I saw:

  1. plain kvm is not that fast
  2. there is this virtio framework which aims to make it faster
  3. using virtio directly is hard, better not reinventing the wheel and just try libvirt

So if you want to try it yourself, you need to pacman -S libvirt, service libvirtd start. Check /var/log/syslog for error messages, in case it can't find some commands (bridge-utils, dnsmasq, etc.), install them.

If you want to create a new virtual machine, you need pacman -S virtinst. Then you can use something like:

virt-install --name=syncpkgcd-helicon --arch=x86_64 --vcpus=1 --ram=1024 --os-type=linux --os-variant=virtio26 --connect=qemu:///system --network network=default --cdrom=/virt/iso/frugalware-1.3-i686-net.iso --disk path=/virt/syncpkgcd/syncpkgcd.img,size=40 --accelerate --vnc --noautoconsole --keymap=us

See man virt-isntall for more info about the meaning of the switches. One trick: kvm can't handle the gfxmenu in our grub on the install cd, so you need to disable that. One way to do it is to use vim -b frugalware-1.3-i686-net.iso, search for "menu /boot", and change "gfx" to "#fx". Then you can run virt-install. It'll start the install in the background. The easiest way (for me) to connect to the console is to create an ssh tunnel to the server running the kvm machine (for example ssh -L 5900:localhost:5900 server), then run krdc localhost:0 on my own machine.

Next trick is that you need kernel support to boot from virtio disks (/dev/vda), that's enabled in frugalware-current.git but there were no rebuild yet, so you need to build it yourself for now.

Once the installation finished, the machine will be shut down. You can use virsh to start it. Here is a great summary about virsh subcommands. Something not to forget: if you want to automatically start the machine after the host booted, use virsh autostart $name.

(You can also do a service libvirt-guests add, that way all guests will be automatically suspended/resumed on shutdown/boot. Just to be clear: if you want the "resume if it was a proper shutdown, start if there was a power cut" feature: you need both init scripts because libvirtd will always start/resume autostart guests, but it will never suspend them on shutdown.)

If grub hangs after reboot, try creating a small (I used 32MB) separate /boot partition first, that should fix the issue.

virsh shutdown $machine won't work if you don't install acpid and enable it as well, so it's a good idea to do so.

The last trick: if you want to use the virt-manager gui from your local machine to manage a remote host, it isn't trivial to do so. First, it would try to login via ssh as root, and that's disabled by default. (And why would you enable it?). Also, even if you allow that, it would try to use nc -U which is supported by the openbsd nc only, the gnu nc does not have such a switch. Instead, we can use socat to connect to unix sockets. So I created a wrapper script under ~/bin with the following contents:

#!/bin/sh
if [ "$1" == "-U" ]; then
        sudo socat - unix-client:$2
else
        /usr/bin/netcat $@
fi

Don't forget to add PATH=what_you_want line to ~/.ssh/environment, and include the full path of ~/bin there. This way you can keep using gnu nc and you can also login as a user to manage your machines, as long as you set up nopasswd sudo for your user for socat.

Finally a mini-benchmark:

The SBU of yugo (i686 buildserver, a bit old HW) is 645 seconds, SBU of an i686 guest on helicon (c2q machine with 8g ram) is 264, SBU of the host build on helicon is 76.

I would call this usable (not right now, but once we sort out the kernel part). Finally something that is free software and is comparable to VMware ESX. :)

Update: I recently did the same install with 1.4pre1 (which installs -current, so the kernel is 2.6.36), the list of tricks you still need:

  • separate /boot (haven't tried without)
  • edit iso image to get rid of gfxboot (tried, still fails without)
  • some problem with grub, you need to manually add "(hd0) /dev/vda" to /boot/grub/device.map, then run grub-install /dev/vda

So no more custom kernel, boot from virtio works by default! :)


Anyremote

Estimated read time: 1 minutes

I've been testing anyremote during the last week. I'm aware that there is kanyremote and ganyremote available, but I wasn't really interested in those, since they would hide the glory details. :)

So I decided to give the server mode mode a try and I choosed okular as a test application. My commandline is:

anyremote -s bluetooth:19 -f /usr/share/anyremote/cfg-data/Server-mode/okular.cfg

Once I started the server on my notebook I could choose it in the midlet on my phone in the j2me client and it worked as expected.


Scripts used in the Python 2.7 rebuild

Estimated read time: 1 minutes

First, I could almost reuse the same set of scripts as described here. The only change I needed to do is that aborting the build loop after each fail is a waste of time, so now I did:

for i in $(cat ~/test.list)
do
        echo $i
        cd ~/git/python27/source/*/$i || continue
        sudo makepkg -t python27,current -C
        git clean -x -d -f
        git checkout -f
        sed -i 's|python>=2.6|python>=2.7|g' FrugalBuild
        if bumppkg -t python27,current --rebuild "- rebuilt with python-2.7"; then
                repoman -t python27 -k push
        else
                echo $i >> ~/failed.list
        fi
done

Then investigated the failed builds manually.

Oh, and obviously I no longer had to build the x86_64/ppc fpms manually, I just enabled syncpkgd for the python27 WIP repo.


Globalsat BT-338X GPS

Estimated read time: 1 minutes

Yesterday I bought a cheap GPS data logger / receiver, and given that the attached install CD did not support Linux, I'm collecting some hopefully useful links here.

Putting everything together, to get the log from the device using bluetooth I first had to create an rfcomm interface, as gpsbabel does not support bluetooth natively:

# rfcomm bind 0 00:0D:B5:38:BA:C6

Then to download and erase the log from the device:

$ gpsbabel -i dg-100,erase=1 -f /dev/rfcomm0 -o gpx \
        -F $(date +%Y-%m-%d).gpx

The gpx format is fine in case you want to later reuse log with digikam's gpssync plugin (available from kipi-plugins).

Now in case you want to convert it to kml to show on Google Maps:

$ gpsbabel -i gpx -f $(date +%Y-%m-%d).gpx -o kml -F $(date +%Y-%m-%d).kml

Finally release the rfcomm interface in case you don't need it anymore:

# rfcomm release 0

Update: there is also a gui which can be used to enable logging of altitude info, etc - just trivial patching is needed and it works with BT-338X as well.


Upgrading to Haven

Estimated read time: 1 minutes

I just upgraded my box at work to Haven, here is a short post to mention two links:

  • ATM you need to manually upgrade nvidia-173xx if you have it installed (after -Syu) due to lack of xorg-server-1.8 support.
  • I needed this xorg config tweak to get my up arrow working again.

Other than that, I removed my xorg.conf and instead I put this to the xorg.conf.d dir. I also added "nouveau.modeset=0" to /boot/grub/menu.lst.

What else.. ah yes, I needed to change the keyboard model to evdev in the KDE System Settings.

Other than that, it went fine. :)

Update: the nvidia-173xx part is now fixed in both current and stable.

© Miklos Vajna. Built using Pelican. Theme by Giulio Fidente on github.