VectorLinux
October 30, 2014, 02:45:59 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: Trying to compile modules  (Read 4671 times)
ted1959
Member
*
Posts: 9


« on: November 10, 2007, 07:07:36 pm »

I am trying to boot VectorLinux from an external usb drive. I have determined that the following modules need to be included in the initrd file:
ehci-hcd, usb-storage, scsi_mod, and sd_mod
The problem is that these modules are compiled into the kernel. When configuring the kernel with make menuconfig I can reset most of these to be built as modules. The scsi_mod (SCSI device support) howeveer won't let me select as a module. I know from looking at other distributions that scsi_mod can be built as a module. Does anyone know how to go about enabing it to be built as a module?

By the way, I'm using VL 5.9 RC1 with Linux 2.6.22.9
« Last Edit: November 10, 2007, 07:09:23 pm by ted1959 » Logged
MikeCindi
Tester
Vectorian
****
Posts: 1073


« Reply #1 on: November 10, 2007, 07:31:06 pm »

If you build the usb modules into the kernel then the scsi module will have to be built in as well since the usb module is dependant on the scsi. I suspect that you have some other options that are built into the kernel that also require scsi to built into the kernel. I believe that until all the modules that are dependant on scsi are deselected then you will not be able to deselect or modify scsi.
HTH,
Mike
« Last Edit: November 10, 2007, 07:36:45 pm by mikecindi » Logged

The plans of the diligent lead to profit...Pro. 21:5
VL64 7.1b3                                     RLU 486143
uelsk8s
Administrator
Vectorian
*****
Posts: 2504



« Reply #2 on: November 10, 2007, 09:03:14 pm »

ted1959,
If the modules you need are built in why would you need to put them in an initrd?

Isnt the whole reason for putting a module in an initrd so the kernel has access to those modules before it has access to the filesystem?

if the module was built in the kernel would have access to it.
Logged
saulgoode
Vectorite
***
Posts: 340



« Reply #3 on: November 10, 2007, 09:09:42 pm »

If they are included in the kernel, why do you need them available as modules?
Logged

A complex system that works is invariably found to have evolved from a simple system that works.
ted1959
Member
*
Posts: 9


« Reply #4 on: November 10, 2007, 09:53:08 pm »

If they are included in the kernel, why do you need them available as modules?

I don't really understand the boot process but apparently at the initial boot stage the kernel doesn't recognize the usb drive.
Here's a site that talks some about it:

http://www.linuxdevices.com/news/NS2850840818.html

IBM developerWorks has published a detailed technical article on booting Linux from external FireWire or USB drives, in conjunction with a boot floppy, USB storage device, internal drive partition, or another device recognized by the system BIOS. The article also explains basic bootloader concepts that may interest embedded Linux developers.

The second, preferred approach involves placing the kernel and an initrd filesystem image on a boot partition recognized by the BIOS. The kernel must support initrd images -- most do. The kernel boots, mounts the initrd image on a RAM disk as the temporary root filesystem, and executes the /linuxrc script that it contains. The script then attempts to load the kernel modules needed to support the device containing the real root filesystem (the external USB/FireWire drive), and attempts to create a device file for it. When the script exits, the kernel unmounts and destroys the temporary root filesystem and mounts the real root filesystem from the external drive before proceding to boot.
Logged
uelsk8s
Administrator
Vectorian
*****
Posts: 2504



« Reply #5 on: November 10, 2007, 10:55:56 pm »

ted1959,
if all the modules you need are built in you Dont need an initrd.
I thought we had everything built into the kenel to support booting from a usb device. That does not mean we do for sure.
Do you get an error when booting the USB drive?

Uelsk8s
Logged
stoichyu
Packager
Vectorite
****
Posts: 369



« Reply #6 on: November 11, 2007, 01:09:03 am »

I think you should look at Slax and the linux-live scripts if you want to make vectorlinux bootable from a usb drive. Or you may want to check out the VL livecd, which is also based on linux-live. The process detailed in the article is how the linux-live scripts work.

http://www.linux-live.org/
http://www.slax.org
Logged

There's no place like ~.
VL 5.8 PentiumD 2.8Ghz Registered Linux User #432836
ted1959
Member
*
Posts: 9


« Reply #7 on: November 11, 2007, 04:14:45 pm »

ted1959,
if all the modules you need are built in you Dont need an initrd.
I thought we had everything built into the kenel to support booting from a usb device. That does not mean we do for sure.
Do you get an error when booting the USB drive?

Uelsk8s

Yes I do get an error when trying to boot from the external usb drive. I have VL installed on partition 6 on the external drive(sda6)
Here is the error:

VFS: Cannot open root device "sda6" or unknown-block(0,0)

