diff --git a/builds/any/installer/sample-postinstall.py b/builds/any/installer/sample-postinstall.py index b7049e6b..cf1db0b4 100644 --- a/builds/any/installer/sample-postinstall.py +++ b/builds/any/installer/sample-postinstall.py @@ -26,6 +26,8 @@ of the installer Python script) will 2. instantiate an instance of each class, with the installer object initialized as the 'installer' attribute 3. invoke the 'run' method (which must be overridden by implementors) + For a post-install plugin, the 'mode' argument is set to + PLUGIN_POSTINSTALL. 4. invoke the 'shutdown' method (by default, a no-op) The 'run' method should return zero on success. In any other case, the @@ -45,6 +47,12 @@ e.g. MountContext. The OnlMountContextReadWrite object and their siblings won't work here because the mtab.yml file is not populated within the loader environment. +A post-install plugin should execute any post-install actions when +'mode' is set to PLUGIN_POSTINSTALL. If 'mode' is set to any other +value, the plugin should ignore it and return zero. The plugin run() +method is invoked multiple times during the installer with different +values of 'mode'. The 'shutdown()' method is called only once. + When using MountContxt, the system state in the installer object can help (self.installer.blkidParts in particular). diff --git a/builds/any/installer/sample-preinstall.py b/builds/any/installer/sample-preinstall.py index 704d9a6c..cd29c2dc 100644 --- a/builds/any/installer/sample-preinstall.py +++ b/builds/any/installer/sample-preinstall.py @@ -26,6 +26,8 @@ of the installer Python script) will 2. instantiate an instance of each class, with the installer object initialized as the 'installer' attribute 3. invoke the 'run' method (which must be overridden by implementors) + For a pre-install plugin, the 'mode' argument is set to + PLUGIN_PREINSTALL. 4. invoke the 'shutdown' method (by default, a no-op) The 'run' method should return zero on success. In any other case, the @@ -38,6 +40,12 @@ prepped/initialized/scanned yet. As per the ONL installer API, the installer starts with *no* filesystems mounted, not even the ones from a prior install. +A pre-install plugin should execute any pre-install actions when +'mode' is set to PLUGIN_PREINSTALL. If 'mode' is set to any other +value, the plugin should ignore it and return zero. The plugin run() +method is invoked multiple times during the installer with different +values of 'mode'. The 'shutdown()' method is called only once. + """ import onl.install.Plugin