Armadilloフォーラム

【Armadillo-X1】の複製方法について

chandra-s2

2022年11月24日 18時30分

いつもお世話になっております。
チャンドラと申します。

現在Armadillo-X1で開発を実施しています。
開発はATDEを使用せず、直接Armadillo本体で行っています。
使用している言語は主にPythonになります。

開発を終えて、量産のため開発に使用したArmadillo本体を複製したいですが、複製方法についてご教授をお願いした次第です。

こちらのページを確認したところ、2つの方法が存在するのは分かります。
https://manual.atmark-techno.com/armadillo-guide-std/armadillo-guide-st…
①dump_rootfs による方法
② x1-debian-builder による方法

また、こちらのページにはイメージファイルについて記載されています。
https://manual.atmark-techno.com/armadillo-x1/armadillo-x1_product_manu…

以上の内容を確認したところ、「完全複製」が目的の場合、「dump_rootfsによる方法」が一番適切だと考えております。

■お願いしたいこと:
現在ATDEを使用せず、開発することを踏まえて、目的の複製のため、適切の方法をご教授を願います。
その際の注意事項なども教えていただければ助かります。

以上、どうぞよろしくお願いいたします。

コメント

at_akihito.irie

2022年11月24日 18時58分

入江です。

> 以上の内容を確認したところ、「完全複製」が目的の場合、「dump_rootfsによる方法」が一番適切だと考えております。

仰るとおりdump_rootfsをご使用いただくのがATDEも使用せずとも可能ですので良いと思います。

注意事項と言うほどのものはないですが、最新のマニュアル・カーネル・DTBをご使用いただき、
マニュアル記載の手順にしっかりと従っていただくのが確実です。

送って頂いたdump_rootfsのマニュアルのURLは最新でないので注意してください。
(以下が現在の最新です。)
https://manual.atmark-techno.com/armadillo-guide-std/armadillo-guide-st…

最新のマニュアルの通り試して躓いてしまった場合はフォーラムにてご質問ください。

以上、よろしくお願いいたします。

chandra-s2

2022年11月25日 9時21分

入江様。
お世話になっております。

>送って頂いたdump_rootfsのマニュアルのURLは最新でないので注意してください。
ご指摘ありがとうございました。

>最新のマニュアルの通り試して躓いてしまった場合はフォーラムにてご質問ください。
承知しました。最新のマニュアル記載の手順に従い、試させていただきます。
また、躓いてしまった場合改めてご質問させていただきます。その際はよろしくお願いいたします。

以上、よろしくお願いいたします。

chandra-s2

2022年11月28日 10時33分

入江様。
お世話になっております。

マニュアルに従い、dumprootfsを実施してみましたが、失敗してしまいました。
失敗ログは以下の通りです。

root@armadillo:~# cat /run/initramfs/dump_rootfs.log
fdisk: cannot open : No such file or directory

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

mkfs.vfat: unable to open : No such file or directory
mkfs.fat 4.1 (2017-01-24)
mount: mounting on /tmp/mnt.XZjrZIv failed: Invalid argument

dump_rootfs has failed.

dump_rootfs v1.1.0

Description:
dump_rootfs can dump a root file system(rootfs) to a specified block
device.

to run dump_rootfs, create "do_dump_rootfs" on the top directory
of the rootfs. "do_dump_rootfs" can be contained parameters of
dump_rootfs.

to exclude files from dump_rootfs, create "excludes.list" on the
top directory of the rootfs. each line of "excludes.list" means
fullpath of files to be exclude from dump_rootfs except lines
starting with "#".

do_dump_rootfs parameters:
dstdev=DEV
required. output the dumpped rootfs archive to DEV. it must be
mountable. for example /dev/sda1, /dev/mmcblk0p2, /dev/mmcblk1p2.

debug
output detailed logs to "/run/initramfs/dump_rootfs.log".

led=LED
blink LED while dumping.
for example /sys/class/leds/green, /sys/class/leds/led1.

force_format=yes
"yes" to exec fdisk and mkfs.vfat before mount dstdev, otherwise
just mount dstdev.

excludes.list description:
#.*
the lines starting with "#" are comments. these are ignored.

.*
the lines starting with the other than "#" are fullpath of
files to be exclude from dump_rootfs. "*" can be used as wild
card.
for example /etc/ssh/ssh*key*.

Example:
run commands below and the armadillo start dumping from the rootfs
to "/dev/mmcblk0p2" after reboot itself. and then detailed logs
are output to "/run/initramfs/dump_rootfs.log" and
"dump_rootfs.tar.gz" is generated in "/dev/mmcblk0p2".

[armadillo ~]# echo "dstdev=/dev/mmcblk0p2" > /do_dump_rootfs
[armadillo ~]# echo "debug" > /do_dump_rootfs
[armadillo ~]# reboot

Please specify "dstdev" to run dump_rootfs or
"debug" for debug.

Armadillo本体にはUSBを刺している状態でコマンドを実行しました。
また、USBは/dev/sda1として認識されるのを確認しました。
"ls"コマンドにて、USB接続した場合/dev/sda1が表示されます。

原因及び対応方法をご教授いただければ幸いです。
よろしくお願いいたします。

chandra-s2

2022年11月28日 10時49分

追記:

debugが有効にした後のログです。

