当前位置:网站首页>Jestson nano custom root file system creation (supports the smallest root file system of NVIDIA Graphics Library)
Jestson nano custom root file system creation (supports the smallest root file system of NVIDIA Graphics Library)
2022-07-03 09:29:00 【Monty Fried Bun】
The first two , We cut the kernel , Constructed a custom kernel , But the official root file system is too large , Yes 13G As much as , and nano Of emmc Version with flash Only 16gb, therefore , Tailoring the root file system is imperative . Based on this , We according to the ubuntu Basic root files create your own custom file system .
In the whole process, I refer to some information on the official website forum , Made two scripts , Run directly in a directory
sudo ./make_rootfs
In the current directory build Generate root file system under directory , take build Copy all files in the directory to /Linux_for_Tegra/rootfs Under the table of contents , Run the following command :
cd ..
sudo ./apply_binaries.sh
This step is used to install NVIDIA Graphics acceleration Library , If it doesn't work , It loses the meaning of using this board .
Run directly later flash.sh Script burning is enough !( See the previous two articles for the burning method )
Script :make_rootfs.sh
#!/bin/bash
URL_ROOTFS_TGZ_BASE=http://cdimage.ubuntu.com/ubuntu-base/releases/18.04/release/ubuntu-base-18.04.5-base-arm64.tar.gz
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
SOURCE_DIR="$( cd "$( dirname "${
BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" BUILD_DIR=$SOURCE_DIR/build rm -r $BUILD_DIR mkdir -p $BUILD_DIR cd $BUILD_DIR # download and extract rootfs wget -O rootfs.tar.gz $URL_ROOTFS_TGZ_BASE tar -xpf rootfs.tar.gz rm rootfs.tar.gz # chroot to rootfs QEMU_PATH=/usr/bin/qemu-aarch64-static if [ ! -f "$FILE" ]; then apt-get install qemu-user-static fi cp $QEMU_PATH $BUILD_DIR/usr/bin/ mount /sys $BUILD_DIR/sys -o bind mount /proc $BUILD_DIR/proc -o bind mount /dev $BUILD_DIR/dev -o bind mv $BUILD_DIR/etc/resolv.conf $BUILD_DIR/etc/resolv.conf.saved cp /etc/resolv.conf $BUILD_DIR/etc cp $SOURCE_DIR/install.sh $BUILD_DIR/ LC_ALL=C chroot $BUILD_DIR /bin/bash -c ./install.sh rm $BUILD_DIR/install.sh echo "<================We are unmounting==============>"
umount $BUILD_DIR/sys
umount $BUILD_DIR/proc
umount $BUILD_DIR/dev
mv $BUILD_DIR/etc/resolv.conf.saved $BUILD_DIR/etc/resolv.conf
rm $BUILD_DIR/usr/bin/qemu-aarch64-static
rm -rf $BUILD_DIR/var/lib/apt/lists/*
rm -rf $BUILD_DIR/dev/*
rm -rf $BUILD_DIR/var/log/*
rm -rf $BUILD_DIR/var/tmp/*
rm -rf $BUILD_DIR/var/cache/apt/archives/*.deb
rm -rf $BUILD_DIR/tmp/*
Script :intstall.sh
One thing to point out is , When we add users , Generally, input directly on the command line useradd , Then enter the password , You can actually go through openssl Set password directly .
useradd -p password
But the password here must be ciphertext , That is to say , Let's go through openssl passwd -crypt To set the password , Then pass the ciphertext in as p Parameters of . namely
PASSWORD=$(openssl passwd -crypt)
useradd -m -p $PASSWORD -s /bin/bash careray
The above command will follow the input plaintext password , Add user after encryption careray.
#!/bin/bash
# update apt cache
apt-get update
# create user
apt-get install -y openssl
echo "Please provide the default password for the user:"
PASSWORD=$(openssl passwd -crypt)
useradd -m -p $PASSWORD -s /bin/bash careray
usermod -aG sudo careray
# install openssh
apt-get install -y openssh-server
# remove old docker version
apt-get remove \
docker \
docker-engine \
docker.io \
containerd \
runc
# install dependencies
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
binfmt-support \
device-tree-compiler \
libasound2 \
libcairo2 \
libdatrie1 \
libegl1 \
libegl1-mesa \
libevdev2 \
libfontconfig1 \
libgles2 \
libgstreamer-plugins-base1.0-0 \
libgstreamer1.0-0 \
libgtk-3-0 \
libharfbuzz0b \
libinput10 \
libjpeg-turbo8 \
libpixman-1-0 \
libpangocairo-1.0-0 \
libpangoft2-1.0-0 \
libpng16-16 \
libssl-dev \
libunwind8 \
libwayland-cursor0 \
libwayland-egl1 \
libx11-6 \
libxext6 \
libxkbcommon0 \
libxrender1 \
locales \
locate \
nano \
network-manager \
openssh-server \
openssl \
python \
python3 \
python3-pip \
sudo \
v4l-utils \
software-properties-common
# We are required to provide libffi6
wget http://ftp.de.debian.org/debian/pool/main/libf/libffi/libffi6_3.2.1-9_arm64.deb
dpkg --install libffi6_3.2.1-9_arm64.deb
# This has no installation candidate
wget http://ports.ubuntu.com/pool/universe/g/gst-plugins-bad1.0/libgstreamer-plugins-bad1.0-0_1.14.0-1ubuntu1_arm64.deb
dpkg --install libgstreamer-plugins-bad1.0-0_1.14.0-1ubuntu1_arm64.deb
# add docker gpg key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
apt-key fingerprint 0EBFCD88
# #Install multimedia packages
# wget https://repo.download.nvidia.com/jetson/t210/pool/main/n/nvidia-l4t-multimedia/nvidia-l4t-multimedia_32.6.1-20210916211029_arm64.deb
# dpkg --install nvidia-l4t-multimedia/nvidia-l4t-multimedia_32.6.1-20210916211029_arm64.deb
# #Install gstreamer_32
# wget https://repo.download.nvidia.com/jetson/t210/pool/main/n/nvidia-l4t-gstreamer/nvidia-l4t-gstreamer_32.6.1-20210916211029_arm64.deb
# dpkg --install nvidia-l4t-gstreamer_32.6.1-20210916211029_arm64.deb
# add docker repo and install
add-apt-repository \
"deb [arch=arm64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
apt-get update
apt-get install -y \
docker-ce \
docker-ce-cli \
containerd.io
# add user to docker group
usermod -aG docker careray
systemctl set-default multi-user.target
Some download URLs in the script may fail to download with the official update , Please update yourself !
边栏推荐
- [point cloud processing paper crazy reading classic version 10] - pointcnn: revolution on x-transformed points
- LeetCode每日一题(2109. Adding Spaces to a String)
- The server denied password root remote connection access
- WARNING: You are using pip ; however. Later, upgrade PIP failed, modulenotfounderror: no module named 'pip‘
- Hudi quick experience (including detailed operation steps and screenshots)
- [set theory] order relation (chain | anti chain | chain and anti chain example | chain and anti chain theorem | chain and anti chain inference | good order relation)
- LeetCode每日一题(2212. Maximum Points in an Archery Competition)
- 2022-2-14 learning xiangniuke project - generate verification code
- Crawler career from scratch (V): detailed explanation of re regular expression
- Linxu learning (4) -- Yum and apt commands
猜你喜欢

Build a solo blog from scratch

CATIA automation object architecture - detailed explanation of application objects (I) document/settingcontrollers

Using Hudi in idea

Windows安装Redis详细步骤

Alibaba cloud notes for the first time

Flink-CDC实践(含实操步骤与截图)

PolyWorks script development learning notes (II) -treeview basic operations

Principles of computer composition - cache, connection mapping, learning experience
![[kotlin puzzle] what happens if you overload an arithmetic operator in the kotlin class and declare the operator as an extension function?](/img/fc/5c71e6457b836be04583365edbe08d.png)
[kotlin puzzle] what happens if you overload an arithmetic operator in the kotlin class and declare the operator as an extension function?
![[point cloud processing paper crazy reading classic version 10] - pointcnn: revolution on x-transformed points](/img/c1/045ca010b212376dc3e5532d25c654.png)
[point cloud processing paper crazy reading classic version 10] - pointcnn: revolution on x-transformed points
随机推荐
Common software open source protocols
ERROR: certificate common name “*.” doesn’t match requested ho
On February 14, 2022, learn the imitation Niuke project - develop the registration function
Vscode编辑器右键没有Open In Default Browser选项
Linxu learning (4) -- Yum and apt commands
[point cloud processing paper crazy reading frontier edition 13] - gapnet: graph attention based point neural network for exploring local feature
Banner - Summary of closed group meeting
2022-2-14 learning xiangniuke project - generate verification code
[set theory] order relation (eight special elements in partial order relation | ① maximum element | ② minimum element | ③ maximum element | ④ minimum element | ⑤ upper bound | ⑥ lower bound | ⑦ minimu
LeetCode每日一题(1300. Sum of Mutated Array Closest to Target)
【点云处理之论文狂读前沿版11】—— Unsupervised Point Cloud Pre-training via Occlusion Completion
Redis learning (I)
Spark 集群安装与部署
Utilisation de hudi dans idea
【Kotlin疑惑】在Kotlin类中重载一个算术运算符,并把该运算符声明为扩展函数会发生什么?
文件系统中的目录与切换操作
Beego learning - JWT realizes user login and registration
PIP configuring domestic sources
Matlab dichotomy to find the optimal solution
解决Editor.md上传图片获取不到图片地址问题