DRI PRIME

Multiple graphic cards accessible from Linux:

$ glxinfo |grep -i renderer
OpenGL renderer string: Mesa DRI Mobile Intel® GM45 Express Chipset
$ DRI_PRIME=1 glxinfo |grep -i renderer
OpenGL renderer string: Gallium 0.4 on AMD RV620

$ xrandr –listproviders
Providers: number : 2
Provider 0: id: 0x83 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 3 associated providers: 0 name:Intel
Provider 1: id: 0x54 cap: 0xd, Source Output, Source Offload, Sink Offload crtcs: 2 outputs: 3 associated providers: 0 name:radeon
$ xrandr –setprovideroffloadsink 0x54 0x83
$ xrandr –listproviders
Providers: number : 2
Provider 0: id: 0x83 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 2 outputs: 3 associated providers: 1 name:Intel
Provider 1: id: 0x54 cap: 0xd, Source Output, Source Offload, Sink Offload crtcs: 2 outputs: 3 associated providers: 1 name:radeon

Google for more.

Asus E35M1-I DELUXE, surround 5.1 sound and dmix

Make HDMI card be second while SB card be first one:


options snd-hda-intel index=1,0

Enable dmix with surround 5.1 support (no upmixing):


pcm.dmixer {
type dmix
ipc_key 1024
ipc_key_add_uid false # let multiple users share
ipc_perm 0666 # IPC permissions (octal, default 0600)
slave {
pcm "hw:0,0"
channels 6
# buffer_size 16384
}
}

pcm.!default {
type plug
slave.pcm dmixer
slave.channels 6
}

to /etc/asound.conf. Enable 6 channels in alsamixer, too.

Eating power – Intel GM45 vs Radeon HD 3400

ThinkPad T400 switched into integrated gpu mode – running Intel GM45 eats ~12W of power.
ThinkPad T400 switched into discrete gpu mode – running Radeon HD 3400 eats … ~28W of power!

Which means that radeon itself eats more than 16W of power (meausred with powertop). That’s more than whole notebook in integrated gpu mode. Nightmare!

Note that HD 3400 was driven by open source radeon driver which doesn’t have any power management support at this moment.

200904 update: ati driver in git contains updated power management and it’s eating ~16W here instead of ~28W now with DynamicPM turned on.

Very fast IPv6 setup on PLD/Linux Th

If you need IPv6 on some PLD Th machine, like in my case laptop, you can just do:

poldek -uGv miredo-client-teredo
service miredo-teredo start

and verify that IPv6 works by doing for example:

mtr -6 www.pld-linux.org

This solution doesn’t require any configuration (well, there are some options that can be altered). It should work even if you are behind some NATs and other weird gateways thanks to Teredo.

Working setup causes new interface to appear, for example:

20: teredo: mtu 1280 qdisc pfifo_fast state UNKNOWN qlen 500
link/[65534]
inet6 2001:x:xx:xx:xx:xx:xx:e4b6/32 scope global
valid_lft forever preferred_lft forever
inet6 fe80::ffff:ffff:ffff/64 scope link
valid_lft forever preferred_lft forever

Of course there are other solutions for non-native IPv6 like 6to4 (pure rc-scripts are enough), ISATAP (see miredo-client-isatap package) or just typical SIT tunnel.

Booting PLD/DOS from USB pendrive

Create partition on your flash drive (using fdisk or cfdisk). Mark one of partitions bootable in fdisk/cdisk. Format that partition with FAT/FAT32 filesystem:

mkfs.vfat -F 32 /dev/sdXY

where sdXY is your partition.

Mount it and copy contents of PLD RescueCD like x86 and x86_64 ISO image to that partition, to /rcd subdirectory.

Make MBR record:

ms-sys -s /dev/sdX

(where sdX is entire flash disk; ms-sys comes from ms-sys package)

Copy syslinux configuration for USB to root directory of your flash drive as syslinux.cfg. DOS/Windows image should be placed in /rcd/boot/dos.gz (compress it with gzip first).

Run:

syslinux -s /dev/sdXY

to load syslinux onto your flash drive.

Reboot your system and check if it boots correctly :-)

Note that some systems have problems with booting from flash driver (especially big like 1G or 2G flash drives).

Booting PLD RescueCD from LILO

Copy files from rescuecd iso image and add section similar to this one to lilo.conf:

