All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] rust-android-sparse: add lightweight simg2img/img2simg implementation
@ 2023-02-11 15:38 Dmitry Baryshkov
  2023-02-11 15:38 ` [PATCH 2/2] image_types.bbclass: add support for sparse images Dmitry Baryshkov
  2023-02-11 17:09 ` [OE-core] [PATCH 1/2] rust-android-sparse: add lightweight simg2img/img2simg implementation Alexander Kanavin
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2023-02-11 15:38 UTC (permalink / raw)
  To: openembedded-core

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 <dmitry.baryshkov@linaro.org>
---
 .../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"
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] image_types.bbclass: add support for sparse images
  2023-02-11 15:38 [PATCH 1/2] rust-android-sparse: add lightweight simg2img/img2simg implementation Dmitry Baryshkov
@ 2023-02-11 15:38 ` Dmitry Baryshkov
  2023-02-11 17:09 ` [OE-core] [PATCH 1/2] rust-android-sparse: add lightweight simg2img/img2simg implementation Alexander Kanavin
  1 sibling, 0 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2023-02-11 15:38 UTC (permalink / raw)
  To: openembedded-core

Add Support for sparse conversion to be able to generate sparse images.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 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"
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH 1/2] rust-android-sparse: add lightweight simg2img/img2simg implementation
  2023-02-11 15:38 [PATCH 1/2] rust-android-sparse: add lightweight simg2img/img2simg implementation Dmitry Baryshkov
  2023-02-11 15:38 ` [PATCH 2/2] image_types.bbclass: add support for sparse images Dmitry Baryshkov
@ 2023-02-11 17:09 ` Alexander Kanavin
  2023-02-14  3:42   ` Dmitry Baryshkov
  1 sibling, 1 reply; 5+ messages in thread
From: Alexander Kanavin @ 2023-02-11 17:09 UTC (permalink / raw)
  To: Dmitry Baryshkov; +Cc: openembedded-core

But is it necessary or desirable to have it in core? This does seem
like something that belongs in meta-oe rather.

Alex

On Sat, 11 Feb 2023 at 16:38, Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:
>
> 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 <dmitry.baryshkov@linaro.org>
> ---
>  .../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"
> --
> 2.30.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#177007): https://lists.openembedded.org/g/openembedded-core/message/177007
> Mute This Topic: https://lists.openembedded.org/mt/96898285/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH 1/2] rust-android-sparse: add lightweight simg2img/img2simg implementation
  2023-02-11 17:09 ` [OE-core] [PATCH 1/2] rust-android-sparse: add lightweight simg2img/img2simg implementation Alexander Kanavin
@ 2023-02-14  3:42   ` Dmitry Baryshkov
  2023-02-14  6:39     ` Alexander Kanavin
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Baryshkov @ 2023-02-14  3:42 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-core

On Sat, 11 Feb 2023 at 19:10, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> But is it necessary or desirable to have it in core? This does seem
> like something that belongs in meta-oe rather.

My goal was to move sparse image handling in a way to be able to
generate them from the BSP layers, removing dependency on the meta-oe
layer. This way it is possible to generate sparse images
unconditionally and then let the user feed them to fastboot.

But yeah, if it's recommended to keep it in meta-oe, I can move my recipe there.

>
> Alex
>
> On Sat, 11 Feb 2023 at 16:38, Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:
> >
> > 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 <dmitry.baryshkov@linaro.org>
> > ---
> >  .../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"
> > --
> > 2.30.2
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#177007): https://lists.openembedded.org/g/openembedded-core/message/177007
> > Mute This Topic: https://lists.openembedded.org/mt/96898285/1686489
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >



--
With best wishes
Dmitry


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH 1/2] rust-android-sparse: add lightweight simg2img/img2simg implementation
  2023-02-14  3:42   ` Dmitry Baryshkov
@ 2023-02-14  6:39     ` Alexander Kanavin
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Kanavin @ 2023-02-14  6:39 UTC (permalink / raw)
  To: Dmitry Baryshkov; +Cc: openembedded-core

On Tue, 14 Feb 2023 at 04:42, Dmitry Baryshkov <dbaryshkov@gmail.com> wrote:
> My goal was to move sparse image handling in a way to be able to
> generate them from the BSP layers, removing dependency on the meta-oe
> layer. This way it is possible to generate sparse images
> unconditionally and then let the user feed them to fastboot.
>
> But yeah, if it's recommended to keep it in meta-oe, I can move my recipe there.

Just to clarify, to get something into core, you need to explain what
are those 'android sparse images', what is consuming them, and whether
supporting them fulfils a broadly useful scenario (this is the hardest
part, as there has not been interest from others). There should also
be testing, and commitment to maintain the pieces.

Alex


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-14  6:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-11 15:38 [PATCH 1/2] rust-android-sparse: add lightweight simg2img/img2simg implementation Dmitry Baryshkov
2023-02-11 15:38 ` [PATCH 2/2] image_types.bbclass: add support for sparse images Dmitry Baryshkov
2023-02-11 17:09 ` [OE-core] [PATCH 1/2] rust-android-sparse: add lightweight simg2img/img2simg implementation Alexander Kanavin
2023-02-14  3:42   ` Dmitry Baryshkov
2023-02-14  6:39     ` Alexander Kanavin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.