Skip to content
Merged
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
35 changes: 34 additions & 1 deletion docker/cti/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!make

cti-all-deps: cti-32.1-jax-deps cti-32.1-tx2-deps cti-32.1-tx2i-deps
cti-all-deps: cti-32.2-jax-deps cti-32.2-tx2-deps cti-32.2-tx2i-deps cti-32.1-jax-deps cti-32.1-tx2-deps cti-32.1-tx2i-deps

cti-32.1-jax-deps: $(addsuffix -deps,$(addprefix cti-32.1-jax-,203))

Expand Down Expand Up @@ -35,6 +35,39 @@ cti-32.1-tx2-%-deps:
-f $(CURDIR)/dependencies.Dockerfile \
/tmp/CTI-L4T-V$*

cti-32.2-jax-deps: $(addsuffix -deps,$(addprefix cti-32.2-jax-,204))

cti-32.2-tx2i-deps: $(addsuffix -deps,$(addprefix cti-32.2-tx2i-,126))

cti-32.2-tx2-deps: $(addsuffix -deps,$(addprefix cti-32.2-tx2-,126))

cti-32.2-jax-%-deps:
BSP_VERSION=$* /bin/bash -c ./download-bsp.sh

$(DOCKER) build \
--build-arg VERSION_ID="$(BIONIC_VERSION_ID)" \
-t $(REPO):$@ \
-f $(CURDIR)/dependencies.Dockerfile \
/tmp/CTI-L4T-V$*

cti-32.2-tx2i-%-deps:
BSP_VERSION=$* /bin/bash -c ./download-bsp.sh

$(DOCKER) build \
--build-arg VERSION_ID="$(BIONIC_VERSION_ID)" \
-t $(REPO):$@ \
-f $(CURDIR)/dependencies.Dockerfile \
/tmp/CTI-L4T-V$*

cti-32.2-tx2-%-deps:
BSP_VERSION=$* /bin/bash -c ./download-bsp.sh

$(DOCKER) build \
--build-arg VERSION_ID="$(BIONIC_VERSION_ID)" \
-t $(REPO):$@ \
-f $(CURDIR)/dependencies.Dockerfile \
/tmp/CTI-L4T-V$*

%-from-folder:
$(DOCKER) build \
--build-arg VERSION_ID="$(BIONIC_VERSION_ID)" \
Expand Down
22 changes: 22 additions & 0 deletions flash/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jetpack-4.2.1-image: 32.2-jax-jetpack-4.2.1-image 32.2-tx2-jetpack-4.2.1-image 3
(DOCKER_BUILD_ROOT="$(CURDIR)/l4t/32.2" $(CURDIR)/build.sh ./conf/$@ $(REPO):$@)

cti-32.1-v203-image: $(addsuffix -image,$(addprefix cti-32.1-v203-,rogue rogue-imx274-2cam mimic-base))

cti-32.2-v204-image: $(addsuffix -image,$(addprefix cti-32.2-v204-,rogue rogue-imx274-2cam mimic-base))