image=/boot/rescuecd-20070617/boot/isolinux/vmlinuz
label=rcd
root=/dev/ram0
initrd=/boot/rescuecd-20070617/rescue.cpi
append=" console=tty0 console=ttyS1,38400n81 panic=60"

PXE remote boot for your home/work lab

PXE is a well known and widely used in some enviroments. I’m quite often playing with some servers, testing, installing various things, reflashing firmwares etc. Usually that was done with PLD RescueCD on a CDRW medium, (Free)DOS images/isos etc. Unfortunately burning different stuff over and over is annoying. How to do something nice and usable?

What you need is a dhcp server, tftp server and PXE ready client machines (most of newer hardware has ability to boot from network over PXE).

Setting dhcp server.

Beside standard network settings in dhcpd.conf you will need:

allow booting ;
allow bootp ;
next-server 192.168.0.250 ;
filename “/pxelinux.0” ;

Setting tftp server

Under PLD that means just installing atftpd package. If you built from sources then run something like:

atftpd -v5 –daemon /var/lib/tftp

Note that atftpd can not serve images bigger than 64MB (due to lack of block number rollover support). tftpd-hpa supports this fortunately.

pxelinux

You will also need syslinux package that comes with pxelinux. pxelinux will load multiple images for us depending on user choice. Use latest available version (3.31 at this moment) because older version miss important piece of functionality (menus).

/var/lib/tftp preparation

Structure I use is shown below. The most important thing is a pxelinux.0 file (symlink to real file in my case) that is whole pxelinux loader that comes with syslinux package. pxelinux uses configuration file from pxelinux.cfg directory. pxelinux tries to load various configuration files and stops at first found:

Jan 13 15:29:12 arm atftpd[5234]: Serving /pxelinux.cfg/01-00-a0-cc-da-d9-3c to 192.168.0.113:57089
Jan 13 15:29:12 arm atftpd[5234]: Serving /pxelinux.cfg/C0A80071 to 192.168.0.113:57090
Jan 13 15:29:12 arm atftpd[5234]: Serving /pxelinux.cfg/C0A8007 to 192.168.0.113:57091
Jan 13 15:29:12 arm atftpd[5234]: Serving /pxelinux.cfg/C0A800 to 192.168.0.113:57092
Jan 13 15:29:12 arm atftpd[5234]: Serving /pxelinux.cfg/C0A80 to 192.168.0.113:57093
Jan 13 15:29:12 arm atftpd[5234]: Serving /pxelinux.cfg/C0A8 to 192.168.0.113:57094
Jan 13 15:29:12 arm atftpd[5234]: Serving /pxelinux.cfg/C0A to 192.168.0.113:57095
Jan 13 15:29:12 arm atftpd[5234]: Serving /pxelinux.cfg/C0 to 192.168.0.113:57096
Jan 13 15:29:12 arm atftpd[5234]: Serving /pxelinux.cfg/C to 192.168.0.113:57097
Jan 13 15:29:12 arm atftpd[5234]: Serving /pxelinux.cfg/default to 192.168.0.113:57098

This means that we can have different configurations for different machines (based on MAC address of machine ehternet card). I’m using default configuration file which is always tried.

My entire /var/lib/tftp structure:

[root@arm /var/lib/tftp]# ls -alR
.:
total 1456
drwxr-xr-x 9 root root 4096 Jan 13 15:26 .
drwxr-xr-x 35 root root 4096 Jan 12 17:35 ..
-rw-r–r– 1 root root 5237 Jan 13 15:25 pxe-background.png
lrwxrwxrwx 1 root root 30 Jan 12 17:41 pxelinux.0 -> /usr/lib64/syslinux/pxelinux.0
drwxr-xr-x 2 root root 20 Jan 13 16:51 pxelinux.cfg
drwxr-xr-x 4 root root 47 Jan 12 09:47 rescue-x86-20060625
drwxr-xr-x 4 root root 47 Jan 12 11:39 rescue-x86-20070109
drwxr-xr-x 4 root root 47 Jan 12 09:47 rescue-x86_64-20060625
drwxr-xr-x 2 root root 31 Jan 12 10:37 suse-10.1
drwxr-xr-x 2 root root 60 Jan 12 10:06 suse-9.2
drwxr-xr-x 2 root root 60 Jan 12 10:05 suse-9.3
lrwxrwxrwx 1 root root 19 Jan 12 17:41 syslinux -> /usr/lib64/syslinux
-rw-r–r– 1 root root 1474560 Nov 18 1999 winb98se.img

