LoginSignup
0
0

初めてのbuildroot

Posted at

素人が初めてbuildrootに触れる

buildrootとは組み込みLinuxを構築できる仕組み(?)みたいなもの。カスタマイズされたLinuxを作成できるようだ。下記サイトなどを参照した。

ターゲット

ここでは、Intel PC(x64)とRaspberryPiとをターゲットにLinuxを作成してみた。

Build

buildroot自体をGet

$ git clone git://git.busybox.net/buildroot buildroot

ターゲットを選択

$ make list-defconfigs

とすると、Buildできるターゲットが表示される。

x64

$ make list-defconfigs | grep pc_x86_64
  pc_x86_64_bios_defconfig            - Build for pc_x86_64_bios
  pc_x86_64_efi_defconfig             - Build for pc_x86_64_efi

「pc_x86_64_efi_defconfig」を選択。

RaspberryPi

$ make list-defconfigs | grep raspberry
  raspberrypi0_defconfig              - Build for raspberrypi0
  raspberrypi0w_defconfig             - Build for raspberrypi0w
  raspberrypi2_defconfig              - Build for raspberrypi2
  raspberrypi3_64_defconfig           - Build for raspberrypi3_64
  raspberrypi3_defconfig              - Build for raspberrypi3
  raspberrypi3_qt5we_defconfig        - Build for raspberrypi3_qt5we
  raspberrypi4_64_defconfig           - Build for raspberrypi4_64
  raspberrypi4_defconfig              - Build for raspberrypi4
  raspberrypi_defconfig               - Build for raspberrypi
  raspberrypicm4io_64_defconfig       - Build for raspberrypicm4io_64
  raspberrypicm4io_defconfig          - Build for raspberrypicm4io
  raspberrypizero2w_defconfig         - Build for raspberrypizero2w

所持するRaspberryPiはとても古いので、「raspberrypi_defconfig」を選択。

ターゲット選択およびmenuconfig

$ make pc_x86_64_efi_defconfig
$ make menuconfig

または

$ make raspberrypi_defconfig
$ make menuconfig

とする。”make menuconfig”を実施すると、下記が表示される。
make_menuconfigのコピー.png
ここでは、そのまま”Exit”すればよい。

本当のBuild

$ make

Buildが終わると、x64(Intel)では

./output/images/disk.img

にイメージが、RaspberryPiでは

./output/images/sdcard.img

にイメージができあがる。

SDカードに書き込み

$ sudo dd if=./output/images/イメージファイル of=/dev/sdc bs=4M conv=fsync

により、SDカードに書き込み。”/dev/sdc”は環境に応じて変わる。

起動

x64(Intel)

あえて、Intel Macで実施。
image.png

RaspberryPi

image.png

とりあえず、成功。カスタマイズは別の機会に。

EOF

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0