当前位置:网站首页>Nanopineo use development process record
Nanopineo use development process record
2022-07-07 04:22:00 【Fiery red auspicious cloud】
NanopiNEO Learning notes
Experience process
adopt Ubuntu Burning official .img Image file
First, through
df -hsee SD The mount ofAnd then through
umount /dev/sdxUninstall all SD Mount item for (x I'm going to replace it with the corresponding 1-2-3)Finally, burn the image file through instructions
sudo if=xxxx.img of=/dev/sdc bs=4MConfigure wireless network card
function
ifconfig -aIf there is wlan0 Indicates that the network card is availableModify file
sudo vim /etc/wpa_supplicant/wap_suoolicant.confnetwork{ ssid = "QQ" PSK="qwertyuiop789" }Save and exit
ifdown wlan0Close network cardifup wlan0Open network card
adopt
ssh [email protected]Realization SSH Sign in
uboot
compile uboot
First install the compiler , Prepare the compilation environment
uboot The compiled source code must be from Ubuntu through git download , Not in Windows through git download , And then through FTP to Ubuntu in , This compilation will make an error
After compiling, it passes
dd if=u-boot-sunxi-with-spl.bin of=/dev/sdc bs=1024 seek=8Download to SD card , And then plug in SD card , adopt SD Card activation uboot
modify uboot The variable parameters of ,uboot Boot kernel , It was through
uboot.srcThis script file starts , The contents of this script file can be found in Linux After successful startup , staybootFind the contents to view in this folderModify the way to start the kernel
Original :
bootcmd=fatload mmc 0:1 ${scriptaddr} boot.scr; source ${scriptaddr}
adopt boot.src The script to start , It seems that the startup parameters are also in the script file
modify :
bootcmd=fatload mmc 0:1 42000000 zImage;fatload mmc 0:1 43000000 sun8i-h3-nanopi-neo.dtb;bootz 42000000 - 43000000
adopt bootz start-up
Modify startup parameters
Original :
Kernel command line: console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2
rootfstypxt4 rw rootwait fsck.repair=yes panic=10 fbcon=map:0 data=/dev/mmcblk0p3 snd-soc-core.pmdown_time00000It is amended as follows :
bootargs=console=ttyS0,115200 root=/dev/mmcblk1p2 rootwait rw
After the modification, a
a job is running for dev-mmcblk0p1.device 1min30sThe problem of , Unresolved
Linux kernel
compile Linux kernel
First compile Linux kernel , In this way, when starting, you can know whether it is your own kernel by checking the compilation date
Install the compiler before compiling , Configure the compilation environment
sudo apt-get install u-boot-toolscd linuxtouch .scmversionmake sunxi_defconfig ARCH=arm CROSS_COMPILE=arm-linux-Compiling the kernel
make zImage ARCH=arm CROSS_COMPILE=arm-linux-Compile the device tree
make dtbs ARCH=arm CROSS_COMPILE=arm-linux-
Compile the complete ,zImage and The device tree file is ready
Replace the original img Kernel file and device tree file in the file
And Replace the original img Root file system in file Is essentially the same , Just to
/dev/sdc2Replace with the storage area for kernel files and device tree files/dev/sdc1The replaced file is
arch/arm/boot/zImageandarch/arm/boot/dtb/sun8i-h3-nanopi-neo.dtb
The root file system
Replace the original img Root file system in file
Prepare a compiled file system ( The one used here has passed buildroot Compiled with the file system )
Insert and burn the original img Of documents SD card
Unload the partition of the root file ( Here is /dev/sdc2)
sudo umount /dev/sdc2take /dev/sdc2 Mount to the temporary partition /mnt
sudo mount /dev/sdc2 /mntDelete the original root file system
Enter the root file system
cd /mntDelete all files
sudo rm ./* -rfBe careful : Use sudo, Otherwise, some files have no permission to delete
Don't delete the wrong path , Wrong, see for yourself ....
Put the compiled root file system into the mounted temporary partition /mnt in
sudo cp Lib_rootfa.tar /mntUnzip the root file system
sudo tar xfv Lib_rootfa.tarDelete the compressed package of the root file system
sudo rm Lib_rootfa.tarSynchronize files
syncUnmount the temporary mount area of the root file system
First, the command window should exit
/mntroute , Otherwise, you are using how to uninstallDirectly enter the system root directory
cduninstall
sudo umount /dev/sdc2Be accomplished , Card insertion , restart
Summary of the learning process
Replace img Document summary in
- Now it's all through SD Remove the card and then mount it to the temporary area to replace the files in different partitions , Can I update files through the network ? The probability is ok , I haven't mastered , Continue to update later
Summary of use experience
take SD Card in computer , adopt
df -hsee SD Allocation of chuck area/dev/sdc1 40M 12M 29M 30% /media/lux/boot /dev/sdc2 1.2G 1.1G 67M 95% /media/lux/rootfs /dev/sdc3 14G 572M 13G 5% /media/lux/userdata/media/lux/bootThe device tree file and Linux Of zImage Image file/media/lux/rootfsThe root file system is stored in/media/lux/userdataThe root file of the super user is stored in
uboot Where are the things that start the content ?
zImage The image and device tree are written in
cp arch/arm/boot/zImage /media/lux/bootcp arch/arm/boot/dts/sun8i-h3-nanopi-neo.dtb /media/lux/bootThese files exist
/media/lux/bootinThe burning method of the root file system is
make modules_install INSTALL_MOD_PATH=/media/lux/rootfs ARCH=arm CROSS_COMPILE=arm-linux-uboot The way of burning is
dd if=uboot.bin of=/dev/sdc bs=1024 seek=8therefore uboot Is in the partition 0 The inside? ? That is to say
/dev/sdc0?
Create a system image file .img
Create a .img file
dd if=/dev/zero of=sys.img bs=1024 conut=300.img File size =bs*count
mount .img file
sudo mount -o loop sys.img /mntloop Mount to /dev/loopX Partition ,X The system will automatically adjust the value of
Use
df -hCheck and you will see a/dev/loopX 283M 2.1M 262M 1% /mntThe option toUninstall is to execute
sudo umount /mntPut the file to be made into the mounted directory
/mntsudo cp /home/lux/files/* /mnt -avrfFix and size files
e2fsck -p -f sys.imgresize2fs -M sys.img
format .img file (*, Record , Choose to do )
sudo mkfs -t ext4 sys.imgWill be able to sys.img Format to store ext4 File format
Commands used in the development process
Query idle loop equipment
sudo losetup -f
mount .img Image file
sudo losetup /dev/loop21 sys.img
Query file system format
lsblk -f
Create a new one 500M The size of .img file .img
dd if=/dev/zero of=sys.img bs=1M count=500
Mount the image file 2 To loop On the device
sudo losetup /dev/loop21 sys.img
Create partitions
sudo fdisk /dev/loop21
Multi partitioned .img File with the loop relation
sudo kpartx -av sys.img
View the associated loop Partition
ls /dev/mapper/
format partition
sudo mkfs.vfat /dev/mapper/loopXp1
sudo mkfs.ext4 /dev/mapper/loopXp2
sudo mkfs.ext4 /dev/mapper/loopXp3
sudo mkfs.ext4 /dev/mapper/loopXp4
Mount partition
sudo mount /dev/mapper/loopXp1 /mnt
Put the file in the partition
cd /mnt
cp xxx /mnt
Uninstall partition
sudo umount /dev/mapper/loopXp1
Do not uninstall instructions in /mnt Execute under directory
边栏推荐
- 测试/开发程序员怎么升职?从无到有,从薄变厚.......
- Use dumping to back up tidb cluster data to GCS
- Some common software related
- Analysis on urban transportation ideas of 2022 Zhongqing cup C
- Redis configuration and optimization of NoSQL
- 这项15年前的「超前」技术设计,让CPU在AI推理中大放光彩
- Hangzhou Electric 3711 binary number
- The JSON format of the international area code of the mobile phone number is obtained with PHP
- Practice Guide for interface automation testing (middle): what are the interface testing scenarios
- 用头像模仿天狗食月
猜你喜欢

機器人(自動化)課程的持續學習-2022-

史上最全MongoDB之安全认证

Antd Comment 递归循环评论

各路行业大佬称赞的跨架构开发“神器”,你get同款了吗?
![[OA] excel document generator: openpyxl module](/img/e3/e6a13a79ad9023cf263d1926a224b5.png)
[OA] excel document generator: openpyxl module

2022年电工杯B 题 5G 网络环境下应急物资配送问题思路分析

1.19.11. SQL client, start SQL client, execute SQL query, environment configuration file, restart policy, user-defined functions, constructor parameters

机械臂速成小指南(十):可达工作空间

ABAP 动态内表分组循环

2022 electrician cup question B analysis of emergency materials distribution under 5g network environment
随机推荐
Implementation of binary search tree
Opencv third party Library
VM virtual machine operating system not found and NTLDR is missing
Redis configuration and optimization of NoSQL
The most complete deployment of mongodb in history
Win11控制面板快捷键 Win11打开控制面板的多种方法
How to solve the problem of adding RTSP device to easycvr cluster version and prompting server ID error?
数学分析_笔记_第10章:含参变量积分
MySQL data loss, analyze binlog log file
Food Chem|深度学习根据成分声明准确预测食品类别和营养成分
ABAP 動態內錶分組循環
见到小叶栀子
idea gradle lombok 报错集锦
Use facet to record operation log
[team learning] [34 issues] scratch (Level 2)
C#使用西门子S7 协议读写PLC DB块
主设备号和次设备号均为0
2022 middle school Youth Cup mathematical modeling question B fertility policy research ideas under the background of open three children
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
5年自动化测试,终于进字节跳动了,年薪30w其实也并非触不可及