./pxelinux.cfg:
total 8
drwxr-xr-x 2 root root 20 Jan 13 16:51 .
drwxr-xr-x 9 root root 4096 Jan 13 15:26 ..
-rw-r–r– 1 root root 2152 Jan 13 15:24 default

./rescue-x86-20060625:
total 54340
drwxr-xr-x 4 root root 47 Jan 12 09:47 .
drwxr-xr-x 9 root root 4096 Jan 13 15:26 ..
drwxr-xr-x 3 root root 104 Jun 25 2006 boot
drwxr-xr-x 2 root root 24 Jan 12 09:53 custom
-rw-r–r– 1 root root 55638528 Jun 25 2006 rescue.cpi

./rescue-x86-20060625/boot:
total 36
drwxr-xr-x 3 root root 104 Jun 25 2006 .
drwxr-xr-x 4 root root 47 Jan 12 09:47 ..
-rw-r–r– 1 root root 17131 Jun 15 2006 ElTorito.img.gz
-rw-r–r– 1 root root 744 Jun 15 2006 README
-rw-r–r– 1 root root 83 Jun 15 2006 boot.bat
-rw-r–r– 1 root root 1475 Jun 15 2006 floppy.img.gz
drwxr-xr-x 2 root root 138 Jun 25 2006 isolinux
-rwxr-xr-x 1 root root 3695 Jun 25 2006 isomod

./rescue-x86-20060625/boot/isolinux:
total 1508
drwxr-xr-x 2 root root 138 Jun 25 2006 .
drwxr-xr-x 3 root root 104 Jun 25 2006 ..
-r–r–r– 1 root root 2048 Jun 25 2006 boot.catalog
-rw-r–r– 1 root root 1594 Jun 25 2006 boot.msg
-rw-r–r– 1 root root 1443 Jun 15 2006 help.msg
-rw-r–r– 1 root root 357528 Jun 25 2006 initrd.ide
-rw-r–r– 1 root root 10440 Jun 25 2006 isolinux.bin
-rw-r–r– 1 root root 1156 Jun 15 2006 isolinux.cfg
-rw-r–r– 1 root root 94760 Jun 15 2006 memtest
-rw-r–r– 1 root root 1056768 Jun 25 2006 vmlinuz

./rescue-x86-20060625/custom:
total 4
drwxr-xr-x 2 root root 24 Jan 12 09:53 .
drwxr-xr-x 4 root root 47 Jan 12 09:47 ..
-rw-r–r– 1 root root 1024 Jun 25 2006 custom.cpio

./rescue-x86-20070109:
total 52768
drwxr-xr-x 4 root root 47 Jan 12 11:39 .
drwxr-xr-x 9 root root 4096 Jan 13 15:26 ..
drwxr-xr-x 3 root root 104 Jan 9 01:10 boot
drwxr-xr-x 2 root root 24 Jan 9 01:10 custom
-rw-r–r– 1 root root 54028800 Jan 9 01:10 rescue.cpi

./rescue-x86-20070109/boot:
total 36
drwxr-xr-x 3 root root 104 Jan 9 01:10 .
drwxr-xr-x 4 root root 47 Jan 12 11:39 ..
-rw-r–r– 1 root root 17131 Jun 15 2006 ElTorito.img.gz
-rw-r–r– 1 root root 744 Jun 15 2006 README
-rw-r–r– 1 root root 83 Jun 15 2006 boot.bat
-rw-r–r– 1 root root 1475 Jun 15 2006 floppy.img.gz
drwxr-xr-x 2 root root 138 Jan 9 01:10 isolinux
-rwxr-xr-x 1 root root 3695 Jan 9 01:10 isomod

./rescue-x86-20070109/boot/isolinux:
total 1708
drwxr-xr-x 2 root root 138 Jan 9 01:10 .
drwxr-xr-x 3 root root 104 Jan 9 01:10 ..
-r–r–r– 1 root root 2048 Jan 9 01:10 boot.catalog
-rw-r–r– 1 root root 1594 Jan 8 21:33 boot.msg
-rw-r–r– 1 root root 1443 Jun 15 2006 help.msg
-rw-r–r– 1 root root 381123 Jan 9 01:10 initrd.ide
-rw-r–r– 1 root root 10440 Jan 9 01:10 isolinux.bin
-rw-r–r– 1 root root 1156 Jun 15 2006 isolinux.cfg
-rw-r–r– 1 root root 94760 Jun 15 2006 memtest
-rw-r–r– 1 root root 1234944 Jan 9 01:05 vmlinuz

