码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 009-BSP学习笔记-在开发板上移植UBUNTU


    在开发板上移植UBUNTU

      • 一、下载ubuntu-base(ubuntu-rootfs)
      • 二、ubuntu文件系统配置
          • 1、安装qemu
          • 2、设置软件源
          • 3、在主机(PC)挂载并配置根文件系统(注意该节均在主机PC下运行)
      • 三、安装测试
          • 1、nfs挂载测试
          • 2、烧录

    一、下载ubuntu-base(ubuntu-rootfs)

    http://cdimage.ubuntu.com/ubuntu-base/releases/
    在PC上解压

    cd /home/zuozhongkai/linux/nfs //进入到 nfs 目录下
    mkdir ubuntu_rootfs //创建名为“ubuntu_rootfs”目录
    sudo tar -vzxf ubuntu-base-16.04.5-base-armhf.tar.gz
    
    • 1
    • 2
    • 3

    二、ubuntu文件系统配置

    1、安装qemu

    PC下载安装qemu并拷贝到ubuntu-base

    sudo apt-get install qemu-user-static
    cd /home/zuozhongkai/linux/nfs/ubuntu_rootfs //进入到 ubuntu_rootfs 目录下
    sudo cp /usr/bin/qemu-arm-static ./usr/bin/ //拷贝 qemu-arm-static
    
    • 1
    • 2
    • 3
    2、设置软件源

    将 Ubuntu 主机下的 DNS 配置文件/etc/resolv.conf 拷贝到根文件系统中,命令如下:

    cd /home/zuozhongkai/linux/nfs/ubuntu_rootfs //进入到 ubuntu_rootfs 目录下
    sudo cp /etc/resolv.conf ./etc/resolv.conf //拷贝 resolv.conf
    
    • 1
    • 2

    打开根文件系统中的 ubuntu_rootfs/etc/apt/sources.list 文件,在此文件最后面添加软件源

    3、在主机(PC)挂载并配置根文件系统(注意该节均在主机PC下运行)

    mount.sh

    1 #!/bin/bash
    2 echo "MOUNTING"
    3 sudo mount -t proc /proc
    	/home/zuozhongkai/linux/nfs/ubuntu_rootfs/proc
    4 sudo mount -t sysfs /sys
    	/home/zuozhongkai/linux/nfs/ubuntu_rootfs/sys
    5 sudo mount -o bind /dev /home/zuozhongkai/linux/nfs/ubuntu_rootfs/dev
    6 sudo mount -o bind /dev/pts
    	/home/zuozhongkai/linux/nfs/ubuntu_rootfs/dev/pts
    7 sudo chroot /home/zuozhongkai/linux/nfs/ubuntu_rootfs
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

    unmount.sh

    1 #!/bin/bash
    2 echo "UNMOUNTING"
    3 sudo umount /home/zuozhongkai/linux/nfs/ubuntu_rootfs/proc
    4 sudo umount /home/zuozhongkai/linux/nfs/ubuntu_rootfs/sys
    5 sudo umount /home/zuozhongkai/linux/nfs/ubuntu_rootfs/dev/pts
    6 sudo umount /home/zuozhongkai/linux/nfs/ubuntu_rootfs/dev
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    常用命令、软件安装

    apt update
    apt install sudo
    apt install vim
    apt install kmod
    apt install net-tools
    apt install ethtool
    apt install ifupdown
    apt install language-pack-en-base
    apt install rsyslog
    apt install htop
    apt install iputils-ping
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    设置基本参数和环境

    passwd root
    echo "alientek_imx6ul" > /etc/hostname
    echo "127.0.0.1 localhost" >> /etc/hosts
    echo "127.0.0.1 alientek_imx6ul" >> /etc/hosts
    ln -s /lib/systemd/system/getty@.service/etc/systemd/system/getty.target.wants/getty@ttymxc0.service
    //ALPHA开发板使用的UART1对应的串口设备文件为ttymxc0,我们需要添加一个名为getty@ttymxc0.service的链接,链接到 getty@.service 服务上
    exit//退出根文件系统
    ./unmount.sh
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    三、安装测试

    1、nfs挂载测试
    setenv bootargs ‘console=tty1 console=ttymxc0,115200 root=/dev/nfs nfsroot=192.168.1.253:/home/zuozhongkai/linux/nfs/ubuntu_rootfs rw ip=192.168.1.251:192.168.1.253:192.168.1.1:255.255.255.0::eth0:off’
    saveenv //保存环境变量
    
    • 1
    • 2

    重启即可

    2、烧录
    //PC上打包文件系统
    cd ubuntu_rootfs //进入到 ubuntu 根文件系统
    tar -vcjf ubuntu_rootfs.tar.bz2 * //打包根文件系统
    
    • 1
    • 2
    • 3

    见系统烧写方式章节(后续整理)

  • 相关阅读:
    java计算机毕业设计基于springboo+vue的教师人事档案管理系统
    SwiftUI4.0有趣的动画升级:新iOS16视图内容过渡动画
    java计算机毕业设计付费自习室管理系统源码+mysql数据库+系统+lw文档+部署
    (附源码)ssm宠物领养系统 毕业设计 031654
    Flink之Watermark水印、水位线
    JavaFX介绍
    asp.net高校留学生信息管理系统VS开发sqlserver数据库web结构c#编程Microsoft Visual Studio
    test_pipeline
    ArrayList 和 LinkedList 的区别
    Python教程---Python基础语法(关系运算符和逻辑运算符)
  • 原文地址:https://blog.csdn.net/qq_38292379/article/details/128083766
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号