LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-15-2007, 03:51 AM   #1
xlq
Member
 
Registered: Feb 2007
Distribution: Slackware 12.0
Posts: 58

Rep: Reputation: 15
Slax: how to build a new kernel?


How to build a new (new as in 2.6.21.5) kernel for Slax 5.1.whatever, on a usb stick? I need this to get networking to work. There are tutorials for rebuilding the slax 2.6.16 series kernel, but not for a more up-to-date kernel.

I know I need squashfs and unionfs, but I'm not sure what else I need, and how to actually install it in the squashfs, initrd.gz etc.
 
Old 12-18-2007, 01:03 PM   #2
slak05
LQ Newbie
 
Registered: Sep 2006
Posts: 10

Rep: Reputation: 0
there are thousands of tutorials and howtos out there going over how to compile the kernel. No matter the distro, the kernel can always be compiled the same way. I've never used slax but this example (2.6.23.11) should work:

Code:
# wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.23.11.tar.bz2
# tar xvf linux-2.6.23.11.tar.bz2 -C /usr/src/
# cd /usr/src/linux-2.6.23.11
# make menuconfig
# make && make modules-install
# cp -v arch/i386/bzImage /boot/linux-2.6.23.11
# cp -v System.map /boot/System.map-2.6.23.11

make menuconfig is where you specify all your kernel build options that are placed in .config in the src root dir. Also I wrote that all on the top of my head so the paths to the kernel and map might be a little off. Make sure to update your grub/lilo/etc to utilize the new kernel.

Last edited by slak05; 12-18-2007 at 01:05 PM.
 
Old 12-20-2007, 11:50 AM   #3
vstoykov
LQ Newbie
 
Registered: Dec 2007
Location: Bulgaria
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
See this:
http://forums.remote-exploit.org/sho...7914&styleid=1

Hint: open build.kernel and edit this line:
Code:
VERSION=2.6.22.6

Last edited by vstoykov; 12-20-2007 at 11:53 AM.
 
Old 12-21-2007, 09:39 AM   #4
xlq
Member
 
Registered: Feb 2007
Distribution: Slackware 12.0
Posts: 58

Original Poster
Rep: Reputation: 15
Thanks, but the problem is not with building the kernel, but with building a kernel that can boot slax.

After some experimentation, I found this to work, if anyone else wants to know:

