Adrian revised this gist . Go to revision
1 file changed, 21 insertions
gistfile1.txt(file created)
@@ -0,0 +1,21 @@ | |||
1 | + | diff --git a/msm-firmware-loader.sh b/msm-firmware-loader.sh | |
2 | + | index c404553..d2c06a8 100644 | |
3 | + | --- a/msm-firmware-loader.sh | |
4 | + | +++ b/msm-firmware-loader.sh | |
5 | + | @@ -25,11 +25,14 @@ set -x | |
6 | + | # https://source.android.com/docs/core/architecture/bootloader/updating#slots | |
7 | + | ab_get_slot() { | |
8 | + | if command -v qbootctl > /dev/null; then | |
9 | + | - ab_slot_suffix=$(qbootctl -a | grep -o 'Active slot: ..' | cut -d ":" -f2 | xargs) || : | |
10 | + | + ab_slot_suffix=$(qbootctl -a | grep -oE 'Active slot: ((_[ab])|(\(null\)))' | cut -d ":" -f2 | xargs) || : | |
11 | + | else | |
12 | + | ab_slot_suffix=$(grep -o 'androidboot\.slot_suffix=..' /proc/cmdline | cut -d "=" -f2) || : | |
13 | + | fi | |
14 | + | - echo "$ab_slot_suffix" | |
15 | + | + if [ "$ab_slot_suffix" != "(null)" ] | |
16 | + | + then | |
17 | + | + echo "$ab_slot_suffix" | |
18 | + | + fi | |
19 | + | } | |
20 | + | ||
21 | + | # Configurations: |
Newer
Older