[ 6.900048] [drm] Driver supports precise vblank timestamp query.
[ 6.946226] nouveau 0000:01:00.0: DRM: MM: using COPY0 for buffer copies
[ 6.986438] nouveau 0000:01:00.0: No connectors reported connected with modes
[ 6.990638] [drm] Cannot find any crtc or sizes - going 1024x768
[ 7.037494] nouveau 0000:01:00.0: DRM: allocated 1024x768 fb: 0x60000, bo ffff880119ac8000
[ 7.038167] fbcon: nouveaufb (fb0) is primary device
[ 7.057025] tg3 0000:05:00.0 eth126: renamed from eth0
[ 7.057201] Console: switching to colour frame buffer device 128x48
[ 7.058711] nouveau 0000:01:00.0: fb0: nouveaufb frame buffer device
[ 7.061913] [drm] Initialized nouveau 1.3.1 20120801 for 0000:01:00.0 on minor 0
[ 7.061954] tg3 0000:05:00.0 eth1: renamed from eth126
[ 7.093948] i2c /dev entries driver
[ 7.666181] usb-storage 2-1.2:1.0: USB Mass Storage device detected
[ 7.666284] scsi host8: usb-storage 2-1.2:1.0
[ 7.666421] usbcore: registered new interface driver usb-storage
[ 7.669848] hidraw: raw HID events driver (C) Jiri Kosina
[ 7.674298] usbcore: registered new interface driver uas
[ 7.677695] ums-realtek 2-1.4:1.0: USB Mass Storage device detected
[ 7.678872] usbcore: registered new interface driver usbhid
[ 7.678884] usbhid: USB HID core driver
[ 7.691809] scsi host9: usb-storage 2-1.4:1.0
[ 7.691923] usbcore: registered new interface driver ums-realtek
[ 7.779904] usb 2-1.1: Warning! Unlikely big volume range (=17152), cval->res is probably wrong.
[ 7.779927] usb 2-1.1: [2] FU [PCM Playback Volume] ch = 2, val = 0/17152/1
[ 7.780068] usbcore: registered new interface driver snd-usb-audio
[ 7.810411] usb 2-1.4: USB disconnect, device number 5
[ 7.896230] input: USB AUDIO as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.2/0003:1130:1620.0001/input/input7
[ 7.947220] hid-generic 0003:1130:1620.0001: input,hidraw0: USB HID v1.10 Device [USB AUDIO ] on usb-0000:00:1d.0-1.1/input2
[ 8.036930] Adding 4194300k swap on /dev/sda1. Priority:-1 extents:1 across:4194300k
[ 8.103926] fuse init (API version 7.23)
[ 8.446249] EXT4-fs (sda2): re-mounted. Opts: (null)
[ 8.670258] scsi 8:0:0:0: Direct-Access WD Ext HDD 1021 2021 PQ: 0 ANSI: 4
[ 8.672945] sd 8:0:0:0: [sdb] 1953519616 512-byte logical blocks: (1.00 TB/932 GiB)
[ 8.675124] sd 8:0:0:0: [sdb] Write Protect is off
[ 8.675378] sd 8:0:0:0: [sdb] Mode Sense: 17 00 10 08
[ 8.677374] sd 8:0:0:0: [sdb] No Caching mode page found
[ 8.677616] sd 8:0:0:0: [sdb] Assuming drive cache: write through
[ 12.311525] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)
[ 15.992701] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 16.004925] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
[ 16.654602] NET: Registered protocol family 10
[ 16.654757] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 18.039591] tg3 0000:05:00.0 eth1: Link is up at 1000 Mbps, full duplex
[ 18.039596] tg3 0000:05:00.0 eth1: Flow control is on for TX and on for RX
[ 18.039627] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ 19.465736] sdb: sdb1
[ 19.472849] sd 8:0:0:0: [sdb] Attached SCSI disk
[ 22.904727] nf_conntrack: automatic helper assignment is deprecated and it will be removed soon. Use the iptables CT target to attach helpers instead.
[ 3685.423293] usb 2-1.1: USB disconnect, device number 3
[11663.191185] usb 2-1.1: new full-speed USB device number 6 using ehci-pci
[11663.278365] usb 2-1.1: New USB device found, idVendor=1130, idProduct=1620
[11663.278371] usb 2-1.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[11663.278375] usb 2-1.1: Product: USB AUDIO
[11663.281569] usb 2-1.1: Warning! Unlikely big volume range (=17152), cval->res is probably wrong.
[11663.281575] usb 2-1.1: [2] FU [PCM Playback Volume] ch = 2, val = 0/17152/1
[11663.282760] input: USB AUDIO as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.2/0003:1130:1620.0002/input/input8
[11663.333415] hid-generic 0003:1130:1620.0002: input,hidraw0: USB HID v1.10 Device [USB AUDIO ] on usb-0000:00:1d.0-1.1/input2
[182044.897407] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[378524.502474] ucc-bin[1907]: segfault at a6c ip 00000000f736d407 sp 00000000ffff45b0 error 4 in Core.so[f72ec000+af000]
[449248.145277] ucc-bin[10266]: segfault at a6c ip 00000000f73c3407 sp 00000000ffb7be70 error 4 in Core.so[f7342000+af000]
[583389.059670] ucc-bin[11136]: segfault at a6c ip 00000000f73ff407 sp 00000000ff886470 error 4 in Core.so[f737e000+af000]
[585175.048859] ucc-bin[1252]: segfault at a6c ip 00000000f7387407 sp 00000000ffcbcdb0 error 4 in Core.so[f7306000+af000]
[625500.138855] ucc-bin[22982]: segfault at a6c ip 00000000f73db407 sp 00000000ffd631b0 error 4 in Core.so[f735a000+af000]
[628767.467561] ucc-bin[12115]: segfault at a6c ip 00000000f7362407 sp 00000000ffbe3a30 error 4 in Core.so[f72e1000+af000]
[629127.188362] ucc-bin[4024]: segfault at a6c ip 00000000f7315407 sp 00000000ffa42130 error 4 in Core.so[f7294000+af000]
[638685.336725] ucc-bin[20405]: segfault at a6c ip 00000000f73ed407 sp 00000000ffeb4570 error 4 in Core.so[f736c000+af000]
[639855.702649] usb 1-1.1: new high-speed USB device number 3 using ehci-pci
[639855.788463] usb 1-1.1: New USB device found, idVendor=03f0, idProduct=a611
[639855.788477] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[639855.788480] usb 1-1.1: Product: Photosmart 7510 series
[639855.788483] usb 1-1.1: Manufacturer: HP
[639855.788486] usb 1-1.1: SerialNumber: CN19H150DJ05PX
[639855.789103] usb-storage 1-1.1:1.2: USB Mass Storage device detected
[639855.789209] scsi host10: usb-storage 1-1.1:1.2
[639856.791321] scsi 10:0:0:0: Direct-Access HP Photosmart 7510 1.00 PQ: 0 ANSI: 5
[639856.793142] sd 10:0:0:0: [sdc] Attached SCSI removable disk
[647548.658264] usb 1-1.1: USB disconnect, device number 3
[666535.166316] usb 1-1.1: new high-speed USB device number 4 using ehci-pci
[666535.253259] usb 1-1.1: New USB device found, idVendor=03f0, idProduct=a611
[666535.253265] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[666535.253268] usb 1-1.1: Product: Photosmart 7510 series
[666535.253271] usb 1-1.1: Manufacturer: HP
[666535.253274] usb 1-1.1: SerialNumber: CN19H150DJ05PX
[666535.253954] usb-storage 1-1.1:1.2: USB Mass Storage device detected
[666535.254021] scsi host11: usb-storage 1-1.1:1.2
[666536.257179] scsi 11:0:0:0: Direct-Access HP Photosmart 7510 1.00 PQ: 0 ANSI: 5
[666536.259910] sd 11:0:0:0: [sdc] Attached SCSI removable disk
[673758.005808] usb 1-1.1: USB disconnect, device number 4
[687515.025752] usb 1-1.1: new high-speed USB device number 5 using ehci-pci
[687515.111671] usb 1-1.1: New USB device found, idVendor=03f0, idProduct=a611
[687515.111676] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[687515.111680] usb 1-1.1: Product: Photosmart 7510 series
[687515.111683] usb 1-1.1: Manufacturer: HP
[687515.111685] usb 1-1.1: SerialNumber: CN19H150DJ05PX
[687515.112419] usb-storage 1-1.1:1.2: USB Mass Storage device detected
[687515.112876] scsi host12: usb-storage 1-1.1:1.2
[687516.116614] scsi 12:0:0:0: Direct-Access HP Photosmart 7510 1.00 PQ: 0 ANSI: 5
[687516.119553] sd 12:0:0:0: [sdc] Attached SCSI removable disk
[694790.473928] usb 1-1.1: USB disconnect, device number 5
[966747.568572] conntrack: generic helper won't handle protocol 132. Please consider loading the specific helper module.