Please append a correct "root=" boot option; here are the available partitions:
0300 195360984 hda drive: ide-disk
0301  hda1
0302  hda2
0303  hda3
0305  hda5
0306  hda6
0307  hda7
0308  hda8
0309  hda9
030a  hda10
030b  hda11

1600 hdc driver: ide-cdrom
1640 hdd driver: ide-cdrom
Kernel panic: Unable to mount root fs on unknown-block(0,0)

Here is the section from my menu.lst file for VL:
# VectorLinux
title           VectorLinux, kernel 2.6.22.9
root            (hd1,0)
kernel          /VectorLinuxBoot/vmlinuz-2.6.22.9 root=/dev/sda6
#initrd         /VectorLinuxBoot/initrd

I also have Ubuntu installed on the external drive so I had already set up a boot partition(sda1). I made a subdirectory which has the contents of VL's boot directory.
I tried booting VL with and without the initrd section and still get the same results.
I copied over the contents of sda6 where I had installed VL over to the hda11 partition on the internal ide drive and was able to boot up VL without any problem. The menu.lst entry for this was:

title           VectorLinux, kernel 2.6.22.9
root            (hd1,0)
kernel          /VectorLinuxBoot/vmlinuz-2.6.22.9 root=/dev/hda11
initrd         /VectorLinuxBoot/initrd

Once it was booted up and running it recognizes the external usb drive as well.
So all I can see is that it looks like it isn't seeing the external usb drive when it's booting up; but if I switch root over to hda11 then once booted up it does recognize the external drive.

Also I am booting from the internal drive which has a boot partition(hda2) of it's own which has the menu.lst file from above. I have another Linux distro installed on it as well.
« Last Edit: November 11, 2007, 04:38:34 pm by ted1959 » Logged
ted1959
Member
*
Posts: 9


« Reply #8 on: November 11, 2007, 06:30:52 pm »

I finally got it to work!!!
After reading this: http://www.ibm.com/developerworks/linux/library/l-fireboot.html?ca=dgr-lnxw09FireBoot
article on booting Linux off of an external firewire or usb drive I see that the author was doing something pretty similar to what I was trying to do.
In method 2 he already had all the modules compiled into the kernel just as VL does. He uses a custom initrd file. The problem ened up being that there needs to be a certain delay in order for the SCSI bus to be scanned and the root device to be found.

Also my partitioning sceme is a little more complicated than usual. I had at one time been booting Ubuntu directly off the external usb drive(set the BIOS to boot off the external drive first). I created a /boot partition on the external drive for that purpose. I finally switched back to booting off of the internal ide drive and I had also installed Kubuntu on it as well so I created a /boot partition on it as well.
So now if I'm booting up Kubuntu on the internal drive the vmlinuz kernel file for it is in /dev/hda2 and if I'm booting up either Ubuntu or VectorLinux the vmlinuz kernel files for these are at /dev/sda1. The menu.lst file that is used is in /dev/hda2/grub.

I booted up VL which I had installed on my internal ide drive(on /dev/hda11). After booted up I then did the following:
1. cd /boot
2. As root: mkinitrd -c -k 2.6.22.9
3. This creates a file named initrd.gz which is the compressed version of the directory "initrd-tree" which is also created.
4. cd /boot/initrd-tree
5. Edit the file "rootdev" and change "/dev/hda11" to "/dev/sda6"         (/dev/sda6 is the external usb drive partition that I want VL to reside on)
6. Edit the file "wait-for-root" and change the value "1" to "10"            This gives 10 seconds for the usb drive to become available.
7. cd /boot
8. As root: mkinitrd                     (No options, this compresses the initrd-tree directory into the file initrd.gz file)
9. I then copied the initrd.gz file over to my boot partition /media/sda1/VectorLinux
10. I then edited my menu.lst file which is located on the internal ide drive in hda2
     Here is the VectorLinux entry:

# VectorLinux
title           VectorLinux, kernel 2.6.22.9
root            (hd1,0)
kernel          /VectorLinuxBoot/vmlinuz-2.6.22.9 root=/dev/sda6
initrd          /VectorLinuxBoot/initrd.gz

After saving the menu.lst file I shutdown VL which was running from /dev/hda11.
Once my grub menu came back up I selected VL again and this time it booted right up from the external usb drive!

So it looks like my first approach to trying to compile modules was totally unnecessary as they were already in the kernel. All that was needed was a new initrd file with an extra delay added.
Logged
uelsk8s
Administrator
Vectorian
*****
Posts: 2504



« Reply #9 on: November 11, 2007, 06:44:43 pm »

ted1959,
Im glad you figured this out. I just found the ibm site and was going to point you at it when you posted.

Uelsk8s
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!