+ sed s/^#.*//g /root/do_dump_rootfs
+ dump_rootfs_dst=/dev/sda1
+ : debug* has been parsed already.
+ force_format=yes
+ [ n = y ]
+ rm -f /root/do_dump_rootfs
+ [ n = y ]
+ [ -e /root/do_dump_rootfs ]
+ [ x/dev/sda1 != x ]
+ dump_rootfs
+ local tmp=
+ local dst=
+ local ret=
+ wait_file /dev/sda1 30
+ local target=/dev/sda1
+ local wait_sec=30
+ : wait 30 seconds /dev/sda1
+ [ ! -e /dev/sda1 ]
+ sleep 1
+ expr 30 - 1
+ wait_sec=29
+ [ 29 -le 0 ]
+ [ ! -e /dev/sda1 ]
+ [ -e /dev/sda1 ]
+ [ 0 -ne 0 ]
+ [ /dev/sda1 != /dev/mmcblk2p2 ]
+ [ yes = yes ]
+ force_format
+ local basedev=
+ local partition=
+ [ /dev/sda1 = /dev/mmcblk2p2 ]
+ fdisk
fdisk: cannot open : No such file or directory

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

+ dump_rootfs_dst=
+ mkfs.vfat -F 32
mkfs.vfat: unable to open : No such file or directory
mkfs.fat 4.1 (2017-01-24)
+ mktemp -d /tmp/mnt.XXXXXXX
+ tmp=/tmp/mnt.XGDXgzv
+ mount /tmp/mnt.XGDXgzv
mount: mounting on /tmp/mnt.XGDXgzv failed: Invalid argument
+ ret=255
+ [ 255 -ne 0 ]
+ rmdir /tmp/mnt.XGDXgzv
+ return 255
+ [ 255 -eq 0 ]
+ echo

+ echo dump_rootfs has failed.
dump_rootfs has failed.
+ echo

+ [ x != xy ]
+ set +x
dump_rootfs v1.1.0

他に必要の情報があればお申し付けください。
よろしくお願いいたします。

at_akihito.irie

2022年11月28日 16時38分

入江です。

/etc/dumprootfs/dumprootfs.confのforce_formatをnoにしてお試しいただけますでしょうか。

[armadillo]# grep "force_format" /etc/dumprootfs/dumprootfs.conf
force_format=no

お手数おかけしますがよろしくお願いいたします。

chandra-s2

2022年11月28日 17時35分

入江様。
お世話になっております。

>/etc/dumprootfs/dumprootfs.confのforce_formatをnoにしてお試しいただけますでしょうか。
上記内容で実行した結果、「dump_rootfs has succeeded.」およびdump_rootfs.tar.gz と dump_rootfs.tar.gz.md5 が確認できました。

早速ご対応いただきありがとうございました。
次はこちらのファイルで複製をしてみます。
また、不明な点がありましたら、ご協力のほどよろしくお願いいたします。

以上です。

chandra-s2

2022年11月29日 10時27分

入江様。
お世話になっております。

dumprootfsにより作成したルートファイルシステムアーカイブを適用する方法について確認です。
マニュアルを確認したところ、2つの方法があります。
①インストールディスクイメージによる更新
https://manual.atmark-techno.com/armadillo-guide-std/armadillo-guide-st…

②ルートファイルシステムのみの書き換え
https://manual.atmark-techno.com/armadillo-x1/armadillo-x1_product_manu…
こちらの方法はマニュアルに「debian-buster-armhf_ax1_[version].tar.gz」を使用していますが、「dump_rootfs.tar.gz」も同じ手順で実行してよろしいでしょうか。

また、上記方法ではSDカードからブートする必要があり、Armadillo 460のような、netflashコマンドで置き換えるのは不可能でしょうか?
https://manual.atmark-techno.com/armadillo-4x0/armadillo-400_series_sof…
現在、Armadillo 460からArmadillo X1に移植するところで、可能な範囲でArmadillo 460の機能や操作手順を維持したいと考えております。

以上、ご回答ご教授いただければ幸いです。
よろしくお願いいたします。

at_akihito.irie

2022年11月29日 13時38分

入江です。

> ①インストールディスクイメージによる更新
> https://manual.atmark-techno.com/armadillo-guide-std/armadillo-guide-st…
>
> ②ルートファイルシステムのみの書き換え
> https://manual.atmark-techno.com/armadillo-x1/armadillo-x1_product_manu…
> こちらの方法はマニュアルに「debian-buster-armhf_ax1_[version].tar.gz」を使用していますが、「dump_rootfs.tar.gz」も同じ手順で実行してよろしいでしょうか。

はい。問題ありません。

①のmake_install_disk_imageに入力するルートファイルシステムアーカイブとしてもご使用いただけます。

> また、上記方法ではSDカードからブートする必要があり、Armadillo 460のような、netflashコマンドで置き換えるのは不可能でしょうか?
> https://manual.atmark-techno.com/armadillo-4x0/armadillo-400_series_sof…
> 現在、Armadillo 460からArmadillo X1に移植するところで、可能な範囲でArmadillo 460の機能や操作手順を維持したいと考えております。

Armadillo-X1のルートファイルシステム全体の書き換え手順については、先の2つの方法のみサポートしています。
申し訳ございませんが、netflashは対応しておりません。

chandra-s2

2022年11月29日 15時20分

入江様。
お世話になっております。

早速ご回答いただきありがとうございました。

> はい。問題ありません。
>
> ①のmake_install_disk_imageに入力するルートファイルシステムアーカイブとしてもご使用いただけます。

> Armadillo-X1のルートファイルシステム全体の書き換え手順については、先の2つの方法のみサポートしています。
> 申し訳ございませんが、netflashは対応しておりません。

ルートファイルシステムアーカイブの使用について承知いたしました。
①か②の方法で対応させていただきます。

以上、よろしくお願いいたします。