LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices


Reply
  Search this Thread
Old 07-09-2004, 04:52 AM   #1
turtlespit
LQ Newbie
 
Registered: Jul 2004
Location: London, England
Posts: 4

Rep: Reputation: 0
Compiling custom Kernel from install cd


I have an IBM Thinkpad laptop, that I'm trying to get slackware 10 up and running on. Since I use Windows XP for work, I've attempted to install slackware 10 on an externel USB2.0 connected HDD.

Upon installation cd, the USB HDD was successful connected to /dev/sd1, and I was able to do the installation without any problems.

Of course, booting the newly installed system is a different issue. None of the prebuilt slackware kernels have USB mass storage support compiled in (I thought the zipslack kernel might work, but that failed as well).

I realise I need to build my own kernel, but at the moment, this is the only PC I have access to.

Essentially my questions are:
- Is it possible to compile a custom kernel whilst running from the install cd? (after booting the install cd, I've mounted the install partition to /cdrom/live - since the path's are set there by default - but make config dies very quickly)

OR

- Does anybody know of where I can find a prebuilt kernel with USB mass support compiled in? (I've tried googling without success...)

OR

- Are there any other solutions that I haven't thought of?

Any suggestion greatly appreciated!

cheers,
Michael
 
Old 07-09-2004, 05:52 AM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Welcome to LQ!

I installed Slack 10.0 with the bare.i kernel and it gave me usb mass storage
right off the bat. Issue
bash-2.05b$ cat /boot/config-ide-2.4.26 | less
and look through that file.

I have 2 usb gas drives (which are lappy drives) and a flash disk. All were
immediately recognized by Slack.

I think the problem may be that you can't mount the device in that stage
of the bootstrap?

You can compile a kernel on another computer and have it on medium ready
to install when Slack asks you which kernel you want to use during it's installation.
Where you compile it doesn't matter, so long as you've got the file available.

Probably not a lot of help, but I hope it gets you thinking some more...
 
Old 07-09-2004, 06:05 AM   #3
turtlespit
LQ Newbie
 
Registered: Jul 2004
Location: London, England
Posts: 4

Original Poster
Rep: Reputation: 0
Hi Chinaman,

Thanks for the reply. You're right - bare.i gives me USB mass storage as a module, so I was able to install slackware. My issue is that without USB mass storage compiled into the kernel, I can't boot (kernel panic since it can't find /dev/sda).

Because my laptop is the only system I have available to me, I'm in a catch 22 situtation. I need to boot linux to compile a kernel, but I need to compile a kernel to boot linux...

cheers,
Michael
 
Old 07-09-2004, 06:13 AM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
You want I should email you my .config file, then you can edit it and burn
it to your CD? I guess that would work, eh? Then you'd be able to load
that kernel in the Slack install when you get to choose.

Edit: You can edit the actual file in Notepad, WordPad, etc.

Last edited by Bruce Hill; 07-09-2004 at 06:15 AM.
 
Old 01-01-2005, 04:03 AM   #5
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 900

Rep: Reputation: 153Reputation: 153
Hi

Got the same issue as turtlespit. Wondering if any progress was made.

I'm probably in a better position as I have a desktop with Slack10 with which I can compile a kernel. Don't know what options to go with.

My external harddrive is an Archos MiniHD USB 2.0.

I work away from home a lot and use Knoppix with a 1 GB USB pen which is becoming full. So If I can't boot directly from the MiniHD I will use it in conjunction with Knoppix.

Best wishes for the New Year.
 
Old 01-01-2005, 12:20 PM   #6
turtlespit
LQ Newbie
 
Registered: Jul 2004
Location: London, England
Posts: 4

Original Poster
Rep: Reputation: 0
Hi aikempshall,

I haven't worked on this for a while, as I need to reorg the contents of my USB cased hard disk, and set up a partition to reattempt this.

I have obtained the latest version of the Slax live cd (see slax.linux-live.org) with development tools (gcc, etc) so I hope to be able to compile a custom kernel using that.

Happy new year to all.

warm regards,
Turtlespit
 
Old 01-01-2005, 01:29 PM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Use the zipslack kernel or boot image.
 
Old 01-02-2005, 06:38 AM   #8
turtlespit
LQ Newbie
 
Registered: Jul 2004
Location: London, England
Posts: 4

Original Poster
Rep: Reputation: 0
gnasley,

I can't be completely sure, but I think I tried the zipslack kernel and it didn't work.

I will try this again though.

cheers,
Turtlespit
 
Old 01-03-2005, 02:51 AM   #9
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
2 ways I can think off the top of my head to get this working.

1) Use a custom initrd to load the USB modules for you.

You'd build the initrd, place it in your /boot directory and make lilo aware of it. This same process is used for booting from SCSI hard drives sometimes. The bootloader would load this initrd as / and then execute whatever is needed to get your models loaded and then switch / to the USB drive. The problem is that you'll need a working linux installation to build the initrd, unless you can find one somewhere.

2) Download one of Live CDs like Knoppix, DamnSmallLinux, or possibly even one of the many Rescue CDs out there that has a toolchain. I believe there is one that trys to mimic Slackware also, so that one may be the best "fit" for the task. I forget the name though. Use the tools on the LiveCD to set up your paritions, format them and etc. Then mount the disk, download the kernel source to it, set it up and build your custom kernel. You'd just need to manipulate the Slackware installation a bit taking care not to overwrite your kernel and etc. You'd want to rebuild the kernel in Slackware when you got it going, so I'd probably keep it as simple as possible and use a barebones non-modular kernel to get it going.

