[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can't boot 2.6.?? kernels - Acer TravelMate 4651LMi



Richard Mittendorfer said...
> Also sprach marc <gmane@auxbuss.com> (Mon, 3 Oct 2005 22:35:08 +0100):
> > Either way, it looks like I'll have to compile the kernel. How does one 
> > go about creating a kernel that doesn't require an initrd? I understand 
> > the ideas, but not the execution. Reading links will be fine, thanks :-)
> 
> google will sure give some info - anyway, for short: 
> 
> get latest linux-source- .deb and "kernel-package"; the c-compiler and
> other necessary stuff will hopefully be dependencies or suggested by
> the source-.deb.
> 
> cd /usr/src
> tar -jxf linux-source-...bz2 or 
> tar -zxf linux-source-...gz
> [unpack the source...]
> 
> cd linux-source
> make menuconfig (if this fails, you'll need ncurses-dev)
> [configure...]
> Be sure to know what kind of hardware is in your laptop. (Hint: lspci
> -v, the manual). Necessary things (like filesystem) must not be build as
> module since the kernel has to boot without an initrd (where these
> modules live with precompiled kernels). If you're unsure build as
> module - these should get loaded with hotplug or can be loaded
> in /etc/modules at startup. Maybe you can find a ready to use .config
> for your laptop somewhere on the net (quick google: tuxmobile.org ,
> www.linux-laptops.net , http://bram.be/travelmate_4651lci.html ,
> http://people.freenet.de/renmi/acer4652.html (german)). Your
> current .config resides in /boot/config-[version]
> 
> # make-kpkg --revision=yours.001 kernel_image
> [compile...]
> 
> # dpkg -i ../linux(or kernel)-image-..-yours.001-...
> [install...]
> grub should get updated by dpkg -i (?), lilo may need some modifications
> in /etc/lilo.conf to point to the new vmlinuz in /boot.
> 
> # reboot
> [use...]
> 
> If you forgot something or made a bobo, boot the old kernel and
> # make-kpkg clean
> # make-kpkg --revision=yours.002 kernel_image

Success!

In the end, the fix - to boot the machine with a 2.6.12 kernel and see 
the CD drive - only requires two steps. 

1. To boot the machine with the regular Debian 2.6.12 kernel package, 
change the grub kernel line to point to /dev/sda3 rather than /dev/hdc3, 
and add pci=noacpi 

2. In addition, to see the CD drive, a kernel compile is required. This 
requires the following one-line change to the file 
include/linux/libata.h:

#undef ATA_ENABLE_ATAPI /* define to enable ATAPI support */
to
#define ATA_ENABLE_ATAPI /* define to enable ATAPI support */ 

That's it.


Notes:

1(a): Any disk mounts defined in /etc/fstab that reference /dev/hdc will 
need to be adjusted to /dev/sda

1(b): pci-noacpi is preferable to apic=off, because it does not 
deactivate the hardware switches for the wireless NIC and Bluetooth.

1(c): An examination of dmesg, after booting, will show a lot of IRQ-
related messages. These can be removed by adding pci=usepirqmask to the 
grub kernel line. The boot process will also be much faster.

1(d): If you've been using the 2.4 kernel and/or Knoppix (installed), 
say, then this change will fix the very slow hard disk access you've 
been experiencing. There is a huge difference in overall performance.

1(e): Other packages might be affected by the /dev/sda change, where 
they have embedded /dev/hdc into their configuration.

1(f): The installation and removal of kernel packages will cause an 
regeneration of /boot/grub/menu.lst, so you might like to save your 
working grub stanza outside the automagic kernel list, to save having to 
edit it each time.

1(g): If you've not applied the changes noted in step (2), then you can 
see that your CD drive is unrecognised via:
# cat /proc/sys/dev/cdrom/info


2(a): To perform the compile you need a kernel config file. You can grab 
this from /boot/config-2.6.12-1-686 after installing the package: linux-
image-2.6.12-1-686

Start by installing the Debian package linux-source-2.6.12. This unpacks 
the file: /usr/src/linux-source-2.6.12.tar.bz2

Unpack this file with:
# tar xjf * or # tar xjf linux-source-2.6.12.tar.bz2

Then edit /usr/src/linux-source-2.6.12/include/linux/libata.h:
#undef ATA_ENABLE_ATAPI /* define to enable ATAPI support */
to
#define ATA_ENABLE_ATAPI /* define to enable ATAPI support */ 

... and save it.

Now copy /boot/config-2.6.12-1-686 to /usr/src/linux-source-
2.6.12/.config. There's no need to change this file in any way (or send 
it through menuconfig)

We can now compile the kernel as detailed in Richard's post above
# make-kpkg --revision=yours.001 kernel_image
[compile...]
# dpkg -I ../kernel-image-2.6.12_yours.001_i386.deb
[install...] Note that this creates a grub entry, which you will need to 
edit in the next step.

Using the kernel config from the Debian package means that an initrd 
will be required at boot time. Create this by:
# cd /boot
# mkinitrd -o /boot/initrd.img-2.6.12 2.6.12

Now, edit /boot/grub/menu.lst to include all the changes noted in step 
(1) - i.e. pci=noacpi, etc. - and add an initrd line to the newly 
created stanza for your new kernel:
kernel	/boot/initrd.img-2.6.12

You can reboot at this point.

2(b): During reboot, you should hear the reassuring sound of you CD 
drive being accessed. You can check its assignment (sr0, probably) via:
# cat /proc/sys/dev/cdrom/info

2(c): You'll probably want to add a line, similar to the following, to 
/etc/fstab
/dev/sr0 /media/cdrom0 iso9660 ro,user,noauto 0 0
You can also use /dev/scd0/

-- 
Best,
Marc



Reply to: