Skip to content

Commit 3adba16

Browse files
authored
add support for agx orin board (#142)
1 parent 81f3211 commit 3adba16

File tree

6 files changed

+157
-144
lines changed

6 files changed

+157
-144
lines changed

Containerfile.image.l4t35

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ RUN chmod 4755 /build/Linux_for_Tegra/rootfs/usr/bin/sudo
4141
# Different patches
4242
COPY patches /patches
4343
RUN patch /build/Linux_for_Tegra/nv_tegra/nv-apply-debs.sh < /patches/nv-apply-debs.diff && \
44-
patch /build/Linux_for_Tegra/tools/jetson-disk-image-creator.sh < /patches/jetson-disk-image-creator.diff
44+
patch /build/Linux_for_Tegra/tools/jetson-disk-image-creator.sh < /patches/jetson-disk-image-creator.diff && \
45+
patch /build/Linux_for_Tegra/tools/jetson-disk-image-creator.sh < /patches/agx-orin.diff
4546

4647
# Remove GUI packages
4748
RUN rm -rf /build/Linux_for_Tegra/nv_tegra/l4t_deb_packages/nvidia-l4t-nvpmodel-gui-tools*.deb && \

Containerfile.image.l4t36

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ RUN chmod 4755 /build/Linux_for_Tegra/rootfs/usr/bin/sudo
4343
# Different patches
4444
COPY patches /patches
4545
RUN patch /build/Linux_for_Tegra/nv_tegra/nv-apply-debs.sh < /patches/nv-apply-debs.diff && \
46-
patch /build/Linux_for_Tegra/tools/jetson-disk-image-creator.sh < /patches/jetson-disk-image-creator.diff
46+
patch /build/Linux_for_Tegra/tools/jetson-disk-image-creator.sh < /patches/jetson-disk-image-creator.diff && \
47+
patch /build/Linux_for_Tegra/tools/jetson-disk-image-creator.sh < /patches/agx-orin.diff
4748

4849
# Remove GUI packages
4950
RUN rm -rf /build/Linux_for_Tegra/nv_tegra/l4t_deb_packages/nvidia-l4t-nvpmodel-gui-tools*.deb && \

Readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The need for the minimalist images came from the official jetson images being la
1414
- [x] Jetson nano
1515
- [x] Jetson nano 2gb
1616
- [x] Jetson orin nano
17+
- [x] Jetson agx orin
1718
- [x] Jetso agx xavier
1819
- [x] Jetson xavier nx
1920

patches/agx-orin.diff

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
209a210
2+
> boardsku="0000"

scripts/build-jetson-image.sh

Lines changed: 115 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -4,157 +4,158 @@
44

55
set -e
66

7-
supported_boards=("jetson-nano" "jetson-nano-2gb" "jetson-orin-nano" "jetson-agx-xavier" "jetson-xavier-nx")
7+
supported_boards=("jetson-nano" "jetson-nano-2gb" "jetson-orin-nano" "jetson-agx-xavier" "jetson-xavier-nx" "jetson-agx-orin")
88

99
function usage() {
10-
echo "Usage: $0 -b <board> -r <revision> -d <device> -l <l4t>"
11-
echo ""
12-
echo "board: the board name, one of the following names:"
13-
for supported_board in "${supported_boards[@]}"; do
14-
echo " ${supported_board}"
15-
done
16-
echo ""
17-
echo "revision: the revision number. Only required for jetson-nano board. The possible values are: 100, 200 or 300."
18-
echo ""
19-
echo "device: the rootfs device SD/USB. Only required for the following boards:"
20-
echo " - jetson-orin-nano"
21-
echo " - jetson-agx-xavier"
22-
echo " - jetson-xavier-nx"
23-
echo ""
24-
echo "l4t version. The possible values are: 32, 35, 36"
25-
exit 1
10+
echo "Usage: $0 -b <board> -r <revision> -d <device> -l <l4t>"
11+
echo ""
12+
echo "board: the board name, one of the following names:"
13+
for supported_board in "${supported_boards[@]}"; do
14+
echo " ${supported_board}"
15+
done
16+
echo ""
17+
echo "revision: the revision number. Only required for jetson-nano board. The possible values are: 100, 200 or 300."
18+
echo ""
19+
echo "device: the rootfs device SD/USB. Only required for the following boards:"
20+
echo " - jetson-orin-nano"
21+
echo " - jetson-agx-orin"
22+
echo " - jetson-agx-xavier"
23+
echo " - jetson-xavier-nx"
24+
echo ""
25+
echo "l4t version. The possible values are: 32, 35, 36"
26+
exit 1
2627
}
2728

2829
while getopts b:r:d:l:h opts; do
29-
case "$opts" in
30-
31-
b)
32-
board=${OPTARG}
33-
if [[ ! " ${supported_boards[@]} " =~ " ${board} " ]]; then
34-
printf "\e[31mError: Unsupported board: %s \n\e[0m" "$board"
35-
echo "The supported boards are:"
36-
for supported_board in "${supported_boards[@]}"; do
37-
echo "- ${supported_board}"
38-
done
39-
exit 1
40-
fi
41-
;;
42-
43-
r)
44-
revision=${OPTARG}
45-
;;
46-
47-
d)
48-
device=${OPTARG}
49-
;;
50-
51-
l)
52-
l4t=${OPTARG}
53-
if [[ "$l4t" != 32 && "$l4t" != 35 && "$l4t" != 36 ]]; then
54-
printf "\e[31mError: Unsupported l4t value: %s \n\e[0m" "$l4t"
55-
echo "The possible values are: 32, 35, 36."
56-
exit 1
57-
fi
58-
;;
59-
60-
h)
61-
usage
62-
;;
63-
64-
*) usage ;;
65-
esac
30+
case "$opts" in
31+
32+
b)
33+
board=${OPTARG}
34+
if [[ ! " ${supported_boards[@]} " =~ " ${board} " ]]; then
35+
printf "\e[31mError: Unsupported board: %s \n\e[0m" "$board"
36+
echo "The supported boards are:"
37+
for supported_board in "${supported_boards[@]}"; do
38+
echo "- ${supported_board}"
39+
done
40+
exit 1
41+
fi
42+
;;
43+
44+
r)
45+
revision=${OPTARG}
46+
;;
47+
48+
d)
49+
device=${OPTARG}
50+
;;
51+
52+
l)
53+
l4t=${OPTARG}
54+
if [[ "$l4t" != 32 && "$l4t" != 35 && "$l4t" != 36 ]]; then
55+
printf "\e[31mError: Unsupported l4t value: %s \n\e[0m" "$l4t"
56+
echo "The possible values are: 32, 35, 36."
57+
exit 1
58+
fi
59+
;;
60+
61+
h)
62+
usage
63+
;;
64+
65+
*) usage ;;
66+
esac
6667
done
6768

