LoginSignup
0
0

Nano Piをいじる(その4)

Posted at

NanoPi R6S用のFriendlyWrtをBuild

ようやくdockerを多少理解したこともあり、NanoPi R6S用のFriendlywrtをBuildしてみた。本家サイトの「11 How to Compile」にて、Build環境の最初の選択肢が、dockerだったこともある。

Build環境作成

ホストubuntuにて実施。

dockerにて実行環境の起動

上記リンク先の”friendlyarm/docker-cross-compiler-novnc”に従う。

$ git clone https://github.com/friendlyarm/docker-ubuntu-lxde-novnc
$ cd docker-ubuntu-lxde-novnc
$ docker build --no-cache -t docker-ubuntu-lxde-novnc .

次にこのイメージを実行する。

$ mkdir ~/work
$ chown 1000:1000 ~/work
$ docker run --rm --privileged -v /dev:/dev \
    --name docker-ubuntu-lxde-novnc \
    -p 6080:80 \
    -p 5900:5900 \
    -e HTTP_PASSWORD=password \
    -e VNC_PASSWORD=password \
    -e PUID=1000 \
    -e PGID=1000 \
    -e USER=ubuntu \
    -e PASSWORD=ubuntu \
    -v ~/.gitconfig:/home/ubuntu/.gitconfig:ro \
    -v ~/work:/home/ubuntu/work \
    -e RESOLUTION=1280x720 \
    docker-ubuntu-lxde-novnc:latest

これにより、dockerイメージ(docker-ubuntu-lxde-novnc)に対して、webブラウザによるアクセス(ポート6080)またはVNCアクセス(ポート5900)により、GUI環境下(LXDE)のubuntuを実行できる(適宜、パスワード入力)。
http接続2.png

FriendlyWrt Build

本家サイト(11.2 Build Openwrt/Friendlywrt)に従い、dockerにて起動されたubuntuにて、Build環境構築およびBuild実施。

環境構築

$ mkdir friendlywrt23-rk3588
$ cd friendlywrt23-rk3588
$ git clone https://github.com/friendlyarm/repo --depth 1 tools
$ tools/repo init -u https://github.com/friendlyarm/friendlywrt_manifests -b master-v23.05 \
        -m rk3588.xml --repo-url=https://github.com/friendlyarm/repo  --no-clone-bundle
$ tools/repo sync -c  --no-clone-bundle

Build

$ ./build.sh rk3588.mk

途中、下記などのWarningが表示されるが、気にせず進める。

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'ubuntu@a8e3ca8ebf83.(none)')

続ける。

$ cd friendlywrt
$ make menuconfig
$ rm -rf ./tmp
$ make -j${nproc}

ここで、下記エラーが発生。

make[3] -C target/linux compile
    ERROR: target/linux failed to build.
make -r world: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make: *** [/home/ubuntu/friendlywrt23-rk3588/friendlywrt/include/toplevel.mk:232: world] Error 1

メッセージに従い、下記を実施。

$ make -j1 V=s

Build成功後、SDカードに書き込むイメージファイルを作成。

$ cd ../
$ ./build.sh sd-img

...

RAW image successfully created (12:27:44).
-rw-r--r-- 1 ubuntu ubuntu 1499999232 Apr  5 12:27 out/friendlywrt_23.05_20240405_rk3588_arm64_sd.img
Tip: You can compress it to save disk space.
-----------------------------------------
Run the following command for sdcard install:
	sudo dd if=out/friendlywrt_23.05_20240405_rk3588_arm64_sd.img bs=1M of=/dev/sdX
-----------------------------------------

”./out/friendlywrt_23.05_20240405_rk3588_arm64_sd.img”というイメージファイルができあがる。これを”docker cp”などによりホストにコピーし、ddコマンドなどにて、SDカードに書き込む。

実行

SDカードを、NanoPi RS6に入れて実行。
IMG_20240405_214748.jpg
成功。

最後に

dockerを起動して外部からリモートアクセスによりGUI操作できるところが、Très bien。

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