当前位置:网站首页>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 !
边栏推荐
- Solve the problem of disordered code in vscode development, output Chinese and open source code
- PIP configuring domestic sources
- Using Hudi in idea
- Hudi 数据管理和存储概述
- NPM install installation dependency package error reporting solution
- Call the contents of Excel cells opened at the same time - button line feed
- 1922. Count Good Numbers
- Common formulas of probability theory
- Navicat, MySQL export Er graph, er graph
- 2022-2-13 learning the imitation Niuke project - home page of the development community
猜你喜欢
【Kotlin疑惑】在Kotlin类中重载一个算术运算符,并把该运算符声明为扩展函数会发生什么?
Crawler career from scratch (3): crawl the photos of my little sister ③ (the website has been disabled)
On February 14, 2022, learn the imitation Niuke project - develop the registration function
[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)
Flask+supervisor installation realizes background process resident
[kotlin learning] operator overloading and other conventions -- overloading the conventions of arithmetic operators, comparison operators, sets and intervals
[kotlin learning] control flow of higher-order functions -- lambda return statements and anonymous functions
IDEA 中使用 Hudi
[set theory] order relation (eight special elements in partial order relation | ① maximum element | ② minimum element | ③ maximum element | ④ minimum element | ⑤ upper bound | ⑥ lower bound | ⑦ minimu
2022-2-13 learning the imitation Niuke project - home page of the development community
随机推荐
[point cloud processing paper crazy reading cutting-edge version 12] - adaptive graph revolution for point cloud analysis
Spark 结构化流写入Hudi 实践
【点云处理之论文狂读前沿版13】—— GAPNet: Graph Attention based Point Neural Network for Exploiting Local Feature
Numerical analysis notes (I): equation root
PowerDesigner does not display table fields, only displays table names and references, which can be modified synchronously
2022-2-13 learning the imitation Niuke project - home page of the development community
Redis learning (I)
Spark structured stream writing Hudi practice
Solve POM in idea Comment top line problem in XML file
Vscode编辑器右键没有Open In Default Browser选项
LeetCode每日一题(968. Binary Tree Cameras)
Computing level network notes
2022-2-13 learn the imitation Niuke project - Project debugging skills
Spark cluster installation and deployment
LeetCode每日一题(2232. Minimize Result by Adding Parentheses to Expression)
LeetCode每日一题(1162. As Far from Land as Possible)
Usage of pandas to obtain MySQL data
Word segmentation in full-text indexing
LeetCode每日一题(1300. Sum of Mutated Array Closest to Target)
基于opencv实现桌面图标识别