Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.