6869
if [ "$board" = "" ]; then
69-
printf "\e[31mError: board argument in required.\e[0m \n\n"
70-
usage
70+
printf "\e[31mError: board argument in required.\e[0m \n\n"
71+
usage
7172
fi
7273

7374
case $board in
7475
"jetson-nano")
75-
if [[ "$revision" != "100" && "$revision" != "200" && "$revision" != "300" ]]; then
76-
printf "\e[31mError: Unknown revision for Jetson nano board.\n\e[0m"
77-
echo "Supported revision: 100, 200 or 300"
78-
exit 1
79-
fi
80-
;;
76+
if [[ "$revision" != "100" && "$revision" != "200" && "$revision" != "300" ]]; then
77+
printf "\e[31mError: Unknown revision for Jetson nano board.\n\e[0m"
78+
echo "Supported revision: 100, 200 or 300"
79+
exit 1
80+
fi
81+
;;
8182

82-
"jetson-orin-nano" | "jetson-xavier-nx" | "jetson-agx-xavier")
83+
"jetson-orin-nano" | "jetson-xavier-nx" | "jetson-agx-xavier" | "jetson-agx-orin")
8384

84-
if [ "$device" = "" ]; then
85-
printf "\e[31mError: device argument required.\n\e[0m"
86-
usage
87-
fi
85+
if [ "$device" = "" ]; then
86+
printf "\e[31mError: device argument required.\n\e[0m"
87+
usage
88+
fi
8889

