Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid command resize-logical-partition:system_a:1373093888 #252

Closed
lefuglyduck opened this issue Jan 15, 2024 · 10 comments · Fixed by #253
Closed

Invalid command resize-logical-partition:system_a:1373093888 #252

lefuglyduck opened this issue Jan 15, 2024 · 10 comments · Fixed by #253

Comments

@lefuglyduck
Copy link

After flashing both partitions with the factory grapheneOS images. I can only get to this step.
~/Desktop/avbroot/extracted$ for image in *.img; do
partition=$(basename "${image}")
partition=${partition%.img}
fastboot flash "${partition}" "${image}"
done
Sending 'boot_a' (65536 KB) OKAY [ 1.847s]
Writing 'boot_a' OKAY [ 0.245s]
Finished. Total time: 2.096s
Sending 'init_boot_a' (8192 KB) OKAY [ 0.246s]
Writing 'init_boot_a' OKAY [ 0.033s]
Finished. Total time: 0.283s
Resizing 'system_a' FAILED (remote: 'Invalid command resize-logical-partition:system_a:1373093888')
fastboot: error: Command failed
Sending 'vbmeta_a' (8 KB) OKAY [ 0.001s]
Writing 'vbmeta_a' OKAY [ 0.037s]
Finished. Total time: 0.039s
Sending 'vendor_boot_a' (65536 KB) OKAY [ 1.876s]
Writing 'vendor_boot_a' OKAY [ 0.238s]
Finished. Total time: 2.116s

Luckily I have the other partition so no issues.

@pascallj
Copy link
Contributor

Have you tried GrapheneOS without using avbroot before to see if it actually works? This doesn't seem like a problem caused by avbroot to me.

Also what fastboot version are you using? Have you tried the standalone version as described in the GrapheneOS CLI Install guide?

@chenxiaolong
Copy link
Owner

Oops, I overlooked this when updating the documentation after avbroot started patching system.img.

The problem is that recent Android versions have 2 fastboot modes:

  • The bootloader has its own fastboot mode. This can flash regular partitions.
  • Recovery mode has a new fastbootd feature. This can flash dynamic/logical partitions.

So the procedure should be:

  1. Reboot to bootloader for regular fastboot
  2. Flash all of the extracted partitions besides system.img
  3. Reboot to fastbootd with fastboot reboot-fastboot
  4. Flash system.img

I need to find a good way to document that in the README without turning this step into a big script.

chenxiaolong added a commit that referenced this issue Jan 16, 2024
`fastboot flashall` is identical to the `fastboot update` command used
by the Pixel factory images, except it reads from a directory instead of
a zip file. It knows how to flip between the fastboot and fastbootd
modes without user intervention.

This is a bit slower than the old method of only flashing the partition
images that were modified, but is much less accident-prone and is a well
supported and tested feature of fastboot.

Fixes: #252

Signed-off-by: Andrew Gunnerson <[email protected]>
chenxiaolong added a commit that referenced this issue Jan 16, 2024
`fastboot flashall` is identical to the `fastboot update` command used
by the Pixel factory images, except it reads from a directory instead of
a zip file. It knows how to flip between the fastboot and fastbootd
modes without user intervention.

This is a bit slower than the old method of only flashing the partition
images that were modified, but is much less accident-prone and is a well
supported and tested feature of fastboot.

Fixes: #252

Signed-off-by: Andrew Gunnerson <[email protected]>
@dementeb
Copy link

dementeb commented Jan 27, 2024

Wow, it definitely should be in README ;)

3 day of attempts...
"I wll always read issues"

@lefuglyduck
Copy link
Author

So the procedure should be:

1. Reboot to bootloader for regular fastboot

2. Flash all of the extracted partitions besides `system.img`

3. Reboot to fastbootd with `fastboot reboot-fastboot`

4. Flash `system.img`

I need to find a good way to document that in the README without turning this step into a big script.

I seen your commit, but I don't see this step anywhere in readme.md.

I see you added this step though:

ANDROID_PRODUCT_OUT=extracted fastboot flashall

Is this supposed to be equivalent to steps above?

@chenxiaolong
Copy link
Owner

