HOWTO: Making custom kernel with USB support for Slackware 9.1

* Linux (Slackware 9.1) on IBM X31 (2672-CEG) * How to make custom kernel * How to put the custom kernel back on CD * How to install Slackware using custom kernel Laptop IBM X31 has no optical drives, but it is able to boot from USB. Slackware 9.1 CD1 has several kernels but none of these have "USB" and "USB Mass Storage" support. This text describes how to make a kernel with USB support and put it on existing CD. I tried to install from the kernel loopback, but it didn't work. Installation allways started, but after 5 seconds I received the message "installation finished". You should try it before reading the rest of the paper: - download Slackware cd1 ISO file - "mkdir /slack1" - "mount -o loop /path/to/slackware9.1.cd1.iso /slack1" - when asked for "source media" during installation, enter "/slack1". If this doesn't function, read the rest of this paper. But before starting with this, visit http://www.slackware.com/faq/do_faq.php?faq=installation, there is maybe a solution for you. *** MAKING CUSTOM KERNEL FOR SLACKWARE USING DEBIAN CD *** ^ 1. I have a Debian cd1 and installed from the cd only the base system with all possible libraries. debian recognizes device on /dev/sr0, and installation lasts just a few minutes. before you start Debian installation, you'll have to mount /dev/sr0 somewhere to be able to choose "source media": - "mount -t iso9660 /dev/sr0 /cdrom" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * If you have another Linux box, than you can make kernel there, and just put it in the ISO file. X31 was/is my only Linux box. my desktop box is FreeBSD, and that's why I installed Debian at first. if you want to make kernel on an another Linux machine, be carefull to use same GCC version, or you could experience crashes during installation. 2. after installation, take bare.i .config file from slackware cd, copy it in /root/bare.i of the fresh installed debian. 3. download the kernel you wish from kernel.org or even bether from official slackware ftp and unpack it into /usr/src. kernel will make a directory i.e linux-2.6.3. if you downloaded bz2 file, unpack like this: - "tar -yxvf linux-2.6.3.tar.bz2" 4. make a symbolic link to linux: - "ln -s linux-2.6.3 linux" and - "cd linux" 5. when you are in /usr/src/linux, type: - "make mrproper" - "make menuconfig", and you'll see a nice ncurses menu for configuring kernel. on the bottom of this menu you can select config file. select this option, type "/root/bare.i" (path where you saved bare.i from slackware cd1) when asked for path to config file, and press enter. I never use "make oldconfig". 6. after that, find in kernel menu "USB" and "USB Mass Storage" support and turn it on. don't make modules, but build everything in kernel 7. exit kernel menu and type: - "make dep && make bzImage" now you have made a custom kernel, and bzImage is in /usr/src/linux/arch/i386/boot/bzImage. You don't need to use "make modules" or "make install" etc, because, you only need bzImage. *** PUT KERNEL ON SLACKWARE 9.1 CD1 *** ^ 1. mount slackware 9.1 CD1 iso file (i didnt download cd2) like this: - "mkdir /slack1" - "mount -o loop /path/to/slackware91.cd1.iso /slack1" 2. now you can go to /slack1 and replace bzImage file in some of the kernels you don't need. I put it in some of the scsi kernels. you just have to replace the original bzImage file with your bzImage from /usr/src/linux/arch/i386/boot/. don't change anything else on the cd. 3. if you want to customize your cd even more, visit ftp://ftp.slackware.com/pub/slackware/slackware-9.1/isolinux/README.TXT. you can either "umount /slack1" and burn it right after that, or you can make new customized ISO by using HOWTO from the link above. I burned this iso file on the cd. on Linux, you can use "cdrecord". for more info about burning cds on linux, read http://www.tldp.org/HOWTO/CD-Writing-HOWTO.html. I burned it on FreeBSD desktop box with "burncd". *** INSTALL SLACKWARE 9.1 *** ^ 1. after that: - boot from this NEW Slackware cd - when asked for kernel, choose the one you made before - make partitions, - login as root, - make dir /cdrom or whetever, mount /dev/sr0 on /cdrom, - type "setup" to start slackware setup - when asked for "source media", choose mounted /cdrom or /dev/sr0 2. that's it. I installed just a base system + programming tools and libraries (no X, desktop environment etc). after that, I downloaded with "lynx" "Dropline Gnome", from www.dropline.net and installed everything I needed.

Shawn Matthiessen inspired me to write this short explaination. Thanks Shawn.
Copyright 2003-2004, Mirza Muharemagic