On Fri, May 23, 2014 at 10:06:24AM -0700, Isaac Dunham wrote:
> On Fri, May 23, 2014 at 01:53:31PM +0200, 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.
> >
> > Sincerely,
> > Bertold Van den Bergh
>
> See below for comments.
>
> > + if(ioctl(sd_fd, BLKRRPART, NULL) < 0)
> > + perror_msg("ioctl (BLKRRPART) failed, old layout still used");
Upon attempting to check the correct return value, I found a
comment indicating that
(1) BLKRRPART will fail if the kernel partition table for a device is in
use (ie, any partition on the device is mounted)
(2) allegedly, partprobe defaults to BLKPG, which updates the
information about a particular partition (unless that partition is in
use).
If this is the case, you might find parsing the partition table and
calling BLKPG to be the only way to make partprobe modify the kernel's
partition info.
HTH,
Isaac Dunham
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net