Linux fastboot 用法學習歸納

2021-07-12 03:16:26 字數 2826 閱讀 1335

最近一衝動就將 windows 系統給全部格式化掉了,完全地換上了 ubuntu 系統。

不過好在是 windows 輕度使用者,加之原來工作也一般是在 ubuntu 的虛擬機器 + 伺服器中,所以過渡到 linux 環境下也並沒有多大的不適。

最蛋疼的有三點,

1、onenote 的缺失;只能用 web 版的,但是編輯起來太不方便了,只能用來查原來記的東西。

2、 outlook 的缺失; 耗時近一天配置好了雷鳥。

3、windows 下燒錄工具 researchdownload 等工具的缺失; 好在找到了兩種曲線救國的辦法。(或者說這才是正道,那些燒錄工具才是 windows 使用者的曲線救國方式)

這兩種燒錄方法就是 dd 和 fastboot。前者是針對與 sd卡的,後者是針對與 nandflash 的,所以用了幾天的 fastboot 正好就將知識點歸納總結一下。

要進入 fastboot 一般是使用 adb reboot bootloader ,所以第一步是安裝 adb 工具。

你可以先直接

$adb
或者

$fastboot
檢視是否有安裝 adb 或者 fastboot

如果沒裝利用如下指令進行安裝

sudo add-apt

-repository ppa:nilarimogard/webupd8

sudo apt-get update

sudo apt-get install android-tools

-adb android-tools

-fastboot

用 usb 連線好裝置後

adb devices
發現 device not found

查閱資料後發現可能沒有自動識別裝置驅動,展訊平台的安卓裝置是通過如下方式來實現安裝:

su

ls ~/.android/ 看是否有 adb_usb.ini 這個檔案,如果沒有的話

vi adb_usb.ini 建立檔案並且輸入 0x1782 儲存並退出

重啟 adb

sudo adb kill-server

sudo adb start-server

接下來用 adb devices 看看裝置出來了沒有吧,應該就 ok 了。

安卓裝置的分割槽,每個分割槽都有對應的 img 檔案對應:

splash1 開機動畫

recovery 資料恢復區

boot 核心

system 系統區

cache 資料快取區

userdata 使用者資料區

直接用 fastboot 命令也可以看到幫助手冊,說的非常詳細。

update reflash device from update.zip //通過.zip壓縮包進行刷機

flashall 「flash boot」 + 「flash system」 //燒錄kernel 和 system

flash [ ] write a file to a flash partition

erase erase a flash partition

getvar display a bootloader variable //獲取 bootloader 可以配置的變數

boot [ ] download and boot kernel

flash:raw boot [ ] create bootimage and flash it

devices list all connected devices

reboot reboot device normally

reboot-bootloader reboot device into bootloader

options:

-w erase userdata and cache

-s specify device serial number

-p specify product name

-c override kernel commandline

-i specify a custom usb vendor id

/* 擦除分割槽 */

fastboot erase //fastboot erase boot 或 fastboot erase system

/* 燒錄分割槽 */

fastboot flash //fastboot flash boot boot.img 或 fastboot flash system system.img

/* 燒錄所有分割槽 */

fastboot flashall

/* 一次燒寫 boot system recovery 分割槽 */

zip a.img b.img c.img

//zip image.zip boot.img system.img recovery.img

fastboot update

//fastboot update image.zip

/* 燒錄開機畫面 */

fastboot flash splash1 // 開機畫面

/* 重啟 */

fastboot reboot

另外 bootloader 的燒寫:

fastboot flash 2ndbl u-boot

.bin //燒寫 uboot //針對展訊平台,其他平台暫時不詳

stack用法,queue用法,

stack stack 模板類的定義在標頭檔案中。stack 模板類需要兩個模板引數,乙個是元素型別,乙個容器型別,但只有元素型別是必要 的,在不指定容器型別時,預設的容器型別為deque。定義stack 物件的示例 如下 stack s1 stack s2 stack 的基本操作有 入棧,如例 s...

stack用法,queue用法,

stack stack 模板類的定義在標頭檔案中。stack 模板類需要兩個模板引數,乙個是元素型別,乙個容器型別,但只有元素型別是必要 的,在不指定容器型別時,預設的容器型別為deque。定義stack 物件的示例 如下 stack s1 stack s2 stack 的基本操作有 入棧,如例 s...

object args用法 args的用法

object args用法 args和 kwargs主要用於函式定義中。args和 kwargs允許您將可變數量的引數傳遞給函式。變數在這裡的含義是,您事先不知道使用者可以將多少個引數傳遞給您的函式,因此在這種情況下,您將使用這兩個關鍵字。args用於將非關鍵字的可變長度引數列表傳送到函式。這是乙個...