Re: [solved] Re: Unable to boot into CompactFlash card - card not found by initrd (BIOS does not support CF booting)

2012-01-23 Thread Scott Ferguson
On 23/01/12 22:37, Michael Lange wrote:
> Hi again,
> 
> I could hardly believe it myself, but I actually got it working now,


Glad to hear it, and congratulations!
(CF boot space, the final frontier?)


If you wanted to boot different CF cards you could possible compile
those modules as GRUB modules, add them to GRUB, then insmod them as
part of the CF card menu entry. Only worth it if you had a few different
CF cards and didn't want to modify the initrd for them (if you also used
them on other machines which BIOS supported CF booting)




> Michael
> 

Thanks for posting the method you used, I'm sure it will prove useful to
others.


Cheers.

-- 
Iceweasel/Firefox extensions for finding answers to Debian questions:-
https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/

NOTE: new update available for Debian Buttons
(New button for querying Debian Developer Package):-
https://addons.mozilla.org/en-US/firefox/addon/debian-buttons/


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f1d4c5b.1020...@gmail.com



[solved] Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-23 Thread Michael Lange
Hi again,

I could hardly believe it myself, but I actually got it working now,
finally the patch from the Puppy linux forum did it!

It took me a while to figure out how to use it; because of my
limited shell scripting capabilities I had to remove the smart automagic
that checks for all available pcmcia sockets (I only have socket 0
anyway), and there seems to be a syntax incompatibility that prevents it
from working with /bin/sh here on my squeeze system, but it works
with /bin/bash (and I had always thought these were the same, but now
I've learned that /bin/sh actually points to /bin/dash ;) and it works
with the /bin/sh in the initrd, too. I then did some experimenting and
found that a more elegant solution than putting the code into the
initrd's init is to put it in a separate file
/etc/initramfs-tools/scripts/init-premount/pcmcia-socket-startup.sh
which now looks like:


#!/bin/sh

print_irq_mask() {
  local digits="0123456789abcdef" i=$1 s=""
  while [ ${#s} -lt 4 ]; do
s=`expr substr $digits $(($i%16+1)) 1`$s
let i=$i/16
  done
  echo -n 0x$s
}

pcmcia_socket_startup() {
  local i j path mask
  i=`expr "$1" : '\([0-9]*\)'`
  if [ "$i" ]; then
let j=i
  else
let i=0 j=9
  fi
  while [ $i -le $j ]; do
path=/sys/class/pcmcia_socket/pcmcia_socket$i
if [ -f $path/available_resources_setup_done ]; then
  echo -n "0x0100 - 0x03af" >$path/available_resources_io
  echo -n "0x03e0 - 0x04ff" >$path/available_resources_io
  echo -n "0x0820 - 0x08ff" >$path/available_resources_io
  echo -n "0x0a00 - 0x0aff" >$path/available_resources_io
  echo -n "0x0c00 - 0x0cff" >$path/available_resources_io
  echo -n "0x000c - 0x000f" >$path/available_resources_mem
  echo -n "0x6000 - 0x60ff" >$path/available_resources_mem
  echo -n "0xa000 - 0xa0ff" >$path/available_resources_mem
  mask=`cat $path/card_irq_mask` # read old irq mask
  mask=$(( mask & ~( (1<<4) | (1<<7) ) )) # exclude irq 4,7
  print_irq_mask $mask >$path/card_irq_mask  # write new irq mask
  echo -n 42 >$path/available_resources_setup_done
fi
let i++
  done
}

pcmcia_socket_startup 0

###

This and the necessary modules added to /etc/initramfs-tools/modules (I
added ide_cs, ide_gd_mod, pcmcia, pcmcia_core and yenta_socket, maybe not
all were actually necessary, but they don't cost much ;) was all I had to
do in the end, then run update-initramfs and the resulting initrd is able
to recognize and mount the CF card partition as root file system
(update-initramfs again outputs an error message because of the file's
syntax, but it seems that this can be safely ignored).

Debian apparently does more or less the same as the above script with a
utility "pcmcia_socket_startup" that comes with udev and is run by udev
after / has been mounted; I had already tried before to run this utility
from within the initrd, but it just failed silently without telling me
why, and I could not find any usage information on it, so maybe it
requires something it does not find in the initrd or it needs a special
cli syntax that only udev knows ;)

> 
> I suspect you are correct - I'm beginning to suspect you have a 16-bit
> PCMCIA bus which would complicate things (and I don't know much about
> them, or self-mutilation)

I think you are right pccardctl status says

3.3V 16-bit PC Card

Maybe this explains why, as I now found, the CF card is slow as hell, it
actually seems to be much slower now than running the system from an USB
flash drive, and I/O operations seem to cause a considerable CPU load :(
Anyway, in cases when I want to use it, speed is not much of an issue, so
I will give it a try anyway, and if I later find that the USB drive wins,
then at least I have learned something ;)

> 
> > I still believe that it might have to do with the CF card being
> > marked as "removable" and the way udev handles these devices, however
> > I don't have a "fixed" card at hand to verify this. In fact I am not
> > even sure that it is "removable"; thunar shows it as removable
> > device, however udevadm info says ATTR{removable}=="0" . Hmmm...
> 
> Perhaps, I wouldn't put too much stock in udev (it's like Wikipedia).

Anyway, now it seems that apparently the problem had nothing to do with
the card being "removable" or not.

Thanks for all your help, and best regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Madness has no purpose.  Or reason.  But it may have a goal.
-- Spock, "The Alternative Factor", stardate 3088.7


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120123123713.e646fef5.klappn...@freenet.de



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-22 Thread Scott Ferguson
On 22/01/12 23:51, Michael Lange wrote:
> Hi,
> 
> Thus spoketh Scott Ferguson  
> unto us on Sun, 22 Jan 2012 18:03:25 +1100:
> 


> 
>> What is the output from:-
>> grub> lsmod
> 
> More than fits on the screen, is there something particular I should look
> for?

Sorry, I overlooked that:-
grub> set pager=1

That's the equivalent of using "more"

> 
> Thanks and regards
> 
> Michael
> 
> 

Cheers

-- 
Iceweasel/Firefox extensions for finding answers to Debian questions:-
https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/

NOTE: new update available for Debian Buttons
(New button for querying Debian Developer Package):-
https://addons.mozilla.org/en-US/firefox/addon/debian-buttons/


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f1cc2c8.4070...@gmail.com



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-22 Thread Scott Ferguson
On 22/01/12 23:51, Michael Lange wrote:
> Hi,
> 
> Thus spoketh Scott Ferguson  
> unto us on Sun, 22 Jan 2012 18:03:25 +1100:
> 
> (...)
>>
>> Your laptop [*1] doesn't appear to have BIOS support for booting from
>> the CF card.
>> Having had the time to do a little Googling (about 10 minutes) there are
>> three possible routes (maybe more).
>> 1. Boot from GRUB installed on hdd, using kernel and initrd copied from
>> CF card install. Known to work[*2]
> 
> That is what I am trying, however when the kernel tries to mount the root
> file system, it is unable to find the CF card. And this is the part which
> I cannot believe that it can't be fixed.

I suspect you are correct - I'm beginning to suspect you have a 16-bit
PCMCIA bus which would complicate things (and I don't know much about
them, or self-mutilation)

> I still believe that it might have to do with the CF card being marked as
> "removable" and the way udev handles these devices, however I don't have a
> "fixed" card at hand to verify this. In fact I am not even sure that it is
> "removable"; thunar shows it as removable device, however udevadm info
> says ATTR{removable}=="0" . Hmmm...

Perhaps, I wouldn't put too much stock in udev (it's like Wikipedia).

> 
>> 2. Boot from GRUB installed on the hdd, using kernel and initrd on the
>> CF card. Should be possible.[*3]
> 
> Does not work, because grub does not find the CF card.

Hence my request for the output of:-
grub> lspci
:-)



