[1353773.415012] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[1717914.743513] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[1723402.978913] mocp[23166]: segfault at 0 ip 00007fb77d367414 sp 00007fffb13e1890 error 4 in libc-2.23.so[7fb77d32c000+1c0000]
[1723517.951390] mocp[24536]: segfault at 0 ip 00007fc0a1ba3414 sp 00007ffe36b981b0 error 4 in libc-2.23.so[7fc0a1b68000+1c0000]
[1723796.295052] mocp[26449]: segfault at 0 ip 00007fc9e2869414 sp 00007ffe62e2d6d0 error 4 in libc-2.23.so[7fc9e282e000+1c0000]
[1724374.530637] mocp[29504]: segfault at 0 ip 00007fdd72321414 sp 00007ffce40e7810 error 4 in libc-2.23.so[7fdd722e6000+1c0000]
[1724577.869046] mocp[30596]: segfault at 0 ip 00007fd33af82414 sp 00007ffe91355710 error 4 in libc-2.23.so[7fd33af47000+1c0000]
[1724597.233037] mocp[30725]: segfault at 0 ip 00007ff32f4db414 sp 00007ffd8134cd00 error 4 in libc-2.23.so[7ff32f4a0000+1c0000]
[1724611.901296] mocp[30816]: segfault at 0 ip 00007f7b285a7414 sp 00007fff9875ecb0 error 4 in libc-2.23.so[7f7b2856c000+1c0000]
[1724639.114351] mocp[30970]: segfault at 0 ip 00007fec465d2414 sp 00007ffc03ced160 error 4 in libc-2.23.so[7fec46597000+1c0000]
[1724656.178450] mocp[31068]: segfault at 0 ip 00007f3d5a85d414 sp 00007ffd9bba2eb0 error 4 in libc-2.23.so[7f3d5a822000+1c0000]
[1767912.183623] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[2128531.801117] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[2206519.119045] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[2212439.559272] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[2213906.671638] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[2253510.242385] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[2343792.133507] traps: calcurse[30413] general protection ip:7ff97c20fbf2 sp:7ffdb88c0d70 error:0 in libc-2.23.so[7ff97c18c000+1c0000]
[2347667.866567] test-delnull[10242]: segfault at 8 ip 0000000000400e14 sp 00007ffd2bc96250 error 4 in test-delnull[400000+2000]
[2397722.989999] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[2645607.338408] conntrack: generic helper won't handle protocol 132. Please consider loading the specific helper module.
[2653214.415785] zita-n2j[27952]: segfault at 10 ip 00000000004042b7 sp 00007fc1ebd53ca8 error 4 in zita-n2j[400000+9000]
[2653464.107565] zita-n2j[31250]: segfault at 10 ip 00000000004042b7 sp 00007f1e32669ca8 error 4 in zita-n2j[400000+9000]
[2653537.443720] zita-n2j[31965]: segfault at 10 ip 00000000004042b7 sp 00007f9145258ca8 error 4 in zita-n2j[400000+9000]
[2653579.100637] zita-n2j[32360]: segfault at 10 ip 00000000004042b7 sp 00007f36e450dca8 error 4 in zita-n2j[400000+9000]
[2654107.988611] zita-n2j[319]: segfault at 10 ip 00000000004042b7 sp 00007ff97e581ca8 error 4 in zita-n2j[400000+9000]
[2654379.273795] zita-n2j[5524]: segfault at 10 ip 00000000004042b7 sp 00007f795f498ca8 error 4 in zita-n2j[400000+9000]
[2654419.977851] zita-n2j[7740]: segfault at 10 ip 00000000004042b7 sp 00007f57eb951ca8 error 4 in zita-n2j[400000+9000]
[2655843.229255] zita-n2j[8190]: segfault at 10 ip 00000000004042b7 sp 00007f9a40f90ca8 error 4 in zita-n2j[400000+9000]
[2805201.874813] test-delnull[20960]: segfault at 8 ip 0000000000400e14 sp 00007ffee86fd560 error 4 in test-delnull[400000+2000]
[2867563.247055] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[3147249.715461] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[3186219.458841] ucc-bin[18288]: segfault at a6c ip 00000000f731a407 sp 00000000ffa37e90 error 4 in Core.so[f7299000+af000]
[3186220.503112] ucc-bin[18308]: segfault at a6c ip 00000000f73f3407 sp 00000000ffd05ed0 error 4 in Core.so[f7372000+af000]
[3186221.545644] ucc-bin[18342]: segfault at a6c ip 00000000f7360407 sp 00000000ffd9c0d0 error 4 in Core.so[f72df000+af000]
[3186222.593100] ucc-bin[18349]: segfault at a6c ip 00000000f73c3407 sp 00000000ffe1f210 error 4 in Core.so[f7342000+af000]
[3186223.639743] ucc-bin[18370]: segfault at a6c ip 00000000f730e407 sp 00000000fffa9f50 error 4 in Core.so[f728d000+af000]
[3186224.682263] ucc-bin[18391]: segfault at a6c ip 00000000f73cc407 sp 00000000ff8a5090 error 4 in Core.so[f734b000+af000]
[3186225.724623] ucc-bin[18399]: segfault at a6c ip 00000000f73a6407 sp 00000000fffd18d0 error 4 in Core.so[f7325000+af000]
[3186226.767128] ucc-bin[18433]: segfault at a6c ip 00000000f736f407 sp 00000000ff9d6bd0 error 4 in Core.so[f72ee000+af000]
[3186227.810560] ucc-bin[18440]: segfault at a6c ip 00000000f73d7407 sp 00000000ffab7c90 error 4 in Core.so[f7356000+af000]
[3186228.853257] ucc-bin[18462]: segfault at a6c ip 00000000f733d407 sp 00000000ffd8ad10 error 4 in Core.so[f72bc000+af000]
[3186229.896376] ucc-bin[18496]: segfault at a6c ip 00000000f73fd407 sp 00000000ffa18550 error 4 in Core.so[f737c000+af000]
[3186230.939045] ucc-bin[18507]: segfault at a6c ip 00000000f73df407 sp 00000000ff9e4490 error 4 in Core.so[f735e000+af000]
[3186231.981709] ucc-bin[18515]: segfault at a6c ip 00000000f73b1407 sp 00000000ffe31290 error 4 in Core.so[f7330000+af000]
[3186233.024479] ucc-bin[18563]: segfault at a6c ip 00000000f7353407 sp 00000000fffe10d0 error 4 in Core.so[f72d2000+af000]
[3186471.356999] ucc-bin[21871]: segfault at a6c ip 00000000f732d407 sp 00000000fffc2810 error 4 in Core.so[f72ac000+af000]
[3186500.075160] ucc-bin[22300]: segfault at a6c ip 00000000f73ba407 sp 00000000ffb4ac50 error 4 in Core.so[f7339000+af000]
[3186556.996819] ucc-bin[23119]: segfault at a6c ip 00000000f73a2407 sp 00000000ff9bc750 error 4 in Core.so[f7321000+af000]
[3186616.454231] ucc-bin[23972]: segfault at a6c ip 00000000f7367407 sp 00000000ff894210 error 4 in Core.so[f72e6000+af000]
[3186632.375856] ucc-bin[24251]: segfault at a6c ip 00000000f73b0407 sp 00000000ffac1f90 error 4 in Core.so[f732f000+af000]
[3186702.224654] ucc-bin[25222]: segfault at a6c ip 00000000f73f9407 sp 00000000ffe37b90 error 4 in Core.so[f7378000+af000]
[3186762.442605] ucc-bin[26154]: segfault at a6c ip 00000000f73db407 sp 00000000ffce8c50 error 4 in Core.so[f735a000+af000]
[3186779.811682] ucc-bin[26428]: segfault at a6c ip 00000000f73ac407 sp 00000000ffdaa850 error 4 in Core.so[f732b000+af000]
[3186804.883950] ucc-bin[26814]: segfault at a6c ip 00000000f7385407 sp 00000000ffebdcd0 error 4 in Core.so[f7304000+af000]
[3186826.124721] ucc-bin[27175]: segfault at a6c ip 00000000f734f407 sp 00000000ff93c550 error 4 in Core.so[f72ce000+af000]
[3186850.984788] ucc-bin[27590]: segfault at a6c ip 00000000f73c1407 sp 00000000fff16610 error 4 in Core.so[f7340000+af000]
[3186883.927370] ucc-bin[28109]: segfault at a6c ip 00000000f73cb407 sp 00000000ffde2bd0 error 4 in Core.so[f734a000+af000]
[3186897.450197] ucc-bin[28321]: segfault at a6c ip 00000000f73d5407 sp 00000000ffd93990 error 4 in Core.so[f7354000+af000]
[3186909.873250] ucc-bin[28520]: segfault at a6c ip 00000000f7304407 sp 00000000fff0b490 error 4 in Core.so[f7283000+af000]
[3187248.043862] ucc-bin[790]: segfault at a6c ip 00000000f7358407 sp 00000000ffa52fd0 error 4 in Core.so[f72d7000+af000]
[3187251.221196] ucc-bin[849]: segfault at a6c ip 00000000f73b6407 sp 00000000ffecdad0 error 4 in Core.so[f7335000+af000]
[3187252.447746] ucc-bin[859]: segfault at a6c ip 00000000f73a1407 sp 00000000ffe75450 error 4 in Core.so[f7320000+af000]
[3187253.711835] ucc-bin[895]: segfault at a6c ip 00000000f73ba407 sp 00000000ffafc4d0 error 4 in Core.so[f7339000+af000]
[3187254.977037] ucc-bin[910]: segfault at a6c ip 00000000f73ea407 sp 00000000ffe6af10 error 4 in Core.so[f7369000+af000]
[3187256.242617] ucc-bin[948]: segfault at a6c ip 00000000f7336407 sp 00000000ff991390 error 4 in Core.so[f72b5000+af000]
[3187257.507531] ucc-bin[969]: segfault at a6c ip 00000000f7358407 sp 00000000ffb8f390 error 4 in Core.so[f72d7000+af000]
[3187258.773626] ucc-bin[1009]: segfault at a6c ip 00000000f73e4407 sp 00000000ff9748d0 error 4 in Core.so[f7363000+af000]
[3187260.002233] ucc-bin[1019]: segfault at a6c ip 00000000f73e5407 sp 00000000ff81ac50 error 4 in Core.so[f7364000+af000]
[3187261.272280] ucc-bin[1057]: segfault at a6c ip 00000000f73f7407 sp 00000000ffc65510 error 4 in Core.so[f7376000+af000]
[3187313.882545] ucc-bin[1850]: segfault at a6c ip 00000000f73b1407 sp 00000000ff82fed0 error 4 in Core.so[f7330000+af000]
[3187344.476709] ucc-bin[2296]: segfault at a6c ip 00000000f7343407 sp 00000000ffd73a90 error 4 in Core.so[f72c2000+af000]
[3187377.911535] ucc-bin[2775]: segfault at a6c ip 00000000f7347407 sp 00000000ffd816d0 error 4 in Core.so[f72c6000+af000]
[3187462.274216] ucc-bin[3947]: segfault at a6c ip 00000000f73f7407 sp 00000000ffb83890 error 4 in Core.so[f7376000+af000]
[3187519.859206] ucc-bin[4792]: segfault at a6c ip 00000000f732d407 sp 00000000fff36fd0 error 4 in Core.so[f72ac000+af000]
[3187599.174741] ucc-bin[5912]: segfault at a6c ip 00000000f73d6407 sp 00000000ffcea610 error 4 in Core.so[f7355000+af000]
[3187615.430626] ucc-bin[6178]: segfault at a6c ip 00000000f730a407 sp 00000000ffb49810 error 4 in Core.so[f7289000+af000]
[3187686.101745] ucc-bin[7227]: segfault at a6c ip 00000000f7336407 sp 00000000ffbf8f10 error 4 in Core.so[f72b5000+af000]
[3187699.301827] ucc-bin[7451]: segfault at a6c ip 00000000f73a6407 sp 00000000ffad41d0 error 4 in Core.so[f7325000+af000]
[3193285.562158] ucc-bin[26895]: segfault at a6c ip 00000000f736c407 sp 00000000ffc88f80 error 4 in Core.so[f72eb000+af000]
[3193287.321397] ucc-bin[26939]: segfault at a6c ip 00000000f73ba407 sp 00000000ffb01c80 error 4 in Core.so[f7339000+af000]
[3193289.084178] ucc-bin[26953]: segfault at a6c ip 00000000f73e3407 sp 00000000ffa8dc80 error 4 in Core.so[f7362000+af000]
[3193290.848513] ucc-bin[26993]: segfault at a6c ip 00000000f730f407 sp 00000000ff8f49c0 error 4 in Core.so[f728e000+af000]
[3193525.366602] ucc-bin[30334]: segfault at a6c ip 00000000f7323407 sp 00000000ffe3a0c0 error 4 in Core.so[f72a2000+af000]
[3193531.782499] ucc-bin[30468]: segfault at a6c ip 00000000f73bc407 sp 00000000fff73300 error 4 in Core.so[f733b000+af000]
[3246233.663668] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[3322604.931484] ucc-bin[15547]: segfault at a6c ip 00000000f7380407 sp 00000000ffba3130 error 4 in Core.so[f72ff000+af000]
[3486853.852231] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[3671154.839239] ucc-bin[32066]: segfault at a6c ip 00000000f73d3407 sp 00000000ffcf8670 error 4 in Core.so[f7352000+af000]
[3862809.609859] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[3930227.759058] sd 0:0:0:0: Attached scsi generic sg0 type 0
[3930227.759139] sr 4:0:0:0: Attached scsi generic sg1 type 5
[3930227.759294] sd 8:0:0:0: Attached scsi generic sg2 type 0
[4040352.408769] ucc-bin[2548]: segfault at a6c ip 00000000f73c3407 sp 00000000ffcce230 error 4 in Core.so[f7342000+af000]
[4045993.449418] ucc-bin[16323]: segfault at a6c ip 00000000f7382407 sp 00000000fffdd7b0 error 4 in Core.so[f7301000+af000]
[4192978.837166] ucc-bin[12127]: segfault at a6c ip 00000000f73b2407 sp 00000000ffa51cf0 error 4 in Core.so[f7331000+af000]
[4225828.292016] calcurse[3184]: segfault at 7fee9728d0f0 ip 00007fee93e6d58b sp 00007fff2137b6a0 error 4 in libc-2.23.so[7fee93def000+1c0000]
[4264697.685901] ucc-bin[7594]: segfault at a6c ip 00000000f73d7407 sp 00000000ff9987f0 error 4 in Core.so[f7356000+af000]
[4294191.337598] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[4341659.716899] test-delnull[21889]: segfault at 8 ip 0000000000400e14 sp 00007ffc40ceff90 error 4 in test-delnull[400000+2000]

RANDOM FORTUNE:

Screw up your courage! You've screwed up everything else.

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.