Banana Pi 測試 – 試用 Lubuntu_1404_v3.1_XBMC

下載網址:http://forum.lemaker.org/thread-2037-1-1-1.html

系統是 base on Lubuntu 14.04,解開的檔案有 14.7G,所以至少要使用 16G 的 SD 卡

開機之後先進入 Lubuntu,再切換到 XBMC

XBMC 英文介面
[@more@]

中文化

很詭異的是,播放影片時,竟然會切換回 Lubuntu,使用 mplayer2 播放

系統的 Video_Tests 目錄中的測試檔,難怪 Image 會那麼大

播 720p / 1080p 影片檔,竟然會直接切換回 Lubuntu ?

試裝 Ubuntu 14.10 Server x86

用起來的感覺之前的版本差不多
光碟開機畫面,選擇 中文(繁體)
[@more@]選擇 安裝 Ubuntu 伺服器(I)

選擇安裝時用的語系

選擇所在的地區國家


不偵測鍵盤型式

選擇 鍵盤型式


設定主機名稱

建立一個新的使用者,並設定密碼




是否要加密使用者的家目錄

設定時區

分割硬碟


安裝系統

沒有經過 Proxy

設定 apt

設定套件更新的方式

設定要安裝的服務

安裝系統中

安裝 grub

終於完成安裝

Ubuntu Desktop 14.10 – 解決 gcin 的圖示無法出現在工作列

這裡使用的是傳統介面
參考文章:
Ubuntu 12.04 LTS (Precise Pangolin) beta 1 快正式登場 [論壇 – Ubuntu安裝問題] | Ubuntu 正體中文站

在工作列的前面,按 Win 鍵+Alt+滑鼠右鍵,選擇 加入面板(A)
[@more@]選擇 程式狀態通知區,然後按 加入

gcin 的圖示就會出現,但也會出現一個圖示

這個圖示是什麼呢?

原來是 ibus,我已經把它移除了,怎麼還陰魂不散?

選擇 偏好設定

不要勾選 在系統匣顯示圖示,然後按 關閉

還有一個礙眼的,選擇 文字輸入設定

不要勾選 在選單列顯示目前輸入來源

Ubuntu 14.10 Desktop i386 版本個人調整

安裝傳統桌面環境
$ sudo apt-get install gnome-session-fallback
選擇 GNOME Flashback(Compiz)GNOME Flashback(Metacity) 都可以

傳統桌面環境
[@more@]安裝 ssh,方便遠端登入管理
$ sudo apt-get install ssh

移除 Brasero 光碟燒錄程式
$ sudo apt-get remove –purge brasero-cdrkit brasero-common

移除 Cheese 網路攝影機
$ sudo apt-get remove –purge cheese cheese-common libcheese-gtk23 libcheese7

移除 Thunderbird 郵件
$ sudo apt-get remove –purge thunderbird thunderbird-gnome-support thunderbird-locale-en thunderbird-locale-en-us thunderbird-locale-zh-hant thunderbird-locale-zh-tw

移除 Transmission
$ sudo apt-get remove –purge transmission-common transmission-gtk

移除 掃描易
$ sudo apt-get remove –purge simple-scan

移除遊戲
$ sudo apt-get remove –purge aisleriot gnome-mahjongg gnome-mines gnome-sudoku

移除 ibus
$ sudo apt-get remove –purge gir1.2-ibus-1.0 ibus ibus-chewing ibus-gtk3 ibus-pinyin ibus-table ibus-table-cangjie3 ibus-table-cangjie5 libibus-1.0-5 libchewing3 libchewing3-data

安裝 gcin
$ sudo apt-get install gcin

設定 gcin(這裡建議不要用 sudo 來操作)
$ sudo im-config

如果出現下面的錯誤訊息

$ sudo chown -R test:test /home/test

安裝 Leafpad
$ sudo apt-get install leafpad

安裝 Chromium 瀏覽器
$ sudo apt-get install chromium-browser chromium-browser-l10n

中文輸入沒有問題,但還是沒有辦法出現 gcin 的圖示

安裝 Flash Player Plugin
$ sudo apt-get install pepperflashplugin-nonfree

$ sudo apt-get install flashplugin-installer

Firefox about:plugins

Chromium chrome://plugins

清除用不到的套件
$ sudo apt-get autoremove

Ubuntu 14.10 (Utopic Unicorn) 釋出

Ubuntu 14.10 (Utopic Unicorn) 於 10/23 釋出,有興趣的人可以上官方網站下載:
http://releases.ubuntu.com/14.10/

