I have an application developed to run on multiple platforms where the boot disk is either ‘/dev/nftla1’ or ‘dev/hdc1’. The Grub bootloader has this information.
But once the kernel takes over & the application starts running, it becomes irrelevant. But, in my application which is mainly in ‘C’, I would like to know the source of boot because the way the files are accessed is different on these platforms.
My question is: Is there a system command or any tricks that you know that could help with what I am trying to achieve?
You can pass kernel boot options from grub and then check them.
More info.
UPDATE:
You can use this C code to parse
/proc/cmdline: