RE: Discovering current MTD partition

Atlant Schmidt
2011-04-28T18:20:58Z

Bjørn:

> $ busybox rdev
> /dev/sda1 /

Just FYI: This doesn't work on my particular
Embedded Linux system (running on UBIfs).
That command produces no result.

Atlant

-----Original Message-----
From: linux-mtd-bounces@lists.infradead.org [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of Bjørn Forsman
Sent: Thursday, April 28, 2011 14:08
To: Umar Qureshey
Cc: linux-mtd@lists.infradead.org
Subject: Re: Discovering current MTD partition

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

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.