試用 Banana Pi M3 – DietPi dietpi-* 工具組

# /DietPi/dietpi/dietpi-autostart

# /DietPi/dietpi/dietpi-banner
———————————————————————–
 DietPi     | 15:17 | Sat 07/01/17
———————————————————————–
 V141       | OrangePi PC (armv7l)
———————————————————————–
 IP Address | 192.168.1.19
———————————————————————–[@more@]
# /DietPi/dietpi/dietpi-cleaner

# /DietPi/dietpi/dietpi-cpu_set

 DietPi-Cpu_Set
———————————————————————–
 Mode: Applying CPU gov
 Please wait…

 [Ok] CPU gov applied: interactive

# /DietPi/dietpi/dietpi-cpuinfo

———————————————————————————————-
 DietPi CPU Info
 Use dietpi-config to change CPU / performance options
———————————————————————————————-
 Architecture |     armv7l
 Temp         |     61’c | Running hot, not recommended.
 Governor     |     interactive

                 Current Freq    Min Freq   Max Freq
 CPU0         |      480 Mhz      480 Mhz    1800 Mhz
 CPU1         |      480 Mhz      480 Mhz    1800 Mhz
 CPU2         |      480 Mhz      480 Mhz    1800 Mhz
 CPU3         |      480 Mhz      480 Mhz    1800 Mhz
 CPU4         |      480 Mhz      480 Mhz    1800 Mhz
 CPU5         |      480 Mhz      480 Mhz    1800 Mhz
 CPU6         |      480 Mhz      480 Mhz    1800 Mhz
 CPU7         |      480 Mhz      480 Mhz    1800 Mhz

# /DietPi/dietpi/dietpi-cron

# /DietPi/dietpi/dietpi-drive_manager

# /DietPi/dietpi/dietpi-update

# /DietPi/dietpi/dietpi-logclear

 DietPi-Logclear
