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-Software | Refactoring #4386

Merged
merged 5 commits into from
May 18, 2021
Merged

DietPi-Software | Refactoring #4386

merged 5 commits into from
May 18, 2021

Conversation

MichaIng
Copy link
Owner

@MichaIng MichaIng commented May 17, 2021

Status: Ready

Commit list/description:

  • DietPi-Software | emonHub: Align API key input boxes with each other. The one shown when selecting emonHub from the list has been overseen when a second one has been implemented into the install section. It is however fine to have both, as the old one is shown more nicely during software selection, but not when the CLI is used, so the new one serves as fallback.
  • DietPi-Software | WiFi Hotspot: Do not install own Realtek hostapd binaries anymore. They are old, require ancient LibSSL1.0.0 and are required only for non-RPi non-x86 non-Armbian SBCs with such a special Realtek WiFi adapter attached. And there were still cases where it simply didn't work.
  • DietPi-Software | LibSSL1.0.0: Remove install option, as it is not required anymore
  • DietPi-Software | Enhance software selection menu a bit: Previous selections in the same session won't be lost when exiting the checklist (ESC/"Back"), but previously already made selections will stay intact. Only when confirming (ENTER/RETURN/"Ok"), selections will be updated based on checklist tacks.
  • DietPi-Software | Only store installed software in the state file and "not installed" flag only for DietPi-RAMlog and Dropbear, as those are initialised as installed, matching our image defaults
  • DietPi-Software | Do not reinstall DietPi-RAMlog on first run, instead apply the dietpi.txt RAMlog size within the first run block
  • DietPi-Software | On first run, force menu mode and skip CLI
  • DietPi-Software | Merge first run DietPi-Automation steps into two dedicated functions, one prior to installs, where no network is strictly required, one afterwards
  • DietPi-Software | Invert first run checks: Treat all cases where the install state is not "2" as first run
  • DietPi-Software | Remove obsolete reset of choice and preference system during first run. The variables are declared with defaults and during first run, dietpi.txt settings or defaults are parsed and applied within the first run code block already. Align those defaults with what is intended.
  • DietPi-Software | Remove USB drive check and flag. It is basically wrong since /dev/sda1 is not necessarily a USB drive while it could be any /dev/sd[a-z][1-9]. Keep the two cases where it was used functionally untouched by explicitly checking findmnt there.
  • DietPi-Software | Shorten and rename aSOFTWARE_* array names to have the same length, because we can :)

+ DietPi-Software | Remove obsolete reset of choice and preference system during first run. The variables are declared with defaults and during first run, dietpi.txt settings or defaults are parsed and applied within the first run code block already. Align those defaults with what is intended.
+ DietPi-Software | Remove USB drive check and flag. It is basically wrong since /dev/sda1 is not necessarily a USB drive while it could be /dev/sd[a-z][1-9]. However, keep the two cases where it is used functionally untouched by explicitly checking findmnt there.
+ DietPi-Software | emonHub: Align API key input boxes with each other. The one shown when selecting emonHub from the list has been overseen when a second one has been implemented into the install section. It is however fine to have both, as the old one is shown more nicely during software selection, but not shown when the CLI is used, so the new one serves as fallback.
+ DietPi-Software | Do not reinstall DietPi-RAMlog on first run, instead apply the dietpi.txt RAMlog size within the first run block
+ DietPi-Software | Only store installed software in the state file + DietPi-RAMlog and Dropbear, as those are initialised as installed, matching our image defaults
@MichaIng MichaIng added Enhancement 💨 Coding 📑 Improving code stability, performance and consistancy labels May 17, 2021
@MichaIng MichaIng added this to the v7.2 milestone May 17, 2021
+ DietPi-Software | Do not install own Realtek hostapd package anymore. It is old, requires ancient libssl1.0.0 and is only required for non-RPi non-x86 non-Armbian SBCs with such a special Realtek WiFi adapter attached. And there were still cases where it simply didn't work.
+ DietPi-Software | LibSSL1.0.0: Remove install option, as it is not required anymore
+ DietPi-Software | Merge first run DietPi-Automation steps into two dedicated functions, one prior to installs, where no network is strictly required, one afterwards.
+ DietPi-Software | Rename aSOFTWARE_* array names to have the same length, because we can :)
@MichaIng MichaIng changed the title DietPi-Software | Little enhancements DietPi-Software | Refactoring May 17, 2021
+ DietPi-Software | Enhance software selection menu a bit: Previous selections in the same session won't be lost when exiting the checklist (ESC/"Back"), but previously already made selections will stay intact. Only when confirming (ENTER/RETURN/"Ok"), selections will be updated based on checklist tacks.
+ CHANGELOG | LibSSL1.0.0 | This old library was kept for backwards-compatibility with old binaries but is not required anymore for any binary provided by DietPi-Software. It has hence been removed from the software list.
@MichaIng
Copy link
Owner Author

MichaIng commented May 18, 2021

Some sorting and cleanup of the code and old obsolete functions/items done. I have further ideas:

  • Merging install + config function blocks so that every software title has a single install block only.
  • Make each software install (and uninstall) block an own function, so that all variables within can be local and cannot interfere with following software installs. Banner, install state marks and all such can the be done in a wrapping loop, so that a finished install will be marked as installed, even if the script gets terminated later.

But this is for next release, for now having some old obsolete stuff removed and tidied should be fine and is good to include into regular testing til release.

@Joulinar
Copy link
Collaborator

it's fine to merge install + config function blocks but there we would need to ensure to have the correct order of software title as some depends on others. Like:

NextCloud depends on database + redis + web server
Portainer debends on Docker
VNC depends on x server

@MichaIng
Copy link
Owner Author

MichaIng commented May 18, 2021

Yes that is true. In most cases this should be correctly ordered already, but important to review it. This makes is a larger task as well, copy&paste a code block, then verify all dependencies are installed before that block, for each software title 😃. Also here, making those separate functions would allow us to install dependencies first and dependants afterwards, with a generic method similar to the new dependency mark system, or even as part of the same loop, performing the install directly instead of setting the mark.

The more I think about it the more I'm sure that this is something for a future version 😄.

+ DietPi-Software | Print info when running first run setup steps
@MichaIng MichaIng merged commit c712c5a into dev May 18, 2021
@MichaIng MichaIng deleted the dietpi-software branch May 18, 2021 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Coding 📑 Improving code stability, performance and consistancy Enhancement 💨
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants