Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1657523

Re: [PATCH 0/5] Extends block2mtd and ubi drivers

From Pali Rohár <pali.rohar@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 0/5] Extends block2mtd and ubi drivers
Date 2017-06-05 13:20 +0200
Message-ID <tOYdd-2bU-37@gated-at.bofh.it> (permalink)
References <tNWZP-34m-7@gated-at.bofh.it> <tNXsS-3tq-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Friday 02 June 2017 18:17:06 Richard Weinberger wrote:
> Pali,
> 
> Am 02.06.2017 um 17:43 schrieb Pali Rohár:
> > This patch series extends block2mtd and ubi drivers to better handle
> > read-only devices and allow to load UBI image from local file which was
> > created for nand device.
> > 
> > Tested for Nokia N900 with Maemo 5 rootfs ubifs image
> > (rootfs_RX-51_2009SE_21.2011.38-1_PR_MR0) which has erase size 128k,
> > write size 2k and nand subpage shift 2.
> 
> What is the use case behind this series?

Take existing ubi image (where is one ubifs volume) and unpack it. Or
rather unpack-modify-pack to do some small changes.

> Did you see my nandsim rework some time ago?
> http://lists.infradead.org/pipermail/linux-mtd/2016-September/069422.html

No yet. I have my patches since 2012, but I decided after cleaning up
them to send... As I think they could be useful for other people.

> If you need a way to load files/nanddumps as NAND devices, this should be a good
> starting point.
> This reminds me that I need to revive that series. :-)

nandsim.ko has problem that needs to be loaded with special parameters
compatible with characteristic of target nand for which is ubi image
prepared. Plus it is nand similator and not layer to translate arbitrary
file image on disk to mtd device. block2mtd is what is doing this part.

> > $ losetup -r /dev/loop0 rootfs_RX-51_2009SE_21.2011.38-1_PR_MR0.ubifs
> > $ echo -n /dev/loop0,131072,2048,2 > /sys/module/block2mtd/parameters/block2mtd
> > $ ubiattach -p /dev/mtd0
> > $ mount /dev/ubi0_0 /mnt/ubi -t ubifs
> > ...
> > $ umount /dev/ubi0_0
> > $ ubidetach -p /dev/mtd0
> > $ echo -n del=/dev/loop0 > /sys/module/block2mtd/parameters/block2mtd
> > $ losetup -d /dev/loop0
> 
> The module-parameter interface is odd. IMHO we should not extend it.

That file is used for adding new mapping from block device to mtd
device. Currently there is no other way how to specify that mapping or
removing mapping.

If you have better idea, let me know and I would try to implement it.

-- 
Pali Rohár
pali.rohar@gmail.com

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] Extends block2mtd and ubi drivers Pali Rohár <pali.rohar@gmail.com> - 2017-06-02 17:50 +0200
  [PATCH 1/5] mtd: block2mtd: Check for valid user supplied erase size Pali Rohár <pali.rohar@gmail.com> - 2017-06-02 17:50 +0200
  [PATCH 2/5] mtd: block2mtd: Add support for specifying MTD write size and subpage shift Pali Rohár <pali.rohar@gmail.com> - 2017-06-02 17:50 +0200
    Re: [PATCH 2/5] mtd: block2mtd: Add support for specifying MTD write  size and subpage shift Richard Weinberger <richard@nod.at> - 2017-06-02 18:20 +0200
      Re: [PATCH 2/5] mtd: block2mtd: Add support for specifying MTD write  size and subpage shift Pali Rohár <pali.rohar@gmail.com> - 2017-06-05 13:30 +0200
        Re: [PATCH 2/5] mtd: block2mtd: Add support for specifying MTD write  size and subpage shift Pali Rohár <pali.rohar@gmail.com> - 2017-06-05 13:30 +0200
          Re: [PATCH 2/5] mtd: block2mtd: Add support for specifying MTD write  size and subpage shift Richard Weinberger <richard@nod.at> - 2017-06-05 13:30 +0200
            Re: [PATCH 2/5] mtd: block2mtd: Add support for specifying MTD write  size and subpage shift Pali Rohár <pali.rohar@gmail.com> - 2017-06-07 10:50 +0200
        Re: [PATCH 2/5] mtd: block2mtd: Add support for specifying MTD write  size and subpage shift Richard Weinberger <richard@nod.at> - 2017-06-05 13:30 +0200
  [PATCH 4/5] mtd: block2mtd: Add support for deleting block2mtd mapping Pali Rohár <pali.rohar@gmail.com> - 2017-06-02 17:50 +0200
  Re: [PATCH 0/5] Extends block2mtd and ubi drivers Richard Weinberger <richard@nod.at> - 2017-06-02 18:20 +0200
    Re: [PATCH 0/5] Extends block2mtd and ubi drivers Pali Rohár <pali.rohar@gmail.com> - 2017-06-05 13:20 +0200

csiph-web