以 iTOP-4412 POP 1G 主板为基础,总结一下 Ubuntu 文件系统的移植。
试验版本:ubuntu-base-16.04.6
获取 ubuntu-base
根据: 在ARM板上跑Ubuntu系统和黑客帝国,牛!-腾讯云开发者社区-腾讯云,下载了 ubuntu-base-16.04.6-base-armhf.tar.gz。
Index of /ubuntu-base/releases
配置 Ubuntu
参考: 米尔瑞米派Remi Pi Ubuntu系统移植指南-腾讯云开发者社区-腾讯云
准备chroot环境
1 | $ mkdir ubuntu_rootfs |
制作挂载脚本
将下列脚本代码拷贝到mount_ubuntu_fs.sh文件中,并改变权限(777)为可执行。
1 |
|
配置 Ubuntu
挂载
1 | $ ./mount_ubuntu_fs.sh -m ./dfs/ |
基础包安装
1 | root@ubuntu:/# chmod 777 /tmp (避免update时失败) |
添加log
1 | root@ubuntu:/# touch /var/log/rsyslog |
安装网络和语言包支持
1 | root@ubuntu:/# apt-get install synaptic |
LXDE桌面系统安装
1 | root@ubuntu:/# apt-get install xinit |
浏览器和音频安装
1 | root@ubuntu:/# sudo apt install epiphany-browser |
设置root密码
1 | root@ubuntu:/# passwd root |
创建新用户
1 | root@ubuntu:/# adduser easy |
添加权限:
1 | chmod 660 /etc/sudoers |
设置hosts和主机名称
1 | vim /etc/hostname |
配置网卡接口
1 | root@ubuntu:/# vim /etc/network/interfaces |
卸载系统
1 | root@ubuntu:/# exit |
至此ubuntu 文件系统已经配置完成。
设置终端类型
在 .bashrc
末尾追加一行 export TERM=xterm
。
烧写系统
配置好的 ubuntu_rootfs,需要烧写到 SD 卡。
在 dts 中设置了 bootargs = "root=/dev/mmcblk0p2 rw console=ttySAC2,115200 init=/linuxrc rootwait";
所以,复制系统文件到 p2。
1 | mkdir tf_card |
也可以在 tf_card 目录中直接启动模拟器。
1 | ./mount_ubuntu_fs.sh -m tf_card/ |
待解决
startup
1 | [FAILED] Failed to start Set console keymap |
reboot
1 | easy@iTop4412_Ubuntu16:~$ reboot |
watchdog: BUG
1 | easy@iTop4412_Ubuntu16:~$ [ 596.033398] watchdog: BUG: soft lockup - CPU#0 stuck for 23s! [swapper/0:0] |
vim 显示问题
只显示一半,设置了 lines 之后,如何设置刚好是终端的行数?