Saturday, July 11, 2009

Enabling access over a serial console

To enable access to a (virtual) system over a serial console I'm doing following steps:

1) add a login-prompt on the serial console

echo 'S0:2345:respawn:/sbin/agetty ttyS0 115200 vt100' >> /etc/inittab


2) allow root to login over serial console

echo ttyS0 >> /etc/securetty


3) let /sbin/init reload the inittab to make the login prompt active

/sbin/telinit q


Now you can connect to the serial console and after pressing 'return' you should see a login prompt.

Optionally put the output of the kernel and boot process over the console
4) add parameters console=tty0 console=ttyS0,115200 to the kernel line in /boot/grub/grub.conf

title Red Hat Enterprise Linux AS (2.6.9-78.EL)
root (hd0,0)
kernel /vmlinuz-2.6.9-78.EL ro root=/dev/VolGroup00/LogVol00 console=tty0 console=ttyS0,115200
initrd /initrd-2.6.9-78.EL.img


By adding both parameters console=tty0 and console=ttyS0,115200, the output of the kernel is sent to both consoles. For the boot messages the last console is used. This is useful if your main console is a serial one, but you also have a real (or virtual) monitor connected.

This is what I see when booting one of my virtual systems on Fedora 11:

# virsh start --console rhel4
Domain rhel4 started
Connected to domain rhel4
Escape character is ^]
Linux version 2.6.9-78.EL (brewbuilder@hs20-bc2-3.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1 Wed Jul 9 15:27:01 EDT 2008
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009f000 (usable)
BIOS-e820: 000000000009f000 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000e8000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000001fff0000 (usable)
BIOS-e820: 000000001fff0000 - 0000000020000000 (ACPI data)
BIOS-e820: 00000000fffbc000 - 0000000100000000 (reserved)
0MB HIGHMEM available.
511MB LOWMEM available.
found SMP MP-table at 000fbd10
Using x86 segment limits to approximate NX protection
zapping low mappings.
DMI 2.4 present.
ACPI: PM-Timer IO Port: 0xb008
ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
Processor #0 6:3 APIC version 20
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] disabled)
ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] disabled)
ACPI: LAPIC (acpi_id[0x03] lapic_id[0x03] disabled)
ACPI: LAPIC (acpi_id[0x04] lapic_id[0x04] disabled)
ACPI: LAPIC (acpi_id[0x05] lapic_id[0x05] disabled)
ACPI: LAPIC (acpi_id[0x06] lapic_id[0x06] disabled)
ACPI: LAPIC (acpi_id[0x07] lapic_id[0x07] disabled)
ACPI: LAPIC (acpi_id[0x08] lapic_id[0x08] disabled)
ACPI: LAPIC (acpi_id[0x09] lapic_id[0x09] disabled)
ACPI: LAPIC (acpi_id[0x0a] lapic_id[0x0a] disabled)
ACPI: LAPIC (acpi_id[0x0b] lapic_id[0x0b] disabled)
ACPI: LAPIC (acpi_id[0x0c] lapic_id[0x0c] disabled)
ACPI: LAPIC (acpi_id[0x0d] lapic_id[0x0d] disabled)
ACPI: LAPIC (acpi_id[0x0e] lapic_id[0x0e] disabled)
ACPI: LAPIC (acpi_id[0x0f] lapic_id[0x0f] disabled)
Enabling APIC mode: Flat. Using 0 I/O APICs
ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 1, version 17, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
Using ACPI (MADT) for SMP configuration information
Allocating PCI resources starting at 30000000 (gap: 20000000:dffbc000)
Built 1 zonelists
Kernel command line: ro root=/dev/VolGroup00/LogVol00 console=tty0 console=ttyS0,115200 elevator=noop
Initializing CPU#0
CPU 0 irqstacks, hard=c0418000 soft=c0417000
PID hash table entries: 2048 (order: 11, 32768 bytes)
Detected 2394.771 MHz processor.
Using pmtmr for high-res timesource
Console: colour VGA+ 80x25
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 513840k/524224k available (2209k kernel code, 9752k reserved, 745k data, 172k init, 0k highmem)
Calibrating delay using timer specific routine.. 4560.74 BogoMIPS (lpj=2280372)
Security Scaffold v1.0.0 initialized
SELinux: Initializing.
selinux_register_security: Registering secondary module capability
Capability LSM initialized as secondary
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 2048K
CPU: Intel Pentium II (Klamath) stepping 03
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Checking 'hlt' instruction... OK.
ENABLING IO-APIC IRQs
..TIMER: vector=0x31 pin1=0 pin2=-1
checking if image is initramfs... it is
Freeing initrd memory: 1175k freed
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xfb510, last bus=0
PCI: Using configuration type 1
mtrr: v2.0 (20020519)
ACPI: Subsystem revision 20040816
ACPI: Interpreter enabled
ACPI: Using IOAPIC for interrupt routing
ACPI: PCI Root Bridge [PCI0] (00:00)
PCI: Probing PCI hardware (bus 00)
ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)
ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)
ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)
ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)
Linux Plug and Play Support v0.97 (c) Adam Belay
xen_mem: Initialising balloon driver.
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: Using ACPI for IRQ routing
ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 11
ACPI: PCI Interrupt 0000:00:01.2[D] -> GSI 11 (level, high) -> IRQ 11
ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10
ACPI: PCI Interrupt 0000:00:01.3[A] -> GSI 10 (level, high) -> IRQ 10
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
ACPI: PCI Interrupt 0000:00:03.0[A] -> GSI 11 (level, high) -> IRQ 11
ACPI: PCI Interrupt 0000:00:04.0[A] -> GSI 11 (level, high) -> IRQ 11
ACPI: PCI Interrupt 0000:00:05.0[A] -> GSI 10 (level, high) -> IRQ 10
apm: BIOS version 1.2 Flags 0x03 (Driver version 1.16ac)
apm: overridden by ACPI.
audit: initializing netlink socket (disabled)
audit(1247389170.873:1): initialized
Total HugeTLB memory allocated, 0
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
Initializing Cryptographic API
ksign: Installing public key data
Loading keyring
- Added public key 9ADA2B4B1EC241DE
- User ID: Red Hat, Inc. (Kernel Module GPG key)
PCI: PIIX3: Enabling Passive Release on 0000:00:01.0
Limiting direct PCI/PCI transfers.
Activating ISA DMA hang workarounds.
pci_hotplug: PCI Hot Plug PCI Core version: 0.5
ACPI: Processor [CPU0] (supports C1)
Real Time Clock Driver v1.12
Linux agpgart interface v0.100 (c) Dave Jones
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Serial: 8250/16550 driver $Revision: 1.90 $ 68 ports, IRQ sharing enabled
�ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
PIIX3: IDE controller at PCI slot 0000:00:01.1
PIIX3: chipset revision 0
PIIX3: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0xc000-0xc007, BIOS settings: hda:pio, hdb:pio
ide1: BM-DMA at 0xc008-0xc00f, BIOS settings: hdc:pio, hdd:pio
hda: QEMU HARDDISK, ATA DISK drive
Using noop io scheduler
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hdc: QEMU DVD-ROM, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
hda: max request size: 1024KiB
hda: 16777216 sectors (8589 MB) w/256KiB Cache, CHS=16383/255/63, (U)DMA
hda: hda1 hda2
hdc: ATAPI 4X CD-ROM drive, 512kB Cache, (U)DMA
Uniform CD-ROM driver Revision: 3.20
ide-floppy driver 0.99.newide
usbcore: registered new driver hiddev
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.0:USB HID core driver
mice: PS/2 mouse device common for all mice
input: AT Translated Set 2 keyboard on isa0060/serio0
input: ImExPS/2 Generic Explorer Mouse on isa0060/serio1
md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
NET: Registered protocol family 2
IP route cache hash table entries: 8192 (order: 3, 32768 bytes)
TCP established hash table entries: 32768 (order: 6, 262144 bytes)
TCP bind hash table entries: 32768 (order: 7, 917504 bytes)
TCP: Hash tables configured (established 32768 bind 32768)
Initializing IPsec netlink socket
NET: Registered protocol family 1
NET: Registered protocol family 17
ACPI wakeup devices:

