{"id":812040,"url":"http://patchwork.ozlabs.org/api/patches/812040/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170910064713.31511-2-alison@peloton-tech.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170910064713.31511-2-alison@peloton-tech.com>","list_archive_url":null,"date":"2017-09-10T06:47:12","name":"[U-Boot,1/2] GPT: create block device for sandbox testing","commit_ref":"bf6d76b84ae13b463c0dca556118047e2d046f33","pull_url":null,"state":"accepted","archived":false,"hash":"52b6ea19a1481a25b2ec42fb449bbd6135af5fa6","submitter":{"id":69170,"url":"http://patchwork.ozlabs.org/api/people/69170/?format=json","name":"Alison Chaiken","email":"alison@peloton-tech.com"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20170910064713.31511-2-alison@peloton-tech.com/mbox/","series":[{"id":2367,"url":"http://patchwork.ozlabs.org/api/series/2367/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=2367","date":"2017-09-10T06:47:11","name":"GPT: create block device for guid testing","version":1,"mbox":"http://patchwork.ozlabs.org/series/2367/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812040/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812040/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xqhTR2Vhwz9sQl\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 10 Sep 2017 16:48:11 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 0C1F3C21E97; Sun, 10 Sep 2017 06:47:40 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id E6F0CC21E54;\n\tSun, 10 Sep 2017 06:47:28 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 61046C21EA8; Sun, 10 Sep 2017 06:47:26 +0000 (UTC)","from bonnet.exerciseforthereader.org\n\t(173-228-89-192.dsl.static.fusionbroadband.com [173.228.89.192])\n\tby lists.denx.de (Postfix) with ESMTP id 3F6F8C21D65\n\tfor <u-boot@lists.denx.de>; Sun, 10 Sep 2017 06:47:20 +0000 (UTC)","by bonnet.exerciseforthereader.org (Postfix, from userid 1000)\n\tid A5B1F5F787; Sat,  9 Sep 2017 23:47:18 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=none autolearn=unavailable\n\tautolearn_force=no version=3.4.0","From":"alison@peloton-tech.com","To":"u-boot@lists.denx.de","Date":"Sat,  9 Sep 2017 23:47:12 -0700","Message-Id":"<20170910064713.31511-2-alison@peloton-tech.com>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170910064713.31511-1-alison@peloton-tech.com>","References":"<CAPnjgZ2bha-k3m-1xb0FDUYEVuTk_tA-zve6WXHJhRVFSu3j9g@mail.gmail.com>\n\t<20170910064713.31511-1-alison@peloton-tech.com>","Cc":"alison@peloton-tech.com, alison@she-devel.com","Subject":"[U-Boot] [PATCH 1/2] GPT: create block device for sandbox testing","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"From: Alison Chaiken <alison@peloton-tech.com>\n\nProvide a Python function that creates a small block device for the\npurpose of testing the cmd/gpt.c or cmd/part.c functions in the u-boot\nsandbox.\n\nSigned-off-by: Alison Chaiken <alison@peloton-tech.com>\n---\n board/sandbox/README.sandbox |  5 +++++\n test/py/make_test_disk.py    | 19 +++++++++++++++++++\n 2 files changed, 24 insertions(+)\n create mode 100755 test/py/make_test_disk.py","diff":"diff --git a/board/sandbox/README.sandbox b/board/sandbox/README.sandbox\nindex 9dc2eb09d1..947241e3eb 100644\n--- a/board/sandbox/README.sandbox\n+++ b/board/sandbox/README.sandbox\n@@ -338,6 +338,11 @@ $> lodev=`sudo losetup -P -f --show ./disk.raw`\n $> sudo mkfs.vfat -n EFI -v ${lodev}p1\n $> sudo mkfs.ext4 -L ROOT -v ${lodev}p2\n \n+or utilize the device described in test/py/make_test_disk.py:\n+\n+   #!/usr/bin/python\n+   import make_test_disk\n+   make_test_disk.makeDisk()\n \n Writing Sandbox Drivers\n -----------------------\ndiff --git a/test/py/make_test_disk.py b/test/py/make_test_disk.py\nnew file mode 100755\nindex 0000000000..5288295588\n--- /dev/null\n+++ b/test/py/make_test_disk.py\n@@ -0,0 +1,19 @@\n+# Copyright (c) 2017 Alison Chaiken\n+#\n+# SPDX-License-Identifier: GPL-2.0\n+#\n+# Create a block device for testing of 'gpt' and 'part' commands.\n+\n+import os\n+\n+def makeDisk():\n+    if (os.path.exists(\"testdisk.raw\")):\n+        os.remove(\"testdisk.raw\")\n+    fd = os.open(\"testdisk.raw\", os.O_RDWR|os.O_CREAT )\n+    os.ftruncate(fd, 4194304)\n+    os.close(fd)\n+    os.spawnl(os.P_WAIT, \"/sbin/sgdisk\", \"sgdisk\", \"-U\",\n+          \"375a56f7-d6c9-4e81-b5f0-09d41ca89efe\", \"testdisk.raw\")\n+    os.spawnl(os.P_WAIT, \"/sbin/sgdisk\", \"sgdisk\", \"--new=1:2048:2560\", \"testdisk.raw\")\n+    os.spawnl(os.P_WAIT, \"/sbin/sgdisk\", \"sgdisk\", \"--new=2:4096:4608\", \"testdisk.raw\")\n+    os.spawnl(os.P_WAIT, \"/sbin/gdisk\", \"sgdisk\", \"-l\", \"testdisk.raw\")\n","prefixes":["U-Boot","1/2"]}