cti-32.1-v124-image: $(addsuffix -image,$(addprefix cti-32.1-v124-,\
astro-mpcie astro-mpcie-tx2i astro-usb3 astro-usb3-tx2i astro-revG+ astro-revG+-tx2i \
elroy-mpcie elroy-mpcie-tx2i elroy-usb3 elroy-usb3-tx2i elroy-revF+ elroy-refF+-tx2i \
Expand All @@ -57,6 +60,18 @@ cti-32.1-v125-image: $(addsuffix -image,$(addprefix cti-32.1-v125-,\
vpg003-base vpg003-base-tx2i \
))

cti-32.2-v126-image: $(addsuffix -image,$(addprefix cti-32.2-v126-,\
astro-mpcie astro-mpcie-tx2i astro-usb3 astro-usb3-tx2i astro-revG+ astro-revG+-tx2i \
elroy-mpcie elroy-mpcie-tx2i elroy-usb3 elroy-usb3-tx2i elroy-revF+ elroy-refF+-tx2i \
orbitty orbitty-tx2i \
rosie rosie-tx2i \
rudi-mpcie rudi-mpcie-tx2i rudi-usb3 rudi-usb3-tx2i rudi rudi-tx2i \
sprocket \
spacely-base spacely-base-tx2i spacely-imx274-6cam spacely-imx274-6cam-tx2i spacely-imx274-3cam spacely-imx274-3cam-tx2i \
cogswell cogswell-tx2i \
vpg003-base vpg003-base-tx2i \
))

cti-32.1-v203-%:
(DOCKER_BUILD_ROOT="$(CURDIR)/cti/32.1" TARGET_BOARD=$(subst -image,,$*) $(CURDIR)/build.sh $(CURDIR)/cti/32.1/rootfs/tegra-linux-sample-32.1.0-jax.conf $(CURDIR)/cti/32.1/bsp/v203.conf $(REPO):$@)

Expand All @@ -67,3 +82,10 @@ cti-32.1-v124-%:
cti-32.1-v125-%:
# $(subst +,plus,$(REPO):$@) replaces '+' with 'plus' in the docker tag
(DOCKER_BUILD_ROOT="$(CURDIR)/cti/32.1" TARGET_BOARD=$(subst -image,,$*) $(CURDIR)/build.sh $(CURDIR)/cti/32.1/rootfs/tegra-linux-sample-32.1.0-tx2.conf $(CURDIR)/cti/32.1/bsp/v125.conf $(subst +,plus,$(REPO):$@))

cti-32.2-v204-%:
(DOCKER_BUILD_ROOT="$(CURDIR)/cti/32.2" TARGET_BOARD=$(subst -image,,$*) $(CURDIR)/build.sh $(CURDIR)/cti/32.2/rootfs/tegra-linux-sample-32.2.0-jax.conf $(CURDIR)/cti/32.2/bsp/v204.conf $(REPO):$@)

cti-32.2-v126-%:
# $(subst +,plus,$(REPO):$@) replaces '+' with 'plus' in the docker tag
(DOCKER_BUILD_ROOT="$(CURDIR)/cti/32.2" TARGET_BOARD=$(subst -image,,$*) $(CURDIR)/build.sh $(CURDIR)/cti/32.2/rootfs/tegra-linux-sample-32.2.0-tx2.conf $(CURDIR)/cti/32.2/bsp/v126.conf $(subst +,plus,$(REPO):$@))
8 changes: 8 additions & 0 deletions flash/cti/32.2/bsp/v126.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DRIVER_PACK=Jetson_Linux_R32.2.0_aarch64.tbz2
DRIVER_PACK_SHA=24d55959fe62dd7e4c2c6d9847008707fea03846
ROOT_DEVICE=mmcblk0p1
BSP=CTI-L4T-V126.tgz
BSP_SHA=d0a2429bc043d4e8a91b795f19f856d127d8b01e
DEPENDENCIES_IMAGE="${DEPENDENCIES_IMAGE:=l4t:32.2-tx2-jetpack-4.2.1-deps}"
FS_DEPENDENCIES_IMAGE="${FS_DEPENDENCIES_IMAGE:=l4t:32.2-tx2-jetpack-4.2.1-deps}"
BSP_DEPENDENCIES_IMAGE="${BSP_DEPENDENCIES_IMAGE:=l4t:cti-32.2-tx2-126-deps}"
8 changes: 8 additions & 0 deletions flash/cti/32.2/bsp/v204.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DRIVER_PACK=Jetson_Linux_R32.2.0_aarch64.tbz2
DRIVER_PACK_SHA=24d55959fe62dd7e4c2c6d9847008707fea03846
ROOT_DEVICE=mmcblk0p1
BSP=CTI-L4T-V204.tgz
BSP_SHA=9ef4b1ac0837372723dc466508593673814b964c
DEPENDENCIES_IMAGE="${DEPENDENCIES_IMAGE:=l4t:32.2-jax-jetpack-4.2.1-deps}"
FS_DEPENDENCIES_IMAGE="${FS_DEPENDENCIES_IMAGE:=l4t:32.2-jax-jetpack-4.2.1-deps}"
BSP_DEPENDENCIES_IMAGE="${BSP_DEPENDENCIES_IMAGE:=l4t:cti-32.2-jax-204-deps}"
95 changes: 95 additions & 0 deletions flash/cti/32.2/default.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
ARG VERSION_ID
ARG DEPENDENCIES_IMAGE
ARG FS_DEPENDENCIES_IMAGE
ARG BSP_DEPENDENCIES_IMAGE
FROM ${DEPENDENCIES_IMAGE} as dependencies

ARG VERSION_ID
ARG FS_DEPENDENCIES_IMAGE
ARG BSP_DEPENDENCIES_IMAGE
FROM ${FS_DEPENDENCIES_IMAGE} as fs-dependencies

ARG VERSION_ID
ARG BSP_DEPENDENCIES_IMAGE
FROM ${BSP_DEPENDENCIES_IMAGE} as bsp-dependencies


ARG VERSION_ID
FROM ubuntu:${VERSION_ID} as qemu

# install qemu for the support of building containers on host
RUN apt-get update && apt-get install -y --no-install-recommends qemu-user-static && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# start of the real image base
ARG VERSION_ID
FROM ubuntu:${VERSION_ID}

COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static

RUN apt-get update && apt-get install -y --allow-downgrades \
bzip2=1.0.6-8.1 libbz2-1.0=1.0.6-8.1 \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y \
apt-utils \
bzip2 \
curl \
lbzip2 \
libpython-stdlib \
perl \
python \
python-minimal \
python2.7 \
python2.7-minimal \
sudo \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

ARG DRIVER_PACK
ARG DRIVER_PACK_SHA

COPY --from=dependencies /data/${DRIVER_PACK} ${DRIVER_PACK}
RUN echo "${DRIVER_PACK_SHA} *./${DRIVER_PACK}" | sha1sum -c --strict - && \
tar -xp --overwrite -f ./${DRIVER_PACK} && \
rm /${DRIVER_PACK}


ARG ROOT_FS
ARG ROOT_FS_SHA

COPY --from=fs-dependencies /data/${ROOT_FS} ${ROOT_FS}
RUN echo "${ROOT_FS_SHA} *./${ROOT_FS}" | sha1sum -c --strict - && \
cd /Linux_for_Tegra/rootfs && \
tar -xp --overwrite -f /${ROOT_FS} && \
rm /${ROOT_FS}

WORKDIR /Linux_for_Tegra

ARG BSP
ARG BSP_SHA

# apply_binaries is handled in the install.sh
COPY --from=bsp-dependencies /data/${BSP} ${BSP}
RUN echo "${BSP_SHA} *./${BSP}" | sha1sum -c --strict - && \
tar -xzf ${BSP} && \
cd ./CTI-L4T && \
sudo ./install.sh

WORKDIR /Linux_for_Tegra

ARG TARGET_BOARD
ARG ROOT_DEVICE
ENV TARGET_BOARD=$TARGET_BOARD
ENV ROOT_DEVICE=$ROOT_DEVICE

RUN echo "#!/bin/bash" >> entrypoint.sh && \
echo "echo \"sudo ./flash.sh \$* ${TARGET_BOARD} ${ROOT_DEVICE}\"" >> entrypoint.sh && \
echo "sudo ./flash.sh \$* ${TARGET_BOARD} ${ROOT_DEVICE}" >> entrypoint.sh && \
chmod +x entrypoint.sh

ENTRYPOINT ["sh", "-c", "sudo ./entrypoint.sh $*", "--"]
145 changes: 145 additions & 0 deletions flash/cti/32.2/iot-edge.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
ARG VERSION_ID
ARG DEPENDENCIES_IMAGE
ARG FS_DEPENDENCIES_IMAGE
ARG BSP_DEPENDENCIES_IMAGE
FROM ${DEPENDENCIES_IMAGE} as dependencies

ARG VERSION_ID
ARG FS_DEPENDENCIES_IMAGE
ARG BSP_DEPENDENCIES_IMAGE
FROM ${FS_DEPENDENCIES_IMAGE} as fs-dependencies

ARG VERSION_ID
ARG BSP_DEPENDENCIES_IMAGE
FROM ${BSP_DEPENDENCIES_IMAGE} as bsp-dependencies

ARG VERSION_ID
FROM ubuntu:${VERSION_ID} as qemu

# install qemu for the support of building containers on host
RUN apt-get update && apt-get install -y --no-install-recommends qemu-user-static && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# start of the real image base
ARG VERSION_ID
FROM ubuntu:${VERSION_ID}

COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static

RUN apt-get update && apt-get install -y --allow-downgrades \
bzip2=1.0.6-8.1 libbz2-1.0=1.0.6-8.1 \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y \
apt-utils \
bzip2 \
curl \
lbzip2 \
libpython-stdlib \
perl \
python \
python-minimal \
python2.7 \
python2.7-minimal \
sudo \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

ARG DRIVER_PACK
ARG DRIVER_PACK_SHA

COPY --from=dependencies /data/${DRIVER_PACK} ${DRIVER_PACK}
RUN echo "${DRIVER_PACK_SHA} *./${DRIVER_PACK}" | sha1sum -c --strict - && \
tar -xp --overwrite -f ./${DRIVER_PACK} && \
rm /${DRIVER_PACK}

ARG ROOT_FS
ARG ROOT_FS_SHA

COPY --from=fs-dependencies /data/${ROOT_FS} ${ROOT_FS}
RUN echo "${ROOT_FS_SHA} *./${ROOT_FS}" | sha1sum -c --strict - && \
cd /Linux_for_Tegra/rootfs && \
tar -xp --overwrite -f /${ROOT_FS} && \
rm /${ROOT_FS}

WORKDIR /Linux_for_Tegra

ARG BSP
ARG BSP_SHA

# apply_binaries is handled in the install.sh
COPY --from=bsp-dependencies /data/${BSP} ${BSP}
RUN echo "${BSP_SHA} *./${BSP}" | sha1sum -c --strict - && \
tar -xzf ${BSP} && \
cd ./CTI-L4T && \
sudo ./install.sh

WORKDIR /Linux_for_Tegra/rootfs

RUN cp /usr/bin/qemu-aarch64-static usr/bin/

RUN echo "#!/bin/bash" >> configure-chroot.sh && \
echo "cp /etc/resolv.conf etc/resolv.conf.host" >> configure-chroot.sh && \
echo "mount --bind /dev/ dev/" >> configure-chroot.sh && \
echo "mount --bind /sys/ sys/" >> configure-chroot.sh && \
echo "mount --bind /proc/ proc/" >> configure-chroot.sh && \
chmod +x configure-chroot.sh

RUN echo "#!/bin/bash" >> install-iot-edge.sh && \
echo "cp -P /etc/resolv.conf /etc/resolv.conf.saved" >> install-iot-edge.sh && \
echo "rm /etc/resolv.conf" >> install-iot-edge.sh && \
echo "cp /etc/resolv.conf.host /etc/resolv.conf" >> install-iot-edge.sh && \
echo "apt update" >> install-iot-edge.sh && \
echo "apt install ca-certificates gpg curl -y --no-install-recommends" >> install-iot-edge.sh && \
echo "curl https://packages.microsoft.com/config/ubuntu/18.04/multiarch/prod.list > ./microsoft-prod.list" >> install-iot-edge.sh && \
echo "mv ./microsoft-prod.list /etc/apt/sources.list.d/" >> install-iot-edge.sh && \
echo "curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg" >> install-iot-edge.sh && \
echo "mv ./microsoft.gpg /etc/apt/trusted.gpg.d/" >> install-iot-edge.sh && \
echo "apt remove --purge -y *docker*" >> install-iot-edge.sh && \
echo "apt update" >> install-iot-edge.sh && \
echo "apt-get install moby-engine -y --no-install-recommends" >> install-iot-edge.sh && \
echo "apt-get install moby-cli -y --no-install-recommends" >> install-iot-edge.sh && \
echo "apt-get install iotedge -y --no-install-recommends" >> install-iot-edge.sh && \
echo "rm /etc/resolv.conf" >> install-iot-edge.sh && \
echo "cp -P /etc/resolv.conf.saved /etc/resolv.conf" >> install-iot-edge.sh && \
echo "rm /etc/resolv.conf.saved" >> install-iot-edge.sh && \
echo "rm /etc/resolv.conf.host" >> install-iot-edge.sh && \
echo "exit" >> install-iot-edge.sh && \
chmod +x install-iot-edge.sh

RUN echo "#!/bin/bash" >> cleanup-chroot.sh && \
echo "umount ./proc" >> cleanup-chroot.sh && \
echo "umount ./sys" >> cleanup-chroot.sh && \
echo "umount ./dev" >> cleanup-chroot.sh && \
echo "cp -P etc/resolv.conf.saved etc/resolv.conf" >> cleanup-chroot.sh && \
echo "rm etc/resolv.conf.saved" >> cleanup-chroot.sh && \
echo "rm usr/bin/qemu-aarch64-static" >> cleanup-chroot.sh && \
chmod +x cleanup-chroot.sh

WORKDIR /Linux_for_Tegra

ARG TARGET_BOARD
ARG ROOT_DEVICE
ENV TARGET_BOARD=$TARGET_BOARD
ENV ROOT_DEVICE=$ROOT_DEVICE

RUN echo "#!/bin/bash" >> entrypoint.sh && \
echo "set -e" >> entrypoint.sh && \
echo "cd /Linux_for_Tegra/rootfs" >> entrypoint.sh && \
echo "./configure-chroot.sh" >> entrypoint.sh && \
echo "chroot . /bin/bash -c ./install-iot-edge.sh" >> entrypoint.sh && \
echo "./cleanup-chroot.sh" >> entrypoint.sh && \
echo "rm configure-chroot.sh" >> entrypoint.sh && \
echo "rm install-iot-edge.sh" >> entrypoint.sh && \
echo "rm cleanup-chroot.sh" >> entrypoint.sh && \
echo "cd /Linux_for_Tegra" >> entrypoint.sh && \
echo "[ -f /conf/config.yaml ] && sudo cp /conf/config.yaml /Linux_for_Tegra/rootfs/etc/iotedge/config.yaml" >> entrypoint.sh && \
echo "echo \"sudo ./flash.sh \$* ${TARGET_BOARD} ${ROOT_DEVICE}\"" >> entrypoint.sh && \
echo "sudo ./flash.sh \$* ${TARGET_BOARD} ${ROOT_DEVICE}" >> entrypoint.sh && \
chmod +x entrypoint.sh

ENTRYPOINT ["sh", "-c", "sudo ./entrypoint.sh $*", "--"]
2 changes: 2 additions & 0 deletions flash/cti/32.2/rootfs/tegra-linux-sample-32.2.0-jax.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ROOT_FS="${ROOT_FS:=Tegra_Linux_Sample-Root-Filesystem_R32.2.0_aarch64.tbz2}"
ROOT_FS_SHA="${ROOT_FS_SHA:=fb63c8ce4799e2e781cc395fb4e6c43fa76b098b}"
2 changes: 2 additions & 0 deletions flash/cti/32.2/rootfs/tegra-linux-sample-32.2.0-tx2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ROOT_FS="${ROOT_FS:=Tegra_Linux_Sample-Root-Filesystem_R32.2.0_aarch64.tbz2}"
ROOT_FS_SHA="${ROOT_FS_SHA:=fb63c8ce4799e2e781cc395fb4e6c43fa76b098b}"