Commit Graph

542 Commits

Author SHA1 Message Date
steadfasterX
30859d2c08
fix-up & enhance advanced error handling
new (internal used) functions:
- _exit
- _exit_report
- _exit_sigint

these are used to fix several (wrong) error handlings.

new environment variable:
- UNATTENDED_PATCHING

by default we assume unattended patching, i.e. if an error occurs during
the patch, reset or any other process we will report the error and
auto close the shell. this is needed as we source functions and code and
so cannot simply terminate a master process. instead the whole shell will
be terminated so if an error occurs nothing else will be executed (and you
should notice easily that something is wrong).

without that a (serious) error can still continue the rest of a function
and you likely not even noticing the error itself.

you can use:

export UNATTENDED_PATCHING=0

before or after sourcing init.sh and it will *NOT* auto-close the shell.
that way you can check the output and fix any issues.

Signed-off-by: steadfasterX <steadfasterX@gmail.com>
2024-04-22 10:24:18 +02:00
steadfasterX
fcec1c8887
common: do not abort when recovery-in-boot
when using strict (i.e set -e added by this PR) a build will fail on release when there is no recovery.img. this makes that non-fatal allowing to proceed

Signed-off-by: steadfasterX <steadfasterX@users.noreply.github.com>
2024-04-22 10:24:18 +02:00
steadfasterX
7724c3effd
make divest functions error aware
this commit adds (the currently non-existing) error handling when
using divest's functions and scripts.
all the magic here gets activated when `source ../../Scripts/init.sh`
gets executed which is already a mandatory step before starting any
of the divest functions.

when something fails during patching, resetting or building
each error will be catched + printed including an error code now.
last but not least the executed file and the line number causing that
failure will be shown, too.

as all divest functions get source'd and so not a single build
script gets executed all ERR's needs to be trapped to catch issues.
I am not aware of another way to handle that properly as sourcing
means we cannot track a script or smth while this approach here
just works.

Example for an error thrown in a function call:

> ERROR: $DOS_WORKSPACE_ROOT/Scripts/Common/Functions.sh -> verifyAllPlatformTags() ended with status >1< at line >49<

Final SUCCESS result message after using `patchWorkspace`:

> [FINAL RESULT] No error detected (please check the above output nevertheless!)

Final ERROR result message after using `patchWorkspace`:

> [FINAL RESULT] Serious error(s) found!!!
> Summary error code was: 126. Check & fix all error lines above

Some notes:

- when an error occurs the process continues until the end (like it is now)
  i.e. an error will not stop the current and following tasks
- when multiple errors occur the exit codes will be summed
- buildDevice: a (summed) end result gets printed (SUCCESS or ERROR) at the very end
- the trap used to catch any error will also be active for any command executed
  on the cli. that means: type "false" -> ENTER and you will get an error, too
  same for any script exectued after source init.sh
- when all goes well the trap will be resetted at the end but there are cases
  where this might not happen -> that is why `resetEnv` can be executed to
  reset the trap, i.e. all becomes as it was before sourcing init.sh
- `resetEnv` gets called automatically:
  - after a successful `patchWorkspace` run
  - whenever CTRL+C is used (during a running task or just on the cli)
  - a process get killed (SIGHUP, TERM)
- the whole implementation might not catch all errors though - it highly depends
  on how the function or the script/program called actually handles errors or better
  said: if they return a proper exit code on failures.
  For example some tools (like some git cmds) might print an error but don't return
  a non-zero exit code. This cannot be tracked other then with your eyes or these
  must be replaced by other methods returning a non-zero exit code on failures.

Signed-off-by: steadfasterX <steadfasterX@gmail.com>
2024-04-22 10:24:18 +02:00
Tavi
e7de509de5
Record current checkouts
Signed-off-by: Tavi <tavi@divested.dev>
2024-04-10 08:15:58 -04:00
Tavi
4f8cfc8a41
you want it, you got it!
now compile it yourself.

Signed-off-by: Tavi <tavi@divested.dev>
2024-04-09 16:25:54 -04:00
Tavi
f5d06ea9aa
Refresh defconfig paths
Signed-off-by: Tavi <tavi@divested.dev>
2024-04-09 13:31:34 -04:00
Tavi
ea83b47d59
apex signing updates
untested

