diff mbox series

[3/3] dev-manual/bmaptool.rst: simplify and fix instructions

Message ID 20241201173801.3290796-3-michael.opdenacker@rootcommit.com
State New
Headers show
Series [1/3] dev-manual: fix styling of references to bmaptool | expand

Commit Message

Michael Opdenacker Dec. 1, 2024, 5:38 p.m. UTC
From: Michael Opdenacker <michael.opdenacker@rootcommit.com>

- Remove duplicate instructions

- Detail how to run bmaptool directly if you installed it on your host
  instead of building it through the ``bmaptool-native`` recipe,
  as running "oe-run-native bmaptool-native bmaptool ..." won't work
  in this case.

Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com>
---
 documentation/dev-manual/bmaptool.rst | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Comments

Ulrich Ölmann Dec. 1, 2024, 7:26 p.m. UTC | #1
Hey Michael,

On Sun, Dec 01 2024 at 17:38 +0000, "Michael Opdenacker via lists.yoctoproject.org" <michael.opdenacker=rootcommit.com@lists.yoctoproject.org> wrote:
> From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
>
> - Remove duplicate instructions
>
> - Detail how to run bmaptool directly if you installed it on your host
>   instead of building it through the ``bmaptool-native`` recipe,
>   as running "oe-run-native bmaptool-native bmaptool ..." won't work
>   in this case.
>
> Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com>
> ---
>  documentation/dev-manual/bmaptool.rst | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/documentation/dev-manual/bmaptool.rst b/documentation/dev-manual/bmaptool.rst
> index 5fc46c7792..e17074b65b 100644
> --- a/documentation/dev-manual/bmaptool.rst
> +++ b/documentation/dev-manual/bmaptool.rst
> @@ -44,14 +44,16 @@ any type of image. Use these steps to flash an image using `bmaptool`:
>     depending on your particular setup. The following commands assume the
>     image resides in the :term:`Build Directory`'s ``deploy/images/`` area:
>
> -   -  If you have write access to the media, use this command form::
> +   -  If needed, set permissions to get write access to the media::
>
> -         $ oe-run-native bmaptool-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
> +         $ such chmod 666 /dev/sdX

a small typo slipped in here: s/such/sudo/

Best regards
Ulrich


> +
> +   -  If you installed the package for `bmaptool`, you can directly run::
> +
> +         $ sudo bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
>
> -   -  If you do not have write access to the media, set your permissions
> -      first and then use the same command form::
> +   -  Otherwise, if you built `bmaptool` with BitBake, run::
>
> -         $ sudo chmod 666 /dev/sdX
>           $ oe-run-native bmaptool-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
>
>  For help on the ``bmaptool`` command, use the following command::
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#5860): https://lists.yoctoproject.org/g/docs/message/5860
> Mute This Topic: https://lists.yoctoproject.org/mt/109865516/3618626
> Group Owner: docs+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/docs/unsub [u.oelmann@pengutronix.de]
> -=-=-=-=-=-=-=-=-=-=-=-
Antonin Godard Dec. 2, 2024, 9:02 a.m. UTC | #2
Hi Michael,

On Sun Dec 1, 2024 at 6:38 PM CET, Michael Opdenacker via lists.yoctoproject.org wrote:
> From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
>
> - Remove duplicate instructions
>
> - Detail how to run bmaptool directly if you installed it on your host
>   instead of building it through the ``bmaptool-native`` recipe,
>   as running "oe-run-native bmaptool-native bmaptool ..." won't work
>   in this case.
>
> Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com>
> ---
>  documentation/dev-manual/bmaptool.rst | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/documentation/dev-manual/bmaptool.rst b/documentation/dev-manual/bmaptool.rst
> index 5fc46c7792..e17074b65b 100644
> --- a/documentation/dev-manual/bmaptool.rst
> +++ b/documentation/dev-manual/bmaptool.rst
> @@ -44,14 +44,16 @@ any type of image. Use these steps to flash an image using `bmaptool`:
>     depending on your particular setup. The following commands assume the
>     image resides in the :term:`Build Directory`'s ``deploy/images/`` area:
>  
> -   -  If you have write access to the media, use this command form::
> +   -  If needed, set permissions to get write access to the media::
>  
> -         $ oe-run-native bmaptool-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
> +         $ such chmod 666 /dev/sdX

I know this was already instructed before, but maybe `chmod o+w` is a better
practice and advice to give. What do you think?

Also I think this recommendation could be given after the sudo command, since it
shouldn't be a problem to write to the device as root. I'm assuming the `chmod
o+w` instruction was added here because oe-run-native doesn't run as root.

> +
> +   -  If you installed the package for `bmaptool`, you can directly run::
> +
> +         $ sudo bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
>  
> -   -  If you do not have write access to the media, set your permissions
> -      first and then use the same command form::
> +   -  Otherwise, if you built `bmaptool` with BitBake, run::
>  
> -         $ sudo chmod 666 /dev/sdX
>           $ oe-run-native bmaptool-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
>  
>  For help on the ``bmaptool`` command, use the following command::

Regards,
Antonin
Michael Opdenacker Dec. 4, 2024, 9:19 a.m. UTC | #3
Hey Ulrich

