# Updating uboot boot args via an OTA update?

**URL:** <https://hub.mender.io/t/updating-uboot-boot-args-via-an-ota-update/643>\
**Category:** General Discussions\
**Created:** [May 30, 2019, 3:14am UTC](https://hub.mender.io/t/updating-uboot-boot-args-via-an-ota-update/643 "2019-05-30T03:14:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samlewis](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/samlewis/32/393_2.png) [@samlewis](https://hub.mender.io/u/samlewis)\
**Post date:** [May 30, 2019, 3:14am UTC](https://hub.mender.io/t/updating-uboot-boot-args-via-an-ota-update/643/1 "2019-05-30T03:14:15Z")

</div>

Is there a recommended way of updating the Linux boot args via an OTA update?

From what I understand, the bootargs are currently taken from uboot as uboot is what manages which partition should be booted into.

I’ve seen that it is possible to specify the ‘chosen bootargs’ via a device tree binary, however I imagine using this rather than the uboot bootargs would interfere with Mender’s ability to manage OTA updates.

Is there a recommended way of combining the bootargs from UBoot with the boot args from the device tree?

---

<div class="post-metadata">

**Author:** ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)\
**Post date:** [May 30, 2019, 7:40am UTC](https://hub.mender.io/t/updating-uboot-boot-args-via-an-ota-update/643/2 "2019-05-30T07:40:27Z")

</div>

@samlewis depends on which platform. Some platforms offer to use boot script (boot.scr) which is set various variables and boot kernel (also this script is doing mender setup). But as said depends on which target you want to use it. Thanks.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [May 30, 2019, 9:58am UTC](https://hub.mender.io/t/updating-uboot-boot-args-via-an-ota-update/643/3 "2019-05-30T09:58:17Z")

</div>

I would typically create something like `my_custom_bootargs` and then set the following in U-boot,

`set bootargs $bootargs $my_custom_bootargs`

This way you can modify the `my_custom_bootargs` to extend the existing logic instead of overwriting it

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [May 30, 2019, 2:19pm UTC](https://hub.mender.io/t/updating-uboot-boot-args-via-an-ota-update/643/4 "2019-05-30T14:19:55Z")

</div>

You can also do something in MENDER\_UBOOT\_PRE\_SETUP\_COMMANDS which is already processed by the Mender logic. To modify that with an OTA update you could probably invoke fw\_setenv from a post-install state script.