Also, there is a CD available for Linux From Scratch 6.0 at http://mirrors.angelinacounty.net/lfs-boot-cd/ that is just 354mb. It will have a complete toolchain with everything you'd need. That may be your best bet as far as download size goes.

Last edited by DaHammer; 01-03-2005 at 03:02 AM.
 
Old 01-03-2005, 04:38 AM   #10
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 900

Rep: Reputation: 153Reputation: 153
Thanks for the replies.

I'm concentrating on option 1 fro DaHammer. Picked up some clues from various other sources.

Now have an initrd.gz sitting in /boot of /dev/sda1. However I can't get the boot process to pick it up. Looking at README.initrd on the installation disks it says once the initrd.gz is made amend the /etc/lilo.conf and run lilo.

This is where I'm stuck. The only way into /dev/sda1 is by mounting it whilst running slackware on my desktop or using the slackware installation disk 1 or the rescue disk 2.

With the installation disk I ran setup again without reformatting and skipping package loading. Used the simple lilo creation but that overwrote my lilo.conf. Used the expert but couldn't find a way of including the initrd.gz or writing the image to a floppy disk.

Tried to do the lilo manually as suggested in README.initrd but couldn't find a way to write it to a floppy. I'm not a lilo person and use GRUB on my desktop. Tried using a GRUB boot disk that refused to start pointing to (sd0,0).

Any suggestions of how I can get LILO to write to a floppy.


Thanks
 
Old 01-03-2005, 12:06 PM   #11
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
The initrd can't be on sda -that's what you nned the modules for. Put the initrd on a floppy or other hard drive which the kernek can access.
 
Old 01-03-2005, 12:30 PM   #12
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 900

Rep: Reputation: 153Reputation: 153
I've got a little closer using a CD to boot with ISOLINUX.

Did a mkinitrd -c -k 2.4.26 -m jbd:ext3 -f ext3 -r /dev/sda1

moved

uhci.o.gz usbcore.o.gz usb-storage.o.gz

into the /boot/initrd-tree/lib/modules/2.4.26

Amended load_kernel_modules to

insmod /lib/modules/$(uname -r)/jbd.o.gz
insmod /lib/modules/$(uname -r)/ext3.o.gz
insmod /lib/modules/$(uname -r)/usb-storage.o.gz
insmod /lib/modules/$(uname -r)/uhci.o.gz
insmod /lib/modules/$(uname -r)/usbcore.o.gz

Amended linuxrc to include a few sleeps.

Ran mkinitrd.

Moved the contents of the boot directory including the initrd.gz to a tmp directory called isolinux ran -
mkisofs -o archos.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table isolinux

cdrecord to create the CD

Booted from the CD. Picked up the initrd.gz. Bombed out on each and every file in modules directory saying something like "not an ELF file". At least I now have a mechanism to work with!

Googled it and can't find anything meaningful on it

Thanks
 
