WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TCL, CF-to-ZIF & extlinux  (Read 4358 times)

Offline sm8ps

  • Sr. Member
  • ****
  • Posts: 338
TCL, CF-to-ZIF & extlinux
« on: November 03, 2010, 04:55:47 PM »
Hello all!
My fruitless tries of installing Tinycore Linux have got me almost despairing! I have searched the internet up and down and always end up turning in circles. Any help or pointer to the right direction would be highly appreciated.
My rig is a bit non-standard in that it uses a CF-to-ZIF adapter which seemingly necessitates the usage of extlinux as only boot loader capable of handling such. (I explained this finding at length here
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/477430/comments/17 and
http://forum.ubuntuusers.de/topic/grub-bootet-nicht-von-cf-karte-acer-aspire-on/#post-2520362)
Installing TCL should be a breeze, I thought. That was long time ago, though, and I still cannot boot into TCL as of today. Here is a list of my partitions from cfdisk:
Code: [Select]
sda1              Primäre     Linux ext3                [HOME]     2582.74
sda2              Primäre     Linux ext2                [TCL]           213.86
sda3              Primäre     Linux ext2                [TCL2]         345.47
sda5  Boot     Logische    Linux ext3                [ROOT]      7336.95
                     Logische    Freier Bereich                             3964.59
sda6              Logische    Linux Swap / Solaris                  1571.03
Here is my extlinux.conf:
Code: [Select]
prompt 1
TIMEOUT 20
DEFAULT ubuntu104

DISPLAY extlinux.txt

LABEL ubuntu104
  KERNEL /boot/vmlinuz-2.6.32-24-generic
  APPEND initrd=/boot/initrd.img-2.6.32-24-generic root=UUID=322df84a-2013-4da4-84de-8b2509cc2edc ro splash pciehp.pciehp_force=1 elavator=noop quiet splash enable_mtrr_cleanup --

LABEL ubuntu104R
  KERNEL /boot/vmlinuz-2.6.32-24-generic
  APPEND initrd=/boot/initrd.img-2.6.32-24-generic root=UUID=322df84a-2013-4da4-84de-8b2509cc2edc ro single splash --

LABEL tcl
COM32 chain.c32
APPEND hd0 2
A couple of remarks to that: Ubuntu boots perfectly fine from sda5 which is referred to by UUID here.
You may wonder why I have extlinux chain load to partition sda2. Without that, my file system on sda5 gets mess up badly and needs to be checked when booting Ubuntu. (Needless to say that TCL does not boot from sda5 either. It crashes with the same kernel panic, cf. below)
Extlinux is configured the following way on sda2:
Code: [Select]
prompt 1
TIMEOUT 20
DEFAULT tcl

LABEL tcl
  kernel /bzImage
  initrd /tinycore.gz
  APPEND ide_core.nodma=0.0 --
This is the best I have been able to do but the booting ends in a kernel panic of which I have attached a screen shot. I had been worried about sda3 being mentioned but having the tinycore files located there or not does not make any difference. Ditto for the nodma-option being present or not. I have also filmed the full boot process but cannot recognize anything bad happening.

It seems to me as if the initial ram disk does not provide tinycore with the necessary tools for dealing with the CF-to-ZIF adapter set-up. Can anybody share some insight?

St. Mueller, Switzerland

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: TCL, CF-to-ZIF & extlinux
« Reply #1 on: November 03, 2010, 05:46:17 PM »
Not that I'd really fully understand your setup, but looking at your screenie, something is obviously wrong.

The kernel seems to mount root on sda3, which appears to be an ext4 fs but gets mounted as ext2 fs(without journal)...

This does not resemble default TC behaviour.

If you want to persist on trying to boot with extlinux, I'd suggest you consult documentation of syslinux and possibly visit the #syslinux channel on irc.freenode.net

Otherwise you might consider alternative methods of booting.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: TCL, CF-to-ZIF & extlinux
« Reply #2 on: November 04, 2010, 04:07:37 AM »
The initrd does not get loaded, your syntax in the later extlinux conf file isn't quite right.

Comparing to the above conf file, the initrd statement should be on the APPEND= line, not by itself.
The only barriers that can stop you are the ones you create yourself.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: TCL, CF-to-ZIF & extlinux
« Reply #3 on: November 04, 2010, 04:46:18 AM »
I had totally overlooked that, in fact it should be
Code: [Select]
APPEND initrd=tinycore.gz
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: TCL, CF-to-ZIF & extlinux
« Reply #4 on: November 04, 2010, 06:48:39 AM »
I've been trying to re-create the situation using QEMU and a (virtual) disk in which I've created two (primary) partitions:
Code: [Select]
tc@box:~$ fdisk -l /dev/hda
Disk /dev/hda: 31 MB, 31457280 bytes
1 heads, 63 sectors/track, 975 cylinders
Units = cylinders of 63 * 512 = 32256 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/hda1   *           2          64        1984+ 83 Linux
/dev/hda2              65         975       28696+ 83 Linux
The first partition (in an attempt to be similar to 'sda5') has just EXTLINUX installed,
Code: [Select]
tc@box:~$ mount /dev/hda1
tc@box:~$ ls -l /mnt/hda1
total 67
-rw-r--r--    1 root     root         19552 Jul 14 16:42 chain.c32
-rw-r--r--    1 root     root            78 Nov  4 07:53 extlinux.conf
-r--r--r--    1 root     root         32768 Nov  4 07:33 ldlinux.sys
drwx------    2 root     root         12288 Nov  4 07:32 lost+found/
and the following 'extlinux.conf':
Code: [Select]
tc@box:~$ cat /mnt/hda1/extlinux.conf
prompt 1
TIMEOUT 20
DEFAULT tcl
LABEL tcl
  COM32 chain.c32
  APPEND hd0 2
The second one (in an attempt to be similar to 'sda2') contains EXTLINUX, the kernel and the inird
Code: [Select]
tc@box:~$ mount /dev/hda2
tc@box:~$ ls -l /mnt/hda2
total 10503
-r--r--r--    1 root     root       2294848 May 13 01:43 bzImage
-rw-r--r--    1 root     root           129 Nov  4 08:06 extlinux.conf
-r--r--r--    1 root     root         32768 Nov  4 07:33 ldlinux.sys
drwx------    2 root     root         12288 Nov  4 07:32 lost+found/
-r--r--r--    1 root     root       8367526 Oct 12 14:15 tinycore.gz
plus the following 'extlinux.conf':
Code: [Select]
tc@box:~$ cat /mnt/hda2/extlinux.conf
prompt 1
TIMEOUT 20
DEFAULT tcl
LABEL tcl
  kernel /bzImage
  initrd /tinycore.gz
  APPEND ide_core.nodma=0.0 --

My problem is that I can't find an issue: The first EXTLINUX starts (via 'chain.32') the second EXTLINUX which boots TC just fine. The fact that all goes well seems to disproof the theory that 'append initrd=tinycore.gz' should be used instead of 'initrd /tinycore.gz'

A couple of thoughts / questions:
(1) What version of EXTLINUX is installed on 'sda5' and 'sda2'? In my testing I was using v4.01 (from the TC 3.x repository).

(2) What is the purpose of 'sda2' vs. 'sda3'? I assume that 'sda2' holds EXTLINUX, the kernel and the inird, but what is meant to be on 'sda3'? I hope there are no duplicates to the files of 'sda2' as that might cloud the issue a bit.

(3) Has that system been booted successfully with TC from CD-ROM (or bootable USB pendrive)? It might be possible to isolate problems of the boot loader and / or the non-standard disk this way. Is it possible to mount all filesystems from the disk when the disk is not involved in booting TC?

(4) Is the initrd still the original one, or has it been remastered? Just before Curaga wrote reply #2 I discovered that one gets a fairly similar kernel panic when no initrd is present (eg. via qemu -kernel bzImage).

(5) Are you sure that the boot code is really 'ide_core.nodma' and not 'ide-core.nodma'? Looking at the kernel documentation (i.e. 'Documentation/kernel-parameters.txt') one gets the impression that it should be a hyphen and not an underscore. OTOH in a different file (i.e. 'Documentation/ide/ide.txt') the underscore is in use.

(6) Would it be possible to get a slightly larger screenshot? I guess if one would use boot code 'vga=ask' (and select something like 80x60) more lines before the kernel panic could be shown.

(7) I also don't agree that there is a confusion about the filesystem type of 'sda3'. TC uses a kernel build with the following options:
Code: [Select]
# CONFIG_EXT2_FS is not set
# CONFIG_EXT3_FS is not set
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT23=y
AFAIK that means that the EXT-4 driver will take care of EXT2 (and EXT3) filesystems. I therefore believe that the 'mounted file system without journal' message indicates that an EXT2 filesystem was found.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: TCL, CF-to-ZIF & extlinux
« Reply #5 on: November 04, 2010, 12:46:52 PM »
(3) Has that system been booted successfully with TC from CD-ROM (or bootable USB pendrive)? It might be possible to isolate problems of the boot loader and / or the non-standard disk this way. Is it possible to mount all filesystems from the disk when the disk is not involved in booting TC?

or netboot (with pxelinux). That would also have been what I would have suggested next.

Quote
(7) I also don't agree that there is a confusion about the filesystem type of 'sda3'. TC uses a kernel build with the following options:
Code: [Select]
# CONFIG_EXT2_FS is not set
# CONFIG_EXT3_FS is not set
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT23=y
AFAIK that means that the EXT-4 driver will take care of EXT2 (and EXT3) filesystems. I therefore believe that the 'mounted file system without journal' message indicates that an EXT2 filesystem was found.

Not disagreeing, I was unaware of that.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline sm8ps

  • Sr. Member
  • ****
  • Posts: 338
Re: TCL, CF-to-ZIF & extlinux
« Reply #6 on: November 04, 2010, 08:42:20 PM »
Thank you all so much for your consideration and effort! Your input is highly appreciated and motivated me to give it another try.
In order to simplify matters I tried to isolate the problem from the various partitions (sda2, sda3) used. So I copied the tinycore files into /boot/ on sda5 and worked only with that partition. Knowing that Ubuntu boots fine, I adapted extlinux.conf to
Code: [Select]
prompt 1
TIMEOUT 20
DEFAULT ubuntu104

DISPLAY extlinux.txt

LABEL ubuntu104
  KERNEL /boot/vmlinuz-2.6.32-24-generic
  APPEND initrd=/boot/initrd.img-2.6.32-24-generic root=UUID=322df84a-2013-4da4-84de-8b2509cc2edc ro splash pciehp.pciehp_force=1 elavator=noop quiet splash enable_mtrr_cleanup --

LABEL ubuntu104R
  KERNEL /boot/vmlinuz-2.6.32-24-generic
  APPEND initrd=/boot/initrd.img-2.6.32-24-generic root=UUID=322df84a-2013-4da4-84de-8b2509cc2edc ro single splash --

LABEL tcl
  KERNEL /boot/bzImage
  APPEND initrd=/boot/tinycore.gz root=UUID=322df84a-2013-4da4-84de-8b2509cc2edc base --

Extlinux 3.63 (from Ubuntu 10.4) shows /boot/bzImage as well as /boot/tinycore.gz loading but ends up with "Boot failed: please change disks and press a key to continue."
Extlinux 4.01 (from tinycore 3.2 live-USB) loads the same -- although much more slowly -- but throws EDD: Error 0a00 reading sector 8289660 as well as two more sectors. This happens even after the file system has been checked by use of e2fsck -pf.
Some additional information:
  • Tinycore boots fine from a USB stick.
  • Kernel as well as initrd come straight from the ISO-image whose md5sum has been verified.
I must admit that I am quite at loss facing all this. So again, any insight would be highly appreciated!
Cheers!
St. Mueller, Switzerland

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: TCL, CF-to-ZIF & extlinux
« Reply #7 on: November 04, 2010, 08:54:05 PM »
Quick note of the top of my head: Don't use boot code 'root=...' with TC (unless IIRC in case of a "scatter installation", which you currently are not attempting and is actually not a supported mode).

TC uses a RAM based root file system (using the initrd and installed extensions), so with this boot code you are somewhat creating a hybrid of the TC kernel and the TC initrd, but also the Ubuntu 'root' filesystem. I'd say with this "mix": all bets are off!!


Edit: OTOH what would make sense is to create a '/tce' directory (e.g. in 'sda5') and then use boot code 'tce=UUID=...' to guide TC to use it for extentions (and the backup file).
« Last Edit: November 04, 2010, 08:57:22 PM by maro »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: TCL, CF-to-ZIF & extlinux
« Reply #8 on: November 05, 2010, 08:01:36 AM »
Check the md5sums of the two extracted TC files on the drive. Even if the ext2 fs is fine, the device itself might have some corrupt blocks.
The only barriers that can stop you are the ones you create yourself.

Offline sm8ps

  • Sr. Member
  • ****
  • Posts: 338
Re: TCL, CF-to-ZIF & extlinux
« Reply #9 on: November 07, 2010, 01:27:14 PM »
Hello all!
Thank you very much for all the joint input! It has pushed my investigations further. As of now, I suspect some hardware error are incompatibility to be the cause of trouble. I did try a different CF-card (different brand, only 2GB size) that I had lying aroung and Tinycore did boot without any problem at all under extlinux. I did also check the md5-sums without noticing any difference.
I might have had the idea to start trouble-shooting at the obvious end but really had been on a wrong track because the fact that I had a OS booting and working fine seemed to exclude the hardware issue. It was only after forum member SvOlli pointed at his own work using GRUB4DOS that the boot-loader itself handed out I/O-errors (http://forum.tinycorelinux.net/index.php?topic=7120.0).
I am still a bit uncertain about what my findings do mean. Is it the CF-card itself that has bad sectors just where Tinycore lies? (How can the md5-sums be equal then?!) Is it the type/brand of card that does not play well with Tinycore? Can there be other reasons that I am over-looking?
BTW: I did try puting tinycore.gz and byImage right under boot and had a simplistic extlinux.cfg as follows
Code: [Select]
LABEL tcl
  KERNEL /boot/bzImage
  APPEND initrd=/boot/tinycore base --
which loads bzImage as well as tinycore.gz but throws a list of "EDD: Error 0a00 reading sector ###" that keeps growing over many more minutes.
After all, I simply want to have a functional Tinycore Linux on my machine together with a functional Ubuntu installation. -- So my quest is going on. Thanks to your joint input I have not yet given up.

Cheers!
St. Mueller, Switzerland
« Last Edit: November 07, 2010, 01:41:21 PM by sm8ps »

Offline sm8ps

  • Sr. Member
  • ****
  • Posts: 338
Re: TCL, CF-to-ZIF & extlinux
« Reply #10 on: November 07, 2010, 04:38:46 PM »
HURRAY!!! After literally months of trying and hours spent/lost, Tinycore finally is running on my machine. You know how happy I am if you have fiddled around with stubborn installations on halfway functional hardware mods.
My thanks go to the forum members posting answers in this thread that in their broadness opened my eyes to the now seemingly obvious. Indeed, the zif-cable had been slightly pushing out of the zif-connector. (I still do not understand why Ubuntu would boot then but I presume that question is just beyond my reach.) I had not noticed this until the glued-on cf-adapter ceased to stick and came off which made that fault visible. Attaching the zif-cable properly allowed Tinycore to boot without a glitch and all is well now.
I am one happy Tinycore fellow now, too!
Cheers!
St. Mueller, Switzerland