基于learning armbian step(4) 的总结,我们来实践一下,接下来的会把整个构建的log都贴出来:

vmuser@vmuser-virtual-machine:~/qemu-arm$ sudo apt-get install qemu-user-static

[sudo] password for vmuser:

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

binfmt-support

The following NEW packages will be installed:

binfmt-support qemu-user-static

0 upgraded, 2 newly installed, 0 to remove and 325 not upgraded.

Need to get 7,753 kB of archives.

After this operation, 86.1 MB of additional disk space will be used.

Do you want to continue? [Y/n] y

Get:1 http://mirrors.aliyun.com/ubuntu xenial/main amd64 binfmt-support amd64 2.1.6-1 [50.7 kB]

Get:2 http://mirrors.aliyun.com/ubuntu xenial-updates/universe amd64 qemu-user-static amd64 1:2.5+dfsg-5ubuntu10.34 [7,702 kB]

Fetched 7,753 kB in 8s (910 kB/s)

Selecting previously unselected package binfmt-support.

(Reading database ... 276761 files and directories currently installed.)

Preparing to unpack .../binfmt-support_2.1.6-1_amd64.deb ...

Unpacking binfmt-support (2.1.6-1) ...

Selecting previously unselected package qemu-user-static.

Preparing to unpack .../qemu-user-static_1%3a2.5+dfsg-5ubuntu10.34_amd64.deb ...

Unpacking qemu-user-static (1:2.5+dfsg-5ubuntu10.34) ...

Processing triggers for systemd (229-4ubuntu21.15) ...

Processing triggers for ureadahead (0.100.0-19) ...

Processing triggers for man-db (2.7.5-1) ...

Setting up binfmt-support (2.1.6-1) ...

Setting up qemu-user-static (1:2.5+dfsg-5ubuntu10.34) ...

Processing triggers for systemd (229-4ubuntu21.15) ...

Processing triggers for ureadahead (0.100.0-19) ...

vmuser@vmuser-virtual-machine:~/qemu-arm$ sudo apt install debootstrap

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following NEW packages will be installed:

debootstrap

0 upgraded, 1 newly installed, 0 to remove and 325 not upgraded.

Need to get 37.2 kB of archives.

After this operation, 262 kB of additional disk space will be used.

Get:1 http://mirrors.aliyun.com/ubuntu xenial-updates/main amd64 debootstrap all 1.0.78+nmu1ubuntu1.6 [37.2 kB]

Fetched 37.2 kB in 0s (357 kB/s)

Selecting previously unselected package debootstrap.

(Reading database ... 276841 files and directories currently installed.)

Preparing to unpack .../debootstrap_1.0.78+nmu1ubuntu1.6_all.deb ...

Unpacking debootstrap (1.0.78+nmu1ubuntu1.6) ...

Processing triggers for man-db (2.7.5-1) ...

Setting up debootstrap (1.0.78+nmu1ubuntu1.6) ...

We can use qemu-debootstrap to building ubuntu rootfs .

vmuser@vmuser-virtual-machine:~/qemu-arm$ sudo qemu-debootstrap --verbose --arch=arm64 --variant=buildd xenial  ubuntu_arm64_xenial  http://mirrors.ustc.edu.cn/ubuntu-ports

[sudo] password for vmuser:

Ok , we get it.

I: Configuring gcc-5...

I: Configuring libstdc++-5-dev:arm64...

I: Configuring gcc...

I: Configuring g++-5...

I: Configuring g++...

I: Configuring build-essential...

I: Configuring libc-bin...

I: Base system installed successfully.

Now we can get the ubuntu rootfs capacity

vmuser@vmuser-virtual-machine:~/qemu-arm$ du -h ubuntu_arm64_xenial/

1.2M         ubuntu_arm64_xenial/var/cache/debconf

12K  ubuntu_arm64_xenial/var/cache/ldconfig

4.0K ubuntu_arm64_xenial/var/cache/apt/archives/partial

54M ubuntu_arm64_xenial/var/cache/apt/archives

54M ubuntu_arm64_xenial/var/cache/apt

55M ubuntu_arm64_xenial/var/cache

4.0K ubuntu_arm64_xenial/var/tmp

68M ubuntu_arm64_xenial/var

318M        ubuntu_arm64_xenial/

If you want to custom your rootfs , your can add build args , qemu-debootstrap will transmit args to debootstrap ,

so learn debootstrap usage, read fonts can help you customization you ubuntu rootfs.

vmuser@vmuser-virtual-machine:~/qemu-arm$ debootstrap --help

Usage: debootstrap [OPTION]... <suite> <target> [<mirror> [<script>]]

Bootstrap a Debian base system into a target directory.

--help                 display this help and exit

--version              display version information and exit

--verbose              don't turn off the output of wget

--download-only        download packages, but don't perform installation

