From patchwork Fri Jun 7 11:05:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 166143 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp486720ili; Fri, 7 Jun 2019 04:05:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzucJCe3jDouHtRtGd4pqz6+va/6yxG/uZSviaR8IdUDwWpjmMNu1fAajFVfj+RDWtMgq/p X-Received: by 2002:a63:70f:: with SMTP id 15mr2113607pgh.432.1559905512285; Fri, 07 Jun 2019 04:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559905512; cv=none; d=google.com; s=arc-20160816; b=YgZcOYrreLzNS26+lGGs3XafmhW9TT7xzwzs+vcBtTVkRLmvauUVFyQKIlW+tRbHtq aO75MBxEp62irOatSPCaz0KS6UVzyhfHILzkJhwjPuHn3Y4IOSRMth1JcE5SYiQ93rUi V13DIj3U8qG4PSd1b569YByG1bok/3xcwIEWU9Gk9AeyK5Se94rt1ti+IJ+snwkUBVNz djEajByFyyjHt/1XFCOyWFgvZ+2hJs4MgL8bc4CSVDws+BOh/KrafbQNTJnDXZlL9n+I resVCkbDPPm4RiWuifoU29Jp8x28kCMuQiLoHO6Rm7pbKf6j5fIHlpcPNLq4c1nrsp83 pFMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=BXIFMWGopUW4m+hQhowTY7+7zd9MgIfKzrJ3Se9nPw8=; b=xSu4fovcKP2pd/Atj1F6UbLfem1NSBz2gF8h73iBFgxDkP8uBJflgy6XTfo/YYs4Og CGVsNM4X3p+g1AtkLjy5SfSTm2QqdHiq7qK1b+wcmXtSK67lHlfwbbH9nV0PJgPRg9p5 hwtrkDXRI2ccdOCKQacmiYR6cK09P/HQLIgkwQkneRlhRc6wufR+oXFrLySya/lYbC2w RoUFXUD3iXTZIjUEKqWjduqHGrijOOyTTUgwrTtCA3kbdUMtyybUalmv5+qSosj9U07a pwwM/puYa42JUeXWyB6vlJMEgvryeuqr5TLeR1Bi5GxwG5jtNKqQD6SEb1Xifbvfn59F KXbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="tqVG4JA/"; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id o4si1543820plb.274.2019.06.07.04.05.11; Fri, 07 Jun 2019 04:05:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="tqVG4JA/"; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 30A307E150; Fri, 7 Jun 2019 11:05:06 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mail.openembedded.org (Postfix) with ESMTP id 822677C87F for ; Fri, 7 Jun 2019 11:05:05 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id t5so1493631wmh.3 for ; Fri, 07 Jun 2019 04:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=19tAh6d7qOt7XtW8k9yonPUJZcm44kEA04P7z0aSkSA=; b=tqVG4JA/tVNyJG9ypuuOzUoArPj16zgKIzTC51tYOkrK0nwMGmBSL9BRXtCC/ywMbG pIEFGwhiPn9xquD32e4Ba4Hneaso9XcTWSL6RwBkmQd7vyOF+0X8X7DI1DflHn88jmaR kNkmddfcMr84K0eYys+oHfQk7qOea56YV8npSq7LQlitK6Zk3qbFFJV2jw+fVxqjkWAh WdHz8w23n5QBWh8PiW0GgRukc67fx3grdNzWkpEG1IUlgnFy+OIUisKjguKvMhJMXWu+ KUfrzvXFtO2eYDqCrLeSc6kzSPaopm1/J4fXEqYPLFo1Z3a9Iz13E+TQeady7l069dqT wEEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=19tAh6d7qOt7XtW8k9yonPUJZcm44kEA04P7z0aSkSA=; b=iF2xQxbRgKRUUicECejI9Nwpkot8CehZB/75p3v5mqJ8YOuCkSJBdViXgf8dVt44DB /8FcmF1Zi+HDbU/4cQB7WtdG3VLAlpIcsMfF5QS/1I9s7bpDkyUTn2TH5cN6Kb/ZjEW8 CzSCLvsLs/3HI6vEwHLLjxJb/XCIWrIhPsgzbT/BERgNqCV+kPDmA3h2xkXe8ixTfzWq ouz+0DVjElGe/oqajyl8kVPzIe1v6bG3UIFpd0uuHy6fMxfGSHGuXH2gajUU7tIe825x c9Xmbu2E+CMy7JS6TDQpYbDGm/PpjSRDALUN29jLsJex28pNHkpzbKFpM7mQDrZR32Y9 I6cA== X-Gm-Message-State: APjAAAXF96yG2TAIkkHPZMjS0rdYAXUoCV62w97chDmPzyrK9jBB6Zjs 4+RkYIuKnjOemr+84QgirxdLQDB7I6A= X-Received: by 2002:a1c:305:: with SMTP id 5mr3359460wmd.101.1559905505818; Fri, 07 Jun 2019 04:05:05 -0700 (PDT) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id 67sm1690403wmd.38.2019.06.07.04.05.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Jun 2019 04:05:04 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Fri, 7 Jun 2019 12:05:02 +0100 Message-Id: <20190607110502.31175-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH] wic/filemap: handle FIGETBSZ failing X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org 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. Signed-off-by: Ross Burton --- scripts/lib/wic/filemap.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core Reviewed-by: Tom Rini Reviewed-by: Tim Orling Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py index 244c07a71cf..a3919fbcad8 100644 --- a/scripts/lib/wic/filemap.py +++ b/scripts/lib/wic/filemap.py @@ -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