环境配置
1、交叉编译器环境变量配置
1)打开编辑.bashrc文档
vi ~/.bashrc
2)在末尾输入如下:
export PATH=$PATH:/root/workspace/allwinner/A40i/bsp/lichee/out/sun8iw11p1/linux/common/buildroot/host/opt/ext-toolchain/bin/
其中“/root/workspace/allwinner/A40i/bsp/lichee/out/sun8iw11p1/linux/common/buildroot/host/opt/ext-toolchain/bin/”
为编译器路径。
3)刷新
然后输入:source ~/.bashrc
2、编写Makefile
1 #内核源代码路径
2 KERNEL_DIR=/root/workspace/allwinner/A40i/bsp/lichee/linux-3.10
3 #交叉编译器的路径(前缀)
4 CROSS_PATH=/root/workspace/allwinner/A40i/bsp/lichee/out/sun8iw11p1/linux/co mmon/buildroot/host/opt/ext-toolchain/bin/arm-linux-gnueabihf-
5 #编译成模块,obj-m编译成模块
6 obj-m += gpio_rmap.o
7
8 default:
9 $(MAKE) ARCH=arm CROSS_COMPILE=$(CROSS_PATH) -C $(KERNEL_DIR) M=$(PWD) m odules
10 clean:
11 rm -rf *.o *.ko *.mod* *.ord* *.sy* .*cmd .tmp*
补充:
1、Samba配置
1)下载samba
sudo apt-get install samba
2)修改samba配置文件
sudo vi /etc/samba/smb.conf
添加如下配置信息:这些信息都是 samba 的说明和设置, 把这些复制上, 格式要设置对, 使用 Tab 键缩进, 然后把注释删除, 不删除会出错。
[ubuntu_samba]
comment = arm ubuntu samba dir #说明
path = /home/samba #共享的 samba #目录
available = yes #允许访问
browseable = yes #可以浏览
public = yes #公开
writable = yes #可写
create mask = 0755 #当外部创建新文件时的权限
security = share #共享模式
force user = root #在外部添加新文件时, 文件的所有者
arm force group =root #在外部添加新文件时, 文件的所在组
3)重启samba
sudo service smbd restart
注:宿主机删除samba链接操作,cmd进入
net use * /del /y
2、SSH配置
1)安装openssh-server
sudo apt-get install openssh-server
2)编辑sshd_config文件
sudo vi /etc/ssh/sshd_config
在文件末尾添加如下内容:
#第一段:
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
#第二段:
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96
#第三段:
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org
3)修改ssh 配 置 文 件
接 着 继 续 改 ssh 配 置 文 件 , 因 为 ssh 默 认 不 允 许 用 户 登 录 , 所 以 我 们 还 需 要 打 开 配 置 文 件“ /etc/ssh_ssshd_config” , 找到PermitRootLogin 配置项
默认: PermitRootLogin prohibit-password”
改成: PermitRootLogin yes”
4)重启SSH服务
/etc/init.d/ssh restart
5)接下来可以通过filezilla和虚拟机互传文件了
注:ubuntu18参考如下链接
https://blog.csdn.net/qq_41746803/article/details/84953813
3、root账户登录ubuntu18
1)获得root权限su
su
2)创建root账户
sudo passwd root
3)修改配置文件
vim /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf
并在文件末尾添加如下代码
greeter-show-manual-login = true
all-guest = false
4) 修改/etc/pam.d/gdm-autologin 文件及 /etc/pam.d/gdm-password 文件
vim /etc/pam.d/gdm-autologin
删除如下语句
auth required pam_succeed_if.so user != root quiet_success
5)修改/root/.profile文件
vim /root/.profile
最后一行 mesg n || true 前添加 tty -s && 即 tty -s &&mesg n || true
6)重启
修改源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.20181013
:%s/security.ubuntu/mirrors.aliyun/g
:%s/archive.ubuntu/mirrors.aliyun/g
sudo apt update