--print-debs           print the packages to be installed, and exit

--arch=A               set the architecture to install (use if no dpkg)

[ --arch=powerpc ]

--include=A,B,C        adds specified names to the list of base packages

--exclude=A,B,C        removes specified packages from the list

--components=A,B,C     use packages from the listed components of the

archive

--variant=X            use variant X of the bootstrap scripts

(currently supported variants: buildd, fakechroot,

scratchbox, minbase)

minbase: 只包含必要的包和apt; 
buildd: 包含编译工具包 
fakechroot: 包含不用root权限的包 
scratchbox: 包含scratchbox(交叉编译工具链)相关包

--keyring=K            check
Release files against keyring K

--no-check-gpg         avoid
checking Release file signatures

--force-check-gpg      force
checking Release file signatures

(also disables
automatic fallback to HTTPS in case

of a missing
keyring), aborting otherwise

--no-resolve-deps      don't try
to resolve dependencies automatically

--unpack-tarball=T     acquire
.debs from a tarball instead of http

--make-tarball=T       download
.debs and create a tarball (tgz format)

--second-stage-target=DIR

Run second stage
in a subdirectory instead of root

(can be used to
create a foreign chroot)

(requires
--second-stage)

--extractor=TYPE       override
automatic .deb extractor selection

(supported: dpkg-deb
ar)

--debian-installer     used for
internal purposes by debian-installer

--private-key=file     read the
private key from file

--certificate=file     use the
client certificate stored in file (PEM)

--no-check-certificate do not check certificate against certificate
authorities

Verify arm64 ubuntu
rootfs:

# cp /usr/bin/qemu-aarch64-static
ubuntu_arm64_xenial/usr/bin/

# mount 
proc ubuntu_arm64_xenial/proc -t proc

# mount 
sysfs ubuntu_arm64_xenial/sys -t sysfs

# cp /etc/hosts
ubuntu_arm64_xenial/etc/hosts

# cp /etc/resolv.conf
ubuntu_arm64_xenial/etc/resolv.conf

# chroot ubuntu_arm64_xenial/

root@vmuser-virtual-machine:/# ls   ---- 》we got it, running arm rootfs in X86 host

bin 
boot  dev  etc 
home  lib  media 
mnt  opt  proc  root  run 
sbin  srv  sys 
tmp  usr  var

root@vmuser-virtual-machine:/# ifconfig

bash: ifconfig: command not found

root@vmuser-virtual-machine:/# apt install net-tools

Reading package lists... Done

Building dependency tree... Done

The following NEW packages will be
installed:

net-tools

0 upgraded, 1 newly installed, 0 to remove
and 0 not upgraded.

Need to get 165 kB of archives.

After this operation, 688 kB of additional
disk space will be used.

Get:1 http://ports.ubuntu.com/ubuntu-ports
xenial/main arm64 net-tools arm64 1.60-26ubuntu1 [165 kB]

Fetched 165 kB in 2s (79.9 kB/s)

perl: warning: Setting locale failed.

perl: warning: Please check that your
locale settings:

LANGUAGE
= "en_US",

LC_ALL
= (unset),

LC_PAPER
= "zh_CN.UTF-8",

LC_NUMERIC
= "zh_CN.UTF-8",

LC_IDENTIFICATION
= "zh_CN.UTF-8",

LC_MEASUREMENT
= "zh_CN.UTF-8",

LC_NAME
= "zh_CN.UTF-8",

LC_TELEPHONE
= "zh_CN.UTF-8",

LC_ADDRESS
= "zh_CN.UTF-8",

LC_MONETARY
= "zh_CN.UTF-8",

LC_TIME
= "zh_CN.UTF-8",

LANG
= "en_US.UTF-8"

are supported and installed on your system.

perl: warning: Falling back to the standard
locale ("C").

debconf: delaying package configuration,
since apt-utils is not installed

E: Can not write log (Is /dev/pts mounted?)
- posix_openpt (2: No such file or directory)

Selecting previously unselected package
net-tools.

(Reading database ... 11949 files and
directories currently installed.)

Preparing to unpack
.../net-tools_1.60-26ubuntu1_arm64.deb ...

Unpacking net-tools (1.60-26ubuntu1) ...

Setting up net-tools (1.60-26ubuntu1) ...

附加如下为构建桌面系统对应的源:

deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ xenial universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security multiverse

