Starting the right filesystem in the boot image

Is it possible to start the right filesystem
in the boot image depending the type memory used.

The reason is: My customer will use CompactFlash
instead of DiskOnChip. But, a unique firmware with
a unique .boot should start without regard the memory type.

My plan is to build a kind of “Fsys.detect”, but is there
another way to do this?

Thanks!