# How add uboot kernel boot parameters

**URL:** <https://hub.mender.io/t/how-add-uboot-kernel-boot-parameters/4826>\
**Category:** Yocto Project\
**Tags:** nxp\
**Created:** [April 5, 2022, 2:41pm UTC](https://hub.mender.io/t/how-add-uboot-kernel-boot-parameters/4826 "2022-04-05T14:41:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![threesc](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@threesc](https://hub.mender.io/u/threesc)\
**Post date:** [April 5, 2022, 2:41pm UTC](https://hub.mender.io/t/how-add-uboot-kernel-boot-parameters/4826/1 "2022-04-05T14:41:11Z")

</div>

Is same question as [here](https://hub.mender.io/t/append-bootargs-to-grub/4193), but I haven’t gotten any of those options to work properly (though i’m not confident I am using CONFIG\_BOOTARGS correctly, i’ve tried putting it in various places in bitbake recipes and .conf files and none have had any effect)

I’ve also tried the solution found [here](https://community.nxp.com/t5/i-MX-Processors/u-boot-kernel-command-line/td-p/381601). Not sure, but I think it didn’t work because of mender?

am inheriting mender-full, I have managed to do what I want by manually editing /boot/efi/EFI/BOOT/grub.cfg; I am trying to add fsck.mode=force and fsck.repair=yes to the kernel boot parameters

I can’t find the page, but I found somewhere someone mentioned there was a bbappend method (which I haven’t been able to get working yet and wasn’t described in much detail) and that they were considering adding a variable for modifying bootargs, but I haven’t found that variable either if it was added

figured I would ask here if there is a proper bitbake way of doing this; currently am looking at [this recipe](https://github.com/mendersoftware/meta-mender/blob/master/meta-mender-core/recipes-bsp/grub-mender-grubenv/grub-mender-grubenv.inc) to try and figure out where that grub.cfg comes from so I can modify it with a patch or bbappend/sed method, but figured I would check if there is a more bitbake way of doing this first

thanks for any help

---

<div class="post-metadata">

**Author:** ![clementp](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/clementp/32/1392_2.png) [@clementp](https://hub.mender.io/u/clementp)\
**Post date:** [April 5, 2022, 3:00pm UTC](https://hub.mender.io/t/how-add-uboot-kernel-boot-parameters/4826/2 "2022-04-05T15:00:18Z")

</div>

Hi @threesc,

If you have dynamic-layers:  
$\> mkdir -p dynamic-layers/mender/recipes-bsp/grub-mender-grubenv  
$\> cd dynamic-layers/mender/recipes-bsp/grub-mender-grubenv

> $\> tree  
> ├── files  
> │ └── 02\_qemu\_console\_x86\_grub.cfg  
> └── grub-mender-grubenv\_%.bbappend

> $\> cat grub-mender-grubenv\_%.bbappend  
> FILESEXTRAPATHS\_prepend\_mender-client-install := “${THISDIR}/files:”  
> SRC\_URI\_append\_\<YOUR\_MACHINE\>\_mender-client-install = " file://02\_qemu\_console\_x86\_grub.cfg;subdir=git"

> $\> cat files/02\_qemu\_console\_x86\_grub.cfg  
> set console\_bootargs=“console=ttyS0,115200n8 nofb modprobe.blacklist=uvesafb”

---

<div class="post-metadata">

**Author:** ![threesc](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@threesc](https://hub.mender.io/u/threesc)\
**Post date:** [April 6, 2022, 10:12am UTC](https://hub.mender.io/t/how-add-uboot-kernel-boot-parameters/4826/3 "2022-04-06T10:12:15Z")

</div>

it seems I don’t have dynamic-layers (couldn’t figure out anything about it with google that made sense for what you mentioned either)

however I did figure out my problem, that method does work for my setup if I do it properly, I was missing the \_mender-client-install bit from the SRC\_URI\_append as I had initially tried removing the \<YOUR\_MACHINE\> bit and control what targets got it by the layer instead, and never noticed there was more there than that bit

---

<div class="post-metadata">

**Author:** ![clementp](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/clementp/32/1392_2.png) [@clementp](https://hub.mender.io/u/clementp)\
**Post date:** [April 6, 2022, 10:34am UTC](https://hub.mender.io/t/how-add-uboot-kernel-boot-parameters/4826/4 "2022-04-06T10:34:08Z")

</div>

To enable dynamic layer add this in your conf/layer.conf

```auto
# Let us add layer-specific bbappends which are only applied when that
# layer is included in our configuration
BBFILES += "${@' '.join('${LAYERDIR}/dynamic-layers/%s/recipes*/*/*.bbappend' % layer \
               for layer in BBFILE_COLLECTIONS.split())}"
BBFILES += "${@' '.join('${LAYERDIR}/dynamic-layers/%s/recipes*/*/*.bb' % layer \
               for layer in BBFILE_COLLECTIONS.split())}"

```
