目前JETPACK SDK镜像是4.5.1版
Jetson Nano 4G 内存版,下载链接:https://developer.nvidia.com/jetson-nano-sd-card-image
Jetson Nano 2G内存版,下载链接:https://developer.nvidia.com/jetson-nano-2gb-sd-card-image
系统镜像6G,默认安装ubuntu desktop等桌面软件,体积非常大,如果项目开发完成,想要将工程文件直接集成到镜像里,进行批量烧录,那么可以通过自制镜像的方式来实现。以下针对Nano版整理的制作方法。
一、下载BSP并解压
1 2 3 |
wget https://developer.nvidia.com/embedded/l4t/r32_release_v5.1/r32_release_v5.1/t210/jetson-210_linux_r32.5.1_aarch64.tbz2 tar xvf jetson-210_linux_r32.5.1_aarch64.tbz2 cd Linux_for_Tegra |
二、host安装依赖
1 2 |
apt-get update apt-get install --no-install-recommends -y qemu-user-static debootstrap binfmt-support coreutils parted gdisk e2fsprogs |
三、运行debootstrap创建基础rootfs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
debootstrap --arch=arm64 --foreign --variant=minbase --include=python3,python3-apt bionic rootfs tee rootfs/etc/apt/sources.list <<-'EOF' deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe multiverse deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiver deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe multiverse deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse EOF tee rootfs/etc/netplan/netcfg.yaml <<-'EOF' network: version: 2 renderer: networkd ethernets: eth0: dhcp4: true EOF cp /usr/bin/qemu-aarch64-static rootfs/usr/bin chroot rootfs /bin/bash -c "/debootstrap/debootstrap --second-stage" |
四、target安装依赖
此时需要chroot到rootfs内
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
chroot rootfs /bin/bash apt update apt install -y libx11-dev libgles2 libpangoft2-1.0-0 libharfbuzz0b libgles2 libdatrie1 libxkbcommon0 libwayland-egl1 libwayland-cursor0 libunwind8 libpng16-16 libpixman-1-0 libjpeg-turbo8 libinput10 libgles2 libevdev2 libcairo2 device-tree-compiler iso-codes libffi6 libncursesw5 libpython3-stdlib libpython3.8-minimal libpython3.8-stdlib libreadline7 libtinfo5 python3-minimal python3.8 libglvnd0 libdrm-common libdrm2 libegl-mesa0 libegl1 libegl1-mesa libgtk-3-0 libgbm1 libglapi-mesa libwayland-server0 libx11-xcb1 libxcb-dri3-0 libxcb-present0 libxcb-sync1 libxcb-xfixes0 libxshmfence1 libgstreamer1.0-0 libgstreamer-plugins-bad1.0-0 libpangocairo-1.0-0 libasound2 libasound2-data libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python python-minimal python2.7 python2.7-minimal apt install -y bash-completion build-essential btrfs-progs cmake curl dnsutils htop iotop isc-dhcp-client iputils-ping kmod linux-firmware locales net-tools netplan.io pciutils python3-dev ssh systemd udev unzip usbutils wpasupplicant vim locale-gen en_US.UTF-8 rm /dev/random rm /dev/urandom exit ./apply_binaries.sh |
五、编译镜像
cd tools
4G版:
./jetson-disk-image-creator.sh -o jetson_4G.img -b jetson-nano -r 300
*(100/200/300 for A01/A02/B00)
2G版:
./jetson-disk-image-creator.sh -o jetson_2G.img -b jetson-nano-2gb-devkit
-rw-r–r– 1 root root 1.8G Jul 11 15:57 jetson.img
基础版镜像只有1.8G,需要什么加什么。
六、烧录镜像
dd if=jetson_4G.img of=/dev/sdb bs=4M conv=fsync status=progress
根据读卡器识别不同,有些是sd设备,有些是mmc设备,根据情况来。
七、调整分区
比较复杂,参考脚本:https://raw.githubusercontent.com/pythops/jetson-nano-image/master/flash-image.sh
八、插电开机、成功启动
原创文章,转载请注明: 转载自贝壳博客
本文链接地址: Jetson 把玩记 三、自制最小文件系统镜像
这个制作的系统的账号密码怎么设定?
官网的2gb镜像有问题,第一次开机会报错,并跳过初次设计界面