amd64 Desktop
http://releases.ubuntu.com/14.10/ubuntu-14.10-desktop-amd64.iso
i386 Desktop
http://releases.ubuntu.com/14.10/ubuntu-14.10-desktop-i386.iso

amd64 Server
http://releases.ubuntu.com/14.10/ubuntu-14.10-server-amd64.iso
i386 Server
http://releases.ubuntu.com/14.10/ubuntu-14.10-server-i386.iso

Cubie Truck 測試 – Lubuntu 篇 使用無線網路連線

因為 Cubie Truck 內建有無線網路,所以測試使用無線網路來進行連線
參考網頁:
tutorials:common:lubuntu_wifi_configuration [Cubieboard Docs]

切換身份為 root
$ su –

安裝相關設定套件
# apt-get install wireless-tools wpasupplicant

載入無線網路模組
# modprobe bcmdhd

讓開機能立即啟用
# echo bcmdhd >> /etc/modules

查看模組的使用
# lsmod | grep bcmdhd
bcmdhd                505137  0[@more@]

啟動無線網路卡 wlan0
# ifconfig wlan0 up

掃描可以使用的無線網路
# iwlist wlan0 scan
wlan0     Scan completed :
          Cell 01 – Address: A0:F3:C1:34:C4:26
                     ESSID:”CHTN_T07AW”
                    Mode:Managed
                    Frequency:2.437 GHz (Channel 6)
                    Quality:1/5  Signal level:-81 dBm  Noise level:-92 dBm
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
                              12 Mb/s; 48 Mb/s

進行連線
# iwconfig wlan0 essid “CHTN_T07AW”

產生編碼後的 key
# wpa_passphrase “CHTN_T07AW” 123456789 | grep -v ‘#psk’ | grep psk | awk -F’=’ ‘{print $2}’
7b1a762a689f76c82d9403c9a4cce22bbc6d6eb9fd0c900ca78e146626b57c11

修改網路組態,加入無線網路部分設定
# vim /etc/network/interfaces
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
        wpa-ssid “CHTN_T07AW”
        wpa-psk 7b1a762a689f76c82d9403c9a4cce22bbc6d6eb9fd0c900ca78e146626b57c11

重新啟動網路
# /etc/init.d/networking restart

先關閉 eth0 方便進行測試
# ifconfig eth0 down

查看 wlan0 無線網路卡網路組態
# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 98:3b:16:1e:67:d8
          inet addr:10.0.1.5  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: fe80::9a3b:16ff:fe1e:67d8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:117 errors:0 dropped:0 overruns:0 frame:0
          TX packets:131 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22069 (22.0 KB)  TX bytes:16739 (16.7 KB)

測試是否能正連線
# ping -c 4 140.111.66.1
PING 140.111.66.1 (140.111.66.1) 56(84) bytes of data.
64 bytes from 140.111.66.1: icmp_req=1 ttl=53 time=14.0 ms
64 bytes from 140.111.66.1: icmp_req=2 ttl=53 time=13.5 ms
64 bytes from 140.111.66.1: icmp_req=3 ttl=53 time=14.1 ms
64 bytes from 140.111.66.1: icmp_req=4 ttl=53 time=13.3 ms

— 140.111.66.1 ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3005ms

解決執行 ufw 出現的警告訊息

自己在設定 Linux 防火牆規則時,都是習慣使用 iptables 指令,把規則寫在 Script 檔,設定成開機時執行,比較不習慣使用第三方的套件來建立,因為後續要修改時會比較麻煩。
不過在 Cubie Truck 的 Ubuntu Server 似乎預設就有安裝 ufw(Uncomplicated Firewall),利用 ufw 來建立防火牆規則。
但在執行 ufw 時會出現一些警告訊息
# ufw status verbose
WARN: /lib is group writable!
WARN: /etc is group writable!
WARN: /etc/default is group writable!
WARN: /usr is group writable!
Status: inactive

看起來似乎是警告這些目錄的權限是群組可以寫入的[@more@]檢查一些這些目錄的權限,預設權限是 775
# ls -ld /lib /etc /etc/default /usr
drwxrwxr-x 96 root root 4096 Oct 18 10:53 /etc
drwxrwxr-x  2 root root 4096 Oct 16 23:18 /etc/default
drwxrwxr-x 21 root root 4096 Oct 16 23:18 /lib
drwxrwxr-x 10 root root 4096 Sep  6 17:54 /usr

把這些目錄的權限改成 751
# chmod 751 /lib /etc /etc/default /usr
# ls -ld /lib /etc /etc/default /usr
drwxr-x–x 96 root root 4096 Oct 18 10:53 /etc
drwxr-x–x  2 root root 4096 Oct 16 23:18 /etc/default
drwxr-x–x 21 root root 4096 Oct 16 23:18 /lib
drwxr-x–x 10 root root 4096 Sep  6 17:54 /usr

