[Toybox] [New toy] partprobe

Bertold Van den Bergh vandenbergh at bertold.org
Fri May 30 08:47:06 PDT 2014


Hello,

Thanks for your replies. I did not know the infrastructure
('loopfiles','minargs') you suggested exists in toybox.

The use case we use this command for is for firmware updates. A new image
is downloaded and copied byte-per-byte (including partition table) onto the
medium using dd. Afterwards, this ioctl is used to make the kernel reload
the partition table. The normal boot process then continues.

You are right that this ioctl does not work when any partition on the
device is in use, but this situation does not occur in our use case.

The solution of the 'real' partprobe is to call BLKPG on all paritions,
this allows limited resizing while other partitions are in use. While this
is a good solution, there are still many cases where the partitions cannot
be resized online (eg overlap with other, mounter, partition). It would
also make the program a lot more complex as it has to parse several types
of partition table.

Sincerely,
Bertold Van den Bergh


On Mon, May 26, 2014 at 1:15 AM, Rob Landley <rob at landley.net> wrote:

> On 05/23/14 06:53, Bertold Van den Bergh wrote:
> > Hello,
> >
> > I have attached a patch adding a program that allows re-reading the
> > partition table. This is often used on embedded systems booting from
> > SD/USB devices that need to resize partitions on first boot.
>
> Hmmm, this command is installed on my old ubuntu 10.04 netbook, running
> "dpkg-query -S $(which partprobe)" says it's part of the gnu parted
> package. Busybox does not have this command.
>
> We already call BLKRRPART in "fdisk" and "eject". I'd be tempted to add
> it to mdev instead of making it a standalone command, but the standalone
> command already exists...
>
> Could you give me an example use case? (You resize the partitions
> without calling fdisk which would already call this ioctl...?)
>
> Thanks,
>
> Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20140530/18f7b909/attachment-0004.htm>


More information about the Toybox mailing list