嘗試向樹莓派3B引入Drbian 9 arm64-PART 2

Stage 1:使用debootstrap製做64位組件

儘管內核工做於64位模式,但系統大多數組件仍舊處於32位模式下。
咱們的目標是引入Debian 9 arm64,天然會想到使用debootstrap
在樹莓派上,給一張SD卡分兩個區:linux

  • 一個在前面,大小100M左右,使用mkfs.vfat類型爲W95 FAT32
  • 一個佔用後面全部的空間,視/boot/cmdline.txtrootfstype的設置選擇分區格式

而後(在樹莓派上)開幹:
sudo debootstrap --verbose --arch=arm64 stretch . https://mirrors.ustc.edu.cn/debian/
編輯sources.listbootstrap

deb http://mirrors.ustc.edu.cn/debian/ stretch main
deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/ jessie main non-free contrib

apt.conf
APT::Default-Release "stretch";
Chroot和以前的準備工做:數組

sudo mount -t proc proc proc
sudo mount -t sysfs sysfs sys
sudo mount -o bind /dev dev
sudo chroot .

視具體狀況安裝軟件包。服務器

apt install hostapd wpasupplicant udhcpd screen dnsmasq sudo openssh-server firmware-brcm80211 ...
  • firmware-brcm80211:使系統識別樹莓派3板載網卡
  • hostapd,udhcpd,dnsmasq:啓動AP必備
  • wpasupplicant:用於鏈接Wifi熱點
  • openssh-server:SSH服務器
  • sudo,screen:這兩個想必你們都據說過吧……

退出Chroot環境,複製配置文件及其它核心組件,例如:ssh

/boot
/lib/modules
/etc/passwd
/etc/shadow
/etc/sudoers
/etc/hostapd
/etc/default
/etc/udhcpd.conf
/etc/udev/
/etc/dnsmasq.conf
...

成功啓動。
可是有煩人的提示(若是沒有就無視掉吧……):
ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem.so' from /etc/ld.so.preload cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
解決方案顯而易見:ui

sudo mv /etc/ld.so.preload /etc/ld.so.preload.bak
sudo touch /etc/ld.so.preload

若是你使用了一張新的SD卡,記得編輯/etc/fstab!code

Stage 2:站穩腳跟

*執行apt-get update,提示:server

Ign:1 https://mirrors.ustc.edu.cn/debian stretch InRelease
Get:2 https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease [22.9 kB]
Hit:2 https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease
Get:3 https://mirrors.ustc.edu.cn/debian stretch Release [113 kB]
Hit:3 https://mirrors.ustc.edu.cn/debian stretch Release
Can't locate Storable.pm in @INC (you may need to install the Storable module) (@INC contains: /etc/perl /usr/local/lib/aarch64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/aarch64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/aarch64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/aarch64-linux-gnu/perl-base) at /usr/bin/apt-show-versions line 37.
BEGIN failed--compilation aborted at /usr/bin/apt-show-versions line 37.
Reading package lists... Done
N: Skipping acquire of configured file 'main/binary-arm64/Packages' as repository 'https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease' doesn't support architecture 'arm64'
N: Skipping acquire of configured file 'non-free/binary-arm64/Packages' as repository 'https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease' doesn't support architecture 'arm64'
N: Skipping acquire of configured file 'contrib/binary-arm64/Packages' as repository 'https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease' doesn't support architecture 'arm64'
N: Skipping acquire of configured file 'ui/binary-arm64/Packages' as repository 'https://mirrors.ustc.edu.cn/archive.raspberrypi.org jessie InRelease' doesn't support architecture 'arm64'
E: Problem executing scripts APT::Update::Post-Invoke-Success 'test -x /usr/bin/apt-show-versions || exit 0 ; apt-show-versions -i'
E: Sub-process returned an error code

筆者嘗試執行sudo apt-get install apt-show-versions,問題解決。dns

小結

路曼曼其修遠兮,吾將上下而求索。ip

目前整個系統僅僅只是能用,還有許多不完美的地方。

更新

4.12的內核能夠使樹莓派工做得更好,ACT燈和VCHI將正常工做。

相關文章
相關標籤/搜索