>>
>> [*2]
>> http://www.murga-linux.com/puppy/viewtopic.php?t=34290&sid=524430a36bb34681698429cdd8f16b0c
> 
> This looks interesting, I will have a closer look at it and see if there
> is something I can try, one of these days. At a quick glance it looks
> like they needed to patch the initrd's init script, maybe I could try to
> adapt this.
> 



>>
>> What is the output from:-
>> grub> lspci
> 
> Basically the same as when being called from the running system, except
> that the "SD Host Controller" appears as "System Hardware".

Could you take a picture of the actual output, post it somewhere, and
post a link?

..or type in the information.

Also the lspci from a Live CD (if possible).
If it's lengthy put the info on paste.debian.net

> 
>> What is the output from:-
>> grub> lsmod
> 
> More than fits on the screen, is there something particular I should look
> for?

I don't know what modules are loaded by your system, so I don't know
what capabilities your GRUB has.

If you look at /boot/grub/grub.cfg you'll see modules loaded (insmod).
/boot/grub/command.lst will show you what commands are available to
GRUB. The starred entries to the left of the : are the commands, to the
right of the : are the modules they come from.
Adding further modules is simple, building new modules is slightly less
so. If a capability is missing from your kernel, and not supplied as a
module in your initrd it may be possible to add it as a GRUB modules.

I'd need to know your PCMCIA hardware to know more.

> 
> Thanks and regards
> 
> Michael
> 



Cheers (thanks for your patience)

-- 
Iceweasel/Firefox extensions for finding answers to Debian questions:-
https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/

NOTE: new update available for Debian Buttons
(New button for querying Debian Developer Package):-
https://addons.mozilla.org/en-US/firefox/addon/debian-buttons/


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f1cadfe.8030...@gmail.com



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-22 Thread Brian
On Sun 22 Jan 2012 at 13:51:11 +0100, Michael Lange wrote:

> Thus spoketh Scott Ferguson  
> unto us on Sun, 22 Jan 2012 18:03:25 +1100:
> 
> (...)
> > 
> > Your laptop [*1] doesn't appear to have BIOS support for booting from
> > the CF card.
> > Having had the time to do a little Googling (about 10 minutes) there are
> > three possible routes (maybe more).
> > 1. Boot from GRUB installed on hdd, using kernel and initrd copied from
> > CF card install. Known to work[*2]
> 
> That is what I am trying, however when the kernel tries to mount the root
> file system, it is unable to find the CF card. And this is the part which
> I cannot believe that it can't be fixed.