The instructions in the new commit (https://github.com/chenxiaolong/avbroot/pull/253/files?short_path=b335630#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5) are an easier way to accomplish the same thing. I haven't merged the changes yet because although I'm pretty confident it'll work, I haven't had the time to factory reset my device and test it myself.

@danielphan2003
Copy link

Where is the android-info.txt that fastboot flashall requires?

@chenxiaolong
Copy link
Owner

chenxiaolong commented Jan 31, 2024

Where is the android-info.txt that fastboot flashall requires?

An empty android-info.txt should work. I'll update #253 after work today to have avbroot extract generate it.

EDIT: Hmm, no, looks like more stuff is needed. I'll have to investigate.

@danielphan2003
Copy link

For now you can extract android-info.txt from the factory image:

image

@chenxiaolong
Copy link
Owner

You might also need super_empty.img from there too.

@chenxiaolong
Copy link
Owner

For now, I've updated README.md in 8054934 to describe the manual steps I've suggested above.

Once I figure out exactly what is needed to get the fastboot flashall method working, we'll switch over to that. I'll keep discussion about the flashall method in #253.

chenxiaolong added a commit that referenced this issue Feb 1, 2024
`fastboot flashall` is identical to the `fastboot update` command used
by the Pixel factory images, except it reads from a directory instead of
a zip file. It knows how to flip between the fastboot and fastbootd
modes without user intervention.

This is a bit slower than the old method of only flashing the partition
images that were modified, but is much less accident-prone and is a well
supported and tested feature of fastboot.

Fixes: #252

Signed-off-by: Andrew Gunnerson <[email protected]>
chenxiaolong added a commit that referenced this issue Feb 1, 2024
`fastboot flashall` is identical to the `fastboot update` command used
by the Pixel factory images, except it reads from a directory instead of
a zip file. It knows how to flip between the fastboot and fastbootd
modes without user intervention.

This is a bit slower than the old method of only flashing the partition
images that were modified, but is much less accident-prone and is a well
supported and tested feature of fastboot.

Fixes: #252

Signed-off-by: Andrew Gunnerson <[email protected]>
chenxiaolong added a commit that referenced this issue Feb 1, 2024
`fastboot flashall` is identical to the `fastboot update` command used
by the Pixel factory images, except it reads from a directory instead of
a zip file. It knows how to flip between the fastboot and fastbootd
modes without user intervention.

This is a bit slower than the old method of only flashing the partition
images that were modified, but is much less accident-prone and is a well
supported and tested feature of fastboot.

Fixes: #252

Signed-off-by: Andrew Gunnerson <[email protected]>
chenxiaolong added a commit that referenced this issue Feb 3, 2024
`fastboot flashall` is identical to the `fastboot update` command used
by the Pixel factory images, except it reads from a directory instead of
a zip file. It knows how to flip between the fastboot and fastbootd
modes without user intervention.

This is a bit slower than the old method of only flashing the partition
images that were modified, but is much less accident-prone and is a well
supported and tested feature of fastboot.

Fixes: #252

Signed-off-by: Andrew Gunnerson <[email protected]>
chenxiaolong added a commit that referenced this issue Feb 3, 2024
`fastboot flashall` is identical to the `fastboot update` command used
by the Pixel factory images, except it reads from a directory instead of
a zip file. It knows how to flip between the fastboot and fastbootd
modes without user intervention.

This is a bit slower than the old method of only flashing the partition
images that were modified, but is much less accident-prone and is a well
supported and tested feature of fastboot.

Fixes: #252

Signed-off-by: Andrew Gunnerson <[email protected]>
chenxiaolong added a commit that referenced this issue Feb 4, 2024
`fastboot flashall` is identical to the `fastboot update` command used
by the Pixel factory images, except it reads from a directory instead of
a zip file. It knows how to flip between the fastboot and fastbootd
modes without user intervention.

This is a bit slower than the old method of only flashing the partition
images that were modified, but is much less accident-prone and is a well
supported and tested feature of fastboot.

Fixes: #252

Signed-off-by: Andrew Gunnerson <[email protected]>
chenxiaolong added a commit that referenced this issue Apr 14, 2024
`fastboot flashall` is identical to the `fastboot update` command used
by the Pixel factory images, except it reads from a directory instead of
a zip file. It knows how to flip between the fastboot and fastbootd
modes without user intervention.

This is a bit slower than the old method of only flashing the partition
images that were modified, but is much less accident-prone and is a well
supported and tested feature of fastboot.

Fixes: #252

Signed-off-by: Andrew Gunnerson <[email protected]>
chenxiaolong added a commit that referenced this issue Apr 15, 2024
`fastboot flashall` is identical to the `fastboot update` command used
by the Pixel factory images, except it reads from a directory instead of
a zip file. It knows how to flip between the fastboot and fastbootd
modes without user intervention.

Fixes: #252

Signed-off-by: Andrew Gunnerson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants