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

DietPi-Update | Apply new update system that allows automatic branch migration #4103

Merged
merged 21 commits into from
Feb 14, 2021

Conversation

MichaIng
Copy link
Owner

@MichaIng MichaIng commented Feb 11, 2021

Status: Review

Commit list/description:

  • DietPi-Update | Add new remote version file for updates and automatic branch migration from next version on

+ DietPi-Update | Add new remote version file for updates and automatic branch migration from next version on
@MichaIng MichaIng added this to the v6.35 milestone Feb 11, 2021
+ DietPi-Pre-patches | Create new pre-patches file in new separate update directory outside of DietPi core scripts directory
+ DietPi-Update | Apply automatic branch migration and new remote version + pre-patches URLs
+ DietPi-Update | Remove https://dietpi.com/ update server. Access to the GitHub repository is required anyway to download the dietpi.txt and for various software configs, when being patched or reinstalled, so it's even better to exit in the very first place instead of running into failing connections at a later stage.
+ DietPi-Update | Remove obsolete CHANGELOG_DOWNLOADED declaration
+ DietPi-Update | Check desktop session via $DISPLAY variable to detect parent X session, like we do everywhere else. lxsession detects LXDE desktop sessions only.
+ DietPi-Update | Both, pre-patches and incremental patches for v6 still need to be applied since DietPi-Update restarts are done before incremental patches have been applied and pre-v6.17 system didn't have pre-patches applied either.
+ DietPi-Update | Create DietPi v7 incremental patch file
+ DietPi-Patch | This is only called by DietPi v6 systems, so restart whenever it is not the second instance already
Update "update" branch
+ DietPi-Update | Fix incremental patch file path
+ DietPi-Update | Apply execute permissions to patch file
+ DietPi-Patch | Loop until hardcoded v6.35 since this the last v6 subversion string.
+ DietPi-Patch | Failsafe: If for some reason the v6 subversion is >35, exit loop as well
+ DietPi-Survey_report | Add DietPi v7.0 support, matching DietPi v6.35 transition version string
+ DietPi-Survey_report | Satisfy shellcheck
+ DietPi-Update | Move APT auto-removal and systemd unit reload after incremental patches from patch file to main script, since we currently handle it as mandatory step anyway.
+ DietPi-Patch | APT auto-removal and systemd unit reload is now done within dietpi-update parent script.
@ravenclaw900
Copy link
Collaborator

Wow, v7. Will this come after or replace 6.35?

@MichaIng
Copy link
Owner Author

MichaIng commented Feb 14, 2021

To allow a smoother drop of support for old Debian versions (Stretch somewhere this year) and as well old DietPi versions, without having to radically break the update ability, I added this method to natively migrate users to separate branches in case automatically, where we can theoretically provide some kind of LTS support, e.g. applying important/security patches for a while, or in case of Debian Stretch implement prompts/hints about how to dist-upgrade to a supported Debian version and then migrate back to the master/stable branch.

This way we don't need to handle complicated and error-prone migration and update-restart cycles and steps in the main branches. This has become quite complicated already and requires a lot of update-path testing to assure that none is broken.
Currently Jessie systems are migrated to the jessie-support branch, but for older DietPi versions this is done after the (theoretically Jessie-incompatible) code has been installed already, so it's not failsafe. Then dropping /DietPi RAMdisk came while Jessie systems are migrated to branch with RAMdisk, which made the patch file code much more complicated and error-prone.

Another major aim is to not completely break updates from older versions when incrementing the major/core version. Instead we can now start to drop support for a tail of very old subversions to simplify the patch file step by step until it (the old one) can be removed completely in two years or so. Then, the dietpi/ directly finally will contain the actual system scripts only while all update-related scripts and files, that are not aimed to remain on systems, are in the dedicated .update/ directory.

It was not required, but since it became possible now, I did increment the major version to v7.0, so that v6.35 is a transition version only, required as intermediate step before an update restart migrates to the new system. But aside of that, it's not a large update, so no deeper meaning. A little like Linux 5.0 being to larger update than 4.19 or 5.1 😄.

What do you think?

+ DietPi-Update | After three years, remove the DietPi pre-v6 version file. This means that these DietPi systems won't see a "new image available" message, indicating that a new image needs to be flashed, but the update check will fail instead, which practically the same can be derived from.
@Joulinar
Copy link
Collaborator

does it means, DietPi version updates are populated to people running latest Debian Buster atm? And for Stretch we just provide bug-fixing? Just for my understanding 🤣

+ DietPi-Update | "DietPi-$GITBRANCH_TARGET/dietpi/server_version" does not exist anymore on v7 branches
@MichaIng
Copy link
Owner Author

MichaIng commented Feb 14, 2021

DietPi version updates are populated to people running latest Debian Buster atm?

For now nothing changes about version support, only Jessie systems would be migrated. But those will never execute that code, as they are migrated via patch_file as before, so it's currently just to show how it can be used. First I had the plan to drop Stretch support when Debian Bullseye becomes stable, but reviewing the current Stretch system share, it's probably better to keep it longer, e.g. end of the year. There are quite some nice things we an do when relying on Buster+, but not that important that we need to make ~9% of our users unhappy 😄.

But yes, once we decide to drop support for Stretch from the main repository code, we can then keep a minimal support on that dedicated branch, backporting only important fixes, depending also on reports/demand or user contributions.

@Joulinar
Copy link
Collaborator

Joulinar commented Feb 14, 2021

probably as well we could prompt a banner info about Stretch being eol somewhere mid of the year too 🤔

@MichaIng
Copy link
Owner Author

probably as well we could prompt a banner info about Stretch being eol somewhere mid of the year to 🤔

Good idea. We did similar for Jessie users two years ago, via MOTD, so there is some buffer to find a spare-time weekend for a dist-upgrade or fresh flash instead of a surprise all of a sudden.

@Joulinar
Copy link
Collaborator

Officially we did not support dist-upgrade 😉 . However this question will pop up sooner or later once Bullseye is out. Maybe we should add a dist-upgrade section to the docs, containing the usual warning. But probably something users would be appreciate on 🤔

@MichaIng
Copy link
Owner Author

MichaIng commented Feb 14, 2021

Yes, I'd still always recommend a fresh flash instead of a dist-upgrade, but many users ignore(d) that anyway and then it's better to have some documented best practice instructions or even start supporting it officially, which forces us to review/learn more about possible unwanted left-overs. Some software options might require a reinstall and such to remain functional.

And indeed it became much less risky than it was a few Debian versions ago. I saw quite some more changelog entries were dist-upgrades were particularly taking into account.

+ Use RC version "-1" before releasing the first beta, as before
+ DietPi-Globals | Default core up
@MichaIng MichaIng merged commit 2dc001b into dev Feb 14, 2021
@MichaIng MichaIng deleted the update branch February 14, 2021 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants