Determine os install directory
I'm writing a program and I need to know the install location of linux as well as root and boot partitions. I'm getting root and boot from /etc/mtab, but I can't find a good way to always determine where the os is installed. This recently caused me to wipe out one of my systems that was booting from a small partition on a windows drive and had the os installed on a separate disk. Also with the recent addition of /dev/mapper to the 2.6 kernel, it's making my life a little harder. Something that accomplishes the analog of the windows environment variables "windir" "SystemRoot" and "SystemDrive" would be what I'm looking for.
|