Considering the Linux PCMCIA HOWTO from 2003 talks about booting using
initrd it would appear capable of a solution.

I have a machine with a BIOS which cannot boot from USB, a situation not
too dissimilar from yours. So I constructed a new Wheezy initrd containing
the USB drivers and used it and the kernel to make an iso file. The file
was put in /boot and /etc/grub.d/40_custom had

   menuentry "usbBOOT" {
   set isofile="/boot/usb-boot.iso"
   loopback loop $isofile
   linux (loop)/boot/vmlinuz-3.1.0-1-686-pae root=LABEL=USBSTICK
   initrd (loop)/boot/initrd.img-3.1.0-1-686-pae
   }

added to it. update-grub was ran.

Selecting usbBOOT boots straight into the OS on USBTICK.







-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2012013313.GJ17235@desktop



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-22 Thread Dom

On 22/01/12 12:51, Michael Lange wrote:

Hi,

Thus spoketh Scott Ferguson
unto us on Sun, 22 Jan 2012 18:03:25 +1100:

(...)


Your laptop [*1] doesn't appear to have BIOS support for booting from
the CF card.
Having had the time to do a little Googling (about 10 minutes) there are
three possible routes (maybe more).
1. Boot from GRUB installed on hdd, using kernel and initrd copied from
CF card install. Known to work[*2]


That is what I am trying, however when the kernel tries to mount the root
file system, it is unable to find the CF card. And this is the part which
I cannot believe that it can't be fixed.
I still believe that it might have to do with the CF card being marked as
"removable" and the way udev handles these devices, however I don't have a
"fixed" card at hand to verify this. In fact I am not even sure that it is
"removable"; thunar shows it as removable device, however udevadm info
says ATTR{removable}=="0" . Hmmm...


I'm sure you should be able to do this. I have done something similar in 
the past.



3. Boot from GRUB installed on the hdd, using plopkexec[*4] to boot the
kernel and initrd on the CF card. 'Might'[*5] be possible.


The CF slot is actualy pcmcia, not USB.


The situation I had was that I had an external SATA disk attached via a 
PCMCIA/Cardbus card which held the root filesystem and was not 
recognised by the BIOS. I put grub and the /boot partition on a CF card 
attached to the internal PATA/IDE connector. The system booted using 
grub on the CF card, then loaded the initrd which enabled the 
PCMCIA/Cardbus card, found the external disk and then mounted it as the 
root filesystem.


Does your initrd contain the right modules to pick up your PCMCIA bus 
and the CF card? (sorry if you've already mentioned those details, I may 
have missed them).


I think I may be able to test a setup similar to yours, as I have a 
CF/PCMCIA adaptor and an old laptop and internal harddisk. If I can find 
a spare CF card with enough capacity, and time to try it, I'll have a go.

--
Dom


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4f1c8387.5000...@rpdom.net



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-22 Thread Michael Lange
Hi,

Thus spoketh Scott Ferguson  
unto us on Sun, 22 Jan 2012 18:03:25 +1100:

(...)
> 
> Your laptop [*1] doesn't appear to have BIOS support for booting from
> the CF card.
> Having had the time to do a little Googling (about 10 minutes) there are
> three possible routes (maybe more).
> 1. Boot from GRUB installed on hdd, using kernel and initrd copied from
> CF card install. Known to work[*2]

That is what I am trying, however when the kernel tries to mount the root
file system, it is unable to find the CF card. And this is the part which
I cannot believe that it can't be fixed.
I still believe that it might have to do with the CF card being marked as
"removable" and the way udev handles these devices, however I don't have a
"fixed" card at hand to verify this. In fact I am not even sure that it is
"removable"; thunar shows it as removable device, however udevadm info
says ATTR{removable}=="0" . Hmmm...

> 2. Boot from GRUB installed on the hdd, using kernel and initrd on the
> CF card. Should be possible.[*3]

Does not work, because grub does not find the CF card.

> 3. Boot from GRUB installed on the hdd, using plopkexec[*4] to boot the
> kernel and initrd on the CF card. 'Might'[*5] be possible.

The CF slot is actualy pcmcia, not USB.

> 
> [*1]"Dell Latitude" X1 A.K.A. "Samsung Q30".
> I don't have access to this device, and haven't taken the time to check,
> so I'm guessing about the lack of BIOS support for booting from the CF
> card. These things can be less than obvious - Windoof can mark a CF card
> RO which can render it unbootable, some BIOS require USB legacy keyboard
> support enabled before being able to boot USB devices - some PCMIA buses
> use 16-bit drivers which would possibly require GRUB to use Linux16.
> 
> Have you checked for BIOS updates?

Yes, the latest BIOS is installed.

> 
> [*2]
> http://www.murga-linux.com/puppy/viewtopic.php?t=34290&sid=524430a36bb34681698429cdd8f16b0c

