Yocto Project Discussions
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@cherry.de>
To: yocto@lists.yoctoproject.org, duane@duaneellis.com
Subject: Re: [yocto] BmpTools question
Date: Wed, 18 Sep 2024 17:57:28 +0200	[thread overview]
Message-ID: <503eb0df-e2b6-4a0e-a78a-de8bc28c8fed@cherry.de> (raw)
In-Reply-To: <PH0PR05MB8478A84A2A8642B365D46045CA622@PH0PR05MB8478.namprd05.prod.outlook.com>

Hi,

On 9/18/24 5:27 PM, Duane Ellis via lists.yoctoproject.org wrote:
> You don't often get email from duane=duaneellis.com@lists.yoctoproject.org. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
> Hi – I am following this page:
> https://docs.yoctoproject.org/dev-manual/bmaptool.html
> 
> And I have some questions about the BMAPTOOL.
> 
> As part of a CI/CD process I need to create a disk image [file] I can later write to an USB stick.
> I don’t find instructions or examples to do that.
> So I tried to figure it out on my own.
> 
> I did the following:
> 
> step 1:
>                  sudo apt install bmap-tools
> 
> Step 2:
>                  Bmap-tool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
> 
> Instead of specifying /dev/sdX – I wrote it to a file, ie: “my-image.img”
> 
> Step 3 (first try)
>                  I transferred that file to my PC and tried to use RUFUS to write directly to a USB Stick.
>                  Rufus has issues and crashes -> That is a seprate problem.
>                  I will try etcher later today.
> 
> Step 3(alternate since that did not work)
>                  I have GITBASH on my windows machine
>                  So running GIT BASH as ADMIN, I tried this:
> 
>         dd if=my-image.img  of=/dev/sdc  bs=16384
> 
> It writes very quickly with bs=16384, dam slow without “bs=16384”
> 
> This image is not bootable ☹
> 
> BUT if I write direct to the USB stick from my Virtual machine it works (ie: Map the USB stick to my VM instead of the Windows Host) all I am doing is replacing the FILE with the DEVICE
> 
> Questions:
> 
> 1) is there docs for creating an IMAGE file? (This would be a good addition to that page/link above)
> 
> 2) Do I need to write to a partition? Ie: /dev/sdc1 instead of the device /dev/sdc
> 
> 3) Are there any examples of this I can/use follow
> 
> 4) I did use DD to DUMP the first 4K or so of the disk to a file
> Then compared that binary with the first 4K of the IMAGE file I created above
> They match perfectly – so I believe the IMAGE file is being written correctly.
> 

The wic image is the image you need to flash on the USB stick. No 
modification required.

dd if=yourimage.wic of=/dev/sdX BS=4M status=progress

and you're good to go. You use the full block device and not a partition.

If you want to use bmap for faster flashing, you need the .wic.bmap 
associated with the .wic file (and the .wic file itself). Then

bmaptool copy yourimage.wic /dev/sdX

it'll look for yourimage.wic.bmap and use it to skip flashing empty 
blocks (empty blocks != blocks with zeroes).

With etcher, you should use .wic only I believe. It's basically an ISO file.

If dd + .wic doesn't work, it is possible the .wic file isn't created 
appropriately, for that you want to check the WKS file that was used to 
create the .wic file.

Cheers,
Quentin


      reply	other threads:[~2024-09-18 15:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18 15:27 BmpTools question Duane Ellis
2024-09-18 15:57 ` Quentin Schulz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=503eb0df-e2b6-4a0e-a78a-de8bc28c8fed@cherry.de \
    --to=quentin.schulz@cherry.de \
    --cc=duane@duaneellis.com \
    --cc=yocto@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox