From patchwork Sat Feb 11 15:38:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 19360 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9110C61DA4 for ; Sat, 11 Feb 2023 15:38:45 +0000 (UTC) Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) by mx.groups.io with SMTP id smtpd.web11.11370.1676129916852167758 for ; Sat, 11 Feb 2023 07:38:37 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=OCDaMgE4; spf=pass (domain: linaro.org, ip: 209.85.218.49, mailfrom: dmitry.baryshkov@linaro.org) Received: by mail-ej1-f49.google.com with SMTP id sa10so22449895ejc.9 for ; Sat, 11 Feb 2023 07:38:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=p4TOYZHAEAw5RICc364zbehkvZXtGUt5wepPxt6fJzY=; b=OCDaMgE4iUnRPbc+ywp3kfAjjqCnpnW7h0I1pKZgU2/wYI6pMB/HcBwgXIDmUsGv8w Q0lgy6Tf0mClDDnL55aOZza9UZg3eaq/CWIX6WitEThzrAtiPc+0+ZAfleGFKuQny09t InA/jidrko2TcFpDbL5/3tSI7MY2x7Z5SZG8e8s4ggDUx1OE//3WYpdvGMzMk8m6yAI2 t+dr8AKnaEDE66VHvnTusvaGGLfwVeO9q5DTgQCdx2ZSsOOK66j3nqGXl/6uzVvMhE4M vZjPWSzdZbX4vPuNZgvyHckkjUJYYAWmfvcEW9D04ktYaiPTpz0eG7SZ6bv7AoIYbFcS 7cSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=p4TOYZHAEAw5RICc364zbehkvZXtGUt5wepPxt6fJzY=; b=LDNkgQDwGWkdoKkTe4svMzv+Z1VZ3sVo1eUIrFFYpo6uFyN+ewW55bnEyxqTTN0O6T 2VTCuvEiu62asr+D0wuSgtS7P5WhLQTUWFmIb5/X7UjcsbkgFT3lFIzTW1NL/B4H0IjG A7gmGj0g8yUGsoDRsN5KzqrGq7Pbz+jixZd+/tXG053yIFsVXW5aORPaXz/NxdpxmaeU T8ZFG5ReRMtqfUUMa0ktq08yMVqOBGnyJ8BCQv4l7Cvdw4G6xrYILCA9SMYQ1VjvKtOc PCshtjtgtf77iS7Tx0HRAzB+ooIuBVAr0PD9jSoDHyH9l9Z38ryyqMn0psEKf0VYjWT1 +qSw== X-Gm-Message-State: AO0yUKWwgVn9BlLJd8j1PXEnbFWqVd1J1R3JQHVoXZUWXM7rwV+Tou29 tYMnDMXXHpMQlXdSoCpBA2d7GOJS+Qt+3dpP X-Google-Smtp-Source: AK7set+xliFFk5BYSQuDJAH00d0scuvJ2jzsamToxiQ/U6dHUQ6WO3YNwdz9Je23GNR6qS/WMCDD+g== X-Received: by 2002:a17:906:942:b0:888:7ac8:c0f4 with SMTP id j2-20020a170906094200b008887ac8c0f4mr19647814ejd.25.1676129915098; Sat, 11 Feb 2023 07:38:35 -0800 (PST) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id og15-20020a1709071dcf00b007aea1dc1840sm3985303ejc.111.2023.02.11.07.38.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 07:38:34 -0800 (PST) From: Dmitry Baryshkov To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/2] rust-android-sparse: add lightweight simg2img/img2simg implementation Date: Sat, 11 Feb 2023 18:38:27 +0300 Message-Id: <20230211153828.2113018-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 11 Feb 2023 15:38:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/177007 The Android's simg2img/img2simg comes from android-tools, which is a huge package with lots of dependencies on its own. It resides inside meta-oe rather than OE-Core. Add lightweight tool to handle sparse images, which is small enough to be pushed into OE-Core. Signed-off-by: Dmitry Baryshkov --- .../rust-android-sparse_0.6.0.bb | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 meta/recipes-extended/rust-android-sparse/rust-android-sparse_0.6.0.bb diff --git a/meta/recipes-extended/rust-android-sparse/rust-android-sparse_0.6.0.bb b/meta/recipes-extended/rust-android-sparse/rust-android-sparse_0.6.0.bb new file mode 100644 index 000000000000..83652b9d452f --- /dev/null +++ b/meta/recipes-extended/rust-android-sparse/rust-android-sparse_0.6.0.bb @@ -0,0 +1,68 @@ +# Auto-Generated by cargo-bitbake 0.3.16 +# +inherit cargo + +# how to get android-sparse could be as easy as but default to a git checkout: +SRC_URI += "crate://crates.io/android-sparse/0.6.0" +S= "${CARGO_VENDORING_DIRECTORY}/android-sparse-${PV}" + +# please note if you have entries that do not begin with crate:// +# you must change them to how that package can be fetched +SRC_URI += " \ + crate://crates.io/aho-corasick/0.7.18 \ + crate://crates.io/assert_cmd/0.9.1 \ + crate://crates.io/autocfg/1.0.1 \ + crate://crates.io/bitflags/1.3.2 \ + crate://crates.io/build_const/0.2.2 \ + crate://crates.io/byteorder/1.4.3 \ + crate://crates.io/cfg-if/1.0.0 \ + crate://crates.io/clap/2.34.0 \ + crate://crates.io/crc/1.8.1 \ + crate://crates.io/difference/2.0.0 \ + crate://crates.io/escargot/0.3.1 \ + crate://crates.io/float-cmp/0.4.0 \ + crate://crates.io/getrandom/0.2.3 \ + crate://crates.io/itoa/0.4.8 \ + crate://crates.io/libc/0.2.109 \ + crate://crates.io/memchr/2.4.1 \ + crate://crates.io/normalize-line-endings/0.2.2 \ + crate://crates.io/num-traits/0.2.14 \ + crate://crates.io/ppv-lite86/0.2.15 \ + crate://crates.io/predicates-core/0.9.0 \ + crate://crates.io/predicates-tree/0.9.0 \ + crate://crates.io/predicates/0.9.1 \ + crate://crates.io/proc-macro2/1.0.33 \ + crate://crates.io/quote/1.0.10 \ + crate://crates.io/rand/0.8.4 \ + crate://crates.io/rand_core/0.6.3 \ + crate://crates.io/rand_chacha/0.3.1 \ + crate://crates.io/rand_hc/0.3.1 \ + crate://crates.io/redox_syscall/0.2.10 \ + crate://crates.io/regex-syntax/0.6.25 \ + crate://crates.io/regex/1.5.4 \ + crate://crates.io/remove_dir_all/0.5.3 \ + crate://crates.io/ryu/1.0.6 \ + crate://crates.io/serde/1.0.130 \ + crate://crates.io/serde_derive/1.0.130 \ + crate://crates.io/serde_json/1.0.72 \ + crate://crates.io/syn/1.0.82 \ + crate://crates.io/tempfile/3.2.0 \ + crate://crates.io/textwrap/0.11.0 \ + crate://crates.io/treeline/0.1.0 \ + crate://crates.io/unicode-width/0.1.9 \ + crate://crates.io/unicode-xid/0.2.2 \ + crate://crates.io/wasi/0.10.2+wasi-snapshot-preview1 \ + crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \ + crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \ + crate://crates.io/winapi/0.3.9 \ +" + +LIC_FILES_CHKSUM = " \ + file://LICENSE;md5=0ffe68749328daf57dd85d5ca6ee981f \ +" + +SUMMARY = "An implementation of Android's sparse file format." +HOMEPAGE = "https://gitlab.com/ra_kete/android-sparse-rs" +LICENSE = "MIT" + +BBCLASSEXTEND += "native" From patchwork Sat Feb 11 15:38:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 19359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C82C8C636CC for ; Sat, 11 Feb 2023 15:38:45 +0000 (UTC) Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by mx.groups.io with SMTP id smtpd.web11.11372.1676129917474903403 for ; Sat, 11 Feb 2023 07:38:37 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=BTyBlt7S; spf=pass (domain: linaro.org, ip: 209.85.218.54, mailfrom: dmitry.baryshkov@linaro.org) Received: by mail-ej1-f54.google.com with SMTP id lu11so22527423ejb.3 for ; Sat, 11 Feb 2023 07:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=LKh/WJUZ/a7LbcLCfqzrp1snhXBTaab70JqzWclptYU=; b=BTyBlt7S6AgVGZ9qMXG5vekYMbXXJ/MxqsYGWg3p+r4i45CKZT9jdUDHrTF/6BWnHV CYJUEvPzHUFe3lzLEWTt4FJgvf4U/xg8lEQO98flLhGakGQ5Xg01kV3FWwY9GzsMS0Bt Mw8BsC1cZUHFLWi+FertzGrJNrA7q+r5ST2FSep+tPpWdFPfZSmlU+E8is7FNpe5st9C 2eIJTYeTHeir2nSmA0H61kkjSQEdl7cuLCPGsw2NsS/4gu0QOveQG8gWqOud/edMaPcM juS50AYZqlB1FEigeQhRLPYSPlw7Xpjdqz9QktMNfhizEf+vvqYBCuzC8Abzq3X4h9hV SPdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LKh/WJUZ/a7LbcLCfqzrp1snhXBTaab70JqzWclptYU=; b=BSSXpltPHwTxHYTHDYiHAw59KGUhLg1lnDL43NbjFKynxq8JNq00aax/hO8omGswR4 67m3/MYrL9cnCMqnXgMLRXJxnb2XbaALJBdJRRL3BqQ9WD6oed+aBxfjCUo7SPE6kQHP PjZe4ZZb2T4LMoROt+N5ePfQAS54bcAsIeSVNO6Aw3XCIYWT2yBaIYaOgCu4MErQoy+H fjgxHZ6ABCvjRdMA+tQn26nyjK2qBBchSQx6zG9qAq2Sf16bh17uLkPIJAdT+ggYM4+B 7+UZ0HgPN6mSVK6BzJFrnbzJ0fimSL+SdQFMMXngfeD/ebjBBQ4Pyoz1e6XSwwNh02jf tFrw== X-Gm-Message-State: AO0yUKVxwIwo9tYCH/EfFb17l8dj6lAXnzfx+LI8MsMX7u2GLckEfBCv YErtc73FxVTOe8B9lHFsNEIEOmv8QFFr7Z1o X-Google-Smtp-Source: AK7set9evLzFcrw2rxB8O8zARpS4QXEMVySA2hcbua8xjaNc0EWOTiVbkkYEJbtU3iLq24HMJPBALw== X-Received: by 2002:a17:907:6d03:b0:8af:22b4:9952 with SMTP id sa3-20020a1709076d0300b008af22b49952mr13760898ejc.38.1676129915776; Sat, 11 Feb 2023 07:38:35 -0800 (PST) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id og15-20020a1709071dcf00b007aea1dc1840sm3985303ejc.111.2023.02.11.07.38.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Feb 2023 07:38:35 -0800 (PST) From: Dmitry Baryshkov To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/2] image_types.bbclass: add support for sparse images Date: Sat, 11 Feb 2023 18:38:28 +0300 Message-Id: <20230211153828.2113018-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230211153828.2113018-1-dmitry.baryshkov@linaro.org> References: <20230211153828.2113018-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 11 Feb 2023 15:38:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/177008 Add Support for sparse conversion to be able to generate sparse images. Signed-off-by: Dmitry Baryshkov --- meta/classes-recipe/image_types.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/image_types.bbclass b/meta/classes-recipe/image_types.bbclass index ae00728a74da..cf8cc27e87e7 100644 --- a/meta/classes-recipe/image_types.bbclass +++ b/meta/classes-recipe/image_types.bbclass @@ -308,7 +308,7 @@ IMAGE_TYPES:append:x86-64 = " hddimg iso" # CONVERSION_CMD/DEPENDS. COMPRESSIONTYPES ?= "" -CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip 7zip zst sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap u-boot vmdk vhd vhdx vdi qcow2 base64 gzsync zsync ${COMPRESSIONTYPES}" +CONVERSIONTYPES = "gz bz2 lzma xz lz4 lzo zip 7zip zst sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum bmap u-boot vmdk vhd vhdx vdi qcow2 base64 gzsync zsync sparse ${COMPRESSIONTYPES}" CONVERSION_CMD:lzma = "lzma -k -f -7 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" CONVERSION_CMD:gz = "gzip -f -9 -n -c --rsyncable ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.gz" CONVERSION_CMD:bz2 = "pbzip2 -f -k ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" @@ -335,6 +335,7 @@ CONVERSION_CMD:qcow2 = "qemu-img convert -O qcow2 ${IMAGE_NAME}${IMAGE_NAME_SUFF CONVERSION_CMD:base64 = "base64 ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} > ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.base64" CONVERSION_CMD:zsync = "zsyncmake_curl ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" CONVERSION_CMD:gzsync = "zsyncmake_curl -z ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}" +CONVERSION_CMD:sparse = "img2simg -c ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type} ${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.${type}.sparse" CONVERSION_DEPENDS_lzma = "xz-native" CONVERSION_DEPENDS_gz = "pigz-native" CONVERSION_DEPENDS_bz2 = "pbzip2-native" @@ -355,6 +356,7 @@ CONVERSION_DEPENDS_vhdx = "qemu-system-native" CONVERSION_DEPENDS_vhd = "qemu-system-native" CONVERSION_DEPENDS_zsync = "zsync-curl-native" CONVERSION_DEPENDS_gzsync = "zsync-curl-native" +CONVERSION_DEPENDS_sparse = "rust-android-sparse-native" RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4" RUNNABLE_MACHINE_PATTERNS ?= "qemu"