当前位置:网站首页>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 -h
see SD The mount ofAnd then through
umount /dev/sdx
Uninstall 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=4M
Configure wireless network card
function
ifconfig -a
If there is wlan0 Indicates that the network card is availableModify file
sudo vim /etc/wpa_supplicant/wap_suoolicant.conf
network{ ssid = "QQ" PSK="qwertyuiop789" }
Save and exit
ifdown wlan0
Close network cardifup wlan0
Open 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=8
Download 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.src
This script file starts , The contents of this script file can be found in Linux After successful startup , stayboot
Find 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 1min30s
The 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-tools
cd linux
touch .scmversion
make 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/sdc2
Replace with the storage area for kernel files and device tree files/dev/sdc1
The replaced file is
arch/arm/boot/zImage
andarch/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/sdc2
take /dev/sdc2 Mount to the temporary partition /mnt
sudo mount /dev/sdc2 /mnt
Delete the original root file system
Enter the root file system
cd /mnt
Delete all files
sudo rm ./* -rf
Be 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 /mnt
Unzip the root file system
sudo tar xfv Lib_rootfa.tar
Delete the compressed package of the root file system
sudo rm Lib_rootfa.tar
Synchronize files
sync
Unmount the temporary mount area of the root file system
First, the command window should exit
/mnt
route , Otherwise, you are using how to uninstallDirectly enter the system root directory
cd
uninstall
sudo umount /dev/sdc2
Be 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 -h
see 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/boot
The device tree file and Linux Of zImage Image file/media/lux/rootfs
The root file system is stored in/media/lux/userdata
The 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/boot
cp arch/arm/boot/dts/sun8i-h3-nanopi-neo.dtb /media/lux/boot
These files exist
/media/lux/boot
inThe 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=8
therefore 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 /mnt
loop Mount to /dev/loopX Partition ,X The system will automatically adjust the value of
Use
df -h
Check and you will see a/dev/loopX 283M 2.1M 262M 1% /mnt
The option toUninstall is to execute
sudo umount /mnt
Put the file to be made into the mounted directory
/mnt
sudo cp /home/lux/files/* /mnt -avrf
Fix and size files
e2fsck -p -f sys.img
resize2fs -M sys.img
format .img file (*, Record , Choose to do )
sudo mkfs -t ext4 sys.img
Will 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
边栏推荐
- 史上最全MongoDB之安全认证
- Some thoughts on cross end development of kbone and applet
- 机器人(自动化)课程的持续学习-2022-
- Win11控制面板快捷键 Win11打开控制面板的多种方法
- SSM+JSP实现企业管理系统(OA管理系统源码+数据库+文档+PPT)
- [record of question brushing] 2 Add two numbers
- Optimization of channel status offline of other server devices caused by easycvr cluster restart
- 史上最全MongoDB之Mongo Shell使用
- [leetcode]Spiral Matrix II
- Web service performance monitoring scheme
猜你喜欢
In cooperation with the research team of the clinical trial center of the University of Hong Kong and Hong Kong Gangyi hospital, Kexing launched the clinical trial of Omicron specific inactivated vacc
The most complete learning rate adjustment strategy in history LR_ scheduler
【刷题记录】2. 两数相加
Ssm+jsp realizes the warehouse management system, and the interface is called an elegant interface
[multi threading exercise] write a multi threading example of the producer consumer model.
Opencv third party Library
The most complete deployment of mongodb in history
5年自动化测试,终于进字节跳动了,年薪30w其实也并非触不可及
[system management] clear the icon cache of deleted programs in the taskbar
[knife-4j quickly build swagger]
随机推荐
2022 middle school Youth Cup mathematical modeling question B fertility policy research ideas under the background of open three children
Collection of idea gradle Lombok errors
Hangzhou Electric 3711 binary number
使用 BR 备份 TiDB 集群到 GCS
如何编写一个程序猿另一个面试官眼前一亮的简历[通俗易懂]
Optimization of channel status offline of other server devices caused by easycvr cluster restart
机器人(自动化)课程的持续学习-2022-
pyqt5 失焦 监听无操作 定时器
ABAP 动态内表分组循环
UltraEdit-32 warm prompt: right association, cancel bak file [easy to understand]
Redis源码学习(31),字典学习,dict.c(一)
Win11截图键无法使用怎么办?Win11截图键无法使用的解决方法
Zero knowledge private application platform aleo (1) what is aleo
What is CGI, IIS, and VPS "suggested collection"
Web service performance monitoring scheme
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
EasyCVR视频广场点击播放时,主菜单高亮效果消失问题的修复
【OA】Excel 文档生成器: Openpyxl 模块
[leetcode]Spiral Matrix II
[leetcode]Spiral Matrix II