・ 移行元
RaspberryPi 4 2GB モデル
OS : Raspberry Pi OS (64-bit)
OS Image: Raspberry Pi OS Lite
Memory : 2GB
記憶媒体: MicroSDカード
IP : 192.168.55.120
最小構成(Xなし)から、後でXwindowを導入。(軽いと言われているxfceをインスト)
・ 移行先
AndroidTVBox A95X F3 Air をLinux化
OS : Armbian Community
OS Image: CLI Serverイメージ
Memory : 4GB
IP : 192.168.55.121
記憶媒体: eMMC (32GB) ※ 構築段階ではMicroSDカードで構築
・ 移行のきっかけ
・GPIOを利用していない
・別件でGPIOを利用可能な筐体を準備したいが、新規購入するには現在の価格情勢は高すぎる
比較的安価に購入可能なAndroidTVBoxに注目した
SoC android TV Box armbianは、systemd-networkd (netplan連携)みたいなので、netplanでconfを書く。
# vi /etc/netplan/20-eth0.yaml
# Added by Armbian # # Reference: https://netplan.readthedocs.io/en/stable/netplan-yaml/ # # Let systemd-networkd manage all Ethernet devices on this system, but be configured by Netplan. network: version: 2 renderer: networkd ethernets: eth0: addresses: - 192.168.55.121/24 routes: - to: default via: 192.168.55.1 nameservers: addresses: [8.8.8.8, 8.8.4.4]
# netplan try
# netplan apply
# apt-get update && apt-get -y upgrade
# systemctl stop wpa_supplicant.service
# systemctl disable wpa_supplicant.service
# apt-get -y install chrony vim.tiny file unzip
# localectl set-locale ja_JP.UTF-8
# update-alternatives –set editor /usr/bin/vim.tiny
https://www.mfeed.ad.jp/ntp/usage.html
# systemctl restart chrony
# dpkg-reconfigure console-setup
# systemctl restart keyboard-setup.service
# apt -y install task-xfce-desktop
# apt -y install xrdp xorgxrdp
# systemctl enable xrdp
# cp -pi /etc/xrdp/startwm.sh /etc/xrdp/startwm.sh.org
# vi /etc/xrdp/startwm.sh
--- /etc/xrdp/startwm.sh.org +++ /etc/xrdp/startwm.sh @@ -10,5 +10,6 @@ . /etc/profile fi -test -x /etc/X11/Xsession && exec /etc/X11/Xsession -exec /bin/sh /etc/X11/Xsession +#test -x /etc/X11/Xsession && exec /etc/X11/Xsession +#exec /bin/sh /etc/X11/Xsession +xfce4-session
# apt install tigervnc-standalone-server
# vi /etc/tigervnc/vncserver.users
:1=develop
# su - develop
$ tigervncpasswd
$ cd ~dev/.vnc/
$ vi tigervnc.conf
$localhost = "no"; $vncStartup = "/usr/bin/startxfce4"; $SecurityTypes = "VncAuth,TLSVnc"; $geometry = "1920x1080"; $depth = "32";
$ exit
# systemctl edit tigervncserver@.service
[Service] Restart=on-success
tigervncserver -xstartup /usr/bin/startxfce4 -SecurityTypes VncAuth,TLSVnc -geometry 1920x1024 -localhost no :1
# systemctl enable tigervncserver@:1.service
# systemctl start tigervncserver@:1.service
# apt -y install task-japanese locales-all task-japanese-desktop fonts-noto fonts-takao
# apt -y install pulseaudio pavucontrol
# apt-get -y install firefox-esr firefox-esr-l10n-ja chromium chromium-driver chromium-l10n \
thunderbird thunderbird-l10n-ja transmission transmission-qt vlc vlc-l10n vlc-plugin-samba
# apt-get -y install python3-venv
# su - develop
$ python3 -m venv py3-venv
$ ./py3-venv/bin/pip3 install chromedriver_binary==130.*
$ ./py3-venv/bin/pip3 install selenium
$ exit
# cd /opt
# rsync -av -e ssh develop@192.168.55.120:/opt/local .
# rsync -av -e ssh develop@192.168.55.120:/opt/os_bkup_script .
# apt-get -y install munin-node
# vi /etc/munin/munin-node.conf (移行元データ コピペ)
インストール完了後に、 # munin-node-configure --suggest を実行。 取得可能な情報があり必要であれば追加設定 # munin-node-configure --shell | /bin/bash
# apt-get -y install nagios-nrpe-server monitoring-plugins-standard
# cd /etc/nagios/nrpe.d
# scp develop@192.168.55.120:/etc/nagios/nrpe.d/* .
# vi <設定ファイル> (適時修正)
# apt-get -y install snmp snmpd telnet
# cd /etc/snmp
# cp -pi snmpd.conf snmpd.conf.org
# scp develop@192.168.55.120:/etc/snmp/snmpd.conf .
# systemctl restart snmpd
# systemctl status snmpd
# apt-get -y install sysstat
# systemctl enable sysstat
# systemctl start sysstat
# systemctl status sysstat
# apt-get -y install postfix
# vi /etc/postfix/main.cf (移行元データ 参考に適時修正)
# vi /eyc/aliases (移行元データ 参考に適時修正)
# newaliases
# systemctl restart postfix
# apt-get -y install nftables
# vi /etc/nftables.conf (移行元データ コピペ)
# systemctl enable nftables
# systemctl start nftables
# nft list ruleset
(確認)
# systemctl -t service
(確認/適時不要サービス停止)
# vi /etc/rsyncd.conf (移行元データ コピペ)
# vi /etc/rsyncd/backup.exclude (移行元データ コピペ)
# vi /etc/rsyncd/backup.include (移行元データ コピペ)
# systemctl enable rsync
# systemctl start rsync
# systemctl status rsync
# apt-get -y install smartmontools monitoring-plugins-check-smart-attributes
# systemctl status smartmontools.service
※ 構築時はHDDが無いのでエラー。 リプレース後(移行元のUSB-HDDを付け替え後)に再確認
# apt-get -y install gcc make cpp
# apt-get -y install linux-libc-dev-current-meson64 libgcc-12-dev libc-dev-bin libc6-dev pkg-config libnl-genl-3-dev libcap-ng-dev libssl-dev liblz4-dev liblzo2-dev
# apt-get -y libstring-random-perl liblwp-protocol-https-perl libhtml-tableparser-perl libdatetime-perl libxml-treepp-perl libdatetime-format-mail-perl libdatetime-format-strptime-per xdotool
# apt-get -y install samba smbclient
# vi smb.conf (移行元データ コピペ)
# mkdir /usb01
# useradd -u 1101 -g 995 user001
# passwd -l user001
# smbpasswd -a user001
# systemctl stop nmbd.service
# systemctl disable nmbd.service
# systemctl restart smb
# systemctl status smb
# apt-get -y install squid squid-langpack
# vi /etc/squid/squid.conf (移行元データ コピペ)
# systemctl restart squid
# systemctl status squid
# apt-get -y install default-mysql-client libdbd-mariadb-perl libdbd-mysql-perl libterm-readkey-perl