RANDOM FORTUNE:

10.0 times 0.1 is hardly ever 1.0.

Kernel Packaging

Note: This tutorial assumes that you know how to compile a kernel already. It only looks at a way of creating a package and doesn't aim to show kernel config options.

Note 2: We won't be using the stock Slackware kernel SlackBuilds.

Kernel Output Target Option

The usual way to make any sort of package is via the $DESTDIR variable. The kernel doesn't use this however, but it does have an O switch which does almost the same thing, although the output might not be exactly what you expect. I will not be using that option here.

Building

Copy your .config into the source directory and do

make menuconfig

(or whichever method you prefer.) You may need to do make mrproper first, and perhaps make oldconfig.

make

Note: Do not use make install or make modules_install, even with O switch, as this will install to /boot and /lib/modules, which we don't want.

At this point everything we need is in the source directory. The file modules.order lists the modules to be installed and we can use that to help us make a package.

Installing Modules and Kernel to our Package Directory

Ok let's use /tmp/kernel-package for our package directory. Also let's assume a 2.6.29.6 kernel with jabberwok as local name. A little bash will copy our modules to it:

LIBSDIR=/tmp/kernel-package/lib/modules/2.6.29.6-jabberwok/kernel

for i in $(sed "s#^kernel/##" modules.order)
do
  mkdir -p $LIBSDIR/$(dirname $i)
  install -m 644 -v $i $LIBSDIR/$(dirname $i)
