The function curtin.get_blockdev_sector_size will not work when called with a devpath which lsblk will return multiple lines of results for.
This means that in some cases formatting a device other than a partition may fail, because block.mkfs checks for logical block size using this function.
For example:
Python 3.5.1+ (default, Mar 30 2016, 22:46:26)
[GCC 5.3.1 20160330] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from curtin import block
>>> block.get_blockdev_sector_size('/dev/sda1')
(512, 512)
>>> block.get_blockdev_sector_size('/dev/sda5')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/magicanus/code/curtin-clean/curtin/curtin/block/__init__.py", line 426, in get_blockdev_sector_size
[parent] = info
ValueError: too many values to unpack (expected 1)
>>> block.get_blockdev_sector_size('/dev/sda')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/magicanus/code/curtin-clean/curtin/curtin/block/__init__.py", line 426, in get_blockdev_sector_size
[parent] = info
ValueError: too many values to unpack (expected 1)
The function curtin. get_blockdev_ sector_ size will not work when called with a devpath which lsblk will return multiple lines of results for.
This means that in some cases formatting a device other than a partition may fail, because block.mkfs checks for logical block size using this function.
For example: blockdev_ sector_ size('/ dev/sda1' ) blockdev_ sector_ size('/ dev/sda5' ) magicanus/ code/curtin- clean/curtin/ curtin/ block/_ _init__ .py", line 426, in get_blockdev_ sector_ size blockdev_ sector_ size('/ dev/sda' ) magicanus/ code/curtin- clean/curtin/ curtin/ block/_ _init__ .py", line 426, in get_blockdev_ sector_ size
Python 3.5.1+ (default, Mar 30 2016, 22:46:26)
[GCC 5.3.1 20160330] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from curtin import block
>>> block.get_
(512, 512)
>>> block.get_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/
[parent] = info
ValueError: too many values to unpack (expected 1)
>>> block.get_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/
[parent] = info
ValueError: too many values to unpack (expected 1)