./rescue-x86-20070109/custom:
total 4
drwxr-xr-x 2 root root 24 Jan 9 01:10 .
drwxr-xr-x 4 root root 47 Jan 12 11:39 ..
-rw-r–r– 1 root root 1024 Jan 9 01:10 custom.cpio

./rescue-x86_64-20060625:
total 44900
drwxr-xr-x 4 root root 47 Jan 12 09:47 .
drwxr-xr-x 9 root root 4096 Jan 13 15:26 ..
drwxr-xr-x 3 root root 104 Jun 25 2006 boot
drwxr-xr-x 2 root root 24 Jun 25 2006 custom
-rw-r–r– 1 root root 45970224 Jun 25 2006 rescue.cpi

./rescue-x86_64-20060625/boot:
total 36
drwxr-xr-x 3 root root 104 Jun 25 2006 .
drwxr-xr-x 4 root root 47 Jan 12 09:47 ..
-rw-r–r– 1 root root 17131 Jun 15 2006 ElTorito.img.gz
-rw-r–r– 1 root root 744 Jun 15 2006 README
-rw-r–r– 1 root root 83 Jun 15 2006 boot.bat
-rw-r–r– 1 root root 1475 Jun 15 2006 floppy.img.gz
drwxr-xr-x 2 root root 138 Jun 25 2006 isolinux
-rwxr-xr-x 1 root root 3695 Jun 25 2006 isomod

./rescue-x86_64-20060625/boot/isolinux:
total 1776
drwxr-xr-x 2 root root 138 Jun 25 2006 .
drwxr-xr-x 3 root root 104 Jun 25 2006 ..
-r–r–r– 1 root root 2048 Jun 25 2006 boot.catalog
-rw-r–r– 1 root root 1530 Jun 25 2006 boot.msg
-rw-r–r– 1 root root 1197 Jun 18 2006 help.msg
-rw-r–r– 1 root root 364891 Jun 25 2006 initrd.ide
-rw-r–r– 1 root root 10440 Jun 25 2006 isolinux.bin
-rw-r–r– 1 root root 701 Jun 15 2006 isolinux.cfg
-rw-r–r– 1 root root 94760 Jun 15 2006 memtest
-rw-r–r– 1 root root 1321472 Jun 25 2006 vmlinuz

./rescue-x86_64-20060625/custom:
total 4
drwxr-xr-x 2 root root 24 Jun 25 2006 .
drwxr-xr-x 4 root root 47 Jan 12 09:47 ..
-rw-r–r– 1 root root 1024 Jun 25 2006 custom.cpio

./suse-10.1:
total 9164
drwxr-xr-x 2 root root 31 Jan 12 10:37 .
drwxr-xr-x 9 root root 4096 Jan 13 15:26 ..
-rw-r–r– 1 root root 8137429 May 3 2006 initrd
-rw-r–r– 1 root root 1237785 May 3 2006 linux

./suse-9.2:
total 12972
drwxr-xr-x 2 root root 60 Jan 12 10:06 .
drwxr-xr-x 9 root root 4096 Jan 13 15:26 ..
-rw-r–r– 1 root root 5379369 Oct 21 2004 initrd
-rw-r–r– 1 root root 4730075 Oct 20 2004 initrd64
-rw-r–r– 1 root root 1555945 Oct 21 2004 linux
-rw-r–r– 1 root root 1608082 Oct 20 2004 linux64

./suse-9.3:
total 14932
drwxr-xr-x 2 root root 60 Jan 12 10:05 .
drwxr-xr-x 9 root root 4096 Jan 13 15:26 ..
-rw-r–r– 1 root root 6183757 Mar 24 2005 initrd
-rw-r–r– 1 root root 6048487 Mar 24 2005 initrd64
-rw-r–r– 1 root root 1424645 Mar 24 2005 linux
-rw-r–r– 1 root root 1625590 Mar 24 2005 linux64

rescue-* directories contain unmodified copy of PLD RescueCD ISO images content. suse-* contain kernel images and initrd file copied from SuSE installation cdrom/dvd. winb98se.img is a image of Windows 98 SE boot floppy disk.

