Open Thaodan opened 5 years ago
How can I default to an alternative value like in shell Scripts with ${too:-bar} ?
About the dependencies , how would you do this with just sed? I'm not sure how to do this in a clean way.
How can I default to an alternative value like in shell Scripts with ${too:-bar} ?
%{?foo}%{!?foo:bar}
, e.g. %{?embed_recovery}%{!?embed_recovery:0}
About the dependencies , how would you do this with just sed? I'm not sure how to do this in a clean way.
sed "s/@EMBED_RECOVERY@/%{?embed_recovery}%{!?embed_recovery:0}/g" -i %{_local_initrd_dir}/jolla-init
sed "s/@EMBED_RECOVERY@/%{?embed_recovery}%{!?embed_recovery:0}/g" -i %{_local_initrd_dir}/jolla-init
Below link is the complete rewrite without sed, I have not fully tested on a running device yet, as I have some doubts about this line: https://github.com/sledges/hybris-initrd/commit/58ab8a4b795c29f69d72937a6ee88096618aa0f6#diff-ae5e5322c8e93e423e4ef2ac5e20cd84R101 Will test when I find time ASAP, probably early next week.
Apologies for coming back on this only now, but github does not send emails about updated PR. We're lucky I was checking my timesheed as it's the end of the month, and found your PR again:)
@sledges No problem. I fixed that line that you mean in mksfosinitrd and cleaned that feature a bit up. About the actual init script to you want the embed recovery code to be present when embed recovery is not used or not present when its not used (shpp solution)?
Yes fixed.
This was looking well on its way and close to be ready for merging, after the many fixes and improvements above. @sledges & @Thaodan, is there a specific reason, why this has been stalling for more than 2 years?
The reason why iI am asking, is that
This was looking well on its way and close to be ready for merging, after the many fixes and improvements above. @sledges & @Thaodan, is there a specific reason, why this has been stalling for more than 2 years?
The reason is that such change needs to be tested on all Jolla's supported devices to avoid regressions, and in case such risk is minimal and/or this functionality is not enabled in a given kernel, the work of updating submodule for each device is still required.
Since we had had a workaround for recovery, this PR was not on a critical path and thus turned into technical debt, due to other priorities. It has certainly become more actual with releasing Xperia 10 II, and we will adjust prioritisation accordingly as possible. For now please use the workaround [1], which is, agreed, more involving than other Xperias, nevertheless recovery mode is (and should) not be a frequently used feature.
[1] https://jolla.zendesk.com/hc/en-us/articles/360021620740
[…] this PR […] turned into technical debt, due to other priorities. It has certainly become more actual with releasing Xperia 10 II, and we will adjust prioritisation accordingly as possible.
… and even more so by releasing SailfishOS for the Xperia 10 III recently.
Summary of what has to be done to use this PR.
%define embed_recovery
)Ignore skip_initramfs
is still passed but doesn't do anything on your devices kernel. For the Xperia XA2 this PR can be used:
https://github.com/mer-hybris/android_kernel_sony_msm/pull/26
This commit contains the required change:
https://github.com/mer-hybris/android_kernel_sony_msm/pull/26/commits/c73ed25d4ae2d6131094b6140ac19d3fa618677dBoth droid-hal and droid-hal-img-boot have to be build after applying the changes mentioned above, after doing so flashing _hybrisboot.img is enough to test if the PR works.
This PR is obsolete for devices using Android 12 and up. It was never required for devices using a dedicated recovery partition (refer to the graph above for devices starting with Android 13): https://source.android.com/docs/core/architecture/partitions/generic-boot#figure-2
Some devices like Sonys X series have no recovery partition on these devices the recovery needs to be inside the regular initramfs.
To do so we check if
skip_initramfs
hasn't been passed (read line 56) and then start the recovery.Background: Bootloaders for Android phones pass
skip_init_ramfs
when the system should be booted normally and don't pass it when the key combination for recovery mode was used. We piggy back on this behavior by using the kernel commandline option is mostly the samen way except that we always use a init-ramfs.