Signed-off-by: Tavi <tavi@divested.dev>
2024-04-09 13:25:56 -04:00
Tavi
835fbb7d2c
Fixup
Signed-off-by: Tavi <tavi@divested.dev>
2024-04-08 15:12:49 -04:00
Tavi
9d6325e2a0
15.1: April ASB work
Signed-off-by: Tavi <tavi@divested.dev>
2024-04-08 13:36:38 -04:00
Tavi
5cad35c028
Fixup
Signed-off-by: Tavi <tavi@divested.dev>
2024-04-06 19:59:27 -04:00
Tavi
97ce53667f
Churn
Signed-off-by: Tavi <tavi@divested.dev>
2024-04-04 14:42:59 -04:00
Tavi
450ad03159
Update CVE patchers
maybe some breakage

Signed-off-by: Tavi <tavi@divested.dev>
2024-04-04 13:55:38 -04:00
Tavi
cdfbce9dfd
Fixups
Signed-off-by: Tavi <tavi@divested.dev>
2024-03-10 12:10:49 -04:00
Tavi
0b8f1a2c57
Churn
Signed-off-by: Tavi <tavi@divested.dev>
2024-03-09 12:02:14 -05:00
Tavi
fdbd1a090f
Update CVE patchers
I made a pass through removing some obvious wrongly applied patches
but there is likely some more breakage here

Signed-off-by: Tavi <tavi@divested.dev>
2024-03-02 12:31:51 -05:00
Tavi
d1be2eaa2f
Fixup
Fixes https://github.com/Divested-Mobile/DivestOS-Build/issues/292

Signed-off-by: Tavi <tavi@divested.dev>
2024-02-28 09:44:10 -05:00
Tavi
01f9defd2b
20.0 doesn't support FDE
Should fix boot on some LGE devices

Signed-off-by: Tavi <tavi@divested.dev>
2024-02-13 17:04:29 -05:00
Tavi
b7ce879d83
Picks
Signed-off-by: Tavi <tavi@divested.dev>
2024-02-11 19:20:38 -05:00
Tad
4eed156d14
Fixup 09494a1c
compile tested: vayu, pioneer

Signed-off-by: Tad <tad@spotco.us>
2023-11-07 21:19:43 -05:00
Tad
f64285f6fd
Update CVE patchers
Signed-off-by: Tad <tad@spotco.us>
2023-10-15 21:06:16 -04:00
Tad
f2e48a04b5
Disable regdb updates
Last update broke wireless for Australian users
Let's use what is included instead

Signed-off-by: Tad <tad@spotco.us>
2023-10-13 02:24:26 -04:00
Tad
5250942b4b
Attempt to fix nile
Something changed between August 10th and September 6th update which broke boot
These are all the functional changes made to the kernel.
Rest were Xen or vmxnet related.
Other 4.9 to 4.4 replacements were double checked and ruled out.

Signed-off-by: Tad <tad@spotco.us>
2023-09-26 15:16:26 -04:00
Tad
337ae6012d
Fixup
TODO: regen

Signed-off-by: Tad <tad@spotco.us>
2023-09-17 20:26:44 -04:00
Tad
84a84c4742
Picks + Churn
Signed-off-by: Tad <tad@spotco.us>
2023-09-10 21:12:24 -04:00
Tad
de3ba78ac7
Unbreak athene
Signed-off-by: Tad <tad@spotco.us>
2023-09-04 14:18:32 -04:00
Tad
6222ce9ee9
Adjust deblob
- Put face unlock on a flag
- Don't remove the (non-executable) files for Google Camera to silence complaints

Signed-off-by: Tad <tad@spotco.us>
2023-09-02 10:29:00 -04:00
Tad
9e954ea987
Restore face unlock for Pixel 4 series
We keep fingerprint reader blobs, so why not these?

Signed-off-by: Tad <tad@spotco.us>
2023-09-01 20:51:49 -04:00
Tad
6d52d2f6ce
m8: Fix display corruption
Fixes the screen shifting vertically when in a full screen task like camera