This looks interesting, I will have a closer look at it and see if there
is something I can try, one of these days. At a quick glance it looks
like they needed to patch the initrd's init script, maybe I could try to
adapt this.

> 
> [*3]From the GRUB cli, what is the output from:-
> grub> ls

Shows the internal HDD's partitions.

> 
> What is the output from:-
> grub> lspci

Basically the same as when being called from the running system, except
that the "SD Host Controller" appears as "System Hardware".

> What is the output from:-
> grub> lsmod

More than fits on the screen, is there something particular I should look
for?

Thanks and regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Prepare for tomorrow -- get ready.
-- Edith Keeler, "The City On the Edge of Forever",
   stardate unknown


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120122135111.6149d216.klappn...@freenet.de



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-21 Thread Scott Ferguson
On 20/01/12 20:59, Michael Lange wrote:
> Thus spoketh Scott Ferguson  
> unto us on Fri, 20 Jan 2012 20:47:38 +1100:
> 
>> On 20/01/12 20:19, Michael Lange wrote:
> (...)



>>
> 
> That is interesting, I didn't know that, but how does grub then know about
> the device when the BIOS doesn't? 

In general it doesn't - it either uses devicemap, or it's own biosdisk
module to generate a devicemap on the fly. But it (GRUB2) is very
powerful, and extendible (and scriptable).

> 
> Regards
> 
> Michael
> 


Your laptop [*1] doesn't appear to have BIOS support for booting from
the CF card.
Having had the time to do a little Googling (about 10 minutes) there are
three possible routes (maybe more).
1. Boot from GRUB installed on hdd, using kernel and initrd copied from
CF card install. Known to work[*2]
2. Boot from GRUB installed on the hdd, using kernel and initrd on the
CF card. Should be possible.[*3]
3. Boot from GRUB installed on the hdd, using plopkexec[*4] to boot the
kernel and initrd on the CF card. 'Might'[*5] be possible.

[*1]"Dell Latitude" X1 A.K.A. "Samsung Q30".
I don't have access to this device, and haven't taken the time to check,
so I'm guessing about the lack of BIOS support for booting from the CF
card. These things can be less than obvious - Windoof can mark a CF card
RO which can render it unbootable, some BIOS require USB legacy keyboard
support enabled before being able to boot USB devices - some PCMIA buses
use 16-bit drivers which would possibly require GRUB to use Linux16.

Have you checked for BIOS updates?

[*2]http://www.murga-linux.com/puppy/viewtopic.php?t=34290&sid=524430a36bb34681698429cdd8f16b0c

[*3]From the GRUB cli, what is the output from:-
grub> ls

What is the output from:-
grub> lspci

If you get nothing, or an error, try again after running:-
grub> insmod lspci

What is the output from:-
grub> lsmod

If you get nothing, or an error, try again after running:-
grub> insmod lsmod


[*4]http://www.plop.at/en/plopkexec.html

[*5]If your CF card uses an USB bus instead of PCMCIA.



Cheers

-- 
Iceweasel/Firefox extensions for finding answers to Debian questions:-
https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/

NOTE: new update available for Debian Buttons
(New button for querying Debian Developer Package):-
https://addons.mozilla.org/en-US/firefox/addon/debian-buttons/


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f1bb4bd.1040...@gmail.com



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-20 Thread Michael Lange
Thus spoketh Scott Ferguson  
unto us on Fri, 20 Jan 2012 20:47:38 +1100:

> On 20/01/12 20:19, Michael Lange wrote:
(...)
> > 
> > I wrote that the the BIOS doesn't know about the CF card, so I
> > thought it is obvious that grub won't know about it either ;)
> 
> That's incorrect - the BIOS doesn't have any bearing on whether GRUB can
> boot a device.
> 

That is interesting, I didn't know that, but how does grub then know about
the device when the BIOS doesn't? 

Regards

Michael



.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Is not that the nature of men and women -- that the pleasure is in the
learning of each other?
-- Natira, the High Priestess of Yonada, "For the World is
   Hollow and I Have Touched the Sky", stardate 5476.3.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120120105916.fafbc746.klappn...@freenet.de



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-20 Thread Scott Ferguson
On 20/01/12 20:19, Michael Lange wrote:
> Hi,
> 
> Thus spoketh Brian  
> unto us on Thu, 19 Jan 2012 21:01:56 +:
> 
>> On Thu 19 Jan 2012 at 20:52:23 +0100, Michael Lange wrote:
>>
>>> So I think what i would need is a way to start at least one of these
>>> hotplug events, the one that installs the CF card, from within the
>>> initrd, *before* it tries to mount / from a device which has not yet
>>> been initialized.
>>
>> You didn't respond to my final two questions, Contrary to my usual
>> practice I'll provide their probable outcomes. 'ls -l' would not have
>> shown the CF card. 'search --label CFCARD' would have said 'no such
>> device'.
> 
> I wrote that the the BIOS doesn't know about the CF card, so I thought it
> is obvious that grub won't know about it either ;)