再次執行 ufw 時,就不會出現警告訊息了!
# ufw status verbose
Status: inactive

Debian / Ubuntu update-rc.d 用法 另一章

在這之前曾經試用 update.rc.d 來啟動或關閉服務,但很詭異的是有些服務,我明明沒有啟動,但有啟動,究竟是什麼原因呢?
這是在 Cubie Truck Ubuntu Server 14.04 中碰到的狀況。
如 Samba 服務
# netstat -antulp | egrep ‘:137|:138|:139|:445’
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      1597/smbd
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      1597/smbd
tcp6       0      0 :::139                  :::*                    LISTEN      1597/smbd
tcp6       0      0 :::445                  :::*                    LISTEN      1597/smbd
udp        0      0 192.168.1.255:137       0.0.0.0:*                           1587/nmbd
udp        0      0 192.168.1.105:137       0.0.0.0:*                           1587/nmbd
udp        0      0 0.0.0.0:137             0.0.0.0:*                           1587/nmbd
udp        0      0 192.168.1.255:138       0.0.0.0:*                           1587/nmbd
udp        0      0 192.168.1.105:138       0.0.0.0:*                           1587/nmbd
udp        0      0 0.0.0.0:138             0.0.0.0:*                           1587/nmbd
[@more@]使用 sysv-rc-conf –list 來列出服務的啟用狀態
# sysv-rc-conf –list
apache2      0:off      1:off   2:on    3:on    4:on    5:on    6:off
apparmor     S:on
atd
console-setu
cron
dbus
dns-clean    1:on       2:on    3:on    4:on    5:on
exim4        0:off      1:off   2:on    3:on    4:on    5:on    6:off
firstrun
friendly-rec
halt         0:on
irqbalance
killprocs    1:on
kmod
memcached    0:off      1:off   2:on    3:on    4:on    5:on    6:off
minidlna     0:off      1:off   2:on    3:on    4:on    5:on    6:off
mysql
networking
nmbd
ntp          1:off      2:on    3:on    4:on    5:on
ondemand     2:on       3:on    4:on    5:on
pppd-dns     1:on       2:on    3:on    4:on    5:on
pptpd        1:off      2:on    3:on    4:on    5:on
procps
rc.local     2:on       3:on    4:on    5:on
reboot       6:on
resolvconf
rsync        0:off      1:off   2:on    3:on    4:on    5:on    6:off
rsyslog
samba        2:off      3:off   4:off   5:off
samba-ad-dc  2:off      3:off   4:off   5:off
sendsigs     0:on       6:on
single       1:on
smbd
ssh
sudo
udev
umountfs     0:on       6:on
umountroot   0:on       6:on
urandom      0:on       6:on    S:on
vsftpd

目前的執行層級
# /sbin/runlevel
N 2

列出執行層級 2 啟動的服務,裡面根本沒有與 Samba 相關的服務
# sysv-rc-conf –list | grep 2:on
apache2      0:off      1:off   2:on    3:on    4:on    5:on    6:off
dns-clean    1:on       2:on    3:on    4:on    5:on
exim4        0:off      1:off   2:on    3:on    4:on    5:on    6:off
memcached    0:off      1:off   2:on    3:on    4:on    5:on    6:off
minidlna     0:off      1:off   2:on    3:on    4:on    5:on    6:off
ntp          1:off      2:on    3:on    4:on    5:on
ondemand     2:on       3:on    4:on    5:on
pppd-dns     1:on       2:on    3:on    4:on    5:on
pptpd        1:off      2:on    3:on    4:on    5:on
rc.local     2:on       3:on    4:on    5:on
rsync        0:off      1:off   2:on    3:on    4:on    5:on    6:off

列出 smbd / nmbd 服務,奇特的是沒有任何狀態
# sysv-rc-conf –list smbd
smbd
# sysv-rc-conf –list nmbd
nmbd

執行 sysv-rc-conf –level 2345 在 level 2345 層級關閉 smbd/nmbd 服務
# sysv-rc-conf –level 2345 smbd off
# sysv-rc-conf –level 2345 nmbd off

列出 smbd / nmbd 服務,終於有執行層級的狀態了!
# sysv-rc-conf –list smbd
smbd         2:off      3:off   4:off   5:off
# sysv-rc-conf –list nmbd
nmbd         2:off      3:off   4:off   5:off

重新啟動電腦
# reboot

重新開機後,發現還是會啟動 Samba Server

