当前位置:网站首页>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
边栏推荐
- 中青杯2022A题高校数学建模竞赛与课程教育思路分析
- Web service performance monitoring scheme
- Food Chem|深度学习根据成分声明准确预测食品类别和营养成分
- 2022年电工杯B 题 5G 网络环境下应急物资配送问题思路分析
- 科兴与香港大学临床试验中心研究团队和香港港怡医院合作,在中国香港启动奥密克戎特异性灭活疫苗加强剂临床试验
- Mysql-数据丢失,分析binlog日志文件
- Five years of automated testing, and finally into the ByteDance, the annual salary of 30W is not out of reach
- 使用 TiDB Lightning 恢复 GCS 上的备份数据
- Storage of data
- [multi threading exercise] write a multi threading example of the producer consumer model.
猜你喜欢
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
【knife-4j 快速搭建swagger】
Imitate Tengu eating the moon with Avatar
Optimization of channel status offline of other server devices caused by easycvr cluster restart
2022 electrician cup question B analysis of emergency materials distribution under 5g network environment
Operational amplifier application summary 1
英特尔David Tuhy:英特尔傲腾技术成功的原因
[team learning] [34 issues] scratch (Level 2)
Formation continue en robotique (automatisation) - 2022 -
5年自动化测试,终于进字节跳动了,年薪30w其实也并非触不可及
随机推荐
【编码字体系列】OpenDyslexic字体
【刷题记录】2. 两数相加
SSM+JSP实现企业管理系统(OA管理系统源码+数据库+文档+PPT)
[record of question brushing] 2 Add two numbers
【OA】Excel 文档生成器: Openpyxl 模块
True Global Ventures新成立的1.46亿美元后续基金关账,其中普通合伙人认缴6,200万美元以对后期阶段的Web3赢家进行投资
中青杯2022A题高校数学建模竞赛与课程教育思路分析
Win11图片打不开怎么办?Win11无法打开图片的修复方法
Dab-detr: dynamic anchor boxes are better queries for Detr translation
Highly paid programmers & interview questions. Are you familiar with the redis cluster principle of series 120? How to ensure the high availability of redis (Part 1)?
Formation continue en robotique (automatisation) - 2022 -
How do test / development programmers get promoted? From nothing, from thin to thick
2022年电工杯B 题 5G 网络环境下应急物资配送问题思路分析
使用 BR 恢复 GCS 上的备份数据
EasyUI export excel cannot download the method that the box pops up
【写给初发论文的人】撰写综述性科技论文常见问题
PHP 实现根据概率抽奖
5年自动化测试,终于进字节跳动了,年薪30w其实也并非触不可及
Quick completion guide of manipulator (10): accessible workspace
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