mirror of
https://git.yoctoproject.org/poky
synced 2026-04-17 18:32:12 +02:00
wic/filemap: handle FIGETBSZ failing
Some file systems don't support fetching the block size (notably the file system Docker uses for containers), so handle the iotctl() failing and raise the expected error. (From OE-Core rev: 3757073726a00c5250556aae3d0daac76b88085e) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
bbe3bf4bfe
commit
ca4cdfcd18
@@ -32,7 +32,10 @@ def get_block_size(file_obj):
|
||||
"""
|
||||
# Get the block size of the host file-system for the image file by calling
|
||||
# the FIGETBSZ ioctl (number 2).
|
||||
binary_data = fcntl.ioctl(file_obj, 2, struct.pack('I', 0))
|
||||
try:
|
||||
binary_data = fcntl.ioctl(file_obj, 2, struct.pack('I', 0))
|
||||
except OSError:
|
||||
raise IOError("Unable to determine block size")
|
||||
bsize = struct.unpack('I', binary_data)[0]
|
||||
if not bsize:
|
||||
import os
|
||||
|
||||
Reference in New Issue
Block a user