ubuntu 16.04 fastboot 可烧写

1.  将 linux fastboot 程序拷贝到 /usr/bin/fastboot 路径下

2. 在 /usr/share/bash-completion/completions/fastboot 路径下创建 fastboot 脚本

_fastboot()  
{
    local cur prev opts
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
    opts="reboot boot flash devices -w reboot-bootloader"


    case "$prev" in
    reboot | devices | -w | reboot-bootloader)
        COMPREPLY=()
        return 0
        ;;
    flash)no permissions
        COMPREPLY=( $(compgen -W "boot system recovery radio userdata rpm sbl1 modem tz persist splash aboot" -- $cur ))
        return 0
        ;;
    boot)
        COMPREPLY=( $(compgen -o filenames -G "${cur}*.img"))
        return 0
        ;;
    *)
        local prev2="${COMP_WORDS[COMP_CWORD-2]}"
        local prev3="${COMP_WORDS[COMP_CWORD-3]}"
        if [ "$prev2" == "flash" ];then
            COMPREPLY=( $(compgen -o filenames -G "${cur}*.img"))
            return 0
        elif [ "$prev2" == "boot" ];then
            COMPREPLY=()
            return 0
        elif [ "$prev3" == "flash" ];then
            COMPREPLY=()
            return 0
        fi
        ;;
    esac


    COMPREPLY=( $(compgen -W "$opts" -- $cur) )
    return 0
}
complete -F _fastboot fastboot


3. 编辑或新建 /etc/udev/rules.d/51-android.rules 文件,增加如下内容,解决下面的 no permissions 权限错误

d00d 为 lsusb 看到的 id,如下信息

Bus 003 Device 011: ID 18d1:d00d Google Inc.

ATTR{idProduct}=="d00d", SYMLINK+="android_fastboot", MODE="0660", GROUP="plugdev", TAG+="uaccess", SYMLINK+="android"

fastboot devices
no permissions (user in plugdev group; are your udev rules wrong?); see [http://developer.android.com/tools/device.html]    fastboot

4. 重启 udev 服务

sudo service udev restart

sudo udevadm trigger

5. fastboot devices 测试一下,成功识别设备即可进行下面的烧录

fastboot flash boot boot.img
target reported max download size of 536870912 bytes
sending 'boot' (12409 KB)...
OKAY [  0.303s]
writing 'boot'...
OKAY [  0.049s]
finished. total time: 0.351s

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
linux ubuntu fastboot 下载 方法1: GSI Flashing Procedure For Android-Q Fresh Launch Build(DP Enabled): Flash META Change directory to Apps path Flash below Apps and GSI image. Apps Build flashing fastboot flash persist persist.img cd secondary-boot fastboot flash boot_a boot.img (boot.img image for CTS-on-GSI, boot-debug.img for VTS testing) fastboot flash dtbo_a dtbo.img fastboot flash recovery_a recovery.img fastboot flash super super.img fastboot flash userdata userdata.img fastboot flash vbmeta_a vbmeta.img fastboot flash vbmeta_system_a vbmeta_system.img GSI Flashing steps: fastboot reboot fastboot fastboot flash system fastboot -w fastboot flashing lock fastboot reboot NOTE: Dynamic Partition mandatory for android-Q Fresh Launch devices. Device should not come out of fastboot mode between Apps flashing and GSI flashing. For Android-Q Upgraded Build or Android-P Builds: Apps and GSI image flashing: fastboot flash userdata userdata.img fastboot flash persist persist.img cd secondary-boot fastboot flash boot_a boot.img fastboot flash dtbo_a dtbo.img fastboot flash vendor_a vendor.img fastboot flash system_a fastboot --disable-verification flash vbmeta_a vbmeta.img fastboot flashing lock fastboot reboot 方法2: 这个版本刷GSI时,oem unlock的操作有更新如下: adb reboot-bootloader fastboot oem sim-allowunlock (允许解锁) fastboot flashing unlock (这里需要按 音量上键 确认) adb reboot-bootloader fastboot flash system system_xxxxxxxxxxx.img fastboot --disable-verification flash vbmeta vbmeta.img fastboot reboot 取消验证,取消AVB验证 fastboot --disable-verification flash vbmeta vbmeta.img 之后就可以通过fastboot烧录boot.img vendor.img system.img 单独烧录。 3.4 AndroidO userdebug版本刷机时禁止dm-verity AndroidO dm-verity disable flag存在于vbmeta.img(keystore分区);而老版本是放置在system.img分区的dm-verity metadata。 1)在设置打开OEM unlocking选项 2)在设置打开USB debugging选项 3)adb reboot bootloader 4)fastboot flashing unlock和fastboot oem unlock 5)fastboot --disable-verity --disable-verification flash vbmeta vbmet
fastboot android10版本 ubuntu linux平台 fastboot version 28.0.2-PD02.200305.0422 $ fastboot -h usage: fastboot [OPTION...] COMMAND... flashing: update ZIP Flash all partitions from an update.zip package. flashall Flash all partitions from $ANDROID_PRODUCT_OUT. On A/B devices, flashed slot is set as active. Secondary images may be flashed to inactive slot. flash PARTITION [FILENAME] Flash given partition, using the image from $ANDROID_PRODUCT_OUT if no filename is given. basics: devices [-l] List devices in bootloader (-l: with device paths). getvar NAME Display given bootloader variable. reboot [bootloader] Reboot device. locking/unlocking: flashing lock|unlock Lock/unlock partitions for flashing flashing lock_critical|unlock_critical Lock/unlock 'critical' bootloader partitions. flashing get_unlock_ability Check whether unlocking is allowed (1) or not(0). advanced: erase PARTITION Erase a flash partition. format[:FS_TYPE[:SIZE]] PARTITION Format a flash partition. set_active SLOT Set the active slot. oem [COMMAND...] Execute OEM-specific command. gsi wipe|disable Wipe or disable a GSI installation (fastbootd only). boot image: boot KERNEL [RAMDISK [SECOND]] Download and boot kernel from RAM. flash:raw PARTITION KERNEL [RAMDISK [SECOND]] Create boot image and flash it. --dtb DTB Specify path to DTB for boot image header version 2. --cmdline CMDLINE Override kernel command line. --base ADDRESS Set kernel base address (default: 0x10000000). --kernel-offset Set kernel offset (default: 0x00008000). --ramdisk-offset Set ramdisk offset (default: 0x01000000)

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值