Win4Lin is a commercial product by NeTraverse which will prepare a linux kernel to install Windows 95,98, or ME. NeTraverse provides various precompiled kernels. Frequently, hardware issues make using one of their precompiled kernels nearly impossible.
The solution is to download and patch a 'vanilla' kernel from http://kernel.org
. The following is, hopefully, a helpful, step-by-step process.
1. First, boot to FC3 on a good, working kernel. Make sure you have all the bugs worked out of it before you try to build your new kernel, as problems with your existing kernel will probably be passed on to the new kernel.
2. Download a kernel from http://kernel.org
. They will come in a zipped package, either BZIP or GZIP. Make a separate directory to do your work in, so that your kernels and patches don't get lost in the clutter. I called mine /kernels. Open a terminal, and change to the '/' directory.
Just so that we don't accidentally do damage to our working system, we'll do as much as we can as 'user'.
Download your kernel to the directory you just prepared, or move it from where ever you downloaded it to the new directory
$mv linux-2.6.10.tar.bz2 /kernels
3. Go to http://www.netraverse.com
and download the appropriate patches for your kernel. For the 2.6.10 kernel, you'll need Kernel-Win4Lin3-2.6.10.patch and mki-adapter26_1_3_10.patch . Download your patches to /kernels
4. Go to the /kernel directory.
5. If your Linux sources are in BZIP format, i.e. end in a .bz2 extension, use the following;
$tar xfvj linux-2.6.10.tar.bz2
If your linux sources are in GZIP format, use the following;
$tar xfvz linux-2.6.10.tar.gz
6. Copy the patches into your new kernel.
$cp Kernel-Win4Lin3-2.6.10.patch linux-2.6.10
$cp mki-adapter26_1_3_10.patch linux-2.6.10
7. You'll need to be in the kernel to apply the patches, and to do all the rest of the work.
$patch -p1 <Kernel-Win4Lin3-2.6.10.patch> patch.log 2>&1
$patch -p1 <mki-adapter26_1_3_10.patch>> patch.log 2>&1
8. Let's check the patch log to make sure the patches applied cleanly.
The file message HUNK FAILED means that specific code lines of the file being patched differ from what the patch program expected to find. If you receive this message, you cannot proceed till the changes specified by the HUNK FAILED message are applied. You'll either need to get a new patch, or make the changes to the kernel source.
9. Once we have all the patches applied cleanly, without ANY errors, we'll need to change the EXTRAVERSION in the Makefile, so that it doesn't conflict with your distribution's working kernel.
Find the EXTRAVERSION line, a few lines down from the top, and insert the curser right after EXTRAVERSION. Give it a unique name that you'll recognize, and use throughout the rest of this build process. You'll have to be consistant with the naming process, so be kind to yourself. I use this; -W4L011405ak, where W4L represents Win4Lin, the date of the build, and my initials.
Click on 'Save' and exit gedit.
10. Your new kernel won't have a .config file, if you've never made any changes to it. The following is what I copied. Make the appropriate changes for your own situation.
$cp /boot/config-2.6.9-1.667 linux-2.6.10/.config
$cp .config config.save
$cp config.save .config
11. Our next step is to run the configuration utility. On the 2.6.x kernels there are four main frontend programs; config, menuconfig, and xconfig, and oldconfig.
config is the least user-friendly. Each possibility is presented, sequentially, as a question. If you make a mistake, you have to start over from the top. I sit on where this pains me!
oldconfig will read the defaults from an existing .config and rewrite necessary links and files. This is a quick way to tinker with minor changes to a configuration you've already built.
menuconfig uses ncurses as a frontend. You'll have to have the ncurses-devel libraries installed to use this utility. There is a help menu at the top of the screen. Use the arrow keys to navigate, Enter to highlight, and Y or N to make your selections. Kinda reminds me of DOS6.0, but it works, and it's pretty easy.
xconfig is a graphical frontend, using gconf. You'll need the qt and X libraries to use this. Most of the later 2.6.x distributions come with the necessary libraries for either this or the menuconfig. The xconfig is my personal favorite. It just seems quick, and straight forward to me. Just click on the boxes and move on.
In addition to your system specific configurations, you MUST make the following configuration settings for your kernel to work with Win4Lin.
Enable loadable module support
Enable module unloading
System V IPC
Kernel support for ELF binaries
ISO 9660 CD-ROM filesystem support
Include NeTraverse Win4Lin Support.
Make sure REGPARM is NOT selected. Win4Lin wil NOT work with REGPARM.
The newer Win4Lin patches claim to support PREMPTABLE kernel. I have not tried it, as I haven't seen a slow-down of performance to make me want to try it.
SELINUX is a big unknown. I've tried it both ways, and haven't had problems which I could identify as being caused by it. But, I've heard of other issues related to it, though not having anything to do with Win4Lin. I choose NOT to enable it, as my firewall works fine without it, and my primary objective, here, is to get Win4Lin going.
Don't get carried away. Just make the changes you really need to make. If your working kernel IS working, you'll only need to make the above changes. "If it ain't broke, don't fix it."
Once you have made all your selections, EXIT.
Choose YES to save your changes.
12. Now, we actually build the kernel. $make dep is NOT necessary with the 2.6.x kernel tree.
$make clean 2>&1 | tee make.log
$make bzImage 2>&1 | tee make.log
On my AMD Duron 1.3G processor, the bzImage takes about 10 - 13 minutes.
$ls -l arch/i386/boot
This will show you your freshly built bzImage.
13. Now, we build the modules.
$make modules 2>&1 | tee make.log
14. The next step, we have to log in as root. This is where we actually install our new kernel.
#make modules_install 2>&1 tee mkmodinst.log
Our fresh-baked modules will be copied into /lib/modules/linux-2.6.10
15. As we near the end, we'll make initial RAMDisk.
#/sbin/mkinitrd /boot/initrd-2.6.10-W4L011405ak.img 2.6.10
(Note the naming convention I referred to when we modified the Makefile. This is IMPORTANT. Be consistant.)
16. Once your kernel is created, we can prepare it for use. From the linux-2.6.10 directory, copy the kernel and System.map to /boot Remember the naming convention.
#cp arch/i386/boot/bzImage /boot/bzImage-2.6.10-W4L011405ak
#cp System.map /boot/System.map-2.6.10-W4L011405ak
#ln -s /boot/System.map-2.6.10-W4L011405ak /boot/System.map
17. Once you have copied the bzImage and System.map to /boot, we'll edit the grub configuration file located in /boot/grub/menu.lst
title Fedora Core 3 ( 2.6.10-W4L011405ak)
kernel /bzImage-2.6.10-W4L011405ak ro root=LABEL=/ quiet
title Fedora Core 3 (2.6.9-1.667)
kernel /vmlinuz-2.6.9-1.667 ro root=LABEL=/ quiet
Menu.lst is the symbolic link to grub.conf. Changes you make to menu.lst are written to grub.conf. I personally want to see things as they load, so I remove the 'rhgb' before quiet. Also, I want to see the menu, so I comment out the hiddenmenu. You could also change the default at this time, if you wanted to.
Click on 'Save'
Exit form gedit.
Troubleshooting build failures.... most of my build failures have been a result of mistakes in my configuration file. Either I neglected to enable something, or I left something enabled which needed to be disabled. Or, I used the default config from the wrong working kernel. I thought I was booted to one kernel, and was actually booted to another one.
18. Now, if your new kernel boots without errors, you can safely install your NeTraverse Win4Lin package, using the instructions on the screen, after you launch the win4lin-install program.
I hope this helps. Send feedback via this forum, or by email to email@example.com