• 移植带桌面ubuntu18.04到RK3568开发板


    一、下载并解压ubuntu-base版本

    1,从ubuntu官方下载最小系统Ubuntu Base 18.04.5 LTS (Bionic Beaver)CD images for Ubuntu Base 18.04.5 LTS (Bionic Beaver)http://cdimage.ubuntu.com/ubuntu-base/releases/18.04.5/release/

    2,解压 

    tar -xvf ubuntu-base-18.04.5-base-arm64.tar.gz
    1. bin dev home media oem proc run srv tmp usr
    2. boot etc lib mnt opt root sbin sys userdata var

    二、安装Qemu-User-Static工具

    1,QEMU是专门模拟不同机器架构的软件,在ubuntu中对其支持良好,若需要挂载ubuntu arm64版本的文件,必须安装qemu-user-static工具。

    sudo apt-get install qemu-user-static

    2,将安装好的qemu-user-static工具拷贝到ubuntu文件系统中

    cp /usr/bin/qemu-arm-static ./usr/bin/

    三、设置软件源和域名解析配置

    1,设置软件下载源

    vim ./binary/etc/apt/sources.list

     使用中科大的下载源

    1. deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
    2. deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
    3. deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe
    4. deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
    5. deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
    6. deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
    7. deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
    8. deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe
    9. deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
    10. deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe

    2,Ubuntu安装软件是通过名apt-get从网上下载安装的。我们需要指定软件源。
    为了制作成功的根文件系统能够联网,可以直接拷贝本机的dns配置文件到根文件系统的相应位置,使用命令“cp /etc/resolv.conf ./etc/resolv.conf”

    cp /etc/resolv.conf ./etc/resolv.conf

    四、挂载根文件系统并chroot

    1,首先在本机挂载刚刚下载好的文件系统,需要挂载proc, sys, dev, dev/pts等文件系统。使用命令“vi mount.sh”添加挂载脚本

    1. mount -t proc /proc binary/proc
    2. mount -t sysfs /sys binary/sys
    3. mount -o bind /dev binary/dev
    4. mount -o bind /dev/pts binary/dev/pts
    5. chroot binary
    1. chmod 777 /tmp/
    2. apt-get update
    3. apt-get upgrade

    五、安装需要的软件和环境

    1. apt-get install ssh
    2. apt-get install net-tools
    3. apt-get install ethtool
    4. apt-get install ifupdown
    5. apt-get install psmisc
    6. apt-get install nfs-common
    7. apt-get install htop
    8. apt-get install vim
    9. apt-get install rsyslog
    10. apt-get install iputils-ping
    11. apt-get install language-pack-en-base
    12. apt-get install sudo
    13. apt-get install network-manager

    然后使用命令“passwd root”设置root用户密码

    passwd root

    创建用户

    adduser username

    接下来使用如下命令设置主机名称和本机IP

    1. echo "ubuntu 18.04" > /etc/hostname
    2. echo "127.0.0.1 localhost" >> /etc/hosts
    3. echo "127.0.0.1 ubuntu 18.04" >> /etc/hosts

    设置好后exit退出 

    六、卸载文件系统并制作镜像

    1,卸载ubuntu文件系统

    1. umount binary/dev/pts
    2. umount binary/dev
    3. umount binary/sys
    4. umount binary/proc

    2,制作文件系统镜像

    ./mk-image.sh

  • 相关阅读:
    Koa: 打造高效、灵活的Node.js后端 (介绍与环境部署)
    超星平台——东电影答案
    AttributeError: ‘NoneType‘ object has no attribute ‘get_fetch_list‘
    nmap之nse脚本简单学习
    云小课|帮您高效快速上传组件至私有依赖库
    计算机组成原理之浮点四则运算
    算法——链表篇
    阿里拆了中台,中台还有未来吗?
    上交所行情文件解析之mktdt00.txt
    前端开发简介与简单代码实现
  • 原文地址:https://blog.csdn.net/yufeng1108/article/details/125411845