Skip to content

Commit e22dab3

Browse files
committed
Refactor nvethernetrm symlink handling for JetPack 6.x to ensure proper directory removal before linking
1 parent bbb0814 commit e22dab3

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

apply_patches.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,13 @@ fi
5555

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

6267
apply_external_patches() {

0 commit comments

Comments
 (0)