debian 文件系统制作 for ARM

This guide details the process of building a Debian Jessie root filesystem for ARM-based boards, such as Acqua, Aria, Arietta, and FOX. It involves using Multistrap on an Ubuntu system, configuring the rootfs, enabling SSH root access, and copying the contents onto a microSD card." 52103080,1339961,Linux服务器上部署Maven项目步骤,"['Linux服务器', 'Maven部署', '应用部署', '进程操作', 'web开发']
摘要由CSDN通过智能技术生成

Build a Debian Jessie root filesystem

This article illustrates how to build an Debian Jessie root filesystem for the all the Acme Systems boards based on Atmel MCU

Requirements

To create the rootfs contents you need an Ubuntu PC (we used an Ubuntu 15.04) with the some packages installed. Type these commands to install them:


~$ sudo apt-get install multistrap
~$ sudo apt-get install qemu
~$ sudo apt-get install qemu-user-static
~$ sudo apt-get install binfmt-support
~$ sudo apt-get install dpkg-cross

Use Multistrap to generate the rootfs contents

"Multistrap is a tool that automates the creation of complete, bootable, Debian root filesystems. It can merge packages from different repositories. Extra packages are added to the rootfs simply by listing them. All dependencies are taken care of.".

Create a working directory in your home directory:

~$ mkdir debian_jessie
~$ cd debian_jessie
~/debian_jessie$

Download the configuration file for your board:

Read Multistrap man page to understand each directive meanings.

Create the root filesystem

When your multistrap.conf file is ready launch type:

  • if you are using a board without FPU like FOX Board G20, Aria G25 or Arietta G25 type for example:
~/debian_jessie$ sudo multistrap -a armel -f multistrap_boardname.conf
  • if you are using a board with FPU like Acqua A5 type:
~/debian_jessie$ sudo multistrap -a armhf -f multistrap_acqua.conf

At the end of this procedure the directory target-rootfs directory will contents the whole rootfs tree to be moved into the second partition of an Acme board bootable microSD.

Configure now the Debian packages using the armel CPU emulator QEMU and chroot to create a jail where dpkg will see the target-rootfs as its root (/) directory.

~/debian_jessie$ sudo cp /usr/bin/qemu-arm-static target-rootfs/usr/bin
~/debian_jessie$ sudo mount -o bind /dev/ target-rootfs/dev/
~/debian_jessie$ sudo LC_ALL=C LANGUAGE=C LANG=C chroot target-rootfs dpkg --configure -a

At this prompt:

Reply with < No >.

Some other prompt will appear during the configuration. Reply to them as you like.

When finished the target rootfs will be almost ready to be moved on the target microSD but it still needs some last extra configuration file before using it.

Based on type board you are using select one of these script to create the the right configuration files:

~/debian_jessie$ chmod +x arietta.sh
~/debian_jessie$ sudo ./arietta.sh

create now the target root login password:

~/debian_jessie$ sudo chroot target-rootfs passwd
Enter new UNIX password: type your password
Retype new UNIX password: type your password again
passwd: password updated successfully

If you want to take a look to the packages installed type:

~/debian_jessie$ sudo chroot target-rootfs dpkg --get-selections | more

Check the Debian version installed:

~/debian_jessie$ cat target-rootfs/etc/debian_version
8.2

Add more packages if needed by typing:

~/debian_jessie$ sudo LC_ALL=C LANGUAGE=C LANG=C chroot target-rootfs apt-get install packagename

Please note that will be possible to add packages also directly on the target board. In than case the command will be simply:

# apt-get install packagename

then remove the qemu-arm-static executable:

~/debian_jessie$ sudo rm target-rootfs/usr/bin/qemu-arm-static

Enable the root access via ssh

By default the sshd server is installed inhibiting the root login via ssh. To enabled it change in target-rootfs/etc/ssh/sshd_config this line:

PermitRootLogin without-password

with this:

PermitRootLogin yes

Copy the rootfs contents on microSD

Format a new microSD.

Mount the microSD on your Ubuntu Linux PC and copy all the target-rootfs contents in the second microSD partition mounted on/media/$USER/rootfs.

~/debian_jessie$ sudo rsync -axHAX --progress target-rootfs/ /media/$USER/rootfs/

Unmount the microSD, insert it in your board, insert the DPI cable to see the Kernel bootstrap messages and boot.

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值