Old 01-03-2005, 01:19 PM   #13
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
You will need to decompress the modules before loading them. And why are you loading an ext3 modules? I'd think that ext3 filesystem support would be built into all of the Slackware kernels. I checked bare.i, if that's the one you are using and both ext3 and debugging support (jbd) are built in.

Last edited by DaHammer; 01-03-2005 at 02:14 PM.
 
Old 01-03-2005, 02:10 PM   #14
aikempshall
Member
 
Registered: Nov 2003
Location: Bristol, Britain
Distribution: Slackware
Posts: 900

Rep: Reputation: 153Reputation: 153
No.

I followed the example from README.initrd.

The initial mkinitrd populated /boot/initrd-tree/lib/modules/2.4.26 with

jbd.o.gz and ext3.o.gz

and created a load_kernel_modules with

insmod /lib/modules/$(uname -r)/jbd.o.gz
insmod /lib/modules/$(uname -r)/ext3.o.gz

I then improvised with uhci.o.gz usbcore.o.gz usb-storage.o.gz following the example of jbd and ext3.

Regards
 
Old 01-03-2005, 02:25 PM   #15
DaHammer
Member
 
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Hehe, I edited my post while you were posting your reply. :D

Anyway, I took a look at the initrd tree that mkinitrd from Slackware creates. There is no mechanism in it to decompress the modules that I see. You must be running "mkinitrd" from a bootdisk, on which modules would be gzipp'ed in order to save space, which is a good idea. But I suspect mkinitrd was never intended to be ran from a bootdisk and just blindly copies the gzipp'ed modules into the tree and adds the the insmod lines for them with the .gz. insmod is not capable of decompressing them first, hince why you get the non-elf error. You'll need to add code to decompress them to the "load_kernel_modules" script before loading them.

Try adding a gzip -d line for them, ie:

gzip -d /lib/modules/$(uname -r)/usb-storage.o.gz
gzip -d /lib/modules/$(uname -r)/uhci.o.gz
gzip -d /lib/modules/$(uname -r)/usbcore.o.gz

Also as mentioned above, I find it odd that the ext3 & jbd modules are present. If they aren't then mkinitrd should error when you run it. Either way, i doubt you need those, even though the example in the initrd.README has them. They should be compiled into the kernel your using.

BTW, the "-m" option to mkinitrd specifies which modules you want.
Code:
Usage: mkinitrd [OPTION]

mkinitrd creates an initial ramdisk used to load kernel modules that
are needed to mount the root filesystem, or other modules that might
be needed before the root filesystem is available.

  -c      Clear the existing initrd tree first
  -f      Filesystem to use for root partition (must be used with -r)
  --help  Display this message
  -k      Kernel version to use
  -m      A colon (:) delimited list of kernel modules to load.
          Additional options may be added to use when loading the
          kernel modules (but in this case the entire list must be
          wrapped with double quotes).
  -o      Output image (default /boot/initrd.gz)
  -r      Root partition device (must be used with -f)
  -s      Initrd source tree (default /boot/initrd-tree/)
  -V      Display version number

A simple example:  Build an initrd for a reiserfs root partition:

  mkinitrd -c -m reiserfs

Another example:  Build an initrd image using Linux 2.6.7 kernel
modules for a system with an ext3 root partition on /dev/hdb3:

  mkinitrd -c -k 2.6.7 -m jbd:ext3 -f ext3 -r /dev/hdb3

If run without options, mkinitrd will rebuild an initrd image using
the contents of the $SOURCE_TREE directory, or, if that directory
does not exist it will be created and populated, and then mkinitrd
will exit.

Last edited by DaHammer; 01-03-2005 at 02:29 PM.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
trouble compiling modules against custom fedora core 4 kernel blahJake Linux - Software 6 12-16-2006 06:54 AM
Problem Compiling Custom Kernel E Pierce Debian 9 08-09-2005 04:48 AM
compiling a custom kernel in 9.3 dvm SUSE / openSUSE 12 07-10-2005 07:57 AM
compiling iptables into custom kernel straxus Linux - Newbie 1 03-26-2005 10:32 PM
Errors compiling custom kernel tron_thomas Linux - General 4 09-03-2004 11:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation

All times are GMT -5. The time now is 08:59 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