———————————————————————————————-
 Mode: Welcome
 Please wait…

 Available commands:

 dietpi-logclear 0
 Backup contents of all log files from /var/log to /root/logfile_storage/*.
 Also clears the contents of all logs files in /var/log.

 dietpi-logclear 1
 Clear contents of all logs files in /var/log.

 dietpi-logclear 2
 Physically delete all files in /var/log and backups in /root/logfile_storage/*.
 May prevent log files from being updated, restart services or reboot.

# /DietPi/dietpi/dietpi-process_tool

# /DietPi/dietpi/dietpi-survey
 [Info] Testing connection to dietpi.com
 [Info] Max duration of 20 seconds, please wait…
 [Ok] Connection test | Completed

# /DietPi/dietpi/dietpi-services

 DietPi-Services
———————————————————————————————-
 Mode:
 Please wait…

DietPi-Services
Available commands: start / stop / restart / enable / disable

# /DietPi/dietpi/dietpi-services mysql stop

 DietPi-Services
———————————————————————————————-
 Mode: mysql
 Please wait…

DietPi-Services
Available commands: start / stop / restart / enable / disable

# /DietPi/dietpi/dietpi-sync

# /DietPi/dietpi/dietpi-update

 DietPi-Update
————————————————————————–
 Mode: Checking for DietPi updates
 Please wait…

 [Info] Checking Mirror : http://dietpi.com/downloads/dietpi-update_mirror/master/server_version
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     5  100     5    0     0      4      0  0:00:01  0:00:01 –:–:–     4
 [Ok] Using update server: http://dietpi.com/downloads/dietpi-update_mirror/master/server_version

 [Ok] No updates required, your DietPi installation is up to date.

 [Info] Current Version : 141
 [Info] Server Version  : 141

試用 Banana Pi M3 – DietPi dietpi-software 安裝套件

DietPi 本身是 base on Debian,所以除了可以使用 apt / dpkg 來安裝及移除軟體外,也可以利用 dietpi-software 來安裝套件。
1. 執行
# /DietPi/dietpi/dietpi-software
  GPLv2 授權

[@more@]

選擇 Software Optimized

可以安裝的軟體套件組

這裡安裝的是 LLAP ( Linux + Lighttpd + MariaDB + PHP )

選擇 Install

確認

安裝過程

安裝完成後,系統會自動重新開機

檢查系統是否有正常安裝完成並啟動相關服務
# netstat -antulp | grep LISTEN
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1225/mysqld
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1036/lighttpd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      447/dropbear
tcp6       0      0 :::80                   :::*                    LISTEN      1036/lighttpd
tcp6       0      0 :::22                   :::*                    LISTEN      447/dropbear

試用 Banana Pi M3 – DietPi dietpi-config 設定工具

dietpi-config 是 DietPi 的設定工具。
1. 執行
# /DietPi/dietpi/dietpi-config
[@more@]1  Display Options(顯示選項)
    Change Resolution (改變解析度)
    GPU/RAM Memory Split (GPU / 記憶體分割)
    LCD Panel addon: none (增加 LCD Panel: 無)

不過這三個選項,在 Banana Pi M3 均無法設定

2  Audio Options(聲音選項)

    Soundcard : none (音效卡 : 無)

Performance Options (效能選項)

    Change CPU Governor : interactive ( 改變 CPU 調速器 : 互動式)    

    CPU 工作頻率調整,自動調整 / 省電型 / 高效能型

  CPU Throttle Up     : 50% ( CPU 運作頻率閥值)

   
    有效的設定範圍:30 ~ 95,建議設定值:Desktop = 50%,Server = 85%

  CPU Max Freq Limit  : Disabled (CPU 最大工作頻率限制:無)

4  Advanced Options ( 進階設定 )

    Swapfile size   : 100 MB ( 設定 Swapfile 大小 )

    Time sync mode  : Boot + Daily ( 時間同步的方式:開機 + 每天)

    Update firmware ( 更新韌體 )

    Bluetooth       : Enabled ( 藍芽 : 開啟 )

    Serial console : Disabled ( 串行控制台 : 取消 )

5  Language/Regional Options ( 語言/地區 選項 )

    Locale   Change Language and Regional Settings ( Locale 設定 )

    Timezone Change Timezone Location Setting ( 時區設定 )


   

Keyboard Change Keyboard Language Setting ( 鍵盤設定 )

6  Security Options ( 安全選項 )

    Change Root Password ( 改變 root 密碼 )

    Change Hostname ( 改變主機名稱 )

7  Network Options: Adapters ( 網路選項: 介面)

8  Network Options: NAS/Misc ( 網路選項: Client 端)

9  AutoStart Options ( 自動執行選項)

10 Tools ( 工具 )

    效能 壓力測試

退出時,如果有做比較大的設定,要讓系統重新啟動

試用 Banana Pi M3 – DietPi 取消 root 帳號不會自動登入系統

Banana Pi M3 上的 DietPi 開機之後,預設會直接以 root 身份登入,雖然很方便,但可能會有資安上的問題。
參考網頁:
linux – Automatic root login in Debian 8.0 (console only) – Super User

1. 先備份原檔
# cp /etc/systemd/system/getty@tty1.service.d/autologin.conf /etc/systemd/system/getty@tty1.service.d/autologin.conf[@more@]
2. 進行修改
# sed -i ‘/–autologin root / s///’ /etc/systemd/system/getty@tty1.service.d/autologin.conf

3. 如果後悔
# sed -i ‘s/agetty/agetty –autologin root/’ /etc/systemd/system/getty@tty1.service.d/autologin.conf

試用 Banana Pi M3 – DietPi 取消每次登入時都會自動執行 dietpi-software

DietPi 在每次 root 登入時都會自動執行設定的畫面

實在有些煩人……[@more@]解決方式:
# sed -i ‘s|/DietPi|#/DietPi|’ /root/.bashrc

後來發現,只要有執行 dietpi-*,又會把下面這一行加回去 /root/.bashrc
/DietPi/dietpi/login

所以就乾脆在 /etc/rc.local 加入去除的這一行
# tail -2 /etc/rc.local
sed -i ‘s|^/DietPi|#/DietPi|’ /root/.bashrc
exit 0

試用 Banana Pi M3 – DietPi 簡單調整

1. 更改預設的 Locale 預設是 en_GB.UTF-8
# locale
LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE=”en_GB.UTF-8″
LC_NUMERIC=”en_GB.UTF-8″
LC_TIME=”en_GB.UTF-8″
LC_COLLATE=”en_GB.UTF-8″
LC_MONETARY=”en_GB.UTF-8″
LC_MESSAGES=”en_GB.UTF-8″
LC_PAPER=”en_GB.UTF-8″
LC_NAME=”en_GB.UTF-8″
LC_ADDRESS=”en_GB.UTF-8″
LC_TELEPHONE=”en_GB.UTF-8″
LC_MEASUREMENT=”en_GB.UTF-8″
LC_IDENTIFICATION=”en_GB.UTF-8″
LC_ALL=

# cat /etc/default/locale
#  File generated by update-locale
LC_MESSAGES=POSIX
LANG=en_GB.UTF-8
LANGUAGE=en_GB.UTF-8[@more@]執行 dpkg-reconfigure locales 進行設定
# dpkg-reconfigure locales
Generating locales (this might take a while)…
  en_US.UTF-8… done
Generation complete.

取消選擇 en_GB.UTF-8

加選 en_US.UTF-8

選擇 OK 繼續

選擇 en_US.UTF-8 為預設的 Locales

選擇 OK 完成設定

後記:
後來發現改用 en_US.UTF-8 後,有些設定畫面就會不太正常,所以後來又改回 en_GB.UTF-8

2. 補安裝一些個人覺得缺少的套件
# apt-get install openssh-client cifs-utils screen dnsutils mlocate

試用 Banana Pi M3 – DietPi


官網下載:DietPi
DietPi 官方網站:http://dietpi.com/

預設登入的帳號及密碼:root / dietpi

剛看到 DietPi 這個名字時,感到有些陌生,不知道是什麼東西,在網路上搜尋了一下,發現它是一套針對單板電腦(Single-Board Computer)所優化的 Debian Linux,其實和 Banana Pi 或是 Raspberry Pi 上使用的 Raspbian Linux 類似,只不過它提供更多或更方便的工具。[@more@]登入後畫面

退出功能表畫面,要再重新執行,可以執行 dietpi-software 即可!

Raspberry Pi • View topic – Raspbian Jessie Lite now available 可以找到 DietPi 和 Raspbian Lite 的比較

從這張表之中,我們可以發現:
1. DietPi 在 SSH Server 是採用 Dropbear,也可以選擇原來的 OpenSSH
2. DietPi 可以自動擴展 /root 分割區
3. DietPi 使用 dietpi-software 管理套件,也可以用原來的 apt-get
4. DietPi 設定系統、網路、CPU 調校,可以使用 dietpi-config
5. 其它….

可以參考的資料:
簡單入門
更多應用