forked from pythops/jetson-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile.image.l4t32
62 lines (48 loc) · 1.82 KB
/
Containerfile.image.l4t32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM ubuntu:jammy
LABEL org.opencontainers.image.authors="Badr @pythops"
# Define the BSP version
ARG BSP=https://developer.download.nvidia.com/embedded/L4T/r32_Release_v7.4/T210/Jetson-210_Linux_R32.7.4_aarch64.tbz2
# Install different dependencies
RUN apt update && \
apt install -y \
wget \
patch \
bzip2 \
qemu-user-static \
sudo \
libxml2-utils \
python3 \
gdisk \
kpartx \
cpio
# Extract the BSP
RUN mkdir /build && \
wget -qO- $BSP | tar -jxpf - -C /build
# Copy the ubuntu rootfs
COPY rootfs/ /build/Linux_for_Tegra/rootfs/
# Sudo permissions
RUN chmod 4755 /build/Linux_for_Tegra/rootfs/usr/bin/sudo
# Different patches
COPY patches /patches
RUN patch /build/Linux_for_Tegra/nv_tegra/nv-apply-debs.sh < /patches/nv-apply-debs.diff && \
patch /build/Linux_for_Tegra/tools/jetson-disk-image-creator.sh < /patches/jetson-disk-image-creator.diff
# Remove python-jetson-gpio
RUN rm -rf /build/Linux_for_Tegra/tools/python-jetson-gpio_*_arm64.deb
# Install nvidia packages in the new rootfs
WORKDIR /build/Linux_for_Tegra/
RUN ./apply_binaries.sh
# Fix permissions
RUN chroot /build/Linux_for_Tegra/rootfs/ /bin/bash -c "chown -R jetson:jetson /home/jetson && chmod 1777 /tmp"
# Edit initrd
WORKDIR /tmp/pythops
#RUN gzip -d -c /build/Linux_for_Tegra/rootfs/boot/initrd > initrd
RUN gzip -d -c /build/Linux_for_Tegra/bootloader/l4t_initrd.img > initrd
WORKDIR /tmp/pythops/lab
RUN cpio -iv < ../initrd && \
echo "nameserver 127.0.0.53" > etc/resolv.conf && \
find . | cpio --create --format="newc" > ../new_initrd
WORKDIR /tmp/pythops
RUN gzip new_initrd && mv new_initrd.gz /build/Linux_for_Tegra/bootloader/l4t_initrd.img
# Copy the script to create the image
COPY scripts/create-jetson-image.sh /usr/local/bin/
WORKDIR /build/Linux_for_Tegra/tools