On 12/1/24 20:26, Ulrich Ölmann wrote:
> Hey Michael,
>
> On Sun, Dec 01 2024 at 17:38 +0000, "Michael Opdenacker via lists.yoctoproject.org" <michael.opdenacker=rootcommit.com@lists.yoctoproject.org> wrote:
>> From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
>>
>> - Remove duplicate instructions
>>
>> - Detail how to run bmaptool directly if you installed it on your host
>>    instead of building it through the ``bmaptool-native`` recipe,
>>    as running "oe-run-native bmaptool-native bmaptool ..." won't work
>>    in this case.
>>
>> Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com>
>> ---
>>   documentation/dev-manual/bmaptool.rst | 12 +++++++-----
>>   1 file changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/documentation/dev-manual/bmaptool.rst b/documentation/dev-manual/bmaptool.rst
>> index 5fc46c7792..e17074b65b 100644
>> --- a/documentation/dev-manual/bmaptool.rst
>> +++ b/documentation/dev-manual/bmaptool.rst
>> @@ -44,14 +44,16 @@ any type of image. Use these steps to flash an image using `bmaptool`:
>>      depending on your particular setup. The following commands assume the
>>      image resides in the :term:`Build Directory`'s ``deploy/images/`` area:
>>
>> -   -  If you have write access to the media, use this command form::
>> +   -  If needed, set permissions to get write access to the media::
>>
>> -         $ oe-run-native bmaptool-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
>> +         $ such chmod 666 /dev/sdX
> a small typo slipped in here: s/such/sudo/


Oops, fixed!
Thanks for the review.
Cheers
Michael.
Michael Opdenacker Dec. 4, 2024, 9:26 a.m. UTC | #4
Hi Antonin

Thanks for the review!

On 12/2/24 10:02, Antonin Godard wrote:
> Hi Michael,
>
> On Sun Dec 1, 2024 at 6:38 PM CET, Michael Opdenacker via lists.yoctoproject.org wrote:
>> From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
>>
>> - Remove duplicate instructions
>>
>> - Detail how to run bmaptool directly if you installed it on your host
>>    instead of building it through the ``bmaptool-native`` recipe,
>>    as running "oe-run-native bmaptool-native bmaptool ..." won't work
>>    in this case.
>>
>> Signed-off-by: Michael Opdenacker <michael.opdenacker@rootcommit.com>
>> ---
>>   documentation/dev-manual/bmaptool.rst | 12 +++++++-----
>>   1 file changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/documentation/dev-manual/bmaptool.rst b/documentation/dev-manual/bmaptool.rst
>> index 5fc46c7792..e17074b65b 100644
>> --- a/documentation/dev-manual/bmaptool.rst
>> +++ b/documentation/dev-manual/bmaptool.rst
>> @@ -44,14 +44,16 @@ any type of image. Use these steps to flash an image using `bmaptool`:
>>      depending on your particular setup. The following commands assume the
>>      image resides in the :term:`Build Directory`'s ``deploy/images/`` area:
>>   
>> -   -  If you have write access to the media, use this command form::
>> +   -  If needed, set permissions to get write access to the media::
>>   
>> -         $ oe-run-native bmaptool-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
>> +         $ such chmod 666 /dev/sdX
> I know this was already instructed before, but maybe `chmod o+w` is a better
> practice and advice to give. What do you think?


I wondered too. Let's do it, I agree.

>
> Also I think this recommendation could be given after the sudo command, since it
> shouldn't be a problem to write to the device as root. I'm assuming the `chmod
> o+w` instruction was added here because oe-run-native doesn't run as root.


Right, this makes no sense to give this recommendation before "sudo".
My V2 will recommend chmod right before running oe-run-native.

Cheers
Michael.
Michael Opdenacker Dec. 4, 2024, 9:33 a.m. UTC | #5
On 12/4/24 10:26, Michael Opdenacker wrote:
> Hi AntoninI know this was already instructed before, but maybe `chmod 
> o+w` is a better
>> practice and advice to give. What do you think?
>
>
> I wondered too. Let's do it, I agree.


Actually "chmod a+w". On my Ubuntu system, "o+w" would have worked, but 
there may be other systems on which the user either owns the device file 
or belongs to its group.
Michael.
Antonin Godard Dec. 4, 2024, 10:17 a.m. UTC | #6
Hi Michael,

On Wed Dec 4, 2024 at 10:33 AM CET, Michael Opdenacker wrote:
>
> On 12/4/24 10:26, Michael Opdenacker wrote:
>> Hi AntoninI know this was already instructed before, but maybe `chmod 
>> o+w` is a better
>>> practice and advice to give. What do you think?
>>
>>
>> I wondered too. Let's do it, I agree.
>
>
> Actually "chmod a+w". On my Ubuntu system, "o+w" would have worked, but 
> there may be other systems on which the user either owns the device file 
> or belongs to its group.
> Michael.

Yes indeed "chmod a+w" covers all use use cases so let's go for that :)

Antonin
diff mbox series

Patch

diff --git a/documentation/dev-manual/bmaptool.rst b/documentation/dev-manual/bmaptool.rst
index 5fc46c7792..e17074b65b 100644
--- a/documentation/dev-manual/bmaptool.rst
+++ b/documentation/dev-manual/bmaptool.rst
@@ -44,14 +44,16 @@  any type of image. Use these steps to flash an image using `bmaptool`:
    depending on your particular setup. The following commands assume the
    image resides in the :term:`Build Directory`'s ``deploy/images/`` area:
 
-   -  If you have write access to the media, use this command form::
+   -  If needed, set permissions to get write access to the media::
 
-         $ oe-run-native bmaptool-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
+         $ such chmod 666 /dev/sdX
+
+   -  If you installed the package for `bmaptool`, you can directly run::
+
+         $ sudo bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
 
-   -  If you do not have write access to the media, set your permissions
-      first and then use the same command form::
+   -  Otherwise, if you built `bmaptool` with BitBake, run::
 
-         $ sudo chmod 666 /dev/sdX
          $ oe-run-native bmaptool-native bmaptool copy build-directory/tmp/deploy/images/machine/image.wic /dev/sdX
 
 For help on the ``bmaptool`` command, use the following command::