89-
if [[ "$device" != "SD" && "$device" != "USB" ]]; then
90-
printf "\e[31mError: Unknown device.\n\e[0m"
91-
echo "device must be SD or USB"
92-
exit 1
93-
fi
94-
;;
90+
if [[ "$device" != "SD" && "$device" != "USB" ]]; then
91+
printf "\e[31mError: Unknown device.\n\e[0m"
92+
echo "device must be SD or USB"
93+
exit 1
94+
fi
95+
;;
9596

9697
*) ;;
9798
esac
9899

99100
case $board in
100101
"jetson-nano" | "jetson-nano-2gb")
101-
l4t=32
102-
;;
102+
l4t=32
103+
;;
103104

104105
"jetson-agx-xavier" | "jetson-xavier-nx")
105-
if [[ "$l4t" == "" ]]; then
106-
echo "Error: l4t version not provided."
107-
echo "l4t must be 32 or 35"
108-
exit 1
109-
fi
110-
if [[ "$l4t" != 32 && "$l4t" != 35 ]]; then
111-
echo "The $board only supports 32.x or 35.x versions."
112-
exit 1
113-
fi
114-
;;
106+
if [[ "$l4t" == "" ]]; then
107+
echo "Error: l4t version not provided."
108+
echo "l4t must be 32 or 35"
109+
exit 1
110+
fi
111+
if [[ "$l4t" != 32 && "$l4t" != 35 ]]; then
112+
echo "The $board only supports 32.x or 35.x versions."
113+
exit 1
114+
fi
115+
;;
115116

116-
"jetson-orin-nano")
117-
if [[ "$l4t" == "" ]]; then
118-
echo "Error: l4t version not provided."
119-
echo "l4t must be 35 or 36"
120-
exit 1
121-
fi
117+
"jetson-orin-nano" | "jetson-agx-orin")
118+
if [[ "$l4t" == "" ]]; then
119+
echo "Error: l4t version not provided."
120+
echo "l4t must be 35 or 36"
121+
exit 1
122+
fi
122123

123-
if [[ "$l4t" != 35 && "$l4t" != 36 ]]; then
124-
echo "The $board only supports 35.x or 36.x versions."
125-
exit 1
126-
fi
124+
if [[ "$l4t" != 35 && "$l4t" != 36 ]]; then
125+
echo "The $board only supports 35.x or 36.x versions."
126+
exit 1
127+
fi
127128

128-
;;
129+
;;
129130
*) ;;
130131
esac
131132

132133
L4T_PACKAGES=""
133134