後來,我發現在 sys-rc-conf –list 看不到狀態的,似乎都會啟動
# sysv-rc-conf –list | egrep -v ‘on|off’
atd
dbus
firstrun
friendly-rec
irqbalance
kmod
mysql
networking
nmbd
procps
rsyslog
samba
samba-ad-dc
smbd
ssh
sudo
udev
vsftpd

真是不知道這是什麼狀態了,只能先在 /etc/rc.local 中把這些不想啟動的服務給停了,或是直接移除,眼不見為淨!
但是我天真了,開機後這些服務依然還是執行中!

後來又與 Banana Pi 的 Bananian 做比對,我說服我自己,這應該是特例,但我也馬上把這一個 Ubuntu 的 Image 也清除了!
# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.6 (wheezy)
Release:        7.6
Codename:       wheezy

# sysv-rc-conf –list
apache2      0:off      1:off   2:on    3:on    4:on    5:on    6:off
bootlogs     1:on       2:on    3:on    4:on    5:on
console-setu S:on
cpufrequtils 2:on       3:on    4:on    5:on
cron         2:on       3:on    4:on    5:on
exim4        0:off      1:off   2:on    3:on    4:on    5:on    6:off
fail2ban     0:off      1:off   2:on    3:on    4:on    5:on    6:off
halt         0:off
haveged      0:off      1:off   2:on    3:on    4:on    5:on    6:off
kbd          S:on
keyboard-set S:on
killprocs    1:on
kmod         S:on
loadcpufreq  2:on       3:on    4:on    5:on
motd         1:on       2:on    3:on    4:on    5:on
mysql        0:off      1:off   2:on    3:on    4:on    5:on    6:off
networking   0:off      6:off   S:on
noip2        0:off      1:off   2:on    3:on    4:on    5:on    6:off
ntp          2:on       3:on    4:on    5:on
openvpn      0:off      1:off   2:on    3:on    4:on    5:on    6:off
pppd-dns     S:on
procps       S:on
rc.local     2:on       3:on    4:on    5:on
reboot       6:off
rmnologin    2:on       3:on    4:on    5:on
rsync        2:on       3:on    4:on    5:on
rsyslog      0:off      1:off   2:on    3:on    4:on    5:on    6:off
screen-clean S:on
sendsigs     0:off      6:off
single       1:on
ssh          2:on       3:on    4:on    5:on
udev         S:on
udev-mtab    S:on
umountfs     0:off      6:off
umountroot   0:off      6:off
urandom      0:off      6:off   S:on
vsftpd       1:off      2:on    3:on    4:on    5:on

Cubie Truck Ubuntu Server
# lsb_release -a
No LSB modules are available.
Distributor ID: Linaro
Description:    Linaro 14.04
Release:        14.04
Codename:       trusty

# sysv-rc-conf –list
apache2      0:off      1:off   2:on    3:on    4:on    5:on    6:off
apparmor     S:on
atd
console-setu
cron
dbus
dns-clean    1:on       2:on    3:on    4:on    5:on
exim4        0:off      1:off   2:on    3:on    4:on    5:on    6:off
firstrun
friendly-rec
halt         0:on
irqbalance
killprocs    1:on
kmod
memcached    0:off      1:off   2:on    3:on    4:on    5:on    6:off
minidlna     0:off      1:off   2:on    3:on    4:on    5:on    6:off
mysql
networking
nmbd
ntp          1:off      2:on    3:on    4:on    5:on
ondemand     2:on       3:on    4:on    5:on
pppd-dns     1:on       2:on    3:on    4:on    5:on
pptpd        1:off      2:on    3:on    4:on    5:on
procps
rc.local     2:on       3:on    4:on    5:on
reboot       6:on
resolvconf
rsync        0:off      1:off   2:on    3:on    4:on    5:on    6:off
rsyslog
samba
samba-ad-dc
sendsigs     0:on       6:on
single       1:on
smbd
snmbd        2:off      3:off   4:off   5:off
ssh
sudo
udev
umountfs     0:on       6:on
umountroot   0:on       6:on
urandom      0:on       6:on    S:on
vsftpd

更換 Unutu Unity 為傳統桌面環境

實在用的很不習慣,所以只好改了!

安裝傳統桌面環境
$ sudo apt-get install gnome-session-fallback[@more@]重新開機後,點選 使用者帳號 後面的小圖

選擇 GNOME Flashback(Compiz)GNOME Flashback(Metacity) 都可以

GNOME Flashback(Compiz) 和 GNOME Flashback(Metacity)

或直接改用 MATE

MATE 桌面環境

改成了傳統的桌面環境,用起來習慣多了!