That's incorrect - the BIOS doesn't have any bearing on whether GRUB can
boot a device.




Cheers

-- 
Iceweasel/Firefox extensions for finding answers to Debian questions:-
https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f19383a.1090...@gmail.com



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-20 Thread Michael Lange
Hi,

Thus spoketh Brian  
unto us on Thu, 19 Jan 2012 21:01:56 +:

> On Thu 19 Jan 2012 at 20:52:23 +0100, Michael Lange wrote:
> 
> > So I think what i would need is a way to start at least one of these
> > hotplug events, the one that installs the CF card, from within the
> > initrd, *before* it tries to mount / from a device which has not yet
> > been initialized.
> 
> You didn't respond to my final two questions, Contrary to my usual
> practice I'll provide their probable outcomes. 'ls -l' would not have
> shown the CF card. 'search --label CFCARD' would have said 'no such
> device'.

I wrote that the the BIOS doesn't know about the CF card, so I thought it
is obvious that grub won't know about it either ;)

> 
> How do you expect GRUB to boot from a device it has no knowledge about? 

I never said that I expect this nor did I say that it does not boot; as I
wrote, I boot from the *internal hard drive* and want then the kernel to
find the CF card. This is very similar to a setup I had a couple of years
ago on a machine with 20 GB hard disk limit. There I connected a 250 GB
HDD as secondary master and a smaller HDD containing a /boot partition as
primary master; then I had to *disable* the secondary master drive in the
BIOS so neither the BIOS nor grub knew about the 250 GB HDD, but it was
no problem for the linux kernel to find it and use it as / . So where /
lies is not grub's business at all, but the kernel's.

> 
> Good luck, anyway.

Thanks.

Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Sometimes a feeling is all we humans have to go on.
-- Kirk, "A Taste of Armageddon", stardate 3193.9


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120120101940.1ace0a8f.klappn...@freenet.de



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-19 Thread Brian
On Thu 19 Jan 2012 at 20:52:23 +0100, Michael Lange wrote:

> So I think what i would need is a way to start at least one of these
> hotplug events, the one that installs the CF card, from within the
> initrd, *before* it tries to mount / from a device which has not yet been
> initialized.

You didn't respond to my final two questions, Contrary to my usual
practice I'll provide their probable outcomes. 'ls -l' would not have
shown the CF card. 'search --label CFCARD' would have said 'no such
device'.

How do you expect GRUB to boot from a device it has no knowledge about? 

Good luck, anyway.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120119210156.GH17235@desktop



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-19 Thread Michael Lange
Hi,

Thus spoketh Brian  
unto us on Thu, 19 Jan 2012 18:25:35 +:

(...)
> 
> The UUID on the 'search' line should be that of the partition on the CF
> card which holds the kernel and the initrd. The line can omitted, as can
> the 'set root' line. The 'linux' and 'initrd' lines are required.

No, there is a spearate /boot partition on the internal HDD
(on /dev/sda1), the CF card cannot be booted directly,  because the BIOS
doesn't know about it.

> 
>/vmlinuz-2.6.32-5-686 root=LABEL=CFCARD ro
> 
> tells GRUB it will find a file vmlinuz-2.6.32-5-686 on the card in the
> root of a partition which has the label 'CFCARD'. Is such a file there?
> And has the partition been labelled ('tune2fs -L' is one method)?

I think that it rather shows grub where to look for the kernel: in the
root of the file system given by the "search" or the "set root" line, and
that it then tells the kernel to mount a file system named "CFCARD" as / .

There are no problems with the first part, the kernel boots but then
fails to find the root file system because the device files have not been
created.
I am quite sure now that this is caused by the way removable
devices are handled at boot time. By staring a couple of times at the
rushing-by boot messages that I get when I boot into the working system I
have installed on /dev/sda2, I found that the CF card is recognized just
*after* the root file system is mounted; the next thing after mounting /
is that udev starts, then I see the message "Synthesizing initial hotplug
events..." (or so) and immediately after this the CF card appears.

So I think what i would need is a way to start at least one of these
hotplug events, the one that installs the CF card, from within the
initrd, *before* it tries to mount / from a device which has not yet been
initialized.

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

There's nothing disgusting about it [the Companion].  It's just another
life form, that's all.  You get used to those things.
-- McCoy, "Metamorphosis", stardate 3219.8


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120119205223.b9b0dfb5.klappn...@freenet.de



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-19 Thread Brian
On Wed 18 Jan 2012 at 11:15:14 +0100, Michael Lange wrote:

> the grub.cfg entry:
> 
> menuentry 'CFcard' --class debian --class gnu-linux --class gnu --class
> os { insmod part_msdos
>insmod ext2
>set root='(hd0,msdos1)'
>search --no-floppy --fs-uuid --set 7329bb28-71ea-4060-96a1-accaeef453f5
>echo   'Loading Linux 2.6.32-5-686 ...'
>linux   /vmlinuz-2.6.32-5-686 root=LABEL=CFCARD ro
>echo   'Loading initial ramdisk ...'
>initrd   /initrd.img-2.6.32-5-686
> }

