# DFU update module generator script bug

**URL:** <https://hub.mender.io/t/dfu-update-module-generator-script-bug/6418>\
**Category:** General Discussions\
**Tags:** update-modules, dfu\
**Created:** [December 14, 2023, 12:06pm UTC](https://hub.mender.io/t/dfu-update-module-generator-script-bug/6418 "2023-12-14T12:06:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Utsav\_Shah](https://avatars.discourse-cdn.com/v4/letter/u/3ab097/32.png) [@Utsav\_Shah](https://hub.mender.io/u/Utsav_Shah)\
**Post date:** [December 14, 2023, 12:06pm UTC](https://hub.mender.io/t/dfu-update-module-generator-script-bug/6418/1 "2023-12-14T12:06:57Z")

</div>

@mirzak and @TheYoctoJester is am facing an additional issue as well . While executing the command to create a mender artifact using the dfu-artifact-gen tool I am getting the following error:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/2X/d/df78a9482818055c0350821bb281a61872edaf3f.png)  
It says that the **./dfu-artifact-gen: 47: 6: not found**  
I have downloaded it in my Downloads folder. Also I have the mender-artifact tool installed as per the given steps at : [Downloads | Mender documentation](https://docs.mender.io/downloads)

What is going off track here?

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [December 14, 2023, 12:10pm UTC](https://hub.mender.io/t/dfu-update-module-generator-script-bug/6418/2 "2023-12-14T12:10:58Z")

</div>

@Utsav_Shah standard shell syntax applied. Either put everything in one command, or use export for variables. You can check the content of a variable by echoing it or looking at the environment. Examples:

```auto
env
ARTIFACT_NAME="myartifact" echo "my artifact name is $ARTIFACT_NAME"

```

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![Utsav\_Shah](https://avatars.discourse-cdn.com/v4/letter/u/3ab097/32.png) [@Utsav\_Shah](https://hub.mender.io/u/Utsav_Shah)\
**Post date:** [December 14, 2023, 12:32pm UTC](https://hub.mender.io/t/dfu-update-module-generator-script-bug/6418/3 "2023-12-14T12:32:32Z")

</div>

@TheYoctoJester I had tried to replace the name directly in the command but still the same issue occurs. I tried giving the names with and without quotes but that does not solve it as well.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/2X/6/68db5465d79b5325a2dc72d33efc9243a0164a82.png)

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [December 14, 2023, 12:43pm UTC](https://hub.mender.io/t/dfu-update-module-generator-script-bug/6418/4 "2023-12-14T12:43:04Z")

</div>

@Utsav_Shah interesting, this is being caused by a hidden bashism. Change the shebang line in `dfu-artifact-gen` to

```auto
#!/bin/bash

```

to invoke it explicitly, then it should work.

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![Utsav\_Shah](https://avatars.discourse-cdn.com/v4/letter/u/3ab097/32.png) [@Utsav\_Shah](https://hub.mender.io/u/Utsav_Shah)\
**Post date:** [December 15, 2023, 5:39am UTC](https://hub.mender.io/t/dfu-update-module-generator-script-bug/6418/5 "2023-12-15T05:39:14Z")

</div>

@TheYoctoJester changing the shell to bash solved the problem of generating the mender artifact.Thank you!

Now I face another issue: The deployment from the mender was successful and the firmware was also uploaded on to the NRF board that I have connected with my main gateway system. However, upon successful completion of the firmware upload the board does not switch to the updated firmware. AS an example I had uploaded a blink program that toggles an LED. To run this program I have to completely restart my entire system and only then the programs switch and my blink program starts running. How do I make sure that whenever the mender deployment of the firmware is done, it automatically starts executing without having to restart my system? Do I need to make any changes or mention any parameters while making the artifact? Or some changes in the dfu-util is required?

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [December 15, 2023, 8:07am UTC](https://hub.mender.io/t/dfu-update-module-generator-script-bug/6418/6 "2023-12-15T08:07:07Z")

</div>

@Utsav_Shah the Update Module has to be installed on the device. This is explained in the tutorial here: [Device Firmware Update (DFU)](https://hub.mender.io/t/device-firmware-update-dfu/1617#install-the-update-module-5).

An Update Module is the client side handling for such artifacts. The upstream source is:

> [@Device Firmware Update (DFU)](https://hub.mender.io/t/device-firmware-update-dfu/1617#install-the-update-module-5):
>
> Description The DFU Update Module is a reference Update Module that demonstrates how to update firmware of a peripheral device using the Device Firmware Update USB device class. Example use-cases: Deploy firmware updates to peripheral devices using the USB Device Firmware Update (DFU) protocol Specification Module name dfu Supports rollback no Requires restart no Artifact generation script yes Full operating system updater no Source code [Update Module](https://github.com/mendersoftware/mender-update-modules/tree/master/dfu/module/dfu), [Artifact Generat…](https://github.com/mendersoftware/mender-update-modules/blob/master/dfu/module-artifact-gen/dfu-artifact-gen)

More details on Update Modules:

> **[Create a custom Update Module | Mender documentation](https://docs.mender.io/artifact-creation/create-a-custom-update-module)**

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![Utsav\_Shah](https://avatars.discourse-cdn.com/v4/letter/u/3ab097/32.png) [@Utsav\_Shah](https://hub.mender.io/u/Utsav_Shah)\
**Post date:** [December 15, 2023, 9:07am UTC](https://hub.mender.io/t/dfu-update-module-generator-script-bug/6418/7 "2023-12-15T09:07:37Z")

</div>

@TheYoctoJester the update module concept is now clear! Thanks. Currently I am facing an issue to automatically start the firmware on the NRF board once the mender articat has been successfully deployed. I have to restart the whole system in order for the uploaded firmware to run on the NRF5340. How do I do this automatically without a restart?

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [December 15, 2023, 9:09am UTC](https://hub.mender.io/t/dfu-update-module-generator-script-bug/6418/8 "2023-12-15T09:09:11Z")

</div>

@Utsav_Shah to add operations concerning DFU, adapt the Update Module to your needs - it is just a script.

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [December 22, 2023, 8:14am UTC](https://hub.mender.io/t/dfu-update-module-generator-script-bug/6418/9 "2023-12-22T08:14:35Z")

</div>

A post was merged into an existing topic: [Enabling multiple firmware/application updates on NRF5340 DK board using DFU feature](https://hub.mender.io/t/enabling-multiple-firmware-application-updates-on-nrf5340-dk-board-using-dfu-feature/6426/2)
