pythops / jetson-image

💾 Create minimalist, Ubuntu based images for the Nvidia jetson boards
371 stars 108 forks source link

cp: cannot create regular file '/jetson/jetson.img' #114

Closed Dviros closed 9 months ago

Dviros commented 10 months ago

Hi, Thank you very much for this project. I'm attempting to build an image for Jetson Nano B1 with Ubuntu 22. I'm using macOS and these are the commands I've been using:

The output I get is super strange, especially because the path "/jetson/jetson.img" exists only in the create-jetson-image.sh script, but also mentioned in a file that I cannot find - jetson-disk-image-creator.sh. I need help to proceed in here please :)

Thanks again, D

sudo just build-jetson-image -b jetson-nano -r 300 -d SD
STEP 1/21: FROM ubuntu:jammy
STEP 2/21: LABEL org.opencontainers.image.authors="Badr @pythops"
--> Using cache dd9e218ec9bf57499f89aceae1e9df51ebbddec1e5d3d83b6bfa906b05b8e954
--> dd9e218ec9bf
STEP 3/21: ARG BSP=https://developer.download.nvidia.com/embedded/L4T/r32_Release_v7.4/T210/Jetson-210_Linux_R32.7.4_aarch64.tbz2
--> Using cache 77930c199b8f969d02e59f1d1e0a42149d383d75474c2eb288e2ad6aa1506c47
--> 77930c199b8f
STEP 4/21: RUN apt update &&     apt install -y         wget         patch         bzip2         qemu-user-static         sudo         libxml2-utils         python3         gdisk         kpartx         cpio
--> Using cache 18cf7b295aba88fd1bd24d01e89b9ff64222b5208d41adef1469e75f35c7c38f
--> 18cf7b295aba
STEP 5/21: RUN mkdir /build &&     wget -qO- $BSP | tar -jxpf - -C /build
--> Using cache 6d4f1cc6538c4f87f46c3e6be8de304640e856c9071b2d923f8bc9c96d544cd7
--> 6d4f1cc6538c
STEP 6/21: COPY rootfs/ /build/Linux_for_Tegra/rootfs/
--> 9212113afa61
STEP 7/21: RUN chmod 4755 /build/Linux_for_Tegra/rootfs/usr/bin/sudo
--> c2d97962b9a7
STEP 8/21: COPY patches /patches
--> c894c3f18221
STEP 9/21: 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
patching file /build/Linux_for_Tegra/nv_tegra/nv-apply-debs.sh
patching file /build/Linux_for_Tegra/tools/jetson-disk-image-creator.sh
--> 0b00756947ad
STEP 10/21: RUN rm -rf /build/Linux_for_Tegra/tools/python-jetson-gpio_*_arm64.deb
--> e6d768ab6e99
STEP 11/21: WORKDIR /build/Linux_for_Tegra/
--> 2b69830929b4
STEP 12/21: RUN ./apply_binaries.sh
Using rootfs directory of: /build/Linux_for_Tegra/rootfs
Installing extlinux.conf into /boot/extlinux in target rootfs
/build/Linux_for_Tegra/nv_tegra/nv-apply-debs.sh
Root file system directory is /build/Linux_for_Tegra/rootfs
Copying public debian packages to rootfs
Start L4T BSP package installation
QEMU binary is not available, looking for QEMU from host system
Found /usr/bin/qemu-aarch64-static
Installing QEMU binary in rootfs
/build/Linux_for_Tegra/rootfs /build/Linux_for_Tegra
Installing BSP Debian packages in /build/Linux_for_Tegra/rootfs
Selecting previously unselected package nvidia-l4t-core.
(Reading database ... 49741 files and directories currently installed.)
Preparing to unpack .../nvidia-l4t-core_32.7.4-20230608212426_arm64.deb ...
Pre-installing... skip compatibility checking.
Unpacking nvidia-l4t-core (32.7.4-20230608212426) ...
Setting up nvidia-l4t-core (32.7.4-20230608212426) ...
Selecting previously unselected package jetson-gpio-common.
(Reading database ... 49787 files and directories currently installed.)
Preparing to unpack .../jetson-gpio-common_2.0.17_arm64.deb ...
Unpacking jetson-gpio-common (2.0.17) ...
Selecting previously unselected package python3-jetson-gpio.
Preparing to unpack .../python3-jetson-gpio_2.0.17_arm64.deb ...
Unpacking python3-jetson-gpio (2.0.17) ...
Selecting previously unselected package nvidia-l4t-3d-core.
Preparing to unpack .../nvidia-l4t-3d-core_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-3d-core (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-apt-source.
Preparing to unpack .../nvidia-l4t-apt-source_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-apt-source (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-camera.
Preparing to unpack .../nvidia-l4t-camera_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-camera (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-configs.
Preparing to unpack .../nvidia-l4t-configs_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-configs (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-cuda.
Preparing to unpack .../nvidia-l4t-cuda_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-cuda (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-firmware.
Preparing to unpack .../nvidia-l4t-firmware_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-firmware (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-gputools.
Preparing to unpack .../nvidia-l4t-gputools_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-gputools (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-graphics-demos.
Preparing to unpack .../nvidia-l4t-graphics-demos_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-graphics-demos (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-gstreamer.
Preparing to unpack .../nvidia-l4t-gstreamer_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-gstreamer (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-init.
Preparing to unpack .../nvidia-l4t-init_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-init (32.7.4-20230608212426) ...
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: trying to overwrite '/etc/systemd/sleep.conf', which is also in package systemd 249.11-0ubuntu3.11
Selecting previously unselected package nvidia-l4t-initrd.
Preparing to unpack .../nvidia-l4t-initrd_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-initrd (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-jetson-io.
Preparing to unpack .../nvidia-l4t-jetson-io_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-jetson-io (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-libvulkan.
Preparing to unpack .../nvidia-l4t-libvulkan_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-libvulkan (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-multimedia-utils.
Preparing to unpack .../nvidia-l4t-multimedia-utils_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-multimedia-utils (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-multimedia.
Preparing to unpack .../nvidia-l4t-multimedia_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-multimedia (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-oem-config.
Preparing to unpack .../nvidia-l4t-oem-config_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-oem-config (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-tools.
Preparing to unpack .../nvidia-l4t-tools_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-tools (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-wayland.
Preparing to unpack .../nvidia-l4t-wayland_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-wayland (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-weston.
Preparing to unpack .../nvidia-l4t-weston_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-weston (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-x11.
Preparing to unpack .../nvidia-l4t-x11_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-x11 (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-xusb-firmware.
Preparing to unpack .../nvidia-l4t-xusb-firmware_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-xusb-firmware (32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-kernel-dtbs.
Preparing to unpack .../nvidia-l4t-kernel-dtbs_4.9.337-tegra-32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-kernel-dtbs (4.9.337-tegra-32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-kernel-headers.
Preparing to unpack .../nvidia-l4t-kernel-headers_4.9.337-tegra-32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-kernel-headers (4.9.337-tegra-32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-kernel.
Preparing to unpack .../nvidia-l4t-kernel_4.9.337-tegra-32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-kernel (4.9.337-tegra-32.7.4-20230608212426) ...
Selecting previously unselected package nvidia-l4t-bootloader.
Preparing to unpack .../nvidia-l4t-bootloader_32.7.4-20230608212426_arm64.deb ...
Unpacking nvidia-l4t-bootloader (32.7.4-20230608212426) ...
Setting up jetson-gpio-common (2.0.17) ...
Setting up python3-jetson-gpio (2.0.17) ...
Setting up nvidia-l4t-apt-source (32.7.4-20230608212426) ...
Pre-installing... skip changing source list.
Setting up nvidia-l4t-configs (32.7.4-20230608212426) ...
Setting up nvidia-l4t-firmware (32.7.4-20230608212426) ...
Setting up nvidia-l4t-gputools (32.7.4-20230608212426) ...
Setting up nvidia-l4t-init (32.7.4-20230608212426) ...
Installing new version of config file /etc/systemd/sleep.conf ...
/var/lib/dpkg/info/nvidia-l4t-init.postinst: line 52: cannot create temp file for here-document: No such file or directory
Setting up nvidia-l4t-libvulkan (32.7.4-20230608212426) ...
Setting up nvidia-l4t-multimedia-utils (32.7.4-20230608212426) ...
Setting up nvidia-l4t-oem-config (32.7.4-20230608212426) ...
Setting up nvidia-l4t-tools (32.7.4-20230608212426) ...
Setting up nvidia-l4t-wayland (32.7.4-20230608212426) ...
Setting up nvidia-l4t-weston (32.7.4-20230608212426) ...
Setting up nvidia-l4t-x11 (32.7.4-20230608212426) ...
Setting up nvidia-l4t-xusb-firmware (32.7.4-20230608212426) ...
Pre-installing xusb firmware package, skip flashing
Setting up nvidia-l4t-kernel (4.9.337-tegra-32.7.4-20230608212426) ...
Using the existing boot entry 'primary'
Pre-installing kernel package, skip flashing
Setting up nvidia-l4t-bootloader (32.7.4-20230608212426) ...
Pre-installing bootloader package, skip flashing
Setting up nvidia-l4t-3d-core (32.7.4-20230608212426) ...
Setting up nvidia-l4t-cuda (32.7.4-20230608212426) ...
Setting up nvidia-l4t-graphics-demos (32.7.4-20230608212426) ...
Setting up nvidia-l4t-initrd (32.7.4-20230608212426) ...
Pre-installing initrd package, skip flashing
Setting up nvidia-l4t-jetson-io (32.7.4-20230608212426) ...
Setting up nvidia-l4t-multimedia (32.7.4-20230608212426) ...
Setting up nvidia-l4t-kernel-dtbs (4.9.337-tegra-32.7.4-20230608212426) ...
Pre-installing kernel-dtbs package, skip flashing
Setting up nvidia-l4t-kernel-headers (4.9.337-tegra-32.7.4-20230608212426) ...
Setting up nvidia-l4t-camera (32.7.4-20230608212426) ...
Setting up nvidia-l4t-gstreamer (32.7.4-20230608212426) ...
Processing triggers for nvidia-l4t-kernel (4.9.337-tegra-32.7.4-20230608212426) ...
Processing triggers for libc-bin (2.35-0ubuntu3.6) ...
/build/Linux_for_Tegra
Removing QEMU binary from rootfs
Removing stashed Debian packages from rootfs
L4T BSP package installation completed!
Rename ubuntu.desktop --> ux-ubuntu.desktop
Disabling NetworkManager-wait-online.service
Disable the ondemand service by changing the runlevels to 'K'
Success!
--> e418874e7e97
STEP 13/21: RUN chroot /build/Linux_for_Tegra/rootfs/ /bin/bash -c "chown -R jetson:jetson /home/jetson && chmod 1777 /tmp"
--> 2dd58604cf75
STEP 14/21: WORKDIR /tmp/pythops
--> f11956804eab
STEP 15/21: RUN gzip -d -c /build/Linux_for_Tegra/bootloader/l4t_initrd.img > initrd
--> aca187c0622e
STEP 16/21: WORKDIR /tmp/pythops/lab
--> 8b41ec2332c2
STEP 17/21: RUN cpio -iv < ../initrd &&     echo "nameserver 127.0.0.53" > etc/resolv.conf &&     find . | cpio --create --format="newc" > ../new_initrd
.
proc
tmp
dev
usr
usr/lib
usr/lib/aarch64-linux-gnu
usr/lib/aarch64-linux-gnu/libkrb5support.so.0.1
usr/lib/aarch64-linux-gnu/libk5crypto.so.3
usr/lib/aarch64-linux-gnu/libgssapi_krb5.so.2
usr/lib/aarch64-linux-gnu/libk5crypto.so.3.1
usr/lib/aarch64-linux-gnu/libgssapi_krb5.so.2.2
usr/lib/aarch64-linux-gnu/libkrb5.so.3
usr/lib/aarch64-linux-gnu/libkrb5support.so.0
usr/lib/aarch64-linux-gnu/libkrb5.so.3.3
usr/lib/aarch64-linux-gnu/libcrypto.so.1.1
usr/bin
usr/bin/tail
usr/bin/mawk
usr/bin/partx
usr/bin/awk
usr/bin/test
usr/bin/tee
usr/bin/timeout
usr/bin/md5sum
usr/bin/sha256sum
usr/bin/which
usr/bin/[
usr/bin/expr
usr/sbin
usr/sbin/chroot
lib
lib/aarch64-linux-gnu
lib/aarch64-linux-gnu/libblkid.so.1.1.0
lib/aarch64-linux-gnu/libcom_err.so.2.1
lib/aarch64-linux-gnu/libext2fs.so.2
lib/aarch64-linux-gnu/libcom_err.so.2
lib/aarch64-linux-gnu/libc-2.27.so
lib/aarch64-linux-gnu/libuuid.so.1.3.0
lib/aarch64-linux-gnu/libm-2.27.so
lib/aarch64-linux-gnu/libselinux.so.1
lib/aarch64-linux-gnu/libkeyutils.so.1.5
lib/aarch64-linux-gnu/libuuid.so.1
lib/aarch64-linux-gnu/libtirpc.so.1
lib/aarch64-linux-gnu/libtinfo.so.5.9
lib/aarch64-linux-gnu/libdns-export.so.1100
lib/aarch64-linux-gnu/libpcre.so.3
lib/aarch64-linux-gnu/libpcre.so.3.13.3
lib/aarch64-linux-gnu/libpthread.so.0
lib/aarch64-linux-gnu/librt.so.1
lib/aarch64-linux-gnu/libmount.so.1.1.0
lib/aarch64-linux-gnu/libpthread-2.27.so
lib/aarch64-linux-gnu/libz.so.1
lib/aarch64-linux-gnu/librt-2.27.so
lib/aarch64-linux-gnu/libe2p.so.2
lib/aarch64-linux-gnu/libkeyutils.so.1
lib/aarch64-linux-gnu/libfdisk.so.1
lib/aarch64-linux-gnu/libresolv.so.2
lib/aarch64-linux-gnu/libnss_nis.so.2
lib/aarch64-linux-gnu/libc.so.6
lib/aarch64-linux-gnu/libnsl-2.27.so
lib/aarch64-linux-gnu/libattr.so.1
lib/aarch64-linux-gnu/libgcc_s.so.1
lib/aarch64-linux-gnu/ld-2.27.so
lib/aarch64-linux-gnu/libmount.so.1
lib/aarch64-linux-gnu/libm.so.6
lib/aarch64-linux-gnu/libnss_nis-2.27.so
lib/aarch64-linux-gnu/libnss_files-2.27.so
lib/aarch64-linux-gnu/libnsl.so.1
lib/aarch64-linux-gnu/libacl.so.1.1.0
lib/aarch64-linux-gnu/libtirpc.so.1.0.10
lib/aarch64-linux-gnu/libblkid.so.1
lib/aarch64-linux-gnu/libattr.so.1.1.0
lib/aarch64-linux-gnu/libtinfo.so.5
lib/aarch64-linux-gnu/libdl-2.27.so
lib/aarch64-linux-gnu/libacl.so.1
lib/aarch64-linux-gnu/libz.so.1.2.11
lib/aarch64-linux-gnu/libnss_files.so.2
lib/aarch64-linux-gnu/libresolv-2.27.so
lib/aarch64-linux-gnu/libisc-export.so.169
lib/aarch64-linux-gnu/libdl.so.2
lib/ld-linux-aarch64.so.1
mnt
bin
bin/gunzip
bin/df
bin/grep
bin/tar
bin/dd
bin/echo
bin/rm
bin/date
bin/gzip
bin/cp
bin/cat
bin/mkdir
bin/sleep
bin/bash
bin/chmod
bin/sed
bin/mountpoint
bin/mount
bin/which
bin/ln
bin/umount
bin/dmesg
bin/ls
etc
etc/ld.so.conf.d
etc/ld.so.conf.d/libc.conf
etc/ld.so.conf.d/aarch64-linux-gnu.conf
etc/alternatives
etc/alternatives/nawk
etc/alternatives/pager
etc/alternatives/awk
etc/alternatives/rmt
etc/alternatives/w
etc/alternatives/README
etc/resolv.conf
etc/netconfig
etc/dhcp
etc/dhcp/dhclient-enter-hooks.d
etc/dhcp/dhclient-enter-hooks.d/debug
etc/dhcp/debug
etc/dhcp/dhclient-exit-hooks.d
etc/dhcp/dhclient-exit-hooks.d/rfc3442-classless-routes
etc/dhcp/dhclient-exit-hooks.d/debug
etc/dhcp/dhclient.conf
etc/protocols
etc/rpc
etc/services
var
sys
sbin
sbin/fdisk
sbin/mkfs.ext4
sbin/getty
sbin/umount.nfs
sbin/umount.nfs4
sbin/mount.nfs
sbin/dhclient
sbin/blkid
sbin/mount.nfs4
sbin/ifconfig
.
init
lib
lib/firmware
lib/firmware/tegra21x_xusb_firmware
lib/firmware/nvidia
lib/firmware/nvidia/tegra210
lib/firmware/nvidia/tegra210/xusb.bin
30163 blocks
30162 blocks
--> d7d6b392ffa9
STEP 18/21: WORKDIR /tmp/pythops
--> ff6b70ddf8e7
STEP 19/21: RUN gzip new_initrd && mv new_initrd.gz /build/Linux_for_Tegra/bootloader/l4t_initrd.img
--> 08e9ff4bb419
STEP 20/21: COPY scripts/create-jetson-image.sh /usr/local/bin/
--> 89a5e365ae1a
STEP 21/21: WORKDIR /build/Linux_for_Tegra/tools
COMMIT jetson-build-image-l4t32
--> 68dc076abb02
Successfully tagged localhost/jetson-build-image-l4t32:latest
68dc076abb02cef4e3466fa9f38257f7e7bef3c12d1bb5345fa02b15956b6d48
Creating image for Jetson nano board (300 revision)
********************************************
     Jetson Disk Image Creation Tool
********************************************
jetson-disk-image-creator.sh - creating signed images
/build/Linux_for_Tegra /build/Linux_for_Tegra/tools
###############################################################################
# L4T BSP Information:
# R32 , REVISION: 7.4
###############################################################################
Board ID(3448) version(300)
copying bctfile(/build/Linux_for_Tegra/bootloader/t210ref/BCT/P3448_A00_lpddr4_204Mhz_P987.cfg)... done.
copying bootloader(/build/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
copying initrd(/build/Linux_for_Tegra/bootloader/l4t_initrd.img)... done.
Making Boot image... done.
Existing sosfile(/build/Linux_for_Tegra/bootloader/nvtboot_recovery.bin) reused.
copying tegraboot(/build/Linux_for_Tegra/bootloader/t210ref/nvtboot.bin)... done.
copying cpu_bootloader(/build/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
copying bpffile(/build/Linux_for_Tegra/bootloader/t210ref/sc7entry-firmware.bin)... done.
copying wb0boot(/build/Linux_for_Tegra/bootloader/t210ref/warmboot.bin)... done.
Existing tosfile(/build/Linux_for_Tegra/bootloader/tos-mon-only.img) reused.
Existing eksfile(/build/Linux_for_Tegra/bootloader/eks.img) reused.
copying dtbfile(/build/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-b00.dtb)... done.
Copying nv_boot_control.conf to rootfs
    populating kernel to rootfs... done.
    populating initrd to rootfs... done.
    populating kernel_tegra210-p3448-0000-p3449-0000-b00.dtb to rootfs... done.
Making system.img...
    populating rootfs from /build/Linux_for_Tegra/rootfs ...    populating /boot/extlinux/extlinux.conf ... done.
    Sync'ing system.img ... done.
    Converting RAW image to Sparse image... done.
system.img built successfully.
Existing tbcfile(/build/Linux_for_Tegra/bootloader/nvtboot_cpu.bin) reused.
copying tbcdtbfile(/build/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-b00.dtb)... done.
copying cfgfile(/build/Linux_for_Tegra/bootloader/t210ref/cfg/flash_l4t_t210_spi_sd_p3448.xml) to flash.xml... done.
copying flasher(/build/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
Existing flashapp(/build/Linux_for_Tegra/bootloader/tegraflash.py) reused.
./tegraflash.py --bl cboot.bin --bct  P3448_A00_lpddr4_204Mhz_P987.cfg --odmdata 0xa4000 --bldtb kernel_tegra210-p3448-0000-p3449-0000-b00.dtb --applet nvtboot_recovery.bin --cmd "sign"  --cfg flash.xml --chip 0x21    --bins "EBT cboot.bin; DTB tegra210-p3448-0000-p3449-0000-b00.dtb"
saving flash command in /build/Linux_for_Tegra/bootloader/flashcmd.txt
saving Windows flash command to /build/Linux_for_Tegra/bootloader/flash_win.bat
assign_value: crc-flash.xml.bin 1 65520 1
printf '\x1' | dd of=crc-flash.xml.bin bs=1 seek=65520 count=1 conv=notrunc
1+0 records in
1+0 records out
1 byte copied, 1.8292e-05 s, 54.7 kB/s
assign_value: crc-flash.xml.bin 0 65521 1
printf '\x0' | dd of=crc-flash.xml.bin bs=1 seek=65521 count=1 conv=notrunc
1+0 records in
1+0 records out
1 byte copied, 1.75e-05 s, 57.1 kB/s
assign_string: crc-flash.xml.bin PTHD 65528 4
echo PTHD | dd of=crc-flash.xml.bin bs=1 seek=65528 count=4 conv=notrunc
4+0 records in
4+0 records out
4 bytes copied, 1.8875e-05 s, 212 kB/s
*** Sign and generate flashing ready partition images... ***
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands

[   0.0020 ] Using default ramcode: 0
[   0.0020 ] Disable BPMP dtb trim, using default dtb
[   0.0020 ]
[   0.0033 ] tegrasign --getmode mode.txt --key None
[   0.0034 ] Assuming zero filled SBK key
[   0.0081 ]
[   0.0082 ] Generating RCM messages
[   0.0095 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 0 --download rcm nvtboot_recovery.bin 0 0
[   0.0096 ] RCM 0 is saved as rcm_0.rcm
[   0.0155 ] RCM 1 is saved as rcm_1.rcm
[   0.0158 ] List of rcm files are saved in rcm_list.xml
[   0.0173 ]
[   0.0173 ] Signing RCM messages
[   0.0187 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.key
[   0.0189 ] Assuming zero filled SBK key
[   0.0374 ]
[   0.0374 ] Copying signature to RCM mesages
[   0.0387 ] tegrarcm --chip 0x21 0 --updatesig rcm_list_signed.xml
[   0.0456 ]
[   0.0456 ] Parsing partition layout
[   0.0469 ] tegraparser --pt flash.xml.tmp
[   0.0533 ]
[   0.0533 ] Creating list of images to be signed
[   0.0547 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --list images_list.xml
[   0.0649 ]
[   0.0650 ] Generating signatures
[   0.0662 ] tegrasign --key None --list images_list.xml --pubkeyhash pub_key.key
[   0.0664 ] Assuming zero filled SBK key
[   0.1916 ]
[   0.1916 ] Generating br-bct
[   0.1930 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.cfg --chip 0x21 0
[   0.2106 ]
[   0.2106 ] Updating boot device parameters
[   0.2119 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatedevparam flash.xml.bin
[   0.2121 ] Warning: No sdram params
[   0.2185 ]
[   0.2185 ] Updating bl info
[   0.2198 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updateblinfo flash.xml.bin --updatesig images_list_signed.xml
[   0.2269 ]
[   0.2269 ] Updating secondary storage information into bct
[   0.2272 ] tegraparser --pt flash.xml.bin --chip 0x21 0 --updatecustinfo P3448_A00_lpddr4_204Mhz_P987.bct
[   0.2319 ]
[   0.2319 ] Updating Odmdata
[   0.2331 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatefields Odmdata =0xa4000
[   0.2333 ] Warning: No sdram params
[   0.2386 ]
[   0.2386 ] Get Signed section of bct
[   0.2399 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --listbct bct_list.xml
[   0.2448 ]
[   0.2448 ] Signing BCT
[   0.2473 ] tegrasign --key None --list bct_list.xml --pubkeyhash pub_key.key
[   0.2474 ] Assuming zero filled SBK key
[   0.2549 ]
[   0.2549 ] Updating BCT with signature
[   0.2562 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatesig bct_list_signed.xml
[   0.2620 ]
[   0.2620 ] Copying signatures
[   0.2634 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --updatesig images_list_signed.xml
[   0.2739 ]
[   0.2739 ] Updating BFS information on BCT
[   0.2752 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatebfsinfo flash.xml.bin
[   0.2805 ]
[   0.2805 ] Copying signed file in /build/Linux_for_Tegra/bootloader/signed
/build/Linux_for_Tegra/tools
jetson-disk-image-creator.sh - creating jetson.img of 2606M...
0+0 records in
0+0 records out
0 bytes copied, 1.2917e-05 s, 0.0 kB/s
jetson-disk-image-creator.sh - create partitions
Creating new GPT entries in memory.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 1
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 2
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 3
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 4
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 5
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 6
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 7
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 8
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 9
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 10
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 11
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 12
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 13
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 0
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
jetson-disk-image-creator.sh - write partitions
add map loop0p1 (253:0): 0 5304320 linear 7:0 28672
add map loop0p2 (253:1): 0 256 linear 7:0 2048
add map loop0p3 (253:2): 0 896 linear 7:0 4096
add map loop0p4 (253:3): 0 1152 linear 7:0 6144
add map loop0p5 (253:4): 0 128 linear 7:0 8192
add map loop0p6 (253:5): 0 384 linear 7:0 10240
add map loop0p7 (253:6): 0 768 linear 7:0 12288
add map loop0p8 (253:7): 0 128 linear 7:0 14336
add map loop0p9 (253:8): 0 896 linear 7:0 16384
add map loop0p10 (253:9): 0 896 linear 7:0 18432
add map loop0p11 (253:10): 0 1536 linear 7:0 20480
add map loop0p12 (253:11): 0 128 linear 7:0 22528
add map loop0p13 (253:12): 0 384 linear 7:0 24576
add map loop0p14 (253:13): 0 256 linear 7:0 26624
jetson-disk-image-creator.sh - writing /build/Linux_for_Tegra/bootloader/signed/nvtboot_cpu.bin.encrypt
157+1 records in
158+0 records out
80896 bytes (81 kB, 79 KiB) copied, 0.00184713 s, 43.8 MB/s
jetson-disk-image-creator.sh - writing /build/Linux_for_Tegra/bootloader/signed/kernel_tegra210-p3448-0000-p3449-0000-b00.dtb.encrypt
465+1 records in
466+0 records out
238592 bytes (239 kB, 233 KiB) copied, 0.00102734 s, 232 MB/s
jetson-disk-image-creator.sh - writing /build/Linux_for_Tegra/bootloader/signed/cboot.bin.encrypt
949+1 records in
950+0 records out
486400 bytes (486 kB, 475 KiB) copied, 0.00228609 s, 213 MB/s
jetson-disk-image-creator.sh - writing /build/Linux_for_Tegra/bootloader/signed/warmboot.bin.encrypt
7+1 records in
8+0 records out
4096 bytes (4.1 kB, 4.0 KiB) copied, 0.000335001 s, 12.2 MB/s
jetson-disk-image-creator.sh - writing /build/Linux_for_Tegra/bootloader/signed/sc7entry-firmware.bin.encrypt
6+1 records in
7+0 records out
3584 bytes (3.6 kB, 3.5 KiB) copied, 0.000128667 s, 27.9 MB/s
jetson-disk-image-creator.sh - writing /build/Linux_for_Tegra/bootloader/signed/tos-mon-only.img.encrypt
105+1 records in
106+0 records out
54272 bytes (54 kB, 53 KiB) copied, 0.0016228 s, 33.4 MB/s
jetson-disk-image-creator.sh - writing /build/Linux_for_Tegra/bootloader/signed/kernel_tegra210-p3448-0000-p3449-0000-b00.dtb.encrypt
465+1 records in
466+0 records out
238592 bytes (239 kB, 233 KiB) copied, 0.00302968 s, 78.8 MB/s
jetson-disk-image-creator.sh - writing /build/Linux_for_Tegra/bootloader/signed/boot.img.encrypt
1304+0 records in
1304+0 records out
667648 bytes (668 kB, 652 KiB) copied, 0.0102258 s, 65.3 MB/s
jetson-disk-image-creator.sh - writing /build/Linux_for_Tegra/bootloader/eks.img
2+1 records in
3+0 records out
1536 bytes (1.5 kB, 1.5 KiB) copied, 0.00019496 s, 7.9 MB/s
jetson-disk-image-creator.sh - writing /build/Linux_for_Tegra/bootloader/bmp.blob
292+1 records in
293+0 records out
150016 bytes (150 kB, 146 KiB) copied, 0.00314747 s, 47.7 MB/s
jetson-disk-image-creator.sh - writing /build/Linux_for_Tegra/bootloader/rp4.blob
248+1 records in
249+0 records out
127488 bytes (127 kB, 124 KiB) copied, 0.0033863 s, 37.6 MB/s
jetson-disk-image-creator.sh - writing /build/Linux_for_Tegra/bootloader/system.img.raw
5304320+0 records in
5304320+0 records out
2715811840 bytes (2.7 GB, 2.5 GiB) copied, 30.8159 s, 88.1 MB/s
del devmap : loop0p1
del devmap : loop0p10
del devmap : loop0p11
del devmap : loop0p12
del devmap : loop0p13
del devmap : loop0p14
del devmap : loop0p2
del devmap : loop0p3
del devmap : loop0p4
del devmap : loop0p5
del devmap : loop0p6
del devmap : loop0p7
del devmap : loop0p8
del devmap : loop0p9
********************************************
   Jetson Disk Image Creation Complete
********************************************
cp: cannot create regular file '/jetson/jetson.img': Operation not permitted
[OK]
pythops commented 10 months ago

Seems to be a permission issue. The image has been generated but can not be copied to your host fs. If you can run the generation scripts on a Linux VM that would solve the issue I think.

Dviros commented 10 months ago

Bummer :( any way to trace to the exact copy command? I'll try to run it in a VM

pythops commented 10 months ago

In the create-jetson-image.sh, there is cp jetson.img /jetson/ which copy the image from the container to the host machine.

Dviros commented 10 months ago

Yep, modified it to point to a controlled folder, but the original path still reflects in the logs. It seems that value appears in jetson-disk-image-creator.sh, which is different from the one that exists in the scripts folder.

Dviros commented 9 months ago

Solved, This was achieved by running

Maybe it's worth adding a switch case to check the OS and run it to extract the img from the docker? Thanks again for your hard work.

pythops commented 9 months ago

Glad that you solved it. I'll add a note to the Readme for macos users

egeakman commented 8 months ago

I just did touch jetson.img before building the Jetson image and it worked.