Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Intel® RealSense™ camera driver for GMSL* interface
# RealSense™ camera driver for GMSL* interface

# Contributor Covenant Code of Conduct

Expand Down
4 changes: 2 additions & 2 deletions COPYRIGHT.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Intel® RealSense™ camera driver for GMSL* interface
# RealSense™ camera driver for GMSL* interface

## Third Party Programs


### This file specifies all 3rd party SW components used for Intel® RealSense™ MIPI Platform Driver and the inbound license for each of these 3rd party components.
### This file specifies all 3rd party SW components used for RealSense™ MIPI Platform Driver and the inbound license for each of these 3rd party components.


#### BSD 2-clause "Simplified" License
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# Intel® RealSense™ camera driver for GMSL* interface
<p align="center">
<!-- Light mode -->
<img src="https://github.com/realsenseai/librealsense/raw/master/doc/img/realsense-logo-light-mode.png#gh-light-mode-only" alt="Logo for light mode" width="30%"/>

<!-- Dark mode -->
<img src="https://github.com/realsenseai/librealsense/raw/master/doc/img/realsense-logo-dark-mode.png#gh-dark-mode-only" alt="Logo for dark mode" width="30%"/>
<br><br>
</p>

# RealSense™ camera driver for GMSL* interface

# D457 MIPI on NVIDIA® Jetson AGX Xavier™ and AGX Orin™
The RealSense™ MIPI platform driver enables the user to control and stream RealSense™ 3D MIPI cameras.
The system shall include:
* NVIDIA® Jetson platform (Currently Supported JetPack versions are: 6.2, 6.1, 6.0, 5.1.2, 5.0.2, 4.6.1)
* RealSense De-Serialize board (https://store.intelrealsense.com/buy-intel-realsense-des457.html)
* NVIDIA® Jetson platform (Currently Supported JetPack versions are: 6.2.1, 6.2, 6.1, 6.0, 5.1.2, 5.0.2, 4.6.1)
* RealSense De-Serialize board (DES457)
* NVIDIA® Jetson AGX Orin™ Passive adapter board from [Leopard Imaging LI-JTX1-SUB-ADPT](https://leopardimaging.com/product/accessories/adapters-carrier-boards/for-nvidia-jetson/li-jtx1-sub-adpt/)
* RS MIPI camera (e.g. https://store.intelrealsense.com/buy-intel-realsense-depth-camera-d457.html)
* RS MIPI camera (e.g. https://store.realsenseai.com/buy-intel-realsense-depth-camera-d457.html)

> Note: This MIPI reference driver is based on RealSense de-serialize board. For other de-serialize boards, modification might be needed.

Expand Down
10 changes: 5 additions & 5 deletions README_JP4.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Intel® RealSense™ camera driver for GMSL* interface on NVIDIA® Jetson AGX Xavier™ JetPack 4.6.1
# RealSense™ camera driver for GMSL* interface on NVIDIA® Jetson AGX Xavier™ JetPack 4.6.1

# D457 MIPI on NVIDIA® Jetson AGX Xavier™
The Intel® RealSense™ MIPI platform driver enables the user to control and stream RealSense 3D MIPI cameras.
The RealSense™ MIPI platform driver enables the user to control and stream RealSense 3D MIPI cameras.

The system shall include:
* NVIDIA® Jetson™ platform (Currently Supported JetPack versions are: 4.6.1)
* RealSense™ De-Serialize board (https://store.intelrealsense.com/buy-intel-realsense-des457.html)
* RS MIPI camera (e.g. https://store.intelrealsense.com/buy-intel-realsense-depth-camera-d457.html)
* RealSense™ De-Serialize board (DES457)
* RS MIPI camera (e.g. https://store.realsenseai.com/buy-intel-realsense-depth-camera-d457.html)

> Note: This MIPI reference driver is based on RealSense™ de-serialize board. For other de-serialize boards, modification might be needed.

### Links
- Intel® RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
- RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
- Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.x](./README_JP6.md) setup guide
- Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 5.x.2](./README_JP5.md) setup guide
- Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 4.6.1](./README_JP4.md) setup guide
Expand Down
10 changes: 5 additions & 5 deletions README_JP5.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Intel® RealSense™ camera driver for GMSL* interface on NVIDIA® Jetson AGX Xavier™ JetPack 5.x.2
# RealSense™ camera driver for GMSL* interface on NVIDIA® Jetson AGX Xavier™ JetPack 5.x.2

# D457 MIPI on NVIDIA® Jetson AGX Xavier™
The Intel® RealSense™ MIPI platform driver enables the user to control and stream RealSense™ 3D MIPI cameras.
The RealSense™ MIPI platform driver enables the user to control and stream RealSense™ 3D MIPI cameras.

The system shall include:
* NVIDIA® Jetson™ platform (Currently Supported JetPack versions are: 5.1.2, 5.0.2)
* RealSense™ De-Serialize board (https://store.intelrealsense.com/buy-intel-realsense-des457.html)
* RS MIPI camera (e.g. https://store.intelrealsense.com/buy-intel-realsense-depth-camera-d457.html)
* RealSense™ De-Serialize board (DES457)
* RS MIPI camera (e.g. https://store.realsenseai.com/buy-intel-realsense-depth-camera-d457.html)

> Note: This MIPI reference driver is based on RealSense™ de-serialize board. For other de-serialize boards, modification might be needed.

### Links
- Intel® RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
- RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
- Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.x](./README_JP6.md) setup guide
- Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 5.x.2](./README_JP5.md) setup guide
- Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 4.6.1](./README_JP4.md) setup guide
Expand Down
16 changes: 8 additions & 8 deletions README_JP6.0.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Intel® RealSense™ camera driver for GMSL* interface
# RealSense™ camera driver for GMSL* interface

# D457 MIPI on NVIDIA® Jetson AGX Orin™ JetPack 6.x
The Intel® RealSense™ MIPI platform driver enables the user to control and stream RealSense™ 3D MIPI cameras.
# D457 MIPI on NVIDIA® Jetson AGX Orin™ JetPack 6.x
The RealSense™ MIPI platform driver enables the user to control and stream RealSense™ 3D MIPI cameras.
The system shall include:
* NVIDIA® Jetson™ platform Supported JetPack versions are:
- [6.2 production release](https://developer.nvidia.com/embedded/jetpack-sdk-62)
- [6.1 production release](https://developer.nvidia.com/embedded/jetpack-sdk-61)
- [6.0 production release](https://developer.nvidia.com/embedded/jetpack-sdk-60)
* RealSense™ [De-Serialize board](https://store.intelrealsense.com/buy-intel-realsense-des457.html)
* RealSense™ De-Serialize board (DES457)
* Jetson AGX Orin™ Passive adapter board from [Leopard Imaging® LI-JTX1-SUB-ADPT](https://leopardimaging.com/product/accessories/adapters-carrier-boards/for-nvidia-jetson/li-jtx1-sub-adpt/)
* RS MIPI camera [D457](https://store.intelrealsense.com/buy-intel-realsense-depth-camera-d457.html)
* RS MIPI camera [D457](https://store.realsenseai.com/buy-intel-realsense-depth-camera-d457.html)

![orin_adapter](https://github.com/dmipx/realsense_mipi_platform_driver/assets/104717350/524e3eb6-6e6b-41cf-9562-9c0f920dd821)


> Note: This MIPI reference driver is based on RealSense™ de-serialize board. For other de-serialize boards, modification might be needed.

### Links
- Intel® RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
- RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
- NVIDIA® Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.0](./README_JP6.0.md) setup guide
- NVIDIA® Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 5.x.2](./README_JP5.md) setup guide
- NVIDIA® Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 4.6.1](./README_JP4.md) setup guide
Expand All @@ -36,7 +36,7 @@ sudo apt-get install -y build-essential bc wget flex bison curl libssl-dev xxd t
```
## Build NVIDIA® kernel drivers, dtb and D457 driver

1. Clone [realsense_mipi_platform_driver](https://github.com/IntelRealSense/realsense_mipi_platform_driver.git) repo.
1. Clone [realsense_mipi_platform_driver](https://github.com/realsenseai/realsense_mipi_platform_driver.git) repo.
2. The developers can set up build environment, ARM64 compiler, kernel sources and NVIDIA's Jetson git repositories by using the setup script.
3. Apply patches for kernel drivers, nvidia-oot module and tegra devicetree.
4. Build project
Expand All @@ -45,7 +45,7 @@ sudo apt-get install -y build-essential bc wget flex bison curl libssl-dev xxd t

Assuming building for 6.0. One can also build for 6.1, 6.2 just replace the last parameter.
```
git clone --branch dev --single-branch https://github.com/IntelRealSense/realsense_mipi_platform_driver.git
git clone --branch dev --single-branch https://github.com/realsenseai/realsense_mipi_platform_driver.git
cd realsense_mipi_platform_driver
./setup_workspace.sh 6.0
./apply_patches.sh 6.0
Expand Down
15 changes: 8 additions & 7 deletions README_JP6.2.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# Intel® RealSense™ camera driver for GMSL* interface
# RealSense™ camera driver for GMSL* interface

# D457 MIPI on NVIDIA® Jetson AGX Orin™ JetPack 6.x
The Intel® RealSense™ MIPI platform driver enables the user to control and stream RealSense™ 3D MIPI cameras.
The RealSense™ MIPI platform driver enables the user to control and stream RealSense™ 3D MIPI cameras.
The system shall include:
* NVIDIA® Jetson™ platform Supported JetPack versions are:
- [6.2.1 production release](https://developer.nvidia.com/embedded/jetpack-sdk-621)
- [6.2 production release](https://developer.nvidia.com/embedded/jetpack-sdk-62)
- [6.1 production release](https://developer.nvidia.com/embedded/jetpack-sdk-61)
- [6.0 production release](https://developer.nvidia.com/embedded/jetpack-sdk-60)
* RealSense™ [De-Serialize board](https://store.intelrealsense.com/buy-intel-realsense-des457.html)
* RealSense™ De-Serialize board (DES457)
* Jetson AGX Orin™ Passive adapter board from [Leopard Imaging® LI-JTX1-SUB-ADPT](https://leopardimaging.com/product/accessories/adapters-carrier-boards/for-nvidia-jetson/li-jtx1-sub-adpt/)
* RS MIPI camera [D457](https://store.intelrealsense.com/buy-intel-realsense-depth-camera-d457.html)
* RS MIPI camera [D457](https://store.realsenseai.com/buy-intel-realsense-depth-camera-d457.html)

![orin_adapter](https://github.com/dmipx/realsense_mipi_platform_driver/assets/104717350/524e3eb6-6e6b-41cf-9562-9c0f920dd821)


> Note: This MIPI reference driver is based on RealSense™ de-serialize board. For other de-serialize boards, modification might be needed.

### Links
- Intel® RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
- RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
- NVIDIA® Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.0](./README_JP6.0.md) setup guide
- NVIDIA® Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.2](./README_JP6.2.md) setup guide
- NVIDIA® Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 5.x.2](./README_JP5.md) setup guide
Expand All @@ -37,7 +38,7 @@ sudo apt-get install -y build-essential bc wget flex bison curl libssl-dev xxd t
```
## Build NVIDIA® kernel drivers, dtb and D457 driver

1. Clone [realsense_mipi_platform_driver](https://github.com/IntelRealSense/realsense_mipi_platform_driver.git) repo.
1. Clone [realsense_mipi_platform_driver](https://github.com/realsenseai/realsense_mipi_platform_driver.git) repo.
2. The developers can set up build environment, ARM64 compiler, kernel sources and NVIDIA's Jetson git repositories by using the setup script.
3. Apply patches for kernel drivers, nvidia-oot module and tegra devicetree.
4. Build project
Expand All @@ -46,7 +47,7 @@ sudo apt-get install -y build-essential bc wget flex bison curl libssl-dev xxd t

Assuming building for 6.2. One can also build for 6.1, 6.0 just replace the last parameter.
```
git clone --branch dev --single-branch https://github.com/IntelRealSense/realsense_mipi_platform_driver.git
git clone --branch dev --single-branch https://github.com/realsenseai/realsense_mipi_platform_driver.git
cd realsense_mipi_platform_driver
./setup_workspace.sh 6.2
./apply_patches.sh 6.2
Expand Down
4 changes: 2 additions & 2 deletions README_driver.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Intel® RealSense™ camera driver for GMSL* interface
# RealSense™ camera driver for GMSL* interface

# D457 MIPI on NVIDIA® Jetson AGX Xavier™ and AGX Orin™ driver API manual pages

### Links
- Intel® RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
- RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
- NVIDIA® Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.x](./README_JP6.md) setup guide
- NVIDIA® Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 5.x.2](./README_JP5.md) setup guide
- NVIDIA® Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 4.6.1](./README_JP4.md) setup guide
Expand Down
6 changes: 3 additions & 3 deletions README_tools.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Intel® RealSense™ camera driver for GMSL* interface
# RealSense™ camera driver for GMSL* interface

# D457 MIPI on NVIDIA® Jetson AGX Xavier™ and AGX Orin™ build scripts manual pages

### Links
- Intel® RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
- RealSense™ camera driver for GMSL* interface [Front Page](./README.md)
- NVIDIA® Jetson AGX Orin™ board setup - AGX Orin™ [JetPack 6.x](./README_JP6.md) setup guide
- NVIDIA® Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 5.x.2](./README_JP5.md) setup guide
- NVIDIA® Jetson AGX Xavier™ board setup - AGX Xavier™ [JetPack 4.6.1](./README_JP4.md) setup guide
Expand Down Expand Up @@ -46,7 +46,7 @@ Reset D457 patches (and any other changes) for kernel image, dtb and D457 driver
```

Note: The `--one-cam` and `--dual-cam` option applies only for JetPack 5.0.2,
compatible with adapter: https://store.intelrealsense.com/buy-intel-realsense-des457.html.
compatible with RealSense™ DES457 deserializer.
- By setting the `--one-cam` option it builds DT with only camera on GMSL link A (default).

- By setting the `--dual-cam` option it builds DT with dual cameras on GMSL link A and B.
Expand Down
6 changes: 3 additions & 3 deletions Security.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Intel® RealSense™ camera driver for GMSL* interface
# RealSense™ camera driver for GMSL* interface

# Security Policy
Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation.
RealSense is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation.

## Reporting a Vulnerability
Please report any security vulnerabilities in this project [utilizing the guidelines here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html).
Please report any security vulnerabilities in this project using this repository's security reporting process (for example, via the "Report a vulnerability" feature or by contacting the maintainers directly).

60 changes: 59 additions & 1 deletion apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ if [[ "$ACTION" == reset && -d "sources_$SOURCES_VERSION/hardware/nvidia/platfor
rm -rfv "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen-industrial" > /dev/null
fi

# Create nvethernetrm symlink for JP 6.x (moved from source_sync_6.x.sh)
# JP 5.x handles nvethernetrm differently (full path clone, not a symlink)
# Must remove the directory first since git reset restores it as a real directory
# and ln -sf cannot replace a directory with a symlink
if [[ "$JETPACK_VERSION" =~ ^6\. ]]; then
if [[ "$ACTION" == reset ]] || [[ "$ACTION" == apply ]]; then
rm -rf "sources_$SOURCES_VERSION/nvidia-oot/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm"
ln -sf ../../../../../../nvethernetrm "sources_$SOURCES_VERSION/nvidia-oot/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm"
fi
fi

apply_external_patches() {
git -C "sources_$SOURCES_VERSION/$3" status > /dev/null
if [[ "$1" == 'apply' ]]; then
Expand All @@ -62,14 +73,24 @@ apply_external_patches() {
fi
ls -Ld "${PWD}/$3/$2"
ls -Lw1 "${PWD}/$3/$2"
# Store the original commit hash before applying patches
ORIGINAL_COMMIT=$(git -C "sources_$SOURCES_VERSION/$3" rev-parse HEAD)
echo "$ORIGINAL_COMMIT" > "sources_$SOURCES_VERSION/$3/.realsense_patch_base"
Comment on lines +76 to +78

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.realsense_patch_base is overwritten on every apply, which can break reset behavior if the user applies patches multiple times (the stored base may become the already-patched commit). Only create .realsense_patch_base if it does not already exist, or store per-action state in a way that preserves the true original base.

Suggested change
# Store the original commit hash before applying patches
ORIGINAL_COMMIT=$(git -C "sources_$SOURCES_VERSION/$3" rev-parse HEAD)
echo "$ORIGINAL_COMMIT" > "sources_$SOURCES_VERSION/$3/.realsense_patch_base"
# Store the original commit hash before applying patches, but only if not already stored
if [[ ! -f "sources_$SOURCES_VERSION/$3/.realsense_patch_base" ]]; then
ORIGINAL_COMMIT=$(git -C "sources_$SOURCES_VERSION/$3" rev-parse HEAD)
echo "$ORIGINAL_COMMIT" > "sources_$SOURCES_VERSION/$3/.realsense_patch_base"
fi

Copilot uses AI. Check for mistakes.
git -C "sources_$SOURCES_VERSION/$3" apply "${PWD}/$3/$2"/*
elif [ "$1" = "reset" ]; then
if ! git -C "sources_$SOURCES_VERSION/$3" diff --quiet || ! git -C "sources_$SOURCES_VERSION/$3" diff --cached --quiet; then
read -p "Repo sources_$SOURCES_VERSION/$3 has changes that will be hard reset. Continue (y/N)? " confirm
[[ "$confirm" != "y" && "$confirm" != "Y" ]] && exit 1
fi
echo -n "$(ls -d "sources_$SOURCES_VERSION/$3"): "
git -C "sources_$SOURCES_VERSION/$3" reset --hard $4
# Reset to original commit if .realsense_patch_base exists, otherwise use L4T_VERSION
if [[ -f "sources_$SOURCES_VERSION/$3/.realsense_patch_base" ]]; then
RESET_TARGET=$(cat "sources_$SOURCES_VERSION/$3/.realsense_patch_base")
git -C "sources_$SOURCES_VERSION/$3" reset --hard "$RESET_TARGET"
rm -f "sources_$SOURCES_VERSION/$3/.realsense_patch_base"
else
git -C "sources_$SOURCES_VERSION/$3" reset --hard $4
fi
fi
}

Expand All @@ -91,4 +112,41 @@ if [[ "$ACTION" = "apply" ]]; then
else
cp "hardware/realsense/${JP5_D4XX_DTSI}" "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-camera-d4xx.dtsi"
fi

# Stage all modified files after patching
git -C "sources_$SOURCES_VERSION/$D4XX_SRC_DST" add -A
[[ -d "sources_$SOURCES_VERSION/$KERNEL_DIR" ]] && git -C "sources_$SOURCES_VERSION/$KERNEL_DIR" add -A
if [[ -d "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" ]]; then
git -C "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" add -A
elif [[ -d "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" ]]; then
git -C "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" add -A
fi

# Get author identity from root repo
GIT_AUTHOR_NAME=$(git config user.name)
GIT_AUTHOR_EMAIL=$(git config user.email)
Comment on lines +125 to +127

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-committing inside vendor/source subrepos with || true can silently leave repos in a partially-patched, dirty state (e.g., if user.name/email are unset or hooks reject the commit). Consider either (a) avoiding commits entirely and keeping changes as a working tree modification, or (b) validating GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL and failing fast (or prompting) if commits are intended and cannot be created.

Copilot uses AI. Check for mistakes.

# Update local git identity for subrepos
git -C "sources_$SOURCES_VERSION/$D4XX_SRC_DST" config user.name "$GIT_AUTHOR_NAME"
git -C "sources_$SOURCES_VERSION/$D4XX_SRC_DST" config user.email "$GIT_AUTHOR_EMAIL"
if [[ -d "sources_$SOURCES_VERSION/$KERNEL_DIR" ]]; then
git -C "sources_$SOURCES_VERSION/$KERNEL_DIR" config user.name "$GIT_AUTHOR_NAME"
git -C "sources_$SOURCES_VERSION/$KERNEL_DIR" config user.email "$GIT_AUTHOR_EMAIL"
fi
if [[ -d "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" ]]; then
git -C "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" config user.name "$GIT_AUTHOR_NAME"
git -C "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" config user.email "$GIT_AUTHOR_EMAIL"
elif [[ -d "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" ]]; then
git -C "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" config user.name "$GIT_AUTHOR_NAME"
git -C "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" config user.email "$GIT_AUTHOR_EMAIL"
fi

# Commit all staged files
git -C "sources_$SOURCES_VERSION/$D4XX_SRC_DST" commit -m "RS patched" || true
[[ -d "sources_$SOURCES_VERSION/$KERNEL_DIR" ]] && git -C "sources_$SOURCES_VERSION/$KERNEL_DIR" commit -m "RS patched" || true
Comment on lines +144 to +146

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-committing inside vendor/source subrepos with || true can silently leave repos in a partially-patched, dirty state (e.g., if user.name/email are unset or hooks reject the commit). Consider either (a) avoiding commits entirely and keeping changes as a working tree modification, or (b) validating GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL and failing fast (or prompting) if commits are intended and cannot be created.

Copilot uses AI. Check for mistakes.
if [[ -d "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" ]]; then
git -C "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" commit -m "RS patched" || true
elif [[ -d "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" ]]; then
git -C "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" commit -m "RS patched" || true
fi
Comment on lines +115 to +151

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Script now stages and auto-commits patched files in subrepos (git commit -m "RS patched"), which may create unintended local commits; avoid auto-committing or require explicit user confirmation.

Details

✨ AI Reasoning
​apply_patches.sh now stages files and runs git commit in nested source repositories automatically after applying patches. This introduces automatic local commits to subrepos (git -C ... commit -m "RS patched"), which may be accidental and alter user working trees unexpectedly. Such automatic commits in scripts can lead to unintentional repository state changes.

🔧 How do I fix it?
Remove debugging statements like console.log, debugger, dd(), or logic bypasses like || true. Keep legitimate logging for monitoring and error handling.

Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Show Fix

Remediation - low confidence
This patch mitigates automatic git staging and committing of patched files in subrepos by removing the unintended debug artifact that created local commits without user confirmation.

Suggested change
# Stage all modified files after patching
git -C "sources_$SOURCES_VERSION/$D4XX_SRC_DST" add -A
[[ -d "sources_$SOURCES_VERSION/$KERNEL_DIR" ]] && git -C "sources_$SOURCES_VERSION/$KERNEL_DIR" add -A
if [[ -d "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" ]]; then
git -C "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" add -A
elif [[ -d "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" ]]; then
git -C "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" add -A
fi
# Get author identity from root repo
GIT_AUTHOR_NAME=$(git config user.name)
GIT_AUTHOR_EMAIL=$(git config user.email)
# Update local git identity for subrepos
git -C "sources_$SOURCES_VERSION/$D4XX_SRC_DST" config user.name "$GIT_AUTHOR_NAME"
git -C "sources_$SOURCES_VERSION/$D4XX_SRC_DST" config user.email "$GIT_AUTHOR_EMAIL"
if [[ -d "sources_$SOURCES_VERSION/$KERNEL_DIR" ]]; then
git -C "sources_$SOURCES_VERSION/$KERNEL_DIR" config user.name "$GIT_AUTHOR_NAME"
git -C "sources_$SOURCES_VERSION/$KERNEL_DIR" config user.email "$GIT_AUTHOR_EMAIL"
fi
if [[ -d "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" ]]; then
git -C "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" config user.name "$GIT_AUTHOR_NAME"
git -C "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" config user.email "$GIT_AUTHOR_EMAIL"
elif [[ -d "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" ]]; then
git -C "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" config user.name "$GIT_AUTHOR_NAME"
git -C "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" config user.email "$GIT_AUTHOR_EMAIL"
fi
# Commit all staged files
git -C "sources_$SOURCES_VERSION/$D4XX_SRC_DST" commit -m "RS patched" || true
[[ -d "sources_$SOURCES_VERSION/$KERNEL_DIR" ]] && git -C "sources_$SOURCES_VERSION/$KERNEL_DIR" commit -m "RS patched" || true
if [[ -d "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" ]]; then
git -C "sources_$SOURCES_VERSION/hardware/nvidia/t23x/nv-public" commit -m "RS patched" || true
elif [[ -d "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" ]]; then
git -C "sources_$SOURCES_VERSION/hardware/nvidia/platform/t19x/galen/kernel-dts" commit -m "RS patched" || true
fi

fi
Loading