ACPI: (supports S3 S4 S5)
Freeing unused kernel memory: 172k freed
Red Hat nash version 4.2.1.13 starting
Mounted /proc filesystem
Mounting sysfs
Creating /dev
Starting udev
Loading dm-mod.ko module
device-mapper: 4.5.5-ioctl (2006-12-01) initialised: dm-devel@redhat.com
Loading jbd.ko module
Loading ext3.ko module
Loading dm-mirror.ko module
Loading dm-zero.ko module
Loading dm-snapshot.ko module
Making device-mapper control node
Scanning logical volumes
Reading all physical volumes. This may take a while...
Found volume group "VolGroup00" using metadata type lvm2
Activating logical volumes
2 logical volume(s) in volume group "VolGroup00" now active
Creating root device
Mounting root filesystem
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
Switching to new root
INIT: version 2.85 booting
Setting default font (latarcyrheb-sun16): [ OK ]

Welcome to Red Hat Enterprise Linux AS
Press 'I' to enter interactive startup.
Setting clock (utc): Sun Jul 12 09:59:43 BST 2009 [ OK ]
Starting udev: [ OK ]
Initializing hardware... storage network audio done[ OK ]
Configuring kernel parameters: [ OK ]
Loading default keymap (de-latin1): [ OK ]
Setting hostname localhost.localdomain: [ OK ]
Checking root filesystem
[/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a /dev/VolGroup00/LogVol00
/dev/VolGroup00/LogVol00: clean, 64778/897600 files, 397753/1794048 blocks
[ OK ]
Remounting root filesystem in read-write mode: [ OK ]
No RAID disks
Setting up Logical Volume Management: [ OK ]
Checking filesystems
Checking all file systems.
[/sbin/fsck.ext3 (1) -- /boot] fsck.ext3 -a /dev/hda1
/boot: clean, 35/26104 files, 12799/104388 blocks
[ OK ]
Mounting local filesystems: [ OK ]
Enabling local filesystem quotas: [ OK ]
Enabling swap space: [ OK ]
INIT: Entering runlevel: 3
Entering non-interactive startup
Applying Intel Microcode update: [ OK ]
Starting monitoring for VG VolGroup00: [ OK ]
Checking for new hardware [ OK ]
Starting pcmcia: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth1:
Determining IP information for eth1... failed.
[FAILED]
Starting system logger: [ OK ]
Starting kernel logger: [ OK ]
Starting portmap: [ OK ]
Starting NFS statd: [ OK ]
Starting RPC idmapd: [ OK ]
Mounting other filesystems: [ OK ]
Starting lm_sensors: [ OK ]
Starting automount: No Mountpoints Defined[ OK ]
Starting smartd: [FAILED]
Starting acpi daemon: [ OK ]
Starting cups: [ OK ]
Starting sshd:[ OK ]
Starting xinetd: [ OK ]
Starting sendmail: [ OK ]
Starting sm-client: [ OK ]
Starting console mouse services: [ OK ]
Starting crond: [ OK ]
Starting xfs: [ OK ]
Starting anacron: [ OK ]
[ OK ] atd: [ OK ]
Starting system message bus: [ OK ]
Starting Red Hat Network Daemon: [ OK ]
Starting HAL daemon: [ OK ]

Red Hat Enterprise Linux AS release 4 (Nahant Update 8)
Kernel 2.6.9-78.EL on an i686

localhost.localdomain login:

Friday, July 3, 2009

Using git for Fedora's CVS

I prefer to use git over CVS. Unfortunately the main repository where all Fedora packages are located uses CVS.

Takis blog contains a very useful guide for working with git on projects located on a CVS-server.

Thanks Takis!

Tuesday, June 16, 2009

Making Adobe Flash work on a 64-bit Fedora 11

On the Fedora Wiki there is an excellent article which made my Fedora 11 (x86_64) run Flash 10.

This is a copy-paste from the article:

Adobe also has a pre-release version of a 64-bit plugin. Until this is supported via yum, you will need to do the following:

1. Download the .tar.gz version from Adobe here.
2. Use "gtar -xzvf" to extract libflashplayer.so and put it in either in /usr/lib64/mozilla/plugins/ or ~/.mozilla/plugins/.
3. Restart Firefox.

Friday, March 20, 2009

Splitting videos with mencoder

YouTube does not allow videos to be longer than 10 minutes. I really have the need to split videos... Googling for this issue brought me to MisterHowTo.com.

Splitting a video looks like this (first 6 minutes and 5 seconds):

$ mencoder -endpos 00:06:05 -ovc copy -oac copy leeuw-tuominen_0-2.AVI -o leeuw-tuominen_0-2_a.avi
MEncoder 1.0rc1-4.1.2 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Core(TM)2 CPU T5500 @ 1.66GHz (Family: 6, Model: 15, Stepping: 2)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2

success: format: 0 data: 0x0 - 0x2e8da65c
AVI file format detected.
VIDEO: [MJPG] 640x480 24bpp 30.000 fps 9219.7 kbps (1125.4 kbyte/s)
[V] filefmt:3 fourcc:0x47504A4D size:640x480 fps:30.00 ftime:=0.0333
videocodec: framecopy (640x480 24bpp fourcc=47504a4d)
audiocodec: framecopy (format=1 chans=1 rate=16000 bits=8 B/s=16000 sample-1)
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing index...51f (54%) 3343.82fps Trem: 0min 744mb A-V:0.033 [9219:128]
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.

Video stream: 9219.507 kbit/s (1152438 B/s) size: 420678432 bytes 365.033 secs 10951 frames

Audio stream: 128.000 kbit/s (16000 B/s) size: 5840000 bytes 365.000 secs


And the second part with offset 6 minutes 5 seconds:

$ mencoder -ss 00:06:05 -ovc copy -oac copy leeuw-tuominen_0-2.AVI -o leeuw-tuominen_0-2_b.avi
MEncoder 1.0rc1-4.1.2 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Core(TM)2 CPU T5500 @ 1.66GHz (Family: 6, Model: 15, Stepping: 2)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2

success: format: 0 data: 0x0 - 0x2e8da65c
AVI file format detected.
VIDEO: [MJPG] 640x480 24bpp 30.000 fps 9219.7 kbps (1125.4 kbyte/s)
[V] filefmt:3 fourcc:0x47504A4D size:640x480 fps:30.00 ftime:=0.0333
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 16000 Hz, 1 ch, u8, 128.0 kbit/100.00% (ratio: 16000->16000)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
videocodec: framecopy (640x480 24bpp fourcc=47504a4d)
audiocodec: framecopy (format=1 chans=1 rate=16000 bits=8 B/s=16000 sample-1)
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing index...90f (100%) 377.05fps Trem: 0min 337mb A-V:0.033 [9219:128]
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.

Video stream: 9219.688 kbit/s (1152460 B/s) size: 349195660 bytes 303.000 secs 9090 frames

Audio stream: 128.000 kbit/s (16000 B/s) size: 4848059 bytes 303.004 secs


After uploading these videos they will be available in their own playlist.

Squash for 2016

It would be great if squash becomes an Olympic sport in 2016!

More promotion at http://squash2016.info.

Tuesday, February 10, 2009

Cloning xorg/freedesktop git projects over http

The network policy at my work makes me use a proxy-server. Unfortunately it looks like x.org or freedesktop.org does not support git usage over http. Just browsing to http://anongit.freedesktop.org does show an error which lets me guess that this server supports cloning over http. Indeed, afer some wrong URLs I've found a working one!


export http_proxy=http://proxy:81
git clone http://anongit.freedesktop.org/git/xorg/xserver.git xorg-xserver


A complete list of projects is available from http://cgit.freedesktop.org.

Thursday, January 22, 2009

Sync Google Contacts with Thunderbird

Google Contacts is an Add-On for Thunderbird which creates an additional address book with your Google contacts.

Great tool!

Sunday, January 18, 2009

CentOS-5 and file sharing over bluetooth

Dag Wieers wrote a very nice and simple blogpost called "OBEX for dummies. This post helped me getting bluetooth file-sharing work in less than five minutes. Thanks Dag! Tried to post a comment on the blog, however that failed for some reason...)

Monday, January 12, 2009

Switching from Linux to OpenBSD?

That grumpy BSD guy: Into a new year, slowly pounding the gates makes me think again about switching my Linux server (with lots of hacking attempts) to a more peaceful OpenBSD...

Tuesday, January 6, 2009

Support special functions keys on laptops with Linux

It's very uncool that some of the keys on my HP/Compaq nc6400 are not working by default. I get following messages in dmesg:

atkbd.c: Unknown key pressed (translated set 2, code 0xd9 on isa0060/serio0).
atkbd.c: Use 'setkeycodes e059 ' to make it known.
atkbd.c: Unknown key released (translated set 2, code 0xd9 on isa0060/serio0).
atkbd.c: Use 'setkeycodes e059 ' to make it known.


Jiri Koshina pointed me to HAL Keymap Quirks which is written by a Red Hat engineer.

My Results


For these (and a lot more) keys I (and you) need at least hal-0.5.10 as said in the link above from Jiri. The keys supported by hal are available in the 30-keymap-*.fdi files from the hal-info git:

http://cgit.freedesktop.org/hal-info/tree/fdi/information/10freedesktop