git: installer: Use ioctl(DIOCGPART) for getting a disk's size.
swildner at crater.dragonflybsd.org
Tue May 31 14:28:53 PDT 2016
Author: Sascha Wildner <saw at online.de>
Date: Tue May 31 23:27:35 2016 +0200
installer: Use ioctl(DIOCGPART) for getting a disk's size.
Before this commit, the installer was grepping in /var/run/dmesg.boot.
This approach has one problem in particular, which is that it was
used with CAM attached disks in mind, which will always print their
size in MiBs. However, some drivers, such as mmcsd(4), roll their own
disk, so they are free to choose what they print in their *_attach()
function. Yet we still want to offer these disks from the installer.
For example, mmcsd(4) starts printing the size in gigabytes if the
disk is >= 10GiB.
This commit changes the installer's survey function to read the
disk's size using ioctl(DIOCGPART) to have consistent results.
Reported-by: Dmitry Postolov <dpostolov at yandex.ru>
Summary of changes:
usr.sbin/installer/libinstaller/survey.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
DragonFly BSD source repository
More information about the Commits