pxelinux “default” configuration file

The configuration file is shown below. vesamenu.c32 allows do display menus in graphical mode with background jpg/png images. For pure text mode there is menu.c32. MENU LABEL allows to add text message shown in menu for single label part of configuration.

“^” is used to mark keyboard shortcut letter.

Windows floppy image uses special loader called memdisk which allows to boot legacy operating systems.

CPU identification case is interesting because it starts entire new “program” named cpuidtest.c32 which is the same kind of “program” as vesamenu.c32. That’s way of handling allows us to create multiple submenus which will read different configuration files specified in APPEND directive – example:

LABEL newmenu
MENU LABEL New Menu
KERNEL vesamenu.c32
APPEND something.conf newmenu.conf

I don’t use submenus in my setup though.

[root@arm /var/lib/tftp]# cat pxelinux.cfg/default
DEFAULT syslinux/vesamenu.c32
MENU BACKGROUND pxe-background.png
PROMPT 0

MENU TITLE Remote Boot Services

label rescue-x86
MENU LABEL ^1. PLD Rescue 20060625 x86
kernel rescue-x86-20060625/boot/isolinux/vmlinuz
append initrd=rescue-x86-20060625/rescue.cpi,rescue-x86-20060625/custom/custom.cpio root=/dev/ram0 CONF=”`/dev/fd0:/rescue`;;;;;;;;;;;”
ipappend 1

label rescue-x86
MENU LABEL ^2. PLD Rescue 20070109 x86
kernel rescue-x86-20070109/boot/isolinux/vmlinuz
append initrd=rescue-x86-20070109/rescue.cpi,rescue-x86-20070109/custom/custom.cpio root=/dev/ram0 CONF=”`/dev/fd0:/rescue`;;;;;;;;;;;”
ipappend 1

label rescue-x86_64
MENU LABEL ^3. PLD Rescue 20060625 x86_64
kernel rescue-x86_64-20060625/boot/isolinux/vmlinuz
append initrd=rescue-x86_64-20060625/rescue.cpi,rescue-x86_64-20060625/custom/custom.cpio root=/dev/ram0 CONF=”`/dev/fd0:/rescue`;;;;;;;;;;;”

label suse-install-9.2-x86
MENU LABEL ^4. SuSE Linux Install 9.2 x86
kernel suse-9.2/linux
append initrd=suse-9.2/initrd splash=silent showopts install=ftp://192.168.1.250/SUSE/9.2

label suse-install-9.2-x86_64
MENU LABEL ^5. SuSE Linux Install 9.2 x86_64
kernel suse-9.2/linux64
append initrd=suse-9.2/initrd64 splash=silent showopts install=ftp://192.168.1.250/SUSE/9.2

label suse-install-9.3-x86
MENU LABEL ^6. SuSE Linux Install 9.3 x86
kernel suse-9.3/linux
append initrd=suse-9.3/initrd splash=silent showopts install=ftp://192.168.1.250/SUSE/9.3

label suse-install-9.3-x86_64
MENU LABEL ^7. SuSE Linux Install 9.3 x86_64
kernel suse-9.3/linux64
append initrd=suse-9.3/initrd64 splash=silent showopts install=ftp://192.168.1.250/SUSE/9.3

label suse-install-10.1-x86
MENU LABEL ^8. SuSE Linux Install 10.1 x86
kernel suse-10.1/linux
append initrd=suse-10.1/initrd splash=silent showopts install=ftp://192.168.1.250/SUSE/10.1

label win98se
MENU LABEL ^9. Windows 98 SE Boot Disk
kernel syslinux/memdisk
append initrd=winb98se.img

LABEL cpuid
MENU LABEL ^A. Identify Processor
KERNEL syslinux/cpuidtest.c32

Screenphotos

(click images to see in full size))

Text boot using menu.c32 (or when vesamenu.c32 gets wrong options, files like background image in wrong size (needs to be 640×480)).

Text boot

Graphical boot with PLD-style background image.

Graphical boot

You can change boot options just like in grub.

Graphical boot with editing parameters for single boot entry

PLD RescueCD boots…

Booting PLD RescueCD

Windows 98 SE image already started.

Booting Windows 98 SE floppy image

Example of CPU Identification that comes with syslinux package.

CPU Identification example

Background image used in screenshots

PLD Background