Discovering current MTD partition

umar at janteq.com umar at janteq.com
Wed Apr 27 13:14:36 EDT 2011


> On 04/27/2011 09:25 AM, umar at janteq.com wrote:
>> Hi,
>> [...]
>> What I'd like is to detect from userspace is which /dev/mtdX partition
>> is
>> the currently executing program running on because that is the partition
>> that has been obviously booted.
>
> I think you might want to take a look at getmntent (3) : it is a libc
> function for getting the /etc/mtab entries. It also seems to be portable.
>
> Cheers,
> David.
>
> --
> David Wagner, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com

This will give me the same info as /proc/mtab.  I cannot figure out how I
can infer which /dev/mtdXX was booted from with this information.





More information about the linux-mtd mailing list