Slax: how to build a new kernel?
How to build a new (new as in 188.8.131.52) 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.
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 (184.108.40.206) should work:
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.
Hint: open build.kernel and edit this line:
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
|All times are GMT -5. The time now is 12:52 PM.|