done

Now we need the kernel and associated files.

mkdir /tmp/kernel-package/boot
cp arch/x86/boot/bzImage /tmp/kernel-package/boot/vmlinuz-2.6.29.6-jabberwok
cp System.map /tmp/kernel-package/boot/System.map-2.6.29.6-jabberwok
cp .config /tmp/kernel-package/boot/config-2.6.29.6-jabberwok
mkdir /tmp/kernel-package/install

doinst.sh:

## Taken from stock modules package
if [ -x sbin/depmod ]; then
  chroot . /sbin/depmod -a 2.6.29.6-jabberwok > /dev/null 2> /dev/null
fi

(cd lib/modules/2.6.29.6-jabberwok ; rm -rf build)
(cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok build)
(cd lib/modules/2.6.29.6-jabberwok ; rm -rf source)
(cd lib/modules/2.6.29.6-jabberwok ; ln -sf /usr/src/linux-2.6.29.6-jabberwok source)

slack-desc:

# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.  Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in.  You must
# make exactly 11 lines for the formatting to be correct.  It's also
# customary to leave one space after the ':'.

kernel-jabberwok|-----handy-ruler------------------------------------------------------|
kernel-jabberwok: kernel and modules for kernel-jabberwok 2.6.29.6
kernel-jabberwok:
kernel-jabberwok: Jabberwokky type kernel!
kernel-jabberwok:
kernel-jabberwok:
kernel-jabberwok:
kernel-jabberwok:
kernel-jabberwok:
kernel-jabberwok:
kernel-jabberwok:
kernel-jabberwok:

They should both be copied to the install directory.

Making the Package

cd /tmp/kernel-package
/sbin/makepkg -l y -c n /tmp/kernel-jabberwok-2.6.29.6-i686-1_tag.txz

Change '_tag' to your usual moniker. Hopefully we now have a package in /tmp. Copy it to a temporary directory somewhere, explodepkg it and check the contents. We don't want to install something with messed up paths etc. If all is well we can installpkg it.

As usual, edit your /etc/lilo.conf and add an option for the new kernel, keeping the old kernel entry in place for safety, then run lilo.

A Little Automation

Of course this would be easier to control with a script rather than typing in these commands manually and trying not to make typos. Here is the script that I've been using (run make menuconfig first):

kernel.SlackBuild

Notes:

You should have a /usr/src/linux-$VERSION-$LOCALNAME on your target box or you may have problems later if compiling anything that needs that source.

Do not omit setting localname in .config.

Conclusion

The aim for doing this was to be able to build a kernel for my old T42 on my desktop box using the T42's .config. It could be possible to split up kernel and modules into separate packages (howto for that coming soon). Note that this does not include the firmware so you should keep the relevant kernel-firmware package installed.

At the end of the day, this helped me to compile a kernel without my laptop getting even warm, which was the point of the project.