From: <p_s...@ya...> - 2003-12-30 11:11:16
|
Thanks for the very detailed response Douglas, I`ll certainly be putting it into practice. However, as far as I can tell, I still need to compile the same kernel/patch combination - 2.4.23-djc3-7um, because this is what my virtual host uses, and I want to do some _kernel_ _module_ compilation (simple netfilter hooks). I`m having trouble getting my kernel modules to compile on my host so I thought if I could develop the same kernel source tree (2.4.23-djc3-7um) on my local machine then I could practice getting things working on that first. But if the basics, like "make linux ARCH=um", are not working then I suppose I can`t entrust the building of modules against this source. Somebody must have got 2.4.23-djc3-7um to compile - it`s on my virtual host... --- Douglas Phillipson <do...@in...> wrote: > Peter Smith wrote: > > I`ve gone to the User Mode Linux site and followed > the > > How To on compiling a kernel but "make linux > ARCH=um" > > results in the following error - > > > > ... > > ../../lib/libfreeswan/ultoa.c:19:22: internal.h: > No > > such file or directory > > make[2]: *** [ultoa.o] Error 1 > > make[2]: Leaving directory > > `/root/uml/linux-2.4.23/net/ipsec' > > make[1]: *** [_subdir_ipsec] Error 2 > > make[1]: Leaving directory > > `/root/uml/linux-2.4.23/net' > > make: *** [_dir_net] Error 2 > > > > I don't think you want to approach UML that way, try > this instead... > > I'm working on a procedure for Redhat. Here is a > start: > > First, I've found a little explanation goes a long > way. We are going to: > > 1) Create and install a new UML Kernel RPM. > This RPM is the UML kernel that will boot on top > of our host OS. > You do NOT boot your machine from this kernel! > > 2) Patch our host machine with the SKAS patch. > 3) Build a new kernal for the host machine with a > "tuntap" device. > Item 2 and 3 go together because they both > require building a new > Kernel so just do both at once and build only > one kernel. This > Kernel is your host OS kernel. You will boot > your machine on it. > The SKAS patch supposedly gives much better > performance to the UML. > The "tuntap" device is required for your UML > kernel to communicate > to the outside world. The "tuntap" device was > automatically > installed in the UML kernel when I made it. It > also needs to > be in your host Kernel. Hence we need to build > a new host kernel. > > 4) Use umlbuilder_gui to create and populate the UML > filesystem. > umlbuilder_gui allows you to fill in the blanks > with the right stuff > to create a filesystem. It installs all the > RPM's that you will > copy from your Redhat CD's on to your hard > drive. It also creates a > startup script called "control" which boots your > UML Kernel on top > of your host OS kernel. > > Note: When I say "do this as you" I mean do it as > the user you are > logged in as. You should NOT be logged in as root > except when > installing RPM's! > > --------------------------------------------------------------------- > 1) Create a new UML Kernel RPM with a 2.4.23 kernel: > > Grab > http://umlbuilder.sourceforge.net/uml-custom.spec > > Edit and modify the lines in uml-custom.spec > that refers to the > kernel version. > > I.E. > > %define kernelversion 2.4.23 << I changed this > from 22 to 23 > %define umlversion 1 << I changed this > from 6 to 1 > > Create a $HOME/.rpmmacros file and add the > following to it: > > %_topdir /home/<your username>/rpm > %packager Douglas Phllipson <your email > address> > > Creating a .rpmmacros file is required to set > the "topdir" > variable so you can run the build as you, not > ROOT. After > creating the UML RPM you have to be root to > install it though. > > So in my case it says the $HOME/.rpmmacros file > contains only: > > %_topdir /home/phillipd/rpm > %packager Douglas Phllipson > <do...@in...> > > Now lets make the rpm (do all this as you, not > root): > > mkdir rpm > cd rpm > mkdir BUILD RPMS SOURCES SPECS SRPMS > > Run the following command as you (not root, takes a > long time): > > CONFIGCOPY=x CONFIG=xconfig rpmbuild -ba > ../uml-custom.spec > > Install the new uml kernel you just made (as > root): > > rpm -Uvh /home/<your user > name>/rpm/RPMS/i386/UML-2.4.23.custom.1um-1.i386.rpm > > So in my case it was (as root): > > rpm -Uvh > /home/phillipd/rpm/RPMS/i386/UML-2.4.23.custom.1um-1.i386.rpm > > OK, that installed the UML kernel we will boot on > top of our host OS. > Dont do anything with it just yet though. We need > to patch and build > your host Kernel with the SKAS patch and add the > "tuntap" device module. > ----------------------------------------------------------------------------- > > 2) and 3) Patch our host machine with the SKAS patch > and add the tuntap > module: > > Grab a stock 2.4.23 Kernel from kernel.org or use > the command below: > > wget > http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.23.tar.bz2 > > unbzip and untar it: > > bzip2 -d linux-2.4.23.tar.bz2 > tar xvf linux-2.4.23.tar > > Grab the skas patch from: > http://aleron.dl.sourceforge.net/sourceforge/user-mode-linux/host-skas3.patch > > Become root (su)... > > Move the 2.4.23 source tree to /usr/src: > > mv linux-2.4.23 /usr/src > > cd /usr/src/linux-2.4.23 > > Save the host-skas3.patch here in > /usr/src/linux-2.4.23 > > cp $HOME/host-skas3.patch . > > Grab your old config file from your booted kernel: > > make oldconfig > > This deposits a ".config" file in your current > directory based on your > old kernel. > > Edit the new .config file and add SKAS to the end of > the EXTRAVERSION > line so it looks like this: > > EXTRAVERSION = SKAS > > Patch the kernel source: > > cat host-skas3.patch | patch -p1 > > Now run "make xconfig" and make sure that the > "tuntap" device is > selected as a module. When the Linux Kernel > Configuration GUI pops up, > click the "Network Device Support" button and click > the "M" gadget for > the "Universal TUN/TAP device driver support". Now > is a good time to > select any other options you want but I would really > limit the > === message truncated === ________________________________________________________________________ Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html |