plasma-phone-packaging / pm-flashtool

Tool for Flashing PM as LXC Container on top of CM
44 stars 27 forks source link

./pm-flash & ./flash-vendor error #33

Open fran-ny opened 5 years ago

fran-ny commented 5 years ago

I'm using these articles to set up Plasma Mobile for a Nexus 5x: https://www.plasma-mobile.org/neon-arch-reference-rootfs/ https://cubiclenate.com/2018/09/22/plasma-mobile-installation-on-nexus-5x/

I've just pulled the git repository, but the following commands are not working - not sure if this is an issue with me or you, any help would be greatly appreciated:

./pm-flash ./flash-vendor

/pm-flash

./flash-vendor

It seems that there were some recent changes with flashboot (for example ./flashboot command no longer works). Is this something you can help me with?

jbruechert commented 5 years ago

You need to install some dependencies on your system. In this case fastboot is missing. On debian and ubuntu, you can use sudo apt install fastboot (On older systems, the package name can be android-tools-fastboot instead).

fran-ny commented 5 years ago

Hi, thanks for the reply. I have fastboot installed. Here are a few outputs from commands (I already ran ./fastboot oem unlock, so it fails now). However, when I run ./pm-flash and ./flash-vendor I get the fastboot not found error. By the way I am on MacOS. Any ideas what could be wrong here? Thank you!

./fastboot oem unlock FAILED (remote: 'Already unlocked') Finished. Total time: 0.005s

./fastboot format cache mke2fs 1.44.3 (10-July-2018) Creating filesystem with 24576 4k blocks and 24576 inodes

Allocating group tables: done
Writing inode tables: done
Creating journal (1024 blocks): done Writing superblocks and filesystem accounting information: done

Sending 'cache' (68 KB) OKAY [ 0.087s] Writing 'cache' OKAY [ 0.018s] Finished. Total time: 0.207s

fran-ny commented 5 years ago

Oh, and I downloaded adb and fastboot again from here: https://developer.android.com/studio/releases/platform-tools, since we talked. If you can give me any more advice that'd be great, otherwise I'll try it on Linux.

jbruechert commented 5 years ago

It seems like fastboot isn't in your $PATH. This makes the script unable to find it.

Which system are you using? MacOS is not really supported.

fran-ny commented 5 years ago

I tried on MacOS both High Sierra and MoJave (MacBook Pro 2017). I just tried again on Ubuntu latest release (Macbook 2009). I get the same error. Can you help me understand how to make sure fastboot is on my $PATH? I'm not sure what else to try.

Like I said, it seems like in October the command ./fastboot stopped working, but when I run ./fastboot -h I can see it is there. Here is the output:

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.

boot image: boot KERNEL [RAMDISK [SECOND]] Download and boot kernel from RAM. flash:raw PARTITION KERNEL [RAMDISK [SECOND]] Create boot image and flash it. --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). --tags-offset Set tags offset (default: 0x00000100). --page-size BYTES Set flash page size (default: 2048). --header-version VERSION Set boot image header version. --os-version MAJOR[.MINOR[.PATCH]] Set boot image OS version (default: 0.0.0). --os-patch-level YYYY-MM-DD Set boot image OS security patch level.

Android Things: stage IN_FILE Sends given file to stage for the next command. get_staged OUT_FILE Writes data staged by the last command to a file.

options: -w Wipe userdata. -s SERIAL Specify a USB device. -s tcp|udp:HOST[:PORT] Specify a network device. -S SIZE[K|M|G] Break into sparse files no larger than SIZE. --slot SLOT Use SLOT; 'all' for both slots, 'other' for non-current slot (default: current active slot). --set-active[=SLOT] Sets the active slot before rebooting. --skip-secondary Don't flash secondary slots in flashall/update. --skip-reboot Don't reboot device after flashing. --disable-verity Sets disable-verity when flashing vbmeta. --disable-verification Sets disable-verification when flashing vbmeta. --wipe-and-use-fbe Enable file-based encryption, wiping userdata. --unbuffered Don't buffer input or output. --verbose, -v Verbose output. --version Display version. --help, -h Show this message.

jbruechert commented 5 years ago

If a binary is in $PATH, it can be used independently of the directory you are in. In that case you can run fastboot everywhere. If the binary is only in your local folder, you need to run ./fastboot, which doesn't work with the flashtool.

jbruechert commented 5 years ago

You can check if the binary is in your path using command -v fastboot. If it correctly returns the path to the fastboot executable, the binary is in $PATH. You can print the list of directories included in $PATH using echo $PATH.