LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Installing Slackware on a custom kernel (https://www.linuxquestions.org/questions/slackware-14/installing-slackware-on-a-custom-kernel-444333/)

hsimah 05-13-2006 03:04 AM

Installing Slackware on a custom kernel
 
I have a very lean kernel on my desktop slackware computer (yeah, I'm proud of it). I installed it all onto one partition, and I am going to reinstall it with a better partitioning system, and I was wondering if it is possible to install Slackware using my current kernel? I am guessing I could just keep my .config file and copy it into the source directory after installing and then recompile that, but I thought this way would be cooler, if it is possible.

cwwilson721 05-13-2006 02:02 PM

You SHOULD be able to add it to the /kernels folder on your slackware install , reimage the iso and burn again. Not sure if there is a list where you can add it in to the list of kernels tho....From what I can figure out, just mkdir /kernel/kernel.i or whatever you wanna name it, copy in the bzImage, config, and System.map, and it SHOULD show as a installable kernel.

Let us know if it works...If it does, you should be able to make the source as a package, and add that in too.

I'm VERY interested in this. If it works for you, I'll try it too. (Why I don't do it first: I only have three blank cd-r disks right now....lol)

hsimah 05-13-2006 05:42 PM

Right, well I am going to work for about 3 hours today (Sunday, bleh :() when I get home I will try it. I mean, whats the worst that can happen? Another coaster?

cwwilson721 05-13-2006 05:45 PM

True. You can then mail it to AOL here in the States. Maybe they'll get the hint....

Old_Fogie 05-13-2006 08:47 PM

LOL AOL coaster, I have a ton of em' here too.

Hey if you get that working how to use a custom kernel at install can you post how you did it? I'd really be interested how that is done PLEASE pretty PLEASE :D

Fogie

cwwilson721 05-13-2006 08:53 PM

Hey, If the OP does not, I'll track 'em down and bludgeon 'em across the torso with a bag of AOL disks.....

Actually, I'm working on doing that(making the custom install cd/kernel) right now...Got some more blanks. Now, if my cd drivr stays working (Been burning only half a disk lately, no matter what os I use...Might have to burn it on the wife's XP box ....shudder...)

cwwilson721 05-14-2006 04:54 AM

I thought of a smallish issue....No modules for the custom kernel....
Might be able to copy them from /lib/kernel

Also, may need headers. From where, I do not know. I look more into this as it goes...

hsimah 05-14-2006 07:32 AM

Yeah I just dumped the files and burnt. Didnt work, coaster #1.

Reburn, this time with the whole current directory (I know I could do it over the network, but I am not sure how) that I use. ie no KDE or emacs etc. This didnt boot. I forgot to make it a bootable cd! Coaster #2... or is it? I booted from my slack cd and did a swap at the prompt. It worked! Everything ran and installed perfectly. So I rebooted. No text after lilo. I don't know what happened here to be honest. I did a blind log in and started XFCE, that brought my monitor to life, just no CLI at boot.

I fiddled with that for a while, even compiled the kernel again via SSH. Still nothing. This is the same kernel that worked before this reinstall, so who knows. So I just reinstalled with my normal slack cd and am compiling my custom kernel from my .config file. I happened to get my hands on an old P3 system which I'll pick up on Wednesday, and which will become my test system for getting this to work I think. It will be interesting

cwwilson, I just wanna be sure before I try again, how would I burn a bootable slack disk?

jimX86 05-14-2006 08:02 AM

This looks interesting. Just a couple thoughts, I've never actually done this...

I don't think you need to fuss with the kernel headers. I think you just need the kernel headers for the kernel version used to build glibc.

hsimah... to burn a bootable CD, there's a README on the first install disk at /isolinux/README.TXT.

cwwilson721 05-14-2006 08:13 PM

I used a mirror script to make the mirror and the ISO's for current. The only issue is that it would remove my "additions" before it would make the iso.

So I added a few lines in to add the files back before it made the iso....And it worked. Unfortunately, I have only one blank cd right now. I'll burn cd1 and see if it lets me start the process and install the custum kernel at the end of the install. (can do the rest later). At least it will let me kow if the kernel would work.

If it's successfull, I'll post a step by step here, maybe even a mini HOW-TO.

hsimah 05-14-2006 10:02 PM

Cool, I hope it works :D.

I am having a weird problem with my install of slack on my desktop. I copied the .config file out of my /usr/src/linux directory (2.4.31 kernel) and reinstalled with the default options from my 10.2 CDs. My ethernet card decided it didnt want to work, but I eventually fixed that by using DHCP instead of static IP address (I do like my IP's static though). Then I did a make mrproper in the source directory and copied in my .config and did make menuconfig, it seemed to be the same (I'd assume it should be) as before my reinstall, so I compiled it (make dep, make clean, make bzImage, make, make install, make modules, make modules_install) and rebooted. Now I get an error at startup with regards to agpgart... I have no idea why it is not working this time! I think I'll jsut format and reinstall again, with the a new slack CD, mines several months old now and fairly scratched.

rkelsen 05-14-2006 11:15 PM

Quote:

Originally Posted by hsimah
I was wondering if it is possible to install Slackware using my current kernel?

Why do you want to do this? I usually install Slackware using the stock kernel, then copy my custom kernel across.

Never had a problem doing things this way.

I've found it handy to make a CD containing my custom kernel (including System.map, config, modules and source tree) and complete copies of my /etc & /var directories.

cwwilson721 05-14-2006 11:26 PM

Mostly, because it's an interesting project. Better than sleeping....

rkelsen 05-14-2006 11:44 PM

Quote:

Originally Posted by cwwilson721
Mostly, because it's an interesting project. Better than sleeping....

Yes, but it would become redundant as soon as the installation is finished. Time better spent sleeping, IMO... :D

jimX86 05-15-2006 06:49 PM

Quote:

Originally Posted by rkelsen
Why do you want to do this?

Because it's there?

To become one with the system?

Seriously, I do a pretty lean install on my laptop, and I'm reckless with experimenting on it. I always burn an install disk with custom tagfiles anyway, so that I can easily reinstall. I might as well toss my own kernel on there too. I'll give it a try after the next release. (cwwilson... if you get there first, I would be interested in knowing what you did.)

cwwilson721 05-15-2006 08:54 PM

So far, I've made coasters....Dang cdrw drive...Well, it is 7 years old...lol

I will outline what I did when I successfully complete it....

cwwilson721 05-16-2006 03:40 PM

I did done did it!
 
Give me a bit to write up how I did it. I'm getting old and creaky here, and the brain doesn't work as fast as it used to.

But It DOES install your custom kernel right off the bat.

You do have to install sources, modules later, just like test26.s. But I'll have everything outlined in the article.

cwwilson721 05-16-2006 04:39 PM

Not For Newbies!!!!!!!!!
 
NOT FOR NEWBIES!!!!!

Here's how I did it:

1: Make sure your custom kernel has the cdrom filesystem and ext2 options COMPILED IN. (Or you'll get the dreaded VFS: Kernel Panic error).

2: Make a /saved directory:
Code:

mkdir /saved
cd to it, and make a directory with a name of 'custom.i'
Code:

cd /saved
mkdir custom.i

If it's a scsi kernel, use '.s' instead. Mine is and IDE one, so I'm going to stick to that.

3: Make sure you have 'checkinstall' installed on your system. If not, you can install it from the 'extras' directory that will be made later.

4: Get this file: http://www.slackware.com/~alien/tools/mirror-slackware-current.sh Edit it to your specs, and add in the 'forced' option so it always makes an iso, then save it. I put it in /sbin, then make it executable.

5: Run 'mirror.sh'. Burn a copy of the resultant iso's to make sure everything works.

6: Go to your kernel source directory, i.e. /usr/src/linux (I always symlink linux to my current kernel). Run 'makepkg' to make a 'source' package. Name it something with 'source' in the filename, and save it to /saved.

7: Stay in /usr/src/linux, and run 'checkinstall', saving the resultant file with 'kernel' in the name, and in /saved again

8: Copy your vmlinuz, config, and System.map to /saved/custom.i . Compress your System.map to a .gz file, and delete the System.map file. Rename the files so they are 'bzImage','config' and 'System.map.gz'

9: Go to /lib/modules/name-of-kernel and run 'makepkg' with 'module' in name, and save it to /saved

10: Go to your 'slackware-current' dir. 'cd' to 'isolinux', and open the 'isolinux.cfg' file. Add in the 'custom.i' kernel. Here's mine as an example:
Code:

default /kernels/bare.i/bzImage initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=bare.i
prompt 1
timeout 1200
display message.txt
F1 message.txt
F2 f2.txt
F3 f3.txt
label linux
  kernel /kernels/bare.i/bzImage
  append -
label adaptec.s
  kernel /kernels/adaptec.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=adaptec.s
label ataraid.i
  kernel /kernels/ataraid.i/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=ataraid.i
label bare.i
  kernel /kernels/bare.i/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=bare.i
label bareacpi.i
  kernel /kernels/bareacpi.i/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=bareacpi.i
label custom.i
  kernel /kernels/custom.i/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=custom.i
label ibmmca.s
  kernel /kernels/ibmmca.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=ibmmca.s
label jfs.s
  kernel /kernels/jfs.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=jfs.s
label old_cd.i
  kernel /kernels/old_cd.i/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=old_cd.i
label pportide.i
  kernel /kernels/pportide.i/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=pportide.i
label raid.s
  kernel /kernels/raid.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=raid.s
label sata.i
  kernel /kernels/sata.i/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=sata.i
label scsi.s
  kernel /kernels/scsi.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=scsi.s
label scsi2.s
  kernel /kernels/scsi2.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=scsi2.s
label scsi3.s
  kernel /kernels/scsi3.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=scsi3.s
label speakup.s
  kernel /kernels/speakup.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=speakup.s
label test26.s
  kernel /kernels/test26.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=test26.s
label xfs.s
  kernel /kernels/xfs.s/bzImage
  append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=6464 rw root=/dev/ram SLACK_KERNEL=xfs.s

Save as isolinux.cfg in your /saved folder

11: Open edit the 'f3.txt' file, and add in your 'custom.i' kernel info, and save to /saved

12: Go to your 'mirror.sh', and edit that. Find the following lines:
Code:

  cd ${SLACKROOTDIR}/${SLACKCURRENT}
  umask 022

  # USe '-rlptD' instead of '-a' so that we don't preserve file ownership -
  # so that we can switch mirrors and still all files will be owned root:root.
  /usr/bin/rsync --delete -z -rlptD $VERBOSE \
      --exclude "pasture/*" \
      ${RSYNCURL}/ .

  # Actually, run rsync again, since it happens that we hit the master server
  # while it is still sync-ing itself.
  /usr/bin/rsync --delete -z -rlptD $VERBOSE \
      --exclude "pasture/*" \
      ${RSYNCURL}/ .

  echo "`date` [$$]: Done mirroring ${SLACKCURRENT} (exit code $?)."

And add in the follwing right after (substituting correct paths for slackware-current and /saved and file names for packages)):
Code:

mv /saved/isolinux.cfg /slackware-current/isolinux/isolinux.cfg
mv /saved/custom.i /slackware-current/kernels/
mkdir /slackware-current/test/packages/linux-2.6.17-rc3
mv /saved/kernel-package.tgz /slackware-current/testing/packages/linux-2.6.17-rc3/kernel-package.tgz
mv /saved/kernel-source-package.tgz /slackware-current/testing/packages/linux-2.6.17-rc3/kernel-source-package.tgz
mv /saved/kernel-modules-package.tgz /slackware-current/testing/packages/linux-2.6.17-rc3/kernel-modules-package.tgz
rm /slackware-current/isolinux/isolinux.cfg
cp isolinux.cfg /slackware-current/isolinux/isolinux.cfg
rm /slackware-current/isolinux/f3.txt
cp /saved/f3.txt /slackware-current/isolinux/f3.txt

echo " Tranferred your new stuff to the slackware-current directory"

13: Backup your /saved directory Just in case, it makes it ALOT easier to restore the files to /saved), and run 'mirror.sh' again, burn the new install cds and check it out....

Now, I haven't done a full install again yet, just the beginning part to see if the custom.i kernel loads, and it does.

After install is over, and you rebooted, go to 'testing', and installpkg on all your new kernel packages.

Hope this helps. I am now going to 'recompile' my bloody kernel again, and do the same process, including a fresh install....

My next post on this thread should be with the new custom.i kernel installed by the installer....

jimX86 05-16-2006 07:37 PM

Whoa. Man, once you've started on something, you don't let go, do you? Nice work.

One trivial suggestion... and I hope this isn't annoying after all the heavy lifting you did to solve this. Since you built packages for the modules and source, you could move them to the appropriate disk sets and add the package name to the tagfiles. That way the install disk will do the work instead of installing them by hand afterwards.

I appreciate your taking the time to write this up. I'm definitely doing this for 11.0.

cwwilson721 05-16-2006 07:41 PM

I was limted to the 'mirror.sh' and rsync. When mirror.sh runs, rsync erases everything that is not on the 'master' mirror....And for whatever reason, I couldn't write a script that would do what I wanted, so...

It works. A little kludgy, but it works. It's installing right now on my spare, so I'll let you know.

cwwilson721 05-16-2006 09:10 PM

Dang it. Forgot to have ext2 support compiled.

Once more into the breech (At least I'm using rw disks...Third time's the charm...)

cwwilson721 05-17-2006 02:22 AM

OK. It works. I need to work on the kernel-modules and source, but it DOES install the custom kernel.

Unfortunately it does not work correctly if you START with the custom kernel and try to install over the network (no module for the ethernet card.) Minor inconvenience, I just booted with the test26.s, at the end installed the custom.i, extracted the modules to the correct place, extracted the source also, and here I am.

Anybody know how to get the packages (module,source) to auto-install/extract to the correct directories? I haven't looked into makepkg or checkinstall much. I could just be missing a switch or something.

Plus, for whatever reason, 'testing' did not burn to my 2 cd's. Any help?


All times are GMT -5. The time now is 05:44 AM.