Debian 64位元安裝教學(測試中)
下載樹梅派基金會最新64位元測試檔案: https://raspi.debian.net/
Windows環境下可使用win32DiskImager燒錄
燒錄好放進樹梅派
接上螢幕 鍵盤滑鼠 開機
輸入root 以超級使用者模式執行指令
設定無線網路
Connect to WiFi network from command line in Linux
啟用無線網路
ip link set dev wlan0 up
掃描無線網路
iwlist wlan0 scan | grep -i ssid
連線到無線網路
確認家裡無線網路加密型態,大部分都是WPA/WPA2混和加密
產生WPA/WPA2加密設定檔
使用wpa_supplicant工具
wpa_passphrase SSID_Name >> /etc/wpa_supplicant.conf SSID_pswd
檢查檔案內容
cat /etc/wpa_supplicant.conf
使用設定檔連線
wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf
- -B means run wpa_supplicant in the background.
- -D specifies the wireless driver. wext is the generic driver.
- -c specifies the path for the configuration file.
從DHCP伺服器取得IP位址
dhclient wlan0
檢查自己的ip位址
ip addr
測試網路狀態 (google位址)
ping 8.8.8.8
進行更新
apt update
apt upgrade
檢查系統核心版本
uname -r
檢查系統硬體架構
umane -m
接下來為了要遠端連線 需要建立一位使用者
adduser username
username是你的使用者名稱
接著輸入密碼、確認密碼
然後會問你一些要填入通訊錄資料 這些不重要全部按Enter跳過
然後按Y確認資訊
接著將使用者加入超級使用者群組
usermod -aG sudo username
- usermod is the tool that modifies a user account.
- -aG is the option that tells the command to add the user to a specific group. The -a option adds a user to the group without removing it from current groups. The -G option states the group where to add the user. In this case, these two options always go together.
- sudo is the group we append to the above options. In this case, it is sudo, but it can be any other group.
- username is the name of the user account you want to add to the sudo group.
確認使用者群組
getent group sudo
會列出超級使用者群組
到此就可以使用winsown電腦或其他作業系統電腦透過ssh連線至Rpi4
在本地端安裝sudo指令
apt-get install sudo -y
這樣遠端連線才能使用sudo指令
首先使用cmd輸入
ssh username@rpi_ip_address
如 ssh johnson@192.168.0.8
接著輸入yes確認連線
輸入密碼即可完成連線
!!開機不會自動連線
安裝gnome桌面
sudo apt-get install task-gnome-desktop
將gnome設定成系統預設
systemctl set–default graphical.target
重新啟動系統
reboot
重新啟動gnome desktop module
systemctl restart gdm.service
接著就可以看到gnome桌面了
接下來將自動休眠關閉
如果不關閉 gnome會自動讓Rpi進入休眠,但是因為Rpi沒有電源鍵,所以無法喚醒 會休眠到無止境
點選setting power auto suspand Never
接下來基本上的運行已經完成,為了方便除錯以及找查資料,建議使用ssh連線進樹梅派,以便複製貼上指令。
首先要確認一下所有硬體設備是否正常運作
輸入
sudo dmesg
查看硬體狀態
筆者安裝的當下是使用
20210210_raspi_4_buster.img.xz
使用Sandisk 16GB C10記憶卡
這裡可以另外輸入
sudo gmesg >> ~/Document/dmesg.log
將dmesg指令所傳回的資料儲存成dmesg.log 位於~/Document下方。
這樣未來要使用就可以直接從這個檔案複製貼上。
接下來一步一步將每個錯誤google找解法。
我的第一個是
[ 11.765253] platform regulatory.0: firmware: failed to load regulatory.db (-2)
[ 11.776838] firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware
這個錯誤是wifi的基礎設施資料庫
https://www.kernel.org/doc/html/latest/networking/regulatory.html
下方連結說明 regulatory domain的功能:
https://wiki.archlinux.org/index.php/Network_configuration/Wireless#Respecting_the_regulatory_domain
“The regulatory domain, or “regdomain”, is used to reconfigure wireless drivers to make sure that wireless hardware usage complies with local laws set by the FCC, ETSI and other organizations”
(翻譯)
使用
iw reg get
可以得到目前電腦設備使用的regulatory代碼(基於alpha2)
預設是00 也就是全球
我們位於台灣,因此最好將台灣的設定檔安裝到電腦中
參考解法:
https://unix.stackexchange.com/questions/459518/where-to-paste-regulatory-db-and-how
前往https://kernel.googlesource.com/pub/scm/linux/kernel/git/sforshee/wireless-regdb/
下載最新版本regulatory檔案
regulatory.db 以及 regulatory.db.p7s
此動作可以直接在rpi的gnome視窗做下載
(因為我也不知道怎麼用ssh丟進去)
對連結點右鍵 令存新檔 先儲存到Download資料夾
下載好後,在Rpi端輸入
cd Download
cp regulatory.db regulatory.db.p7s /lib/firmware
將兩個檔案複製到lib/firmware下方
重新啟動系統
sudo reboot
再輸入一次sudo dmesg就發現剛剛的錯誤消失了。
iw 指令說明:
下一步是針對錯誤
[ 10.480433] brcmfmac mmc0:0001:1: firmware: failed to load brcm/brcmfmac43455-sdio.clm_blob (-2)
進行處理
老實說,現在wifi運作得很順利,我其實不太想處理這兩個關於wifi韌體的錯誤,但是為了讓dmesg好看一點,還是處理一下好了
首先我們先下載以後一定會用到的wget工具
sudo apt install wget
接著將工作資料夾移動到
下方
cd /lib/firmware/brcm
前往
https://github.com/RPi-Distro/firmware-nonfree/blob/master/brcm/brcmfmac43455-sdio.clm_blob
下載遺失的檔案
sudo wget https://github.com/RPi-Distro/firmware-nonfree/blob/master/brcm/brcmfmac43455-sdio.clm_blob
等他下載好 重新開機
sudo reboot
重開機之後發現wifi不見了 趕緊把剛剛載的檔案刪掉然後重開機 ㄎㄎ
重開機之後就好了 恢復正常
因為raspberry pi 4 b+ 使用
/lib/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt
這個檔案將無線網路卡以及藍芽的設定設置好,因此可以忽略dmesg中關於Brodcom(bdcm)的錯誤訊息
雖然很方便 但是之後未來如果實際遇到無線網路卡的安裝狀況,還是需要上網到Debian 或者linux kernel 關於firmware的網頁找驅動程式。
現在剩下最後一個問題:
GNOME視窗的解析度不是1920*1080,我們要調整螢幕設定來更改
https://www.raspberrypi.org/documentation/configuration/config-txt/README.md
https://webtechie.be/post/2020-09-29-64bit-raspbianos-on-raspberrypi4-with-usbboot/
下載RaspiOS 64-bit version