ユーザ用ツール

サイト用ツール


mae3xx_devel:chroot_qemu:start

差分

この文書の現在のバージョンと選択したバージョンの差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
mae3xx_devel:chroot_qemu:start [2014/03/31 12:05]
admin
mae3xx_devel:chroot_qemu:start [2021/09/14 13:49] (現在)
admin [ターゲット root filesystem へ chroot]
ライン 1: ライン 1:
 +====== PC上で root filesystem を変更する(QEMU使用) ======
 +
 +[[mae3xx_devel:​build_firmware:​start]] の手順でファームウェアを作成することはできますが、\\
 +パッケージの追加・削除 については "​apt-get"​ コマンドを実行する必要があります。\\
 +実機で NFSやSDカード、USBメモリなどを root filesystem として起動し、作業を行なってもよいのですが、\\
 +環境の準備に手間がかかりますので、ここではPC上で作業する方法を紹介します。
 +
 +\\
 +
 +===== ターゲット root filesystem の準備 =====
 +
 +ターゲットの root filesystem は、[[download_software:​mae3xx:​start|ダウンロード:​MA-E3xxシリーズ]] からダウンロードして\\
 +展開しておきます。
 +
 +<​code>​
 +user1@lubuntu-vpc:​~/​work$ ls -l
 +合計 55464
 +-rw-r--r-- ​ 1 user1 user1 56777748 ​ 3月 31 10:39 MAE320_rootfs_base_rc1.tar.xz
 +-rwxr-xr-- ​ 1 user1 user1     ​4680 ​ 3月 26 16:05 build_firm.sh
 +drwxr-xr-x 20 root  root      4096  3月  4 16:32 mae320_rootfs ​ <---- ここに展開した
 +user1@lubuntu-vpc:​~/​work$ ​
 +</​code>​
 +
 +<​code>​
 +user1@lubuntu-vpc:​~/​work$ ls -l mae320_rootfs/​
 +合計 72
 +drwxr-xr-x ​ 2 root root 4096  3月 11 09:44 bin
 +drwxr-xr-x ​ 2 root root 4096  3月 31 10:44 boot
 +drwxr-xr-x ​ 2 root root 4096  3月 31 10:43 dev
 +drwxr-xr-x 80 root root 4096  3月 31 10:35 etc
 +drwxr-xr-x ​ 3 root root 4096  2月 18 14:22 home
 +drwxr-xr-x 16 root root 4096  3月  6 10:04 lib
 +drwxr-xr-x ​ 2 root root 4096  2月 17 12:55 media
 +drwxr-xr-x ​ 6 root root 4096  3月  7 12:13 mnt
 +drwxr-xr-x ​ 2 root root 4096  3月 10 16:25 opt
 +drwxr-xr-x ​ 2 root root 4096 10月 14 05:42 proc
 +drwx------ ​ 5 root root 4096  3月 25 16:47 root
 +drwxr-xr-x ​ 2 root root 4096  2月 17 12:59 run
 +drwxr-xr-x ​ 2 root root 4096  3月 26 13:57 sbin
 +drwxr-xr-x ​ 2 root root 4096  2月 17 12:55 srv
 +drwxr-xr-x ​ 2 root root 4096  6月  5  2013 sys
 +drwxrwxrwt ​ 5 root root 4096  3月 31 11:46 tmp
 +drwxr-xr-x 10 root root 4096  2月 17 12:55 usr
 +drwxr-xr-x 11 root root 4096  2月 17 12:55 var
 +user1@lubuntu-vpc:​~/​work$
 +</​code>​
 +
 +\\
 +
 +===== chroot スクリプトの準備 =====
 +
 +このファイルをダウンロードしておきます。
 +
 +^  filename ​ ^  stat  ^  sha1sum ​ ^  info  |
 +|{{:​mae3xx_devel:​chroot_qemu:​chroot_arm.sh|}}|2014/​03/​31 12:16 611 B|5140784dd478dc194180e3a6ec454d78b302f7b5| |
 +
 +\\
 +
 +===== ターゲット root filesystem へ chroot =====
 +
 +下記の通り、ターゲット root filesystem のパスを指定して実行します。
 +
 +<​code>​
 +user1@lubuntu-vpc:​~/​work$ sudo ./​chroot_arm.sh mae320_rootfs/​
 +[sudo] password for user1: ​
 +root@lubuntu-vpc:/#​
 +</​code>​
 +
 +とくに変化はないように見えます。\\
 +uname コマンドで確認してみます。
 +
 +<​code>​
 +root@lubuntu-vpc:/#​ uname -a
 +Linux lubuntu-vpc 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 armv7l armv7l armv7l GNU/Linux
 +root@lubuntu-vpc:/#​
 +</​code>​
 +
 +machine/​processor/​hardware-platform が **"​armv7l"​** となっており、ARM環境になっていることがわかります。
 +
 +\\
 +
 +===== ターゲット root filesystem 上での作業 =====
 +
 +apt-get コマンドが動作するか、確認してみます。
 +
 +<​code>​
 +root@lubuntu-vpc:/#​ apt-get update  ​
 +0% [Working]qemu:​ Unsupported syscall: 374
 +Ign http://​ports.ubuntu.com saucy InRelease ​       ​
 +Ign http://​ports.ubuntu.com saucy-updates InRelease
 +Ign http://​ports.ubuntu.com saucy-security InRelease
 +Hit http://​ports.ubuntu.com saucy Release.gpg
 +Hit http://​ports.ubuntu.com saucy-updates Release.gpg
 +Hit http://​ports.ubuntu.com saucy-security Release.gpg
 +Hit http://​ports.ubuntu.com saucy Release
 +Hit http://​ports.ubuntu.com saucy-updates Release
 +Hit http://​ports.ubuntu.com saucy-security Release
 +Hit http://​ports.ubuntu.com saucy/main armhf Packages
 +Hit http://​ports.ubuntu.com saucy/​restricted armhf Packages
 +Hit http://​ports.ubuntu.com saucy/​universe armhf Packages
 +Hit http://​ports.ubuntu.com saucy/main Translation-en
 +Hit http://​ports.ubuntu.com saucy/​restricted Translation-en
 +Hit http://​ports.ubuntu.com saucy/​universe Translation-en
 +Hit http://​ports.ubuntu.com saucy-updates/​main armhf Packages
 +Hit http://​ports.ubuntu.com saucy-updates/​restricted armhf Packages
 +Hit http://​ports.ubuntu.com saucy-updates/​universe armhf Packages
 +Hit http://​ports.ubuntu.com saucy-updates/​main Translation-en
 +Hit http://​ports.ubuntu.com saucy-updates/​restricted Translation-en
 +Hit http://​ports.ubuntu.com saucy-updates/​universe Translation-en
 +Hit http://​ports.ubuntu.com saucy-security/​main armhf Packages
 +Hit http://​ports.ubuntu.com saucy-security/​restricted armhf Packages
 +Hit http://​ports.ubuntu.com saucy-security/​universe armhf Packages
 +Hit http://​ports.ubuntu.com saucy-security/​main Translation-en
 +Hit http://​ports.ubuntu.com saucy-security/​restricted Translation-en
 +Hit http://​ports.ubuntu.com saucy-security/​universe Translation-en
 +Reading package lists... Done
 +root@lubuntu-vpc:/# ​
 +</​code>​
 +
 +動作することが確認できました。\\
 +あとは、通常と同じ手順でパッケージの追加・削除が可能です。
  
mae3xx_devel/chroot_qemu/start.1396235129.txt.bz2 · 最終更新: 2014/03/31 12:05 by admin