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>
- 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>
- 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>
- Only enable on Linux 3.0 through 4.9
- Always enable defer option
- Only run twice a second, instead of fifty times a second
Signed-off-by: Tad <tad@spotco.us>
- 19.1/20.0: Enable low ram for <6GB devices
- 20.0: support RROs with exec spawning patch from GrapheneOS
- allow work profiles when low ram is enabled
- churn
- cherrypicks
Signed-off-by: Tad <tad@spotco.us>
this one will break the build when using https://github.com/Divested-Mobile/DivestOS-Build/pull/206 :
> rename: /ssd/tmp/dos/hotdog/LineageOS-20.0/release_keys//incrementals/xxxx-20.0-20230713-dos-hotdog-incremental_*.zip*: not accessible: No such file or directory
the next one is a cosmetic thing only. while the current implementation does not break the build I prefer skipping it if not needed at all instead of just the `|| true` workaround.
"fixes" the message in build output when no delta is requested:
> cp: cannot stat 'xxxx-20.0-20230713-dos-hotdog-incremental_*.zip*': No such file or directory
Signed-off-by: steadfasterX <steadfasterX@users.noreply.github.com>
As dtbo is necessary on avicii, hotdog, hotdogb, instantnoodle, instantnoodlep, kebab, lemonades, pro1x
Which all don't currently have a fastboo.zip provided
Signed-off-by: Tad <tad@spotco.us>
20.0:
- akatsuki
- lemonades
- dipper, equuleus, polaris, ursa
19.1:
- kirin, mermaid
- apollon
note lemonades is failing like kebab:
> Sum of sizes in oneplus_dynamic_partitions_partition_list is 3765178368, which is greater than oneplus_dynamic_partitions_size (3753902080)
Signed-off-by: Tad <tad@spotco.us>
The deblobber already removes xtra-daemon which is what actually performs the requests.
This is just extra sanctity.
Signed-off-by: Tad <tad@spotco.us>
Fixes the following issue on systems where /bin/sh != /bin/bash (e.g. Ubuntu):
> source [...]/Scripts/Common/Tag_Verifier.sh && verifyTagIfPlatform : 1: source: not found
for these (unsupported) systems the following is still required (not needed on Fedora or other systems using /bin/sh -> /bin/bash):
1. `ln -s /bin/bash ~/.local/bin/sh`
2. .bashrc -> `export PATH="$HOME/.local/bin:$PATH"`
3. .bashrc -> `alias sh='/bin/bash'`
Signed-off-by: steadfasterX <steadfasterX@users.noreply.github.com>
- Enable APEX for Pixel 6/7, necessary for camera and pKVM
- Also drop hack removing pKVM for Pixel 6/7
- patch from GrapheneOS
- Extend hmalloc workaround to /apex
- Deblobber:
- actually handle wildcard f/w/b overlays
- move some stuff around
- remove some more Pixel blobs
- flag and disable removal of camera extensions, being able to use the second camera is nice
- Adjust what hardenDefconfig disables, caused boot issues
minimal impact as most of these are already default-disabled
can be narrowed down in future
- Disable some of the bionic hardening patches, causing more boot issues
annoying to lose, but having a phone that boots is more important
- Add LTE only mode to 17.1, 18.1, 19.1, and 20.0, credit GrapheneOS
- Remove Pixel 2 ramdisk compression reverts, fixed upstream
And yes, I know I should've split up this commit...
Signed-off-by: Tad <tad@spotco.us>