# How to build the image with RT(realtime) patch?

**URL:** <https://community.solid-run.com/t/how-to-build-the-image-with-rt-realtime-patch/114>\
**Category:** NXP LX2160\
**Tags:** NXP-LX2160\
**Created:** [July 13, 2021, 4:38pm UTC](https://community.solid-run.com/t/how-to-build-the-image-with-rt-realtime-patch/114 "2021-07-13T16:38:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qii](https://avatars.discourse-cdn.com/v4/letter/q/97f17d/32.png) [@Qii](https://community.solid-run.com/u/Qii)\
**Post date:** [July 13, 2021, 4:38pm UTC](https://community.solid-run.com/t/how-to-build-the-image-with-rt-realtime-patch/114/1 "2021-07-13T16:38:58Z")

</div>

Hi,  
I need one image with RT patch to enhance CPU performance.

Now the steps which I have already done are

- download pre-build image from Solid-run website and flash image to HW HoneyComb and ClearFog CX
- check the version for kernel, it’s Linux localhost 5.4.47-00007-g8edfda9bc
- can clone source code from github and complete building the image locally
- can get the RT-5.4.47- patch from Ubuntu website

Then what’s the next step? How to build the new image with RT(realtime) patch?

Thanks.

---

<div class="post-metadata">

**Author:** ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)\
**Post date:** [July 13, 2021, 5:48pm UTC](https://community.solid-run.com/t/how-to-build-the-image-with-rt-realtime-patch/114/2 "2021-07-13T17:48:14Z")

</div>

Qii,

NXP already has a specific -RT patches branch for the LX2160a kernel. We are working to port this into our lx2160a\_build BSP and will update you shortly.

-Jon

---

<div class="post-metadata">

**Author:** ![Qii](https://avatars.discourse-cdn.com/v4/letter/q/97f17d/32.png) [@Qii](https://community.solid-run.com/u/Qii)\
**Post date:** [July 13, 2021, 10:32pm UTC](https://community.solid-run.com/t/how-to-build-the-image-with-rt-realtime-patch/114/3 "2021-07-13T22:32:47Z")

</div>

OK, thank you.

---

<div class="post-metadata">

**Author:** ![Qii](https://avatars.discourse-cdn.com/v4/letter/q/97f17d/32.png) [@Qii](https://community.solid-run.com/u/Qii)\
**Post date:** [July 15, 2021, 3:13pm UTC](https://community.solid-run.com/t/how-to-build-the-image-with-rt-realtime-patch/114/4 "2021-07-15T15:13:10Z")

</div>

Hi Jon,

Just to check the new image is available?

Ad can you please share the link for this image with RT patch to me by email?

Some information can not be public from company side. Your understanding will be more than appreciated.

Thank you!

---

<div class="post-metadata">

**Author:** ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)\
**Post date:** [July 15, 2021, 6:09pm UTC](https://community.solid-run.com/t/how-to-build-the-image-with-rt-realtime-patch/114/5 "2021-07-15T18:09:24Z")

</div>

I understand your concerns, but the -RT patchset is public GPL code and already publicly available through NXP’s repositories. We will make this a build option in our lx2160a\_build repository as a choice for any customer to use. How you implement does not need to be disclosed in public or private to us. Thanks for understanding that we build our products around an open source BSP and any non NRE work will be publicly available for all our customers to benefit from.

---

<div class="post-metadata">

**Author:** ![Qii](https://avatars.discourse-cdn.com/v4/letter/q/97f17d/32.png) [@Qii](https://community.solid-run.com/u/Qii)\
**Post date:** [July 19, 2021, 4:41pm UTC](https://community.solid-run.com/t/how-to-build-the-image-with-rt-realtime-patch/114/6 "2021-07-19T16:41:39Z")

</div>

Hi Jon,

So the new lx2160a\_build repository with RT patch is available now?

Thanks.

---

<div class="post-metadata">

**Author:** ![jnettlet](https://dub1.discourse-cdn.com/flex005/user_avatar/community.solid-run.com/jnettlet/32/62_2.png) [@jnettlet](https://community.solid-run.com/u/jnettlet)\
**Post date:** [July 21, 2021, 5:51am UTC](https://community.solid-run.com/t/how-to-build-the-image-with-rt-realtime-patch/114/7 "2021-07-21T05:51:51Z")

</div>

You can enable building a preempt\_rt kernel with our lx2160a\_build project by applying the following patch.

```auto
diff --git a/runme.sh b/runme.sh
index 667b5cf..3842d72 100755
--- a/runme.sh
+++ b/runme.sh
@@ -19,6 +19,7 @@ UEFI_RELEASE=${UEFI_RELEASE:-RELEASE}
 SHALLOW=${SHALLOW:false}
 SECURE=${SECURE:false}
 ATF_DEBUG=${ATF_DEBUG:false}
+PREEMPT_RT=${PREEMPT_RT:true}
 
 if ["x$SHALLOW" == "xtrue"]; then
        SHALLOW_FLAG="--depth 1"
@@ -132,7 +133,12 @@ for i in $QORIQ_COMPONENTS; do
                CHECKOUT=$RELEASE
                # Release LSDK-20.12
                if ["x$i" == "xlinux"] && ["x$RELEASE" == "xLSDK-20.12"]; then
- CHECKOUT=LSDK-20.12-V5.4
+ if ["x$i" == "xlinux"] && ["x$RELEASE" == "xLSDK-20.12"]; then
+ if ["x$PREEMPT_RT" == "xtrue"]; then
+ CHECKOUT=LSDK-20.12-V5.4-RT
+ else
+ CHECKOUT=LSDK-20.12-V5.4
+ fi
                fi
                # Release LSDK-20.4
                if ["x$i" == "xu-boot"] && ["x$RELEASE" == "xLSDK-20.04"]; then

```

NXP’s documentation can be found here. [https://docs.nxp.com/bundle/GUID-3FFCCD77-5220-414D-8664-09E6FB1B02C6/page/GUID-BF678D45-5F9E-4459-8F4E-10028E4262D7.html](https://docs.nxp.com/bundle/GUID-3FFCCD77-5220-414D-8664-09E6FB1B02C6/page/GUID-BF678D45-5F9E-4459-8F4E-10028E4262D7.html)
