明远智睿技术论坛

标题: 移植ubuntu到i.mx6ull --1 [打印本页]

作者: mumu_A    时间: 2019-6-14 20:56
标题: 移植ubuntu到i.mx6ull --1
本帖最后由 myzr_soft 于 2019-8-7 08:43 编辑

简介说明:
MY-IMX6-CB140P-6Y2D-256M-4G:(6Y2D是IMX6ULL,256M是内存,4G是EMMC)
安装ubuntu或debian建议存储是EMMC,这样容量大。1.下载Ubuntu系统和修改相关配置
首先创建保存路径
$ mkdir ~/image
$ cd image
$ mkdir ubrfs16.04.4
$ cd ubrfs16.04.4
下载ubuntu-base-16.04.4-base-armhf.tar.gz
$ wget http://cdimage.ubuntu.com/ubuntu ... 4-base-armhf.tar.gz

使用sudo 解压:
$ sudo tar zxf ubuntu-base-16.04.4-base-armhf.tar.gz
安装qemu-user-static工具
$ sudo apt-get install qemu-user-static
拷贝qemu-arm-static到刚刚解压出来的目录
$ sudo cp /usr/bin/qemu-arm-static ./usr/bin/
网络配置
修改根文件系统软件源
$ sudo vim ./etc/apt/sources.list

添加 ubuntu arm 源(也可在网上找其他的arm源)
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe

为了制作成功的根文件系统能够联网,可以直接拷贝本机的dns配置文件到根文件系统的相应位置

$ sudo cp /etc/resolv.conf ./etc/resolv.conf

首先在本机挂载刚刚下载好的文件系统,联网完成相应的配置,然后载烧录到开发板上。

需要挂载proc, sys, dev, dev/pts等文件系统。

编写一个bash脚本ms.sh来完成挂载和卸载操作,首先回到ubrfs16.04.4的上一级目录,并创建ms.sh文件,
$ cd ~/image
$ vim ms.sh
创建ms.sh文件内容如下:
#!/bin/bash
mnt ()
{
    echo "MOUNTING"
    sudo mount -t proc /proc ${2}proc
    sudo mount -t sysfs /sys ${2}sys
    sudo mount -o bind /dev ${2}dev
    sudo mount -o bind /dev/pts ${2}dev/pts      
    sudo chroot ${2}   
}
umnt ()
{
    echo "UNMOUNTING"
    sudo umount ${2}proc
    sudo umount ${2}sys
    sudo umount ${2}dev/pts
    sudo umount ${2}dev
}
if [ "$1" = "-m" ] && [ -n "$2" ];
then
    mnt $1 $2
    echo "mnt -m pwd"
elif [ "$1" = "-u" ] && [ -n "$2" ];
then
    umnt $1 $2
    echo "mnt -u pwd"
else
    echo ""
    echo "Either 1'st, 2'nd or bothparameters were missing"
    echo ""
    echo "1'st parameter can be one ofthese: -m(mount) OR -u(umount)"
    echo "2'nd parameter is the full pathof rootfs directory(with trailing '/')"
    echo ""
    echo "For example: ch-mount -m/media/sdcard/"
    echo ""
    echo 1st parameter : ${1}
    echo 2nd parameter : ${2}
fi





欢迎光临 明远智睿技术论坛 (http://bbs.myzr.com.cn/) Powered by Discuz! X3.2