All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] doc/wic,README.hardware: add dd option conv=sparse
@ 2025-01-26 12:37 Jörg Sommer
  2025-01-26 12:53 ` [docs] " Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Jörg Sommer @ 2025-01-26 12:37 UTC (permalink / raw)
  To: docs, joerg.sommer; +Cc: Jörg Sommer

From: Jörg Sommer <joerg.sommer@navimatix.de>

The GNU implementation of dd supports the skipping of sparse blocks which
can speed-up the write, esp. of wic images with big holes:

    $ sudo dd if=image.wic of=/dev/sdb bs=2M
    2683+1 Datensätze ein
    2683+1 Datensätze aus
    5628735488 Bytes (5,6 GB, 5,2 GiB) kopiert, 84,2773 s, 66,8 MB/s

    $ sudo dd if=image.wic of=/dev/sdb bs=2M conv=sparse
    2683+1 Datensätze ein
    2683+1 Datensätze aus
    5628735488 Bytes (5,6 GB, 5,2 GiB) kopiert, 11,3314 s, 497 MB/s

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
---
 documentation/dev-manual/wic.rst  |  8 +++++++-
 meta-yocto-bsp/README.hardware.md | 20 ++++++++++++++------
 2 files changed, 21 insertions(+), 7 deletions(-)


I don't know if I should amend the "dd if=directdisksdb-gpt-201710090938-sdb.direct" in line
595, because this wouldn't match the output of dd.


diff --git a/documentation/dev-manual/wic.rst b/documentation/dev-manual/wic.rst
index fced0e170c..792fa35fa7 100644
--- a/documentation/dev-manual/wic.rst
+++ b/documentation/dev-manual/wic.rst
@@ -507,7 +507,13 @@ built your image, and boot from the media. You can write the image by using
 
 or ::
 
-   $ sudo dd if=mkefidisk-201804191017-sda.direct of=/dev/sdX
+   $ sudo dd if=mkefidisk-201804191017-sda.direct of=/dev/sdX bs=2M conv=sparse
+
+.. note::
+
+   The option ``conv=sparse`` is a GNU extension to skip writing of blocks
+   with purely zeros. If your ``dd`` (e.g. BusyBox) does not support it, you
+   can safely remove this option.
 
 .. note::
 
diff --git a/meta-yocto-bsp/README.hardware.md b/meta-yocto-bsp/README.hardware.md
index d2cc05f909..a824963e4e 100644
--- a/meta-yocto-bsp/README.hardware.md
+++ b/meta-yocto-bsp/README.hardware.md
@@ -91,7 +91,7 @@ Depending on the device, it can boot from a traditional hard-disk, a USB device,
 or over the network. Writing generated images to physical media is
 straightforward with a caveat for USB devices. The following examples assume the
 target boot device is /dev/sdb, be sure to verify this and use the correct
-device as the following commands are run as root and are not reversable.
+device as the following commands are run as root and are not reversible.
 
 USB Device:
 
@@ -105,7 +105,11 @@ USB Device:
   2. Use the `dd` utility to write the image to the raw block device. For
      example:
 
-         # dd if=core-image-minimal-genericx86.hddimg of=/dev/sdb
+         # dd if=core-image-minimal-genericx86.hddimg of=/dev/sdb bs=2M conv=sparse
+
+      The option `conv=sparse` is a GNU extension to skip writing of blocks with
+      purely zeros. If your `dd` doesn't support it, you can safely drop this
+      option.
 
   If the device fails to boot with "Boot error" displayed, or apparently
   stops just after the SYSLINUX version banner, it is likely the BIOS cannot
@@ -119,9 +123,11 @@ USB Device:
 
   2. Use a ".wic" image with an EFI partition
 
-     1. With a default grub-efi bootloader:
+     1. With a default grub-efi bootloader (`conv=sparse` is a GNU extension to
+        skip empty blocks for speed up; remove it, if your `dd` doesn't support
+        it):
 
-            # dd if=core-image-minimal-genericx86-64.wic of=/dev/sdb
+            # dd if=core-image-minimal-genericx86-64.wic of=/dev/sdb bs=2M conv=sparse
 
      2. Use systemd-boot instead. Build an image with `EFI_PROVIDER="systemd-boot"` then use the above
        `dd` command to write the image to a USB stick.
@@ -179,8 +185,10 @@ From a Linux system with access to the image files perform the following steps:
 
          $ bitbake core-image-minimal
 
-  2. Use the "dd" utility to write the image to the SD card. For example:
+  2. Use the `dd` utility to write the image to the SD card. For example
+     (`conv=sparse` is a GNU extension to skip empty blocks for speed up; remove
+     it, if your `dd` doesn't support it):
 
-         # dd if=core-image-minimal-beaglebone-yocto.wic of=/dev/sdb
+         # dd if=core-image-minimal-beaglebone-yocto.wic of=/dev/sdb bs=2M conv=sparse
 
   3. Insert the SD card into the Beaglebone and boot the board.
-- 
2.47.1



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

end of thread, other threads:[~2025-01-27  8:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-26 12:37 [PATCH] doc/wic,README.hardware: add dd option conv=sparse Jörg Sommer
2025-01-26 12:53 ` [docs] " Richard Purdie
2025-01-26 15:25   ` Jörg Sommer
2025-01-26 16:56     ` Yoann Congal
2025-01-27  8:18       ` Antonin Godard

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.