Restructure building images, flashing and booting
This commit is contained in:
parent
4df7e93655
commit
4369df9673
5 changed files with 146 additions and 93 deletions
36
fastboot.py
Normal file
36
fastboot.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
import logging
|
||||
import subprocess
|
||||
|
||||
|
||||
def fastboot_erase_dtbo():
|
||||
subprocess.run(
|
||||
[
|
||||
'fastboot',
|
||||
'erase',
|
||||
'dtbo',
|
||||
],
|
||||
capture_output=True,
|
||||
)
|
||||
|
||||
|
||||
def fastboot_flash(partition, file):
|
||||
result = subprocess.run([
|
||||
'fastboot',
|
||||
'flash',
|
||||
partition,
|
||||
file,
|
||||
])
|
||||
if result.returncode != 0:
|
||||
logging.info(f'Failed to flash {file}')
|
||||
exit(1)
|
||||
|
||||
|
||||
def fastboot_boot(file):
|
||||
result = subprocess.run([
|
||||
'fastboot',
|
||||
'boot',
|
||||
file,
|
||||
])
|
||||
if result.returncode != 0:
|
||||
logging.fatal(f'Failed to boot {file} using fastboot')
|
||||
exit(1)
|
Loading…
Add table
Add a link
Reference in a new issue