close

最近又把CB4 拿出來裝 Linux,發現 CB4 沒有再更新,可用的 Debian Linux 為 Debian 7 (Wheezy) ,這個版本已在 2020/6/30 停止支援和更新,所以就開始研究如何自己更新為新版...

第一個想法是有沒有現在的 IMAGE 可用,但找了找都沒有! 接下來只好自己動作更新....

一個 Linux 基本上是包含三部分

1.Boot Loader
2.Kernel
3.Root FS

我們要更新的是 Root FS

1.建立使用的環境

使用OS: Ubuntu 20.04

安裝所需軟體

$sudo apt-get install build-essential libncurses5-dev u-boot-tools qemu-user-static debootstrap git binfmt-support libusb-1.0-0-dev pkg-config

$sudo apt-get install gcc-arm-linux-gnueabihf

2 建立基本 ROOT FS

# debootstrap --foreign --no-check-gpg --arch=armhf jessie jessie

# cd jessie
# cp /usr/bin/qemu-arm-static usr/bin/
# chroot . /debootstrap/debootstrap --second-stage

2.1.修改 RootFS 中的設定
2.1.1.修改主机名
# echo “cubie” > etc/hostname

2.1.2.修改網路設定 etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo eth0
iface lo inet loopback
iface eth0 inet dhcp

2.1.3.修改 etc/modules,加上

sunxi_gmac
ump
mali
sunxi_cedar_mod

2.1.4.修改 etc/fstab 文件,制定系统自动挂载的文件系统。

tmpfs /tmp tmpfs size=30m 0

2.1.5.修改 ROOT 密碼
# chroot . passwd root

2.2. 安裝相關軟體

# export LC_ALL=C
# chroot . apt-get update

2.2.1. 安裝 locales
# chroot . apt-get install locales

2.2.2. 安裝 openssh-server

#chroot . apt-get install openssh-server

編輯 etc/ssh/sshd_config 讓 Root 可以由 SSH 登入

把 PermitRootLogin without-password

改成PermitRootLogin yes

2.2.3. 安裝 fbset

#chroot . apt-get install fbset

2.3. 收尾

安装完以后,把下载的临时文件删除,以减少基础系统的大小。执行下面命令

#chroot . apt-get clean

保存基础系统,
#tar -c * |gzip -9 > ../debian-armhf-stage2.1.tar.gz

3.更新 RootFS

接下來就是把建立的目錄取代原本的 RootFS,再把原本的 /lib/firmware 及 /lib/modules 複製進去即可完成,

開機後即更新至 Debian 8 (Jessie)

圖片

但世界沒有這麼美好,更新完 RootFS 之後會遇到一個嚴重的問題,Serial Console 無法啟動,所以無法經由 Serial Console 登入!

但其它功能很正常,如果你知道它的IP,你可經由 SSH 發登入!

這是因為 Serial Console 需要 Kernel 一個功能,所以才無法啟動,之後我自行更新了功能即可正常啟動!

圖片

 

arrow
arrow
    文章標籤
    debian Cubieboard4 Linux
    全站熱搜

    山哥 發表在 痞客邦 留言(0) 人氣()