組み込みLinuxの勉強として
あるARMデバイスのためにSDカードのパーティションにUbuntuのRoot File Systemを展開しておきたい。
タイトルはBuild
とあるがビルドするほどのものでもないかもしれない。
実行環境はVMplayer上のUbuntu16.04 LTS
0 準備
$ sudo apt-get install qemu-user-static
今回はSDカードの第二パーティションにRoot File Systemを展開したいので事前にそうしておく。
$ sudo gparted /dev/sdb
などで
とする
1 インストール
$ sudo mount -o loop /dev/sdX2 /mnt
ここを見て
Index of /dists
自分の欲しいUbuntuのバージョンの名前?をコマンドの適切な位置に入れる。
例えば
16.04 LTSならxenial
14.04 LTSならtrusty
sudo debootstrap --foreign --arch armhf [Ubuntuのバージョン] /mnt http://ports.ubuntu.com/ sudo cp /usr/bin/qemu-arm-static /mnt/usr/bin/ sudo chroot /mnt /usr/bin/groups: cannot find name for group ID 0 I have no name!@ubuntu:/#
これでchrootした
ここからは、chroot以下での作業
I have no name!@ubuntu:/# ./debootstrap/debootstrap --second-stage I have no name!@ubuntu:/# passwd (略) I have no name!@ubuntu:/# su root@ubuntu:/# passwd (念のため) (略) root@ubuntu:/# apt-get update (略) root@ubuntu:/# adduesr hoge (略:パスワードは設定する)
/home以下にhogeのフォルダができている。
または
root@ubuntu:/# cat /etc/passwd
でhogeユーザーがいることを確かめて終了
これで一応Root File System の展開は終了。
・・続く
- 作者: Jonathan Corbet,Alessandro Rubini,Greg Kroah-Hartman,山崎康宏,山崎邦子,長原宏治,長原陽子
- 出版社/メーカー: オライリージャパン
- 発売日: 2005/10/22
- メディア: 単行本
- 購入: 2人 クリック: 43回
- この商品を含むブログ (35件) を見る