From patchwork Mon Jun 21 21:01:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1495320 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G825S028Rz9sRf for ; Tue, 22 Jun 2021 07:01:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5F3B440165; Mon, 21 Jun 2021 21:01:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fOKvWtzKQpJ2; Mon, 21 Jun 2021 21:01:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id A4DB3400F4; Mon, 21 Jun 2021 21:01:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id BF03A1BF2CF for ; Mon, 21 Jun 2021 21:01:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id BB4FB40328 for ; Mon, 21 Jun 2021 21:01:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 482dYbMWOX6t for ; Mon, 21 Jun 2021 21:01:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by smtp4.osuosl.org (Postfix) with ESMTPS id 0756640317 for ; Mon, 21 Jun 2021 21:01:18 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id BC59A40006; Mon, 21 Jun 2021 21:01:15 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Mon, 21 Jun 2021 23:01:06 +0200 Message-Id: <20210621210111.363433-2-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621210111.363433-1-thomas.petazzoni@bootlin.com> References: <20210621210111.363433-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v6 1/5] package/bmap-tools: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Jeremy Connat Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Nicolas Carrier Signed-off-by: Nicolas Carrier [Thomas: numerous reworks, add myself in DEVELOPERS] Signed-off-by: Thomas Petazzoni --- DEVELOPERS | 2 ++ package/Config.in | 1 + package/bmap-tools/Config.in | 44 ++++++++++++++++++++++++++++++ package/bmap-tools/bmap-tools.hash | 3 ++ package/bmap-tools/bmap-tools.mk | 13 +++++++++ 5 files changed, 63 insertions(+) create mode 100644 package/bmap-tools/Config.in create mode 100644 package/bmap-tools/bmap-tools.hash create mode 100644 package/bmap-tools/bmap-tools.mk diff --git a/DEVELOPERS b/DEVELOPERS index f6621e9670..ad6ad79ade 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1985,6 +1985,7 @@ F: board/intel/galileo/ F: configs/galileo_defconfig N: Nicolas Carrier +F: package/bmap-tools/ F: package/php-xdebug/ N: Nicolas Cavallari @@ -2635,6 +2636,7 @@ F: configs/stm32mp157c_dk2_defconfig F: package/android-tools/ F: package/b43-firmware/ F: package/b43-fwcutter/ +F: package/bmap-tools/ F: package/c-periphery/ F: package/cdrkit/ F: package/cifs-utils/ diff --git a/package/Config.in b/package/Config.in index cb8ece4919..f3d6503427 100644 --- a/package/Config.in +++ b/package/Config.in @@ -196,6 +196,7 @@ menu "Filesystem and flash utilities" source "package/aufs/Config.in" source "package/aufs-util/Config.in" source "package/autofs/Config.in" + source "package/bmap-tools/Config.in" source "package/btrfs-progs/Config.in" source "package/cifs-utils/Config.in" source "package/cpio/Config.in" diff --git a/package/bmap-tools/Config.in b/package/bmap-tools/Config.in new file mode 100644 index 0000000000..83b4d92786 --- /dev/null +++ b/package/bmap-tools/Config.in @@ -0,0 +1,44 @@ +config BR2_PACKAGE_BMAP_TOOLS + bool "bmap-tools" + depends on BR2_PACKAGE_PYTHON3 || BR2_PACKAGE_PYTHON + select BR2_PACKAGE_PYTHON3_PYEXPAT if BR2_PACKAGE_PYTHON3 # runtime + select BR2_PACKAGE_PYTHON_PYEXPAT if BR2_PACKAGE_PYTHON # runtime + select BR2_PACKAGE_PYTHON_SETUPTOOLS # runtime, pkg_resources + select BR2_PACKAGE_PYTHON_SIX # runtime + help + Tool to flash image files to block devices using the block map + bmaptool is a generic tool for creating the block map (bmap) + for a file, and copying files using the block map. The idea is + that large file containing unused blocks, like raw system + image files, can be copied or flashed a lot faster with + bmaptool than with traditional tools like "dd" or "cp". + + Relevant optional dependencies: + + - Busybox compiled with CONFIG_BZIP2, or BR2_PACKAGE_BZIP2, + to support bz2 compressed images + + - BR2_PACKAGE_PIGZ for optimized gzip decompression + + - Busybox compiled with CONFIG_LZOP, or BR2_PACKAGE_LZOP, to + support lzo compressed images. + + - BR2_PACKAGE_ZIP to support zip compressed images + + - BR2_PACKAGE_LZ4 to support lz4 compressed images + + - BR2_PACKAGE_ZSTD to support zstd compressed images + + - Busybox compiled CONFIG_FEATURE_SEAMLESS_* or + BR2_PACKAGE_TAR to support tar compressed images + + - BR2_PACKAGE_OPENSSH to retrieve images over SSH. + + - BR2_PACKAGE_SSHPASS to retrieve images over SSH if + password authentication is used. + + Image signature verification is not supported as + python-gpgme is not available. Optimized bzip2 decompression + is not supported as pbzip2 is not available. + + https://github.com/intel/bmap-tools diff --git a/package/bmap-tools/bmap-tools.hash b/package/bmap-tools/bmap-tools.hash new file mode 100644 index 0000000000..82a570ecac --- /dev/null +++ b/package/bmap-tools/bmap-tools.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 0658afb972e7221aa16fece3f84e29e5102e901c929253d7fb6040bde28243f7 bmap-tools-3.6.tar.gz +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING diff --git a/package/bmap-tools/bmap-tools.mk b/package/bmap-tools/bmap-tools.mk new file mode 100644 index 0000000000..c8b41c225f --- /dev/null +++ b/package/bmap-tools/bmap-tools.mk @@ -0,0 +1,13 @@ +################################################################################ +# +# bmap-tools +# +################################################################################ + +BMAP_TOOLS_VERSION = 3.6 +BMAP_TOOLS_SITE = $(call github,intel,bmap-tools,v$(BMAP_TOOLS_VERSION)) +BMAP_TOOLS_LICENSE = GPL-2.0 +BMAP_TOOLS_LICENSE_FILES = COPYING +BMAP_TOOLS_SETUP_TYPE = setuptools + +$(eval $(python-package)) From patchwork Mon Jun 21 21:01:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1495319 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G825B6XLbz9sRf for ; Tue, 22 Jun 2021 07:01:34 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id DC3806072A; Mon, 21 Jun 2021 21:01:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N4lchoyBXMuP; Mon, 21 Jun 2021 21:01:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 49FE160647; Mon, 21 Jun 2021 21:01:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id E04DE1BF2CF for ; Mon, 21 Jun 2021 21:01:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id CD3CE60750 for ; Mon, 21 Jun 2021 21:01:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AnKY45_oe38m for ; Mon, 21 Jun 2021 21:01:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by smtp3.osuosl.org (Postfix) with ESMTPS id C0D616069C for ; Mon, 21 Jun 2021 21:01:18 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 0D1A520003; Mon, 21 Jun 2021 21:01:16 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Mon, 21 Jun 2021 23:01:07 +0200 Message-Id: <20210621210111.363433-3-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621210111.363433-1-thomas.petazzoni@bootlin.com> References: <20210621210111.363433-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v6 2/5] package/bmap-tools: enable host package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Jeremy Connat Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" bmaptool allows to drastically reduce the amount of data to transfer when writing to an SD card. Example with a 544 MiB sdcard.img: $ bmaptool create sdcard.img > sdcard.bmap $ gzip sdcard.img $ bmaptool copy sdcard.img.gz /dev/sdc bmaptool: info: discovered bmap file 'sdcard.bmap' bmaptool: info: block map format version 2.0 bmaptool: info: 139265 blocks of size 4096 (544.0 MiB), mapped 23918 blocks (93.4 MiB or 17.2%) bmaptool: info: copying image 'sdcard.img.gz' to block device '/dev/sdc' using bmap file 'sdcard.bmap' bmaptool: info: 100% copied bmaptool: info: synchronizing '/dev/sdc' bmaptool: info: copying time: 7.7s, copying speed 12.1 MiB/sec So it means that instead of writing 544 MiB, only 93.4 MiB had to be written. In terms of implementation details, compared to the target bmap-tools package, there are fewer "selects" that are needed because: - The dependency on setuptools is not needed, because the package uses the setuptools SETUP_TYPE, so host-python-setuptools is already a build dependency. - host-python and host-python3 are always built with Expat XML support. Signed-off-by: Thomas Petazzoni --- package/Config.in.host | 1 + package/bmap-tools/Config.in.host | 12 ++++++++++++ package/bmap-tools/bmap-tools.mk | 1 + 3 files changed, 14 insertions(+) create mode 100644 package/bmap-tools/Config.in.host diff --git a/package/Config.in.host b/package/Config.in.host index 064c98af3d..8d443ea255 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -5,6 +5,7 @@ menu "Host utilities" source "package/android-tools/Config.in.host" source "package/asn1c/Config.in.host" source "package/babeltrace2/Config.in.host" + source "package/bmap-tools/Config.in.host" source "package/btrfs-progs/Config.in.host" source "package/cbootimage/Config.in.host" source "package/checkpolicy/Config.in.host" diff --git a/package/bmap-tools/Config.in.host b/package/bmap-tools/Config.in.host new file mode 100644 index 0000000000..a20829030d --- /dev/null +++ b/package/bmap-tools/Config.in.host @@ -0,0 +1,12 @@ +config BR2_PACKAGE_HOST_BMAP_TOOLS + bool "host bmap-tools" + select BR2_PACKAGE_HOST_PYTHON_SIX # runtime + help + Tool to flash image files to block devices using the block map + bmaptool is a generic tool for creating the block map (bmap) + for a file, and copying files using the block map. The idea is + that large file containing unused blocks, like raw system + image files, can be copied or flashed a lot faster with + bmaptool than with traditional tools like "dd" or "cp". + + https://github.com/intel/bmap-tools diff --git a/package/bmap-tools/bmap-tools.mk b/package/bmap-tools/bmap-tools.mk index c8b41c225f..32399ca151 100644 --- a/package/bmap-tools/bmap-tools.mk +++ b/package/bmap-tools/bmap-tools.mk @@ -11,3 +11,4 @@ BMAP_TOOLS_LICENSE_FILES = COPYING BMAP_TOOLS_SETUP_TYPE = setuptools $(eval $(python-package)) +$(eval $(host-python-package)) From patchwork Mon Jun 21 21:01:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1495321 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G825h1z8sz9sTD for ; Tue, 22 Jun 2021 07:02:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 05369607ED; Mon, 21 Jun 2021 21:01:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f7S355W_S9qO; Mon, 21 Jun 2021 21:01:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 72D7D60622; Mon, 21 Jun 2021 21:01:56 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 825E41BF2CF for ; Mon, 21 Jun 2021 21:01:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 71F026069C for ; Mon, 21 Jun 2021 21:01:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OvtDbysZ2tJW for ; Mon, 21 Jun 2021 21:01:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by smtp3.osuosl.org (Postfix) with ESMTPS id 8265E6003C for ; Mon, 21 Jun 2021 21:01:22 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id E3EAF240003; Mon, 21 Jun 2021 21:01:18 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Mon, 21 Jun 2021 23:01:08 +0200 Message-Id: <20210621210111.363433-4-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621210111.363433-1-thomas.petazzoni@bootlin.com> References: <20210621210111.363433-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v6 3/5] support/testing/infra/emulator.py: update pre-built kernels X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Jeremy Connat , Ricardo Martincoski Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The pre-built vexpress kernel used by the testing infrastructure is a 4.0.0 kernel, which is getting old to be used with reasonably recent toolchains. This commit updates the pre-built kernels for both the versatile and vexpress machines to 5.10.7 (they have already been put online). Signed-off-by: Thomas Petazzoni --- support/testing/infra/emulator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/support/testing/infra/emulator.py b/support/testing/infra/emulator.py index 5611ec96e8..0a77eb80fc 100644 --- a/support/testing/infra/emulator.py +++ b/support/testing/infra/emulator.py @@ -54,16 +54,16 @@ class Emulator(object): if arch == "armv7": kernel = infra.download(self.downloaddir, - "kernel-vexpress") + "kernel-vexpress-5.10.7") dtb = infra.download(self.downloaddir, - "vexpress-v2p-ca9.dtb") + "vexpress-v2p-ca9-5.10.7.dtb") qemu_cmd += ["-dtb", dtb] qemu_cmd += ["-M", "vexpress-a9"] elif arch == "armv5": kernel = infra.download(self.downloaddir, - "kernel-versatile-4.19") + "kernel-versatile-5.10.7") dtb = infra.download(self.downloaddir, - "versatile-pb-4.19.dtb") + "versatile-pb-5.10.7.dtb") qemu_cmd += ["-dtb", dtb] qemu_cmd += ["-M", "versatilepb"] qemu_cmd += ["-device", "virtio-rng-pci"] From patchwork Mon Jun 21 21:01:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1495323 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G826865fRz9sRf for ; Tue, 22 Jun 2021 07:02:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0D34383ABB; Mon, 21 Jun 2021 21:02:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FMBdYObcdrLh; Mon, 21 Jun 2021 21:02:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 5B8CA83AAF; Mon, 21 Jun 2021 21:02:21 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id E61FD1BF2CF for ; Mon, 21 Jun 2021 21:01:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E222D4031F for ; Mon, 21 Jun 2021 21:01:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kVTZsUBQE3cM for ; Mon, 21 Jun 2021 21:01:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by smtp4.osuosl.org (Postfix) with ESMTPS id B39A640317 for ; Mon, 21 Jun 2021 21:01:23 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 9B485C0006; Mon, 21 Jun 2021 21:01:20 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Mon, 21 Jun 2021 23:01:09 +0200 Message-Id: <20210621210111.363433-5-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621210111.363433-1-thomas.petazzoni@bootlin.com> References: <20210621210111.363433-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v6 4/5] support/testing/tests/package/test_bmap_tools: new test X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Jeremy Connat Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Nicolas Carrier This patch implements a simple test in which a dummy file system image is created, then `bmaptool create` and `bmaptool copy` are used to copy it to another file. Signed-off-by: Nicolas Carrier [Thomas: several reworks, add myself to DEVELOPERS] Signed-off-by: Thomas Petazzoni --- DEVELOPERS | 4 ++ .../tests/package/sample_bmap_tools.sh | 15 +++++ .../testing/tests/package/test_bmap_tools.py | 61 +++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100755 support/testing/tests/package/sample_bmap_tools.sh create mode 100644 support/testing/tests/package/test_bmap_tools.py diff --git a/DEVELOPERS b/DEVELOPERS index ad6ad79ade..b4518b0cc7 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1987,6 +1987,8 @@ F: configs/galileo_defconfig N: Nicolas Carrier F: package/bmap-tools/ F: package/php-xdebug/ +F: support/testing/tests/package/sample_bmap_tools.sh +F: support/testing/tests/package/test_bmap_tools.py N: Nicolas Cavallari F: package/libgit2/ @@ -2687,6 +2689,8 @@ F: package/squashfs/ F: package/wayland/ F: package/weston/ F: support/testing/tests/boot/test_syslinux.py +F: support/testing/tests/package/sample_bmap_tools.sh +F: support/testing/tests/package/test_bmap_tools.py F: toolchain/ N: Timo Ketola diff --git a/support/testing/tests/package/sample_bmap_tools.sh b/support/testing/tests/package/sample_bmap_tools.sh new file mode 100755 index 0000000000..7c90368c17 --- /dev/null +++ b/support/testing/tests/package/sample_bmap_tools.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# simple test which creates a dummy file system image, then use bmaptool create +# and bmaptool copy to copy it to another file + +set -xeu + +# create the necessary test files +dd if=/dev/zero of=disk.img bs=2M count=1 +mkfs.ext4 disk.img +fallocate -d disk.img +dd if=/dev/zero of=copy.img bs=2M count=1 + +# do a test copy of the file system image +bmaptool create -o disk.img.bmap disk.img +bmaptool copy disk.img copy.img diff --git a/support/testing/tests/package/test_bmap_tools.py b/support/testing/tests/package/test_bmap_tools.py new file mode 100644 index 0000000000..e8802fc057 --- /dev/null +++ b/support/testing/tests/package/test_bmap_tools.py @@ -0,0 +1,61 @@ +import os +import infra + +from infra.basetest import BRTest + + +class TestBmapTools(BRTest): + __test__ = False + sample_script = "tests/package/sample_bmap_tools.sh" + copy_script = 'tests/package/copy-sample-script-to-target.sh' + config = \ + """ + BR2_arm=y + BR2_cortex_a8=y + BR2_TOOLCHAIN_EXTERNAL=y + BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y + BR2_PACKAGE_BMAP_TOOLS=y + BR2_ROOTFS_POST_BUILD_SCRIPT="{}" + BR2_ROOTFS_POST_SCRIPT_ARGS="{}" + BR2_TARGET_ROOTFS_EXT2=y + BR2_TARGET_ROOTFS_EXT2_4=y + BR2_TARGET_ROOTFS_EXT2_SIZE="65536" + # BR2_TARGET_ROOTFS_TAR is not set + BR2_PACKAGE_UTIL_LINUX=y + BR2_PACKAGE_UTIL_LINUX_FALLOCATE=y + BR2_PACKAGE_E2FSPROGS=y + BR2_PACKAGE_UTIL_LINUX_LIBUUID=y + """.format(infra.filepath(copy_script), + infra.filepath(sample_script)) + timeout = 60 + + def login(self): + img = os.path.join(self.builddir, "images", "rootfs.ext4") + self.emulator.boot(arch="armv7", + kernel="builtin", + kernel_cmdline=["root=/dev/mmcblk0", + "rootfstype=ext4"], + options=["-drive", "file={},if=sd,format=raw".format(img)]) + self.emulator.login() + + def test_run(self): + self.login() + cmd = "/root/{}".format(os.path.basename(self.sample_script)) + _, exit_code = self.emulator.run(cmd, timeout=20) + self.assertEqual(exit_code, 0) + + +class TestPy2BmapTools(TestBmapTools): + __test__ = True + config = TestBmapTools.config + \ + """ + BR2_PACKAGE_PYTHON=y + """ + + +class TestPy3BmapTools(TestBmapTools): + __test__ = True + config = TestBmapTools.config + \ + """ + BR2_PACKAGE_PYTHON3=y + """ From patchwork Mon Jun 21 21:01:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1495322 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G825w14Tnz9sRf for ; Tue, 22 Jun 2021 07:02:12 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 7BE60402A1; Mon, 21 Jun 2021 21:02:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YgYh-EHRHllU; Mon, 21 Jun 2021 21:02:09 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id CBB0E40158; Mon, 21 Jun 2021 21:02:08 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7DEAB1BF2CF for ; Mon, 21 Jun 2021 21:01:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6DD6583ACC for ; Mon, 21 Jun 2021 21:01:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I--pPGpl7N_R for ; Mon, 21 Jun 2021 21:01:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by smtp1.osuosl.org (Postfix) with ESMTPS id AED1283AC9 for ; Mon, 21 Jun 2021 21:01:23 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id CD233240002; Mon, 21 Jun 2021 21:01:21 +0000 (UTC) From: Thomas Petazzoni To: Buildroot List Date: Mon, 21 Jun 2021 23:01:10 +0200 Message-Id: <20210621210111.363433-6-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210621210111.363433-1-thomas.petazzoni@bootlin.com> References: <20210621210111.363433-1-thomas.petazzoni@bootlin.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v6 5/5] support/testing/tests/package/test_bmap_tools: add test for host bmap-tools X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni , Jeremy Connat Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Thomas Petazzoni --- .../testing/tests/package/test_bmap_tools.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/support/testing/tests/package/test_bmap_tools.py b/support/testing/tests/package/test_bmap_tools.py index e8802fc057..a0f8d5c2ad 100644 --- a/support/testing/tests/package/test_bmap_tools.py +++ b/support/testing/tests/package/test_bmap_tools.py @@ -1,5 +1,6 @@ import os import infra +import subprocess from infra.basetest import BRTest @@ -59,3 +60,31 @@ class TestPy3BmapTools(TestBmapTools): """ BR2_PACKAGE_PYTHON3=y """ + + +class TestHostBmapTools(BRTest): + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ + """ + BR2_PACKAGE_HOST_BMAP_TOOLS=y + # BR2_TARGET_ROOTFS_TAR is not set + BR2_TARGET_ROOTFS_EXT2=y + """ + + def test_run(self): + cmd = [os.path.join(self.b.builddir, "host", "bin", "bmaptool"), + "create", + "-o", os.path.join(self.b.builddir, "images", "rootfs.ext2.bmap"), + os.path.join(self.b.builddir, "images", "rootfs.ext2")] + ret = subprocess.call(cmd, + stdout=self.b.logfile, + stderr=self.b.logfile) + self.assertEqual(ret, 0) + + cmd = [os.path.join(self.b.builddir, "host", "bin", "bmaptool"), + "copy", + os.path.join(self.b.builddir, "images", "rootfs.ext2"), + os.path.join(self.b.builddir, "images", "rootfs.ext2.copy")] + ret = subprocess.call(cmd, + stdout=self.b.logfile, + stderr=self.b.logfile) + self.assertEqual(ret, 0)