learning armbian steps(5) ----- armbian 构建arm rootfs的更多相关文章

  1. learning armbian steps(6) ----- armbian 源码分析(一)

    为了深入学习armbian,前面已经学习了如何手动构建arm ubuntu rootfs. 由于armbian官方的文档比较的匮乏,所以最终还是决定通过其编译的过程来深入地学习. 为了快速度深入地学习 ...

  2. learning armbian steps(8) ----- armbian 源码分析(三)

    在lib/main.sh当中 ) == main.sh ]]; then echo "Please use compile.sh to start the build process&quo ...

  3. learning armbian steps(9) ----- armbian 源码分析(四)

    在上一节的分析当中,我们知道是通过对话框来选择到底编译的是哪块板子,基于什么样的配置. 接下来我们来拿一个实例来分析一下具体的案例,我们会选中如下所示的版本 iotx-3 AM335X 1Gb SoC ...

  4. learning armbian steps(3) ----- armbian 文件系统定制思路

    如何定制自已的armbian文件系统. 1)uboot 2)  kernel 3)  rootfs 针对linux 系统开发人员来说,真正有用的只是其armbian文件系统, 将其制作成所需的文件系统 ...

  5. learning armbian steps(7) ----- armbian 源码分析(二)

    从compile.sh开始入手: SRC="$(dirname "$(realpath "${BASH_SOURCE}")")" # fal ...

  6. learning armbian steps(2) ----- armbian 镜像编译

    参考:https://docs.armbian.com/Developer-Guide_Build-Preparation/ 通过如下指令进行编译: apt-get -y -qq install gi ...

  7. learning armbian steps(1) ----- armbian 入门知识基础学习

    第一问: armbian是什么? Armbian是轻量级的Debian系统和为ARM开发板专门发行并重新编译的Ubuntu系统. 第二问:  什么场景下会用到armbian系统? 一个带有arm编译器 ...

  8. learning armbian steps(4) ----- armbian 技术内幕

    在学习新的框架之前,肯定有一个原型机,通过最普通的指令来实现其功能. 做到这一点之后,所有的东西都不在是秘密,缺的时间进行系统深入的学习. 其实可以自已先来手动构建一个原生的arm 文件系统,基于qe ...

  9. 构建 ARM Linux 4.7.3 嵌入式开发环境 —— U-BOOT 引导 Kernel

    经过若干天的反复测试,搜索.终于成功利用 Qemu 在 u-boot 下引导 ARM Linux 4.7.3 内核.如下详细解释整个构建过程. 准备环境 运行环境:Ubuntu 16.04 需要的虚拟 ...

随机推荐

  1. 插入排序——C语言

    插入排序 插入排序(Insertion-Sort)的算法描述是一种简单直观的排序算法.它的工作原理是通过构建有序序列,对于未排序数据,在已排序序列中从后向前扫描,找到相应位置并插入.  (每步将一个待 ...

  2. const关键字的使用——C语言

    一.常规用法 关键字const用来定义只读变量,被const定义的变量它的值是不允许改变的,即不允许给它重新赋值,即使是赋相同的值也不可以.所以说它定义的是只读变量,这也就意味着必须在定义的时候就给它 ...

  3. 如何将Linux的工程原封不动地移植到Windows上面

    习惯在Linux下进行开发.但是由于工作需要,不得不与其他使用Windows的项目组同事对接,同事要求我给出可用的程序,而我只有基于makefile的传统工程. 改动到VS工程上发现一部分头文件在Wi ...

  4. BZOJ4516 SDOI2016生成魔咒(后缀自动机)

    本质不同子串数量等于所有点的len-parent树上父亲的len的和.可以直接维护. #include<iostream> #include<cstdio> #include& ...

  5. 18-MySQL DBA笔记-MySQL Server调优

    第18章 MySQL Server调优 本章将为读者介绍针对MySQL Server的优化,这也是DBA最熟悉的领域之一.首先我们介绍MySQL的主要参数,然后,讲述常见硬件资源的优化.我们假设读者已 ...

  6. 在论坛中出现的比较难的sql问题:4(row_number函数+子查询 分组连续编号问题)

    原文:在论坛中出现的比较难的sql问题:4(row_number函数+子查询 分组连续编号问题) 所以,觉得有必要记录下来,这样以后再次碰到这类问题,也能从中获取解答的思路. 求一查询语句 http: ...

  7. VS App_Code文件夹下的类文件不能直接被调用的解决方法

    如下图所示,新建的类不能直接使用,会显示报错,检查命名空间什么的,未果 通过百度搜索,发现这么一篇文章:https://blog.csdn.net/younghaiqing/article/detai ...

  8. axios全局配置及拦截器

    axios使用说明文档 axios 全局配置: //axios-init.js import axios from 'axios': let loadingInstance; //创建Loading ...

  9. 前端开发 Vue -3axios

    Axios是什么? 应该念“阿克希奥斯”……但是太长太拗口,我一般念“阿笑斯”…… Axios 是一个基于 promise 的 HTTP 库,简单的讲就是可以发送get.post请求.说到get.po ...

  10. @PostConstruct注解原理解析

    所有文章 https://www.cnblogs.com/lay2017/p/11478237.html 正文 @PostConstruct注解使用简介 在了解一个东西的原理之前,我们得初步的懂得如何 ...