Could the kernel name not be retained in the kernel and made available to /etc/rc? That really doesn't solve the problem. It just makes the behavior even more magic. The only real solution to this is to always retain the kernel symbol table in memory (allowing it to be paged out if DDB is not present), and have a way of retrieving it.