The UUID on the 'search' line should be that of the partition on the CF
card which holds the kernel and the initrd. The line can omitted, as can
the 'set root' line. The 'linux' and 'initrd' lines are required.

   /vmlinuz-2.6.32-5-686 root=LABEL=CFCARD ro

tells GRUB it will find a file vmlinuz-2.6.32-5-686 on the card in the
root of a partition which has the label 'CFCARD'. Is such a file there?
And has the partition been labelled ('tune2fs -L' is one method)?

> and the final error
> message when booting fails is:
> 
> ALERT! /dev/disk/by-label/CFCARD does not exist. Dropping to a shell!

Let's see what GRUB knows about the partition with label CFCARD. Boot
and go to a command line with 'c'. Any sign of it in the output of
'ls -l'? Alternatively, what does 'search --label CFCARD' say?


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120119182535.GG17235@desktop



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-18 Thread Michael Lange
Hi,

Thus spoketh Scott Ferguson  
unto us on Wed, 18 Jan 2012 22:10:40 +1100:
(...)
> 
> set root='(hd1,msdos1)'
> 
> hd0 is the first hard drive (where /boot lives)

I think root=(...) should not point to / but to grub's root, at least the
page you linked suggests this:

"GRUB uses GRUB's root device implicitly. So if you set the root device
to, say, ‘(hd1,1)’ by the command ‘set root=(hd1,1)’ (see set),
then /boot/kernel is the same as (hd1,1)/boot/kernel."

Anyway, changing this line does not have any effect, apparently it is
overridden by 

search (...)--fs-uuid --set 7329bb28-71ea-4060-96a1-accaeef453f5

which points to (hd0,msdos1).
Of course I stole the menu entry syntax from the debian installer and it
looks like for some reason they added some redundance here, I tried and
actually I can omit either the "set root..." line or the "search..."
line, but in the latter case I must set root='(hd0,msdos1)' or grub will
try to load the kernel from the CF card and so fail because the BIOS
don't know about it.

(...)
> 
> I regret I don't have the time to check the above for you at the moment
> (CF card is in use). I'm not sure if the / in front of the initrd and
> kernel are necessary. (there paths are supposed to be relative to the
> /boot directory). So try without them as well.

Hmm, as long as it finds both kernel and initrd I think it can't be too
bad ;)
 
> You still get problems we can try boot delays incase it takes too long
> to make the device ready (pcmcia lag).

I have tried before to add rootdelay=30 which is suggested often in these
cases, but without success. And, if the problem is caused by a pcmcia
delay, shouldn't then the card be available after a few minutes in the
rescue shell? If so, I can confirm that at least 15 min. is not enough ;)

Now, as grub boots the kernel ok and tries to mount the right partition
as "/", I am afraid the problem is somewhere else than in the grub menu
entry :(

I have been looking into the udev rules files in the intrd and found the
following in 60-persistent-storage.rules :

# skip removable ide devices, because open(2) on them causes an events
# loop
KERNEL=="hd*[!0-9]", ATTR{removable}=="1", DRIVERS=="ide-cs|ide-floppy", \
GOTO="persistent_storage_end"
KERNEL=="hd*[0-9]", ATTRS{removable}=="1", \
GOTO="persistent_storage_end"

I even tried uncommenting this, but  of course it was not that easy ;)

Unfortunately good docs on writing udev rules are even much harder to
find than good grub docs ;)

Thanks for your efforts, I really appreciate that!

Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Murder is contrary to the laws of man and God.
-- M-5 Computer, "The Ultimate Computer", stardate 4731.3


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120118183227.aaa60237.klappn...@freenet.de



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-18 Thread Scott Ferguson
On 18/01/12 21:15, Michael Lange wrote:
> Hi,
> 
> thanks for the reply.
> 
> Thus spoketh Scott Ferguson  
> unto us on Wed, 18 Jan 2012 11:23:35 +1100:
> 
>>
>> At the grub prompt hit 'e' to enter edit mode.
>> What where does GRUB expect the root to be? (should not be hd0, probably
>> should be hd1,1).
> 
> the grub.cfg entry:
> 
> menuentry 'CFcard' --class debian --class gnu-linux --class gnu --class
> os { insmod part_msdos
>insmod ext2
>set root='(hd0,msdos1)'

set root='(hd1,msdos1)'

hd0 is the first hard drive (where /boot lives)

>search --no-floppy --fs-uuid --set 7329bb28-71ea-4060-96a1-accaeef453f5
>echo   'Loading Linux 2.6.32-5-686 ...'
>linux   /vmlinuz-2.6.32-5-686 root=7329bb28-71ea-4060-96a1-accaeef453f5 ro

linux   /vmlinuz-2.6.32-5-686
root=UID=7329bb28-71ea-4060-96a1-accaeef453f5 ro

I'm not certain about the directory slash either

>echo   'Loading initial ramdisk ...'
>initrd   /initrd.img-2.6.32-5-686
> }
> 
> where both (hd0,msdos1) and 7329bb28-71ea-4060-96a1-accaeef453f5 point
> to /boot on /dev/sda1.
> The grub menuentry was one of my first suspects, too, especially as I am
> not familiar with grub2 at all and good docs on it are hard to find. 

