sh: Make initrd detection more robust.