134135
if [[ -f "l4t_packages.txt" ]]; then
135-
while IFS= read -r line; do
136-
if [[ ${line} != \#* ]]; then
137-
L4T_PACKAGES+=" $line"
138-
fi
139-
done <"l4t_packages.txt"
136+
while IFS= read -r line; do
137+
if [[ ${line} != \#* ]]; then
138+
L4T_PACKAGES+=" $line"
139+
fi
140+
done <"l4t_packages.txt"
140141

141142
fi
142143

143144
L4T_PACKAGES="${L4T_PACKAGES# }"
144145

145146
sudo -E XDG_RUNTIME_DIR= DBUS_SESSION_BUS_ADDRESS= podman build \
146-
--cap-add=all \
147-
--jobs=4 \
148-
--build-arg L4T_PACKAGES="$L4T_PACKAGES" \
149-
-f Containerfile.image.l4t"$l4t" \
150-
-t jetson-build-image-l4t"$l4t"
147+
--cap-add=all \
148+
--jobs=4 \
149+
--build-arg L4T_PACKAGES="$L4T_PACKAGES" \
150+
-f Containerfile.image.l4t"$l4t" \
151+
-t jetson-build-image-l4t"$l4t"
151152

152153
sudo podman run \
153-
--rm \
154-
--privileged \
155-
-v .:/jetson \
156-
-e JETSON_BOARD="$board" \
157-
-e JETSON_DEVICE="$device" \
158-
-e JETSON_REVISION="$revision" \
159-
localhost/jetson-build-image-l4t"$l4t":latest \
160-
create-jetson-image.sh
154+
--rm \
155+
--privileged \
156+
-v .:/jetson \
157+
-e JETSON_BOARD="$board" \
158+
-e JETSON_DEVICE="$device" \
159+
-e JETSON_REVISION="$revision" \
160+
localhost/jetson-build-image-l4t"$l4t":latest \
161+
create-jetson-image.sh

scripts/create-jetson-image.sh

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,49 @@
44

55
case "$JETSON_BOARD" in
66
jetson-nano-2gb)
7-
printf "Create image for Jetson nano 2GB board \n"
8-
sudo ./jetson-disk-image-creator.sh -o jetson.img -b jetson-nano-2gb-devkit
9-
cp jetson.img /jetson/
10-
printf "[OK]\n"
11-
;;
7+
printf "Create image for Jetson nano 2GB board \n"
8+
sudo ./jetson-disk-image-creator.sh -o jetson.img -b jetson-nano-2gb-devkit
9+
cp jetson.img /jetson/
10+
printf "[OK]\n"
11+
;;
1212

1313
jetson-nano)
14-
printf "Creating image for Jetson nano board (%s revision) \n" "$JETSON_REVISION"
15-
sudo ./jetson-disk-image-creator.sh -o jetson.img -b jetson-nano -r "$JETSON_REVISION"
16-
cp jetson.img /jetson/
17-
printf "[OK]\n"
18-
;;
14+
printf "Creating image for Jetson nano board (%s revision) \n" "$JETSON_REVISION"
15+
sudo ./jetson-disk-image-creator.sh -o jetson.img -b jetson-nano -r "$JETSON_REVISION"
16+
cp jetson.img /jetson/
17+
printf "[OK]\n"
18+
;;
1919

2020
jetson-orin-nano)
21-
printf "Creating image for Jetson orin nano board \n"
22-
sudo ./jetson-disk-image-creator.sh -o jetson.img -b jetson-orin-nano-devkit -d "$JETSON_DEVICE"
23-
cp jetson.img /jetson/
24-
printf "[OK]\n"
25-
;;
21+
printf "Creating image for Jetson orin nano board \n"
22+
sudo ./jetson-disk-image-creator.sh -o jetson.img -b jetson-orin-nano-devkit -d "$JETSON_DEVICE"
23+
cp jetson.img /jetson/
24+
printf "[OK]\n"
25+
;;
2626

2727
jetson-xavier-nx)
28-
printf "Creating image for Jetson xavier nx board \n"
29-
sudo ./jetson-disk-image-creator.sh -o jetson.img -b jetson-xavier-nx-devkit -d "$JETSON_DEVICE"
30-
cp jetson.img /jetson/
31-
printf "[OK]\n"
32-
;;
28+
printf "Creating image for Jetson xavier nx board \n"
29+
sudo ./jetson-disk-image-creator.sh -o jetson.img -b jetson-xavier-nx-devkit -d "$JETSON_DEVICE"
30+
cp jetson.img /jetson/
31+
printf "[OK]\n"
32+
;;
3333

3434
jetson-agx-xavier)
35-
printf "Creating image for Jetson agx xavier board \n"
36-
sudo ./jetson-disk-image-creator.sh -o jetson.img -b jetson-agx-xavier-devkit -d "$JETSON_DEVICE"
37-
cp jetson.img /jetson/
38-
printf "[OK]\n"
39-
;;
35+
printf "Creating image for Jetson agx xavier board \n"
36+
sudo ./jetson-disk-image-creator.sh -o jetson.img -b jetson-agx-xavier-devkit -d "$JETSON_DEVICE"
37+
cp jetson.img /jetson/
38+
printf "[OK]\n"
39+
;;
40+
41+
jetson-agx-orin)
42+
printf "Creating image for Jetson agx orin board \n"
43+
sudo ./jetson-disk-image-creator.sh -o jetson.img -b jetson-agx-orin-devkit -d "$JETSON_DEVICE"
44+
cp jetson.img /jetson/
45+
printf "[OK]\n"
46+
;;
4047

4148
*)
42-
printf "\e[31mUnsupported Jetson board. \e[0m\n"
43-
exit 1
44-
;;
49+
printf "\e[31mUnsupported Jetson board. \e[0m\n"
50+
exit 1
51+
;;
4552
esac

0 commit comments

Comments
 (0)