how to write code in build file according condition?

I want to use CF card to boot my system,I use “devb-eide …hd0t79” to recognize it,but sometimes if customer make the harddisk to primary master,CF card will becomes hd1,so the system can’t boot correctly,I want to know how to get result of “devb-eide …hd0t79” in build file when system is booting,if it fails,I should use “hd1t79” to recognize CF card,please help me.

in the boot image, just check for presence of /dev/hd0t79 and /dev/hd1t79 and mount either one of them.

how to check?

You have to include a shell and a script in your image that you’ll run a script that detect this

if -d /dev/hd1 then;
mount …

if -d /dev/hd0 then

Doing this from memory, check the doc on sh for details.

if do as you said,I can’t check it correctly,for on my target we have two harddisk and one cf card,the system can always find hd0 and hd1,how it can decide which is CF card?by the way,my cf card has type of 79 and harddisk has type of 77 and 78.

You may need to run another instance of devb-eide to control the CF card. The command pin provides the correct addresses for talking to the CF card.

how can I run devb-eide,if CF card is primary master(or slave),harddisk is secondary master,I should write:
devb-eide blk automount=hd0t79…
but if CF card is secondary master,I should write as:
devb-eide blk automount=hd1t79…
how to run another instance?