hashbang/os

Update datetime to allow to sideload ota without downgrade protection kicking in

ypid opened this issue · 7 comments

ypid commented

First of all think you so much for this robust looking local build system! I come from building Copperhead OS and later Rattlesnake OS on my private infrastructure. With Rattlesnake OS it was really messy because it was basically manual. I reviewed your scripts. Not in depth yet but so far I could not find any flaws.

To the question. When I tried to sideload the Hashbang OS ota update, I got:

E:Update package is older than the current build, expected a build newer than timestamp 1547037537 but package has timestamp 1543792453 and downgrade not allowed.

Apparently the datetime in https://github.com/hashbang/os/blob/master/config.yml#L5 seems static. Is this how it is supposed to be? Does the Hashbang OS recovery not have downgrade protection?

Also, currently my build failed to boot, do you know if someone tested this upgrade path Rattlesnake OS -> Hashbang OS on a Google Pixel (sailfish)?

Apparently the datetime in https://github.com/hashbang/os/blob/master/config.yml#L5 seems static. Is this how it is supposed to be?

I'm pretty sure there were some issues with reproducible builds due to this.

Does the Hashbang OS recovery not have downgrade protection?

Last I heard it was in-progress.

Also, currently my build failed to boot, do you know if someone tested this upgrade path Rattlesnake OS -> Hashbang OS on a Google Pixel (sailfish)?

Shouldn't have any issues if it's a clean flash, Sailfish should already be tested and supported.

@ypid Did you happen to rebuild or do a clean flash and get it working?

Right now yes, the datetime is static -but- the idea is that whenever the repo is updated with new upstreams, that the date gets bumped too, but inbetween these points all build should be deterministic.

The idea here is that anyone should be able to checkout the code for any release and be able to build and get a flashable image identical to the one we will host, proving that we didn't deviate from the public code in any way.

ypid commented

Sorry for the delay. I did many clean builds of Hashbang OS by now. I did quite some testing on this as I did not really want to do a factory reset, also because I had not included the add-backup.patch in my builds before Hashbang OS. But I did not find another way to get this running. Sideloading the OTA just goes into a boot loop. It starts until the Android logo (animation starts but not finished) then resets. Luckily the bootloader detects this malfunction and switches to the backup slot after ~10 tries. Just don’t answer to the question of the bootloader to do a factory reset with yes.

I also tried building Rattlesnake OS for one last time. It also hang in the same boot loop.

So I bought a testing phone (sailfish). And it really just was the upgrade that did not work for some reason. Clean install of my Hashbang OS build worked perfectly.

Thanks for the update.

Are you able to apply updates to your testing phone you did a clean install on?

ypid commented

You are welcome.

I of course tested this before reinstalling my main phone. Clean install an older #!os build I had laying around and then upgrading worked.

I think the right way to resolve this is probably have "make config" automatically bump the timestamp in config.yml.

If that seems reasonable then this would be an easy win for anyone to take on.

ypid commented

I now picked up this easy first issue as no other new contributer did it.