diff --git a/FileSets/VersionIndependent/PageSettingsPackageAdd.qml b/FileSets/VersionIndependent/PageSettingsPackageAdd.qml index 01f7426..21dd99d 100644 --- a/FileSets/VersionIndependent/PageSettingsPackageAdd.qml +++ b/FileSets/VersionIndependent/PageSettingsPackageAdd.qml @@ -151,7 +151,7 @@ MbPage { else if (entryValid) return ("add " + packageName + " ?") else if (editPackageName.value == "") - return ("enter package name") + return ("enter a unique package name") else if (editGitHubUser.value == "") return ("enter GitHub user") else if (editGitHubBranch.value == "") diff --git a/HelperResources/EssentialResources b/HelperResources/EssentialResources index 3c264b1..53970f6 100755 --- a/HelperResources/EssentialResources +++ b/HelperResources/EssentialResources @@ -3,8 +3,7 @@ # EssentialResources for SetupHelper # contains a variables necessary for all setup helper scripts # -# sourced from CommonResources, UpdateResources and reinstallMods -# and also updateFileSets +# sourced from IncludeHelpers, packageManagerEnd.sh and reinstallMods # get the full, unambiguous path to this script (and therefore to script that sourced it) scriptDir="$( cd "$(dirname $0)" >/dev/null 2>&1 ; /bin/pwd -P )" diff --git a/PackageManager.py b/PackageManager.py index 42372ec..e0b1034 100755 --- a/PackageManager.py +++ b/PackageManager.py @@ -467,7 +467,11 @@ def PushAction (command=None, source=None): elif action == 'install' or action == 'uninstall' or action == 'check': DbusIf.LOCK ("PushAction 2") package = PackageClass.LocatePackage (packageName) - if package != None: + # SetupHelper uninstall is processed later as PackageManager exists + if packageName == "SetupHelper" and action == 'uninstall': + global SetupHelperUninstall + SetupHelperUninstall = True + elif package != None: package.InstallPending = True theQueue = InstallPackages.InstallQueue queueText = "Install" @@ -2697,10 +2701,6 @@ def InstallPackage ( self, packageName=None, source=None , action='install' ): global SetupHelperUninstall - if packageName == "SetupHelper" and action == 'uninstall': - SetupHelperUninstall = True - return - # refresh versions, then check to see if an install is possible DbusIf.LOCK ("InstallPackage") package = PackageClass.LocatePackage (packageName) @@ -3651,7 +3651,6 @@ def run (self): # persistent storage for mainLoop packageIndex = 0 noActionCount = 0 -lastDownloadMode = AUTO_DOWNLOADS_OFF currentDownloadMode = AUTO_DOWNLOADS_OFF bootInstall = False DeferredGuiEditAcknowledgement = None @@ -3678,7 +3677,6 @@ def mainLoop (): global noActionCount global packageIndex global noActionCount - global lastDownloadMode global currentDownloadMode global bootInstall global lastTimeSync @@ -3709,19 +3707,20 @@ def mainLoop (): # or SetupHelper uninstall was deferred # exit mainLoop and do uninstall in main, then reboot # skip all processing below ! - if MediaScan.AutoUninstall or SetupHelperUninstall: - mainloop.quit() - return False - actionMessage = "" bootReinstallFile="/etc/venus/REINSTALL_PACKAGES" + # default values - changed below based on states + emptyPackageList = False + scanForActions = True + currentDownloadMode = AUTO_DOWNLOADS_OFF + autoInstall = False # hold off all package processing if package list is empty - emptyPackageList = False if len (PackageClass.PackageList) == 0: emptyPackageList = True - holdOffScan = True + scanForActions = False + packageIndex = 0 # if boot-time reinstall has been requiested by reinstallMods # override modes and initiate auto install of all packages @@ -3731,29 +3730,31 @@ def mainLoop (): bootInstall = True packageIndex = 0 logging.warning ("starting boot-time reinstall") - currentDownloadMode = AUTO_DOWNLOADS_OFF - lastDownloadMode = AUTO_DOWNLOADS_OFF autoInstall = True - holdOffScan = False elif WaitForGitHubVersions: - holdOffScan = True - # not doing boot install - use dbus values + scanForActions = False + + # don't look for new actions if uninstalling all packages or uninstalling SetupHelper + # uses defaults above + elif MediaScan.AutoUninstall or SetupHelperUninstall: + pass + + # not doing something special - use dbus values else: autoInstall = DbusIf.GetAutoInstall () # save mode before chaning so changes can be detected below lastDownloadMode = currentDownloadMode currentDownloadMode = DbusIf.GetAutoDownloadMode () # download mode changed - # restart at beginning of list and signal mode change to the GitHub version thread + # restart at beginning of list and request GitHub version refresh if currentDownloadMode != lastDownloadMode \ and ( currentDownloadMode == ONE_DOWNLOAD or lastDownloadMode == AUTO_DOWNLOADS_OFF ): - holdOffScan = True + packageIndex = 0 + scanForActions = False UpdateGitHubVersion.SetPriorityGitHubVersion ('REFRESH') - else: - holdOffScan = False # make sure a new scan starts at beginning of list - if holdOffScan: + if not scanForActions: packageIndex = 0 # process one package per pass of mainloop else: @@ -3809,7 +3810,7 @@ def mainLoop (): actionMessage = "installing " + packageName + " ..." PushAction ( command='install' + ':' + packageName, source='AUTO' ) DbusIf.UNLOCK ("mainLoop 1") - # end if not holdOffScan + # end if scanForActions DbusIf.LOCK ("mainLoop 2") actionsPending = False @@ -3820,7 +3821,6 @@ def mainLoop (): for package in PackageClass.PackageList: if package.DownloadPending or package.InstallPending: actionsPending = True - # clear GitHub version if not refreshed in 10 minutes elif package.GitHubVersion != "" and package.lastGitHubRefresh > 0 and time.time () > package.lastGitHubRefresh + SLOW_GITHUB_REFRESH + 10: package.SetGitHubVersion ("") @@ -3853,9 +3853,11 @@ def mainLoop (): # wait for two complete passes with nothing happening # before triggering reboot, GUI restart or initializing PackageManager Settings + # or ininstalling packages # these actions are all handled in main () after mainLoop () exits if noActionCount >= 2: - if SystemReboot or InitializePackageManager or GuiRestart or RestartPackageManager: + if SystemReboot or InitializePackageManager or GuiRestart\ + or RestartPackageManager or MediaScan.AutoUninstall or SetupHelperUninstall: # already exiting - include pending operations if systemAction == REBOOT_NEEDED: SystemReboot = True @@ -3908,9 +3910,11 @@ def directUninstall (packageName): SetupHelperUninstall = True return + packageDir = "/data/" + packageName + setupFile = packageDir + "/setup" try: - setupFile = "/data/" + packageName + "/setup" - if os.path.isfile(setupFile)and os.access(setupFile, os.X_OK): + if os.path.isdir (packageDir) and os.path.isfile (setupFile) \ + and os.access(setupFile, os.X_OK): proc = subprocess.Popen ( [ setupFile, 'uninstall', 'runFromPm' ], bufsize=-1, stdout=subprocess.PIPE, stderr=subprocess.PIPE) proc.commiunicate () # output ignored @@ -3932,7 +3936,6 @@ def directUninstall (packageName): def setPmRestart (signal, frame): global RestartPackageManager - RestartPackageManager = True def shutdownPmRestart (signal, frame): @@ -4189,7 +4192,7 @@ def main(): AddRemove.join (timeout=1.0) MediaScan.join (timeout=1.0) except: - logging.critical ("attempt to join threads failed - one or more threads failed to exit") + logging.critical ("one or more threads failed to exit") pass # if initializing PackageManager persistent storage, set PackageCount to 0 @@ -4198,15 +4201,23 @@ def main(): if InitializePackageManager: DbusIf.DbusSettings['packageCount'] = 0 + # com.victronenergy.packageManager no longer available after this call + DbusIf.RemoveDbusService () + # auto uninstall triggered by AUTO_UNINSTALL_PACKAGES flag file on removable media - # notify before DbusServicces is removed if MediaScan.AutoUninstall: - SystemReboot = True # uninstall all packages EXCEPT SetupHelper which is done later for path in os.listdir ("/data"): - packageDir = "/data/" + path - if os.path.isdir (packageDir): - directUninstall (path) + directUninstall (path) + SystemReboot = True + + # tell supervise not to restart PackageManager when this program exits + if SystemReboot or SetupHelperUninstall: + logging.warning ("setting PackageManager to not restart") + try: + proc = subprocess.Popen ( [ 'svc', '-o', '/service/PackageManager' ] ) + except: + logging.critical ("svc command failed") # remaining tasks are handled in packageManagerEnd.sh because # SetupHelper uninstall needs to be done after PackageManager.py exists @@ -4227,10 +4238,6 @@ def main(): except: logging.critical ("packageManagerEnd.sh failed") - # delay to provide time for packageManagerEnd.sh to start up - time.sleep (0.1) - DbusIf.RemoveDbusService () - logging.warning (">>>> PackageManager exiting") # Always run our main loop so we can process updates diff --git a/PageSettingsGeneral.qml b/PageSettingsGeneral.qml deleted file mode 100644 index 37ff69c..0000000 --- a/PageSettingsGeneral.qml +++ /dev/null @@ -1,123 +0,0 @@ -import QtQuick 1.1 -import com.victron.velib 1.0 -import "utils.js" as Utils - -MbPage -{ - id: root - property string bindPrefix: "com.victronenergy.settings" - - model: VisibleItemModel { - MbItemOptions { - id: accessLevelSelect - description: qsTr("Access level") - bind: Utils.path(bindPrefix, "/Settings/System/AccessLevel") - magicKeys: true - writeAccessLevel: User.AccessUser - possibleValues: [ - MbOption { description: qsTr("User"); value: User.AccessUser; password: "ZZZ" }, - MbOption { description: qsTr("User & Installer"); value: User.AccessInstaller; password: "ZZZ" }, - MbOption { description: qsTr("Superuser"); value: User.AccessSuperUser; readonly: true }, - MbOption { description: qsTr("Service"); value: User.AccessService; readonly: true } - ] - - // touch version to get super user - property bool pulledDown: listview.contentY < -60 - Timer { - running: accessLevelSelect.pulledDown - interval: 5000 - onTriggered: if (user.accessLevel >= User.AccessInstaller) accessLevelSelect.item.setValue(User.AccessSuperUser) - } - - // change to super user mode if the right button is pressed for a while - property int repeatCount - onFocusChanged: repeatCount = 0 - - function open() { - if (user.accessLevel >= User.AccessInstaller && ++repeatCount > 60) { - if (accessLevelSelect.value !== User.AccessSuperUser) - accessLevelSelect.item.setValue(User.AccessSuperUser) - repeatCount = 0 - } - } - } - - MbEditBox { - description: "Set root password" - showAccessLevel: User.AccessSuperUser - onEditDone: { - if (newValue.length < 6) { - toast.createToast("Please enter at least 6 characters") - } else { - toast.createToast(vePlatform.setRootPassword(newValue)) - item.value = "" - } - } - } - - MbSwitch { - name: qsTr("SSH on LAN") - showAccessLevel: User.AccessSuperUser - bind: "com.victronenergy.settings/Settings/System/SSHLocal" - } - - MbSwitch { - id: remoteSupportOnOff - name: qsTr("Remote support") - bind: "com.victronenergy.settings/Settings/System/RemoteSupport" - } - - MbItemValue { - description: qsTr("Remote support tunnel") - item.value: remotePort.item.valid && remotePort.item.value !== 0 ? qsTr("Online") : qsTr("Offline") - show: remoteSupportOnOff.item.value - } - - MbItemValue { - id: remotePort - description: qsTr("Remote support IP and port") - item.bind: "com.victronenergy.settings/Settings/System/RemoteSupportIpAndPort" - show: remoteSupportOnOff.item.value - } - - MbOK { - id: reboot - description: qsTr("Reboot?") - writeAccessLevel: User.AccessUser - onClicked: { - toast.createToast(qsTr("Rebooting..."), 10000, "icon-restart-active") - vePlatform.reboot() - } - } - - MbSwitch { - property VBusItem hasBuzzer: VBusItem {bind: "com.victronenergy.system/Buzzer/State"} - name: qsTr("Audible alarm") - bind: Utils.path(bindPrefix, "/Settings/Alarm/Audible") - show: hasBuzzer.valid - } - - MbSwitch { - name: qsTr("Enable status LEDs") - bind: Utils.path(bindPrefix, "/Settings/LEDs/Enable") - show: item.valid - } - - MbItemOptions { - id: demoOnOff - description: qsTr("Demo mode") - bind: Utils.path(bindPrefix, "/Settings/Gui/DemoMode") - possibleValues: [ - MbOption { description: qsTr("Disabled"); value: 0 }, - MbOption { description: qsTr("ESS demo"); value: 1 }, - MbOption { description: qsTr("Boat/Motorhome demo 1"); value: 2 }, - MbOption { description: qsTr("Boat/Motorhome demo 2"); value: 3 } - ] - } - - MbItemText { - text: qsTr("Starting demo mode will change some settings and the user interface will be unresponsive for a moment.") - wrapMode: Text.WordWrap - } - } -} diff --git a/ReadMe b/ReadMe index 42a7048..ca1a42f 100644 --- a/ReadMe +++ b/ReadMe @@ -11,17 +11,21 @@ The SetupHelper package provides: a "blind" install of SetupHelper from SD/USB media - a blind uninstall mechanism which optionally includes reinstalling Venus OS + a blind uninstall mechanism which optionally includes reinstalling Venus OS - backup and restore SOME settings from com.victronenergy.settings - this includes custom logos and copying logs to removable media - SetupHelper - PackageManager - gui + backup and restore SOME settings from com.victronenergy.settings + this includes custom logos and copying logs to removable media + SetupHelper + PackageManager + gui - Restart or initialize PackageManager + Restart or initialize PackageManager + Restart the GUI +SetupHelper v8 adds the ability for multiple packages to modify the same file + Packages must be written to "patch" a file rather than "replace" it + SetupHelper v7.0 adds a conflict resolution mechanism. Packages can identify known conflicts with other packages with a "pacakgeDependencies" list One package can specify that other packages must be uninstalled or installed @@ -51,14 +55,9 @@ Helper resources Other packages use "helper hesources" provided by SetupHelper Helper Resources simplify the package's setup script and include hooks that PackageManager uses to control installs and uninstalls. - Helper resources can be included in a package making them independent of SetupHelper. - However, without SetupHelper: - a package can only be installed and uninstalled rom the command line - automatic reinstall after a firmware update will not occur! - Installing SetupHelper is highly recommended ! -More information here: +More information about Setup Helper and how to create packages that use it can be found here: https://www.dropbox.com/scl/fo/bx5aftvgrqq0vp060mwip/h?rlkey=k28c2i49fjfpcyjfsuldwp159&dl=0 Blind Install: @@ -135,10 +134,12 @@ especially if you don't have a network setup. The following document describes ssh access and also serial terminal connections on Cerbo GX: https://www.victronenergy.com/live/ccgx:root_access +Remote ssh access is now available via tailscale using the TailscaleGX package + System Recovery: -It is highly unlikely, but some users have reported a package install leaving their system unresponsive +It is unlikely, but some users have reported a package install leaving their system unresponsive or with a nonfuncitonal GUI (white screen). In this case, your options depend on the current state of the system. First, (as always) reboot. This may clear the problem. @@ -167,7 +168,19 @@ Fourth, try booting to the previous Venus OS version (in Stored backup firmware) For updates from removable media: /opt/victronenergy/swupdate-scripts/check-swupdate.sh -force -update -offline -Fifth, perform the Blind uninstall procedure below. +Fifth, If PackageManager is still running, it will detect a file named AUTO_UNINSTALL_PACKAGES on removable media. + Create a file of that name (no extension, content unimportant) on a USB memory stick or SD card + and insert this into the GX device. + + The system should eventually reboot. In most cases, this should occur within 1-2 minutes. + After reboot, the system should come up in the stock configuration with no packages installed. + + If the system does not reboot, it is likely PackageManager is no longer running, so try other options. + + Remember to remove the media cotaining the AUTO_UNINSTALL_PACKAGES file to this will be repeated + the next time PackageManager runs. + +Sixth, perform the Blind uninstall procedure below. Finally: If you are running on a Raspberry PI, you can reimage the system SD card. @@ -215,239 +228,6 @@ The archive for this is named venus-data.UninstallPackages.tar.gz. is renamed to venus-data.UninstallPackages.tar.gz so that the blind install will run only once. This renaming is necessary to prevent a loop where the system uninstalls and reboots. -Description: - -There are two parts to SetupHelper: -1) Package Manager, controls automatic and manual updates to packages - -2) Utilities used by other packages' setup scripts. - These resources simplify the task of writing install/uninstall scripts - and may be of help to others writing packages of their own. - -The latter is of concern only to those writing new Venus modifications -or modifying an existing setup script. -These are described in detail later in the SetupHelperDescription document. - -Package Manager: - -The Package Manager includes a set of menus on the GX device menu system - that allows the user to view package versions, - control automatic package updates - and manually install, uninstall, add and remove packages. - - A python program runs in the background (as a service) to do the actual - work and to interface with the menus. - - Package Manager menu: - - The first line of this menu provides status for Package Manager, - indicating what it is currently doing - - Automatic GitHub downloads controls if packages are automatically downloaded - from GitHub. This occurs if a newer version is available. - Modes: - On checks GitHub for a package that is newer than what is stored on the system - If multiple downloads are detected, PackageManager waits after a download has occurred before checking another - The wait time is 10 seconds for the first pass through the active packages. - After one pass through all packages, the downloads spaced 10 MINUTES apart - Once checks GitHub for a package, then downloads are turned off - Off disables GitHub downloads - - Note that when switching on automatic downloads, PackageManager first refreshes the version information from GitHub - - Auto install packages: - Controls whether new versions of a package are automatically installed. - Some users may wish to have the system automatically download new updates, - but install them manually. - In this case, automatic GitHub downloads may be turned on and Auto install packages turned off - - Auto install packages also influences whether packages transferred from SD/USB media - are automatically installed or just transferred to local storage - - Active packages: - displays all active packages - - Version information is displayed for each package: - Git Hub shows the version found on GitHub - Stored shows the version stored on the GX device - Installed shows the version actually installed and running - - Tapping on one of the entries leads to the Package editor menu - - Git Hub versions are not refreshed if autodownloads are turned off - to eliminate internet bandwidth from periodic checks. - If auto downloads are off: - Git Hub versions are refreshed once when entering the Package Versions menu - one package every 2 seconds - The Git Hub version for the package shown in the Package editor menu will be refreshed once - If auto downloads are on, one Git Hub version is refreshed every 10 minutes - after an initial pass of one package every 2 seconds. - - Inactive packages: - displays all INACTIVE packages - I.e., default packages not yet activated or manually removed - The first entry is always "new" and allows the operator to enter package name, GitHub user and branch/tag - from scratch - Additional lines (if any) are default packages (from the defaultPackageList file) - If a package is already added to the version list, it will not appear in the Add Package list - - Tapping on one of the entries leads to the Add Package menu - - Backup & Restore settings: - saves settings to the settingsBackup file on removable SD/USB media - or to local media (/data/settingsBackup) - restores from same - /data/SetupHelper/settingsList is a complete list of settings saved to settingsBackup - GuiMods - SetupHelper - ShutdownManager - SOME Victron stock settings in the following sections - Alarms - CGwacs - DigitalInputs - Generators - Gui - Pump - Relay - System - SystemSetup - Vrmlogger - Additionally, backup and restore of the following to/from removable media only - Any logo files in /data/themes/overlay - Setup script options in /data/setupOptions - All logs stored in /data/log are written to logs.zip on the removable media only - as part of the backup - The parameters must exist to be saved - The parameters will be created and set to the backed up value during a restore - - Note: Victron is working on a more comprehensive mechanism but is not working reliably yet - This part of PackageManager is temporary and will be removed when the Victron functionality is working - - SETTINGS_AUTO_RESTORE: - An automatic settings restore will be performed when PackageManager if the file named - SETTINGS_AUTO_RESTORE is detected in the root of removable media - - CAUTION: LEAVING THIS FLASH DRIVE IN THE SYSTEM WILL TRIGGER A SETTINGS RESTORE WITH EVERY BOOT - YOU MUST REMOVE THE FLASH DRIVE AFTER AUTO RESTORE - - microSD / USB: - is a duplicate of the menu item in VRM online portal - it can be used to eject ALL removable media before physically removing them - NOTE: all media is ejected, so if you are using one for VRM logging, - you'll need to reboot or unplug, then replug that device. - - AUTO_EJECT: - If this flag file is found on any removable media, ALL removable media is ejected - after the media is scanned AND if any transferrers were performed: - transfer a package from the media (as an archive file) to /data - restore backup settings - this will NOT occur for - manual settings backup or restore - - Removable media can be corrupted if removed while the VRM logger is still writing to it - so the drive must be ejected to prevent corruption - A manual eject button is included in the PackageManager menu - This automatic eject is intended for unattended deployment and will only occur if the AUTO_EJECT file exists - Unfortunately, the eject mechanism ejects all removable media, not just a specific one. - The VRM logger automatically uses the first removable media found so there is no control over it, - - - AUTO_INSTALL_PACKAGES: - If the file AUTO_INSTALL_PACKAGES is found on removable media, packages will be installed - even if the Auto Install menu option is turned off. This is generally used only for system deployment (see below). - - AUTO_UNINSTALL_PACKAGES: - As above, but will uninstall all packages found in /data - This is useful if you have not command line access and end up with a GUI that is unresponsive - or just to clean up a system, returning it (almost) to factory defaults - This flag file oerrides AUTO_INSTALL_PACKAGES if both are present - - The system is rebooted after the uninstall all just to be sure there's nothing left behind. - - Note: this uses PackageManager, so if SetupHelper isn't installed it will do nothing - - AUTO_INSTALL: - If the file AUTO_INSTALL is present in a package directory, the package will be installed - as if the auto install option is set in the PackageManager menu - Version checks are still performed and DO_NOT_INSTALL is honored - - ONE_TIME_INSTALL - If the file ONE_TIME_INSTALL is present in a package directory, the package is automatically installed - even if automatic installs are diabled and the DO_NOT_INSTALL flag is set - This ONE_TIME_INSTALL is removed when the install is performed - to prevent repeated installs - Packages may be deployed with this flag set to insure it is installed - when a new version is transferred from removable media or downloaded from GitHub - - INITIALZE_PACKAGE_MANAGER and menu item: - If present, the PackageManager's persistent storage (dbus Settings parameters) are initialized - and PackageManager restarted - On restart, PackageManager will rebuild the dbus Settings from packages found in /data - Only custom Git Hub user and branch information is lost. - - - Package editor: - This menu facilitates: - manual install, uninstall, package add and package remove - changing GitHub access information for each package - - Normally, you would want to download the latest released version - but you may also wish to try out a beta version or revert to a previous one. - Once the GitHub branch is changed, PackageManager will update the GitHub version - and, if enabled, download this alternate version. - - Remove Package - Packages that are of no interest to you may be removed from Package Manager. - Removed packages will no longer appear in the version list or be accessible from the Package Editor menu. - But you can add the package back in manually. - - Show Conflicts - If package conflicts exist, the Show Conflicts button appears - Pressign that shows a list of conflicts and asks if they should be resolved - Pressing Proceed will trigger the necessary package installs and uninstalls - needed to resolve the conflicts - - Add package menu: - Allows the package name, GitHub user and GitHub branch or tag to be entered. - - Pressing Proceed initiates the package add. - The package will be added to the package list (and appear in the Package versions menu) - only IF the name is unique - - Pressing Cancel returns to the default package list - - All three fields must be set appropriately or you'll see -- for the GitHub version - - - Package Manager does not allow removing packages unless they are uninstalled first. - - Package Manager DOES permit uninstalling SetupHelper, - however this will remove the Package Manager itself. - Once removed, the Blind Install mechanism will be needed again !! - -USB/SD updates: - - When the GX device is not connected to the internet, a USB flash drive or microSD card provides an install/upgrade path. - - To use the USB update process - Navigate to the GitHub, repo, click on tags and select the appropriate branch or specific version tag. - Choose the .tar.gz download link. - (Do not download from the Code tab or download the .zip file. These won't work.) - Copy the archive file to a USB memory stick or microSD card. - Do NOT unpack the archive - Repeat this for all packages you wish to install. - (These can all be placed on the same media along with the SetupHelper venus-data.tgz file) - Insert the stick in the GX device. - If SetupHelper has not yet been installed, follow the Blind Install process above. - Once Package Manager is running, it will transfer and unpack the archive files - and update the package list with the new packages. - If Auto install packages is turned on, the packages will then be installed - - NOTE: no version checks are made for packages found on SD/USB media! - Package Manager is quite content to transfer and install an older version! - So make sure you have the latest version especially if your GX device does not have internet access. - - - System automatic configuration and package installation: It is possible to use SetupHelper to set up a new system based on a template saved from a working system. Setup the working system the way you want the new system to behave including custom icons, @@ -459,6 +239,3 @@ System automatic configuration and package installation: Create AUTO_INSTALL_PACKAGES on the flash drive as well. Place the flash drive into the GX device to be configured and reboot (once for v2.90 or twice for prior versions). REMOVE THE FLASH DRIVE after you have verified that all packages have been installed (check Active packages in PackageManager). - - -If you are interested in the inner workings of Setup Manager and Package Manager or wish to create a package that can be managed by PackageManager, the document "Package development guidelines" in the DropBox link above contains assitional information. Feel free to contact me through the issues part of SetupHelper on GitHub. diff --git a/blindInstall/SetupHelperVersion b/blindInstall/SetupHelperVersion index 84b2f94..5648d43 100644 --- a/blindInstall/SetupHelperVersion +++ b/blindInstall/SetupHelperVersion @@ -1 +1 @@ -v8.0~33 +v8.0 diff --git a/changes b/changes index bf0cecd..fddb57a 100644 --- a/changes +++ b/changes @@ -1,35 +1,19 @@ -v8.0: (beta) +v8.0: allow multiple packages to modify the same file allow multiple patch files for each active file fixed: PackageManager hangs if there is no setup script in package directory - fixed: package conflict message disappears fixed: "Once" download scan doesn't check all packages - fixed: package checks run unnecessarily after an unclean shutdown - the real time clock last's value was not updated - causing file mod times to be newer than last RTC value - fixed: patch fails if pachage was installed by replacement (old install) - base script prechecks on file modificaiton times to eliminate unnecessary work - setupHelper uninstall and reboots/gui restarts moved from PackageManager main - to separate script - add TailscaleGX to default package list - updatePackage: changed HelperResources version checking to minimize prompts - updatePackage: added patch options including MANUAL to prevent automatic patch updates - updatePackage: rewrite update file sets loop for speed improvement - replace OS's patch with one that handles more cases (eg, 0 context) and options fixed: PackageManager hangs on Python 2 (Venus OS prior to v2.80) - fixed: some patching errors - fixed: PackageManager does not exit for reboot - updatePackage: prompt for helper resources update - don't use HelperResources from package directory (only from SetupHelper) + use HelperResources only from SetupHelper (not from package directory) this was necessary because /data/SetupHelper/patch is now used in place of the stock patch executable moved SetupHelper logging to /var/log/PackageManager/current - fixed: uninstall of patched files failed - added manual recheck for errors discovered in setup script prechecks - move patched files to /etc/venus so it tracks the selected root fs and is cleared - when the firmware is updated - PackageManager completes pending operations before exiting - fixed: patch not working + from /var/log/SetupHelper + added Recheck button for errors discovered in setup script prechecks + PackageManager now completes pending operations before exiting + add TailscaleGX to default package list + updatePackage: added patch options including MANUAL to prevent automatic patch updates + updatePackage: rewrite update file sets loop for speed improvement v7.18: fixed: only first service is uninstalled diff --git a/HelperResources/forSetupScript b/forSetupScript similarity index 100% rename from HelperResources/forSetupScript rename to forSetupScript diff --git a/packageManagerEnd.sh b/packageManagerEnd.sh index 51b9913..92ab730 100755 --- a/packageManagerEnd.sh +++ b/packageManagerEnd.sh @@ -24,21 +24,8 @@ # # reboot overrides a guiRestart since the reboot will restart the GUI -logFile=/data/log/PackageManager/current -logMessage () -{ - # to setup helper log - if [ ! -z $logFile ]; then - if [ -f "$logFile" ]; then - echo "pmEnd: $*" | tai64n >> $logFile - fi - fi -} - -# copied from Essential Resources -EXIT_SUCCESS=0 -EXIT_REBOOT=123 -EXIT_RESTART_GUI=124 +source "/data/SetupHelper/HelperResources/EssentialResources" +logToConsole=false logMessage "starting packageManagerEnd.sh" @@ -62,27 +49,25 @@ while [ $# -gt 0 ]; do shift done -# wait for PackageManager to exit before doing anything if $shUninstall || $reboot ; then - service="/service/PackageManager" - # insure the PackageManager service doesn't restart when it exits - # it will start up again after the reboot if it is still installed - # only issue svc -o if PM is running or it will be started !!! - if [ $(svstat "$service" | awk '{print $2}') == "up" ]; then - svc -o "$service" - fi + waitCount=0 + # wait for up to 20 seconds for PM to exit while true; do if [ -z "$( pgrep -f PackageManager.py )" ]; then break - else + elif (( waitCount == 0 )); then logMessage "waiting for PackageManager.py to exit" - sleep 5 + elif (( waitCount > 20 )); then + logMessage "PackageManager.py DID NOT EXIT - continuing anyway" + break fi + (( waitCount += 1 )) + sleep 1 done fi if $shUninstall ; then - logMessage ">>>> uninstalling SetupHelper !!" + logMessage ">>>> uninstalling SetupHelper" setupFile="/data/SetupHelper/setup" if [ -f "$setupFile" ]; then $setupFile uninstall runFromPm diff --git a/reinstallMods b/reinstallMods index fdfeb01..32246b9 100755 --- a/reinstallMods +++ b/reinstallMods @@ -21,7 +21,7 @@ if [ -f "$setupOptionsDir/DO_NOT_AUTO_INSTALL" ]; then logMessage "CRITICAL: SetupHelper was manually uninstalled therefore it was not reinstalled" logMessage " other packages will NOT BE REINSTALLED either !" -# install PackageManager service if not yet installed +# install PackageManager service else # installing the PackageManager service requires remounting root R/W updateRootToReadWrite diff --git a/venus-data-UninstallPackages.tgz b/venus-data-UninstallPackages.tgz new file mode 100644 index 0000000..905a856 Binary files /dev/null and b/venus-data-UninstallPackages.tgz differ diff --git a/venus-data.tgz b/venus-data.tgz new file mode 100644 index 0000000..e35b517 Binary files /dev/null and b/venus-data.tgz differ diff --git a/version b/version index e9e8b80..5648d43 100644 --- a/version +++ b/version @@ -1 +1 @@ -v8.0~36 +v8.0