Re: Discovering current MTD partition

Bjørn Forsman
2011-04-28T18:08:23Z

On 27 April 2011 01:43, Umar Qureshey <umar@janteq.com> wrote:
> [...]
> Aside from scanning /proc/cmdline, is there a way to
> programmatically ascertain which mtd partition is active *now*.
> I need to find this information within a Python script but really if it can
> be done in C (perhaps a syscall?), it's all I need.

Busybox has a command called 'rdev' that looks up the block device
that is mounted on /.

$ busybox rdev
/dev/sda1 /

Look in busybox/util-linux/rdev.c and busybox/libbb/find_root_device.c
for the implementation details.

Best regards,
Bjørn Forsman