Raspberry Pi Advanced Course 1: Create a shared folder (solve the problem of no share file under ls /mnt/hgfs/), cross-compilation tool chain, Linux kernel preparation

Make basic preparations for Linux kernel development

1. Virtual machine settings shared folder

Insert picture description here
Then open the terminal:

ls /mnt/hgfs/
可看到share文件
即为成功

There is a problem: there is no share file under ls /mnt/hgfs/
Insert picture description here

cd mnt  //显示没有该文件或者目录
//应该输入
cd /mnt/hgfs
如果还没有,直接创建
mkdir /mnt/hgfs
----------------------
cd /mnt/hgfs
ls
//但没有找到share文件时------共享文件夹
sudo vmhgfs-fuse .host:/ /mnt/hgfs/ -o allow_other -o uid=1000
即可成功。
ls /mnt/hgfs/share/   //查看

**2. Prepare for Linux kernel development**:

rm * -rf
//删除所有文件

Insert picture description here

mkdir SYSTEM   //建立一个系统相关的文件夹

Check the version of Raspberry Pi:

uname -r

Insert picture description here

Download the corresponding kernel and cross-compilation tool chain
linux-rpi-4.14.y.zip tools-master.zip wiring Pi on the official website

Put it into the SYSTEM folder under Linux

Insert picture description here
Unzip the cross-compilation toolchain

unzip tools-master.zip

Next, make the cross-compilation permanent:

========================================
//在一个终端下依此进入以下文件夹:
dazai@ubuntu:~/SYSTEM/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin$ 
pwd   //显示当前绝对路径
echo $PATH   //获取路径
=========================================
在另一个终端的:
//在家目录下:
vi .bashrc
在最下面:
export PATH=$PATH : pwd

Insert picture description here
After saving and closing, type in the terminal:

source .bashrc
 arm-linux-gnueabihf-gcc -v

Insert picture description here
Found that it can compile normally.

Continue to unzip the Linux kernel folder:

cd SYSTEM/
ls
unzip linux-rpi-4.14.y.zip

Insert picture description here
Decompression is complete: The
Insert picture description here
basic preparations for Linux kernel development are completed.

Guess you like

Origin blog.csdn.net/weixin_40734514/article/details/108725540