Signed-off-by: Tad <tad@spotco.us>
2023-08-31 21:55:13 -04:00
Tad
56b71651c5
Tweak
Signed-off-by: Tad <tad@spotco.us>
2023-08-30 15:22:00 -04:00
Tad
f7d0ff4af2
Fixup athene
- Disable default encryption on athene, doesn't work
- Remove QC telephony extensions, causes Dialer to crash

Signed-off-by: Tad <tad@spotco.us>
2023-08-29 23:34:49 -04:00
Tad
e067f59555
14.1: add athene
tried to buy a harpia, ended up with an athene :(

Signed-off-by: Tad <tad@spotco.us>
2023-08-29 21:55:15 -04:00
Tad
f9afe6f862
Really unbreak Pixel 4 camera, by not removing Motion Sense blobs
Signed-off-by: Tad <tad@spotco.us>
2023-08-26 21:38:22 -04:00
Tad
bf55f7d572
Remove more face unlock blobs and unbreak camera on Pixel 4 series
Signed-off-by: Tad <tad@spotco.us>
2023-08-26 18:22:51 -04:00
Tad
52fde9a0e7
Fixup
Signed-off-by: Tad <tad@spotco.us>
2023-08-25 15:36:12 -04:00
Tad
7509afb74d
20.0: add Mi8917
Signed-off-by: Tad <tad@spotco.us>
2023-08-25 14:47:54 -04:00
Tad
0f127cfcc8
Update defconfigs
Signed-off-by: Tad <tad@spotco.us>
2023-08-25 09:27:01 -04:00
Tad
fa030fcbf4
Churn
Signed-off-by: Tad <tad@spotco.us>
2023-08-24 21:38:33 -04:00
Tad
52a0c55c41
Fixups
- Revert Freetype branch switching for 15.1+, broken
- Don't include OpenEUICC on Pixel 2 and 3 series, they won't work
- Churn

Signed-off-by: Tad <tad@spotco.us>
2023-08-24 03:06:02 -04:00
Tad
8b51c3cd0f
Fixup OpenEUICC inclusion
Signed-off-by: Tad <tad@spotco.us>
2023-08-21 20:00:31 -04:00
Tad
c90920965f
Remove some garbage
Signed-off-by: Tad <tad@spotco.us>
2023-08-20 16:11:44 -04:00
Tad
d34d676805
Fixup removal of DebuggingRestrictionController
Signed-off-by: Tad <tad@spotco.us>
2023-08-20 15:18:21 -04:00
Tad
7fb56809ac
Small fixups
Signed-off-by: Tad <tad@spotco.us>
2023-08-18 16:08:10 -04:00
Tad
1485be072d
Notes
Signed-off-by: Tad <tad@spotco.us>
2023-08-18 10:59:06 -04:00
Tad
7ef5d9a9c4
Broken EUICC handling
Signed-off-by: Tad <tad@spotco.us>
2023-08-05 18:57:32 -04:00
Tad
180280b233
Update CVE patchers
TODO: adjust min version of CVE-2023-4132

Signed-off-by: Tad <tad@spotco.us>
2023-08-04 21:00:29 -04:00
Tad
7cbceb9d81
Tweaks
Signed-off-by: Tad <tad@spotco.us>
2023-07-27 20:44:56 -04:00
Tad
bdc6f0dff7
Tweak
Signed-off-by: Tad <tad@spotco.us>
2023-07-25 10:59:22 -04:00
Tad
c8d3354113
Patch from CalyxOS to make AOSP less spyware
Signed-off-by: Tad <tad@spotco.us>
2023-07-24 14:35:24 -04:00
Tad
e74f861c8e
Fixes + Churn
- Fix instances of awk failing on missing globs
- Remove unwanted packages from work/user/managed profiles
- Remove proprietary camera extensions

Signed-off-by: Tad <tad@spotco.us>
2023-07-24 03:59:51 -04:00
Tad
05bb9b039b
18.1: add debx
Signed-off-by: Tad <tad@spotco.us>
2023-07-22 19:20:39 -04:00