Perhaps by "good" you mean "specific to your particular needs". :-)

info grub?

"To help you find out which number specifies a partition you want, the
GRUB command-line (*note Command-line interface::) options have argument
completion. This means that, for example, you only need to type

 set root=(

   followed by a , and GRUB will display the list of drives,
partitions, or file names. So it should be quite easy to determine the
name of your target partition, even with minimal knowledge of the
syntax."

The full, very comprehensive manuals are online at gnu.org.
Currently blacked out for some bizarre reason (yeah I know, SOPA, but
GNU users don't need educating - just a message should be enough.
Wikipedia is different, and Facebook should blackout for the rest of the
decade).

http://webcache.googleusercontent.com/search?q=cache%3Ahttp%3A%2F%2Fwww.gnu.org%2Fsoftware%2Fgrub%2Fmanual%2Fgrub.html

> I admit that I don't know what the "set root=..." line does at all, when I
> change it into set root='(hd1,msdos1)' or '(hd1,1)' I can't see any
> difference. However, when I edited the grub.cfg entry the same way I
> could boot an usb flash drive, so I think it is ok, and the final error
> message when booting fails is:
> 
> ALERT! /dev/disk/by-label/CFCARD does not exist. Dropping to a shell!

See modification I suggested above

> 
> So apparently linux looks up the right place but does not find it, no
> wonder as there is no /dev/hda

So where does GRUB live?
;-p


> and none of the boot messages indicating
> the CF card has been recognized is seen.

Agreed

> 
> Regards
> 
> Michael
> 
> 


I regret I don't have the time to check the above for you at the moment
(CF card is in use). I'm not sure if the / in front of the initrd and
kernel are necessary. (there paths are supposed to be relative to the
/boot directory). So try without them as well.

You still get problems we can try boot delays incase it takes too long
to make the device ready (pcmcia lag).


Cheers

-- 
Iceweasel/Firefox extensions for finding answers to Debian questions:-
https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f16a8b0.2050...@gmail.com



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-18 Thread Michael Lange
Hi,

thanks for the reply.

Thus spoketh Scott Ferguson  
unto us on Wed, 18 Jan 2012 11:23:35 +1100:

> 
> At the grub prompt hit 'e' to enter edit mode.
> What where does GRUB expect the root to be? (should not be hd0, probably
> should be hd1,1).

the grub.cfg entry:

menuentry 'CFcard' --class debian --class gnu-linux --class gnu --class
os { insmod part_msdos
   insmod ext2
   set root='(hd0,msdos1)'
   search --no-floppy --fs-uuid --set 7329bb28-71ea-4060-96a1-accaeef453f5
   echo   'Loading Linux 2.6.32-5-686 ...'
   linux   /vmlinuz-2.6.32-5-686 root=LABEL=CFCARD ro
   echo   'Loading initial ramdisk ...'
   initrd   /initrd.img-2.6.32-5-686
}

where both (hd0,msdos1) and 7329bb28-71ea-4060-96a1-accaeef453f5 point
to /boot on /dev/sda1.
The grub menuentry was one of my first suspects, too, especially as I am
not familiar with grub2 at all and good docs on it are hard to find. I
admit that I don't know what the "set root=..." line does at all, when I
change it into set root='(hd1,msdos1)' or '(hd1,1)' I can't see any
difference. However, when I edited the grub.cfg entry the same way I
could boot an usb flash drive, so I think it is ok, and the final error
message when booting fails is:

ALERT! /dev/disk/by-label/CFCARD does not exist. Dropping to a shell!

So apparently linux looks up the right place but does not find it, no
wonder as there is no /dev/hda and none of the boot messages indicating
the CF card has been recognized is seen.

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

When a child is taught ... its programmed with simple instructions --
and at some point, if its mind develops properly, it exceeds the sum of
what it was taught, thinks independently.
-- Dr. Richard Daystrom, "The Ultimate Computer",
   stardate 4731.3.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120118111514.84f5d694.klappn...@freenet.de



Re: Unable to boot into CompactFlash card - card not found by initrd

2012-01-17 Thread Scott Ferguson
On 18/01/12 07:08, Michael Lange wrote:
> Hi everyone,
> 
> I already tried it somewhere else, but as no one knew help, I hope it
> is ok to bother you, too ;)
> 
> I am trying to boot my Dell Latitude X1 netbook into a CompactFlash card.
> The system is debian squeeze.
> The card is inserted into the netbook's built-in CF card slot, which
> apparently is connected internally through a Pcmcia adapter.
> 
> Because the netbook is not able to boot from the card itself (it does not
> show up in the netbook's BIOS bot menu), I have a
> spearate /boot partition on the netbbok's internal HDD (on /dev/sda1).
> Now, when I boot into the squeeze install on the HDD (on /dev/sda2), the
> CF card is detected as /dev/hda and appears to work flawlessly.
> 
> So I copied the squeeze install onto the CF card (/dev/hda1), with
> the /boot partition on /dev/sda1, and try to boot this, however the initrd
> fails to detect the CF card and leaves the system hanging at "Waiting for
> root file system..." and after 30 seconds or so I am dropped onto a
> rescue shell.

At the grub prompt hit 'e' to enter edit mode.
What where does GRUB expect the root to be? (should not be hd0, probably
should be hd1,1).

> 
> My first thought was that one or the other driver module needed for the
> CF card was missing from the initrd, however after I rebuilt the initrd
> with every single module that lsmod from the running system reports
> included, it still is the same :(


Some systems need to wait before the CF card becomes available - some
may require specific kernel parameters to be added.

It 'should' be possible to boot your CF card from GRUB. I've had to do
similar things to add rescue USB stick entries to GRUB menus on boxen
that don't support USB booting.

I'll wait until I've seen the answer to my first question before making
more suggestions.




Cheers

-- 
Iceweasel/Firefox extensions for finding answers to Debian questions:-
https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f161107.5050...@gmail.com



Unable to boot into CompactFlash card - card not found by initrd

2012-01-17 Thread Michael Lange
Hi everyone,

I already tried it somewhere else, but as no one knew help, I hope it
is ok to bother you, too ;)

I am trying to boot my Dell Latitude X1 netbook into a CompactFlash card.
The system is debian squeeze.
The card is inserted into the netbook's built-in CF card slot, which
apparently is connected internally through a Pcmcia adapter.

Because the netbook is not able to boot from the card itself (it does not
show up in the netbook's BIOS bot menu), I have a
spearate /boot partition on the netbbok's internal HDD (on /dev/sda1).
Now, when I boot into the squeeze install on the HDD (on /dev/sda2), the
CF card is detected as /dev/hda and appears to work flawlessly.

So I copied the squeeze install onto the CF card (/dev/hda1), with
the /boot partition on /dev/sda1, and try to boot this, however the initrd
fails to detect the CF card and leaves the system hanging at "Waiting for
root file system..." and after 30 seconds or so I am dropped onto a
rescue shell.

My first thought was that one or the other driver module needed for the
CF card was missing from the initrd, however after I rebuilt the initrd
with every single module that lsmod from the running system reports
included, it still is the same :(

When I do
$ cat /proc/modules
from the rescue shell, I can verify that
the modules are actually present, but
$ ls /dev | grep hd
shows that the device files for the CF card are still missing, so it is
no surprise that the file system is not found.

Shortly before the system hangs, the boot message

pcmcia_socket pcmcia_socket0: pccard: PCMCIA card inserted into slot 0

appears, and when I eject and re-insert the card, there are alike messages,
too, so apparently the slot itself is recognized, and even the card seems to
be detected somehow, but not recognized as compactflash card.

So it seems that there is some kind of "magic" missing from the initrd that
is responsible for probing the pcmcia port; I guess that the lines:

pcmcia_socket pcmcia_socket0: cs: memory probe 0xdfd0-0xdfdf:
  excluding 0xdfd0-0xdfd0 0xdfdf-0xdfdf
pcmcia 0.0: pcmcia: registering new device pcmcia0.0

from the dmesg output show that the card is finally detected, but
"who" is responsible for this (probably some udev rule? but how to set it up?),
and how to add this to the initrd?

I cannot believe that it is not possible to have the root file system on such
a card, but I have no idea what else to try.
Any ideas are much appreciated.

Below I attached some of the output of dmesg and lspci I get when I boot
into the working system on /dev/sda2, in case it might help to track
down the problem.

Regards and thanks in advance.

Michael

$ lspci
00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express 
Processor to DRAM Controller (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 915GM/GMS/910GML 
Express Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 915GM/GMS/910GML Express 
Graphics Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI 
Express Port 1 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) 
USB UHCI #1 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) 
USB UHCI #3 (rev 03)
00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) 
USB UHCI #4 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) 
USB2 EHCI Controller (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3)
00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW 
(ICH6 Family) AC'97 Audio Controller (rev 03)
00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge 
(rev 03)
00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) 
IDE Controller (rev 03)
02:01.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b3)
02:01.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C552 IEEE 1394 Controller (rev 08)
02:01.2 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host 
Adapter (rev 17)
02:03.0 Network controller: Intel Corporation PRO/Wireless 2200BG [Calexico2] 
Network Connection (rev 05)


$ dmesg
(...)
[8.610412] pcmcia_socket pcmcia_socket0: pccard: PCMCIA card inserted into 
slot 0
[8.616028] mmc0: SDHCI controller on PCI [:02:01.2] using DMA
[8.659306] udev[312]: renamed network interface eth0 to eth1
[8.922665] composite sync not supported
[9.091638] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x100-0x3af: 
clean.
[9.093498] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x3e0-0x4ff: 
clean.
[9.094287] pcmcia_socket pcmcia_socket0: cs: IO port probe 0x820-0x8ff: 
clean.
[9.094945] pcmcia_socket pcmcia_socket0: cs: IO port probe 0xc00-0xcf7: 
clean.
[9.095837] pcmcia_socket pcmcia_socket0: cs: IO port probe 0xa00-0xaff: 
clean.
[9