1. download and untar Linux, squashfs3.3, aufs
2. make squashfs3.3/squashfs-tools and install them (mksquashfs/unsquashfs) somewhere on the host system
3. "make distclean" the kernel source tree
4. apply the squashfs patch (use patch -Np1 < ...)
5. follow the aufs instructions (copy the fs/ and include/ directories into the Linux source tree and update various config files)
6. configure the kernel (don't forget to include squashfs and aufs, preferably built-in instead of as modules)
7. make the kernel
8. mount the slax iso and copy all the files so you can modify them
9. replace the vmlinuz with your new bzImage
10. take boot/initrd.gz and gunzip it. If you run "file" on it, you can see it is an ext2 filesystem. Mount it somewhere.
11. Remove the old modules in the initrd from lib/modules/xxx/ and install the new ones to this directory (you only need the modules required to boot - I started with Slackware's huge-smp configuration, so I needed only a blank modules.dep in this directory)
12. modify linuxrc to use 'aufs' instead of 'unionfs'
13. in the sample/ folder in the aufs source tree, there is a script called unionctl. Replace bin/unionctl in the initrd with this script.
14. unmount the initrd, recompress it with gzip -9 and put it back in the boot/ directory where it came from.
15. use unsquashfs to extract all the files from base/01_kernel.mo on the cd (the files go into squashfs-root)
16. remove all the kernel modules (lib/modules/xxx/) from the squashfs-root and install the new ones; in the Linux source tree use "make INSTALL_MOD_PATH=xxx modules_install" where xxx is the path of squashfs-root (NOT the path of squashfs-root/lib/modules/xxx/)
17. replace bin/mksquashfs and bin/unsquashfs with the new versions (come to think of it, the squashfs tools you built earlier might be linked against incompatible glibc versions; I was using Slackware so it worked fine for me)
18. delete the old 01_kernel.mo and run mksquashfs squashfs-root <path-to-cd-files>/base/01_kernel.mo
19. use mkisofs to make the new cd image, and hope it works
 
Old 01-23-2010, 12:01 PM   #5
lukas712
LQ Newbie
 
Registered: Jan 2010
Posts: 1

Rep: Reputation: 0
new kernel

Quote:
Originally Posted by xlq View Post
Thanks, but the problem is not with building the kernel, but with building a kernel that can boot slax.

After some experimentation, I found this to work, if anyone else wants to know:

1. download and untar Linux, squashfs3.3, aufs
2. make squashfs3.3/squashfs-tools and install them (mksquashfs/unsquashfs) somewhere on the host system
3. "make distclean" the kernel source tree
4. apply the squashfs patch (use patch -Np1 < ...)
5. follow the aufs instructions (copy the fs/ and include/ directories into the Linux source tree and update various config files)
6. configure the kernel (don't forget to include squashfs and aufs, preferably built-in instead of as modules)
7. make the kernel
8. mount the slax iso and copy all the files so you can modify them
9. replace the vmlinuz with your new bzImage
10. take boot/initrd.gz and gunzip it. If you run "file" on it, you can see it is an ext2 filesystem. Mount it somewhere.
11. Remove the old modules in the initrd from lib/modules/xxx/ and install the new ones to this directory (you only need the modules required to boot - I started with Slackware's huge-smp configuration, so I needed only a blank modules.dep in this directory)
12. modify linuxrc to use 'aufs' instead of 'unionfs'
13. in the sample/ folder in the aufs source tree, there is a script called unionctl. Replace bin/unionctl in the initrd with this script.
14. unmount the initrd, recompress it with gzip -9 and put it back in the boot/ directory where it came from.
15. use unsquashfs to extract all the files from base/01_kernel.mo on the cd (the files go into squashfs-root)
16. remove all the kernel modules (lib/modules/xxx/) from the squashfs-root and install the new ones; in the Linux source tree use "make INSTALL_MOD_PATH=xxx modules_install" where xxx is the path of squashfs-root (NOT the path of squashfs-root/lib/modules/xxx/)
17. replace bin/mksquashfs and bin/unsquashfs with the new versions (come to think of it, the squashfs tools you built earlier might be linked against incompatible glibc versions; I was using Slackware so it worked fine for me)
18. delete the old 01_kernel.mo and run mksquashfs squashfs-root <path-to-cd-files>/base/01_kernel.mo
19. use mkisofs to make the new cd image, and hope it works
Hi, please cau you upload the file 01_kernel.mo with updated kernel somewhere into net?
 
Old 01-23-2010, 12:19 PM   #6
SqdnGuns
Senior Member
 
Registered: Aug 2005
Location: Pensacola, FL
Distribution: Slackware64® Current & Arch
Posts: 1,092

Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by lukas712 View Post
Hi, please cau you upload the file 01_kernel.mo with updated kernel somewhere into net?
It was over 2 years ago..........(Dec 21st, 2007 10:39)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Which is the kernel build directory? I Can't find kernel build files crabsody Debian 7 01-09-2007 04:48 AM
LXer: Howto: build Linux kernel module against installed kernel w/o full kernel source tree LXer Syndicated Linux News 0 09-03-2006 08:21 PM
grub commands for slax /slax frodo Paridoth Linux - General 2 07-15-2006 11:05 PM
kernel-source-2.6.5-7.src.rpm requires kernel-dummy to build!? fizzdandantilus SUSE / openSUSE 5 12-02-2004 12:48 PM
New FAQ topic: Should I edit my kernel configuration?/Should I build a custom kernel? chort *BSD 10 09-10-2004 11:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration