-
I see that a custom plugin script is run during phase 0, phase 1, and post-install of the --customize command just like a custom phase script. If one wanted a plugin to run during a --burn command, would it be the same script (perhaps with different parameters) or should you use a separate script? What would the phase parameter indicate if running during a burn operation? Maybe 'post-install'? What's the fundamental/practical difference between running a --burn command with a plugin vs. b0script & b1script? p.s. Maybe I just am not familiar enough with navigating and searching Github, but it took some hunting to find sdm-plugin-template referenced in sdm Plugins. A link right when it was mentioned would be very helpful. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
Great questions! I just looked at the docs, and indeed...the questions you are asking are not answered there, so will do some wordsmithing there once the extent of the gap is clear. Here's what I think is the missing piece: How Plugins work When a
In the case of
By the way, this is exactly how custom phase scripts work, except that the custom phase script (invoked via Yes, custom phase scripts AND plugins can be used together. However, only Plugins can be used with This means you can build modular plugins for just about anything you want, and have a lot more control over how you build your deployed disks. I build all my server images from a single IMG, and add in various services when I burn one. This means I can easily put (for instance) the Samba server on my file server, but no Samba on all the rest. I found that having a common configuration, with all my various bits and pieces (.bashrc, .ssh files, other tools/scripts, etc) already there makes me SO much more productive. It took me a while to get everything into my custom phase script, but I tried to improve it every time I ran into something else that I needed in the image. |
Beta Was this translation helpful? Give feedback.
-
Also, you asked about the difference between plugins and b0script vs b1script. b0script and b1script are a result of not spending enough time thinking about the problem when they were done. I was solving a specific problem and they were a great solution at the time. Now that I've built up more capability in sdm (generalized spawning being the important aspect), plugins are a natural next step with much more capability than b0script/b1script. But, there are still uses for b0script/b1script, such as used in sdm-gburn. While what it wants to do could all be done by building plugins, b0script/b1script are very convenient in this use case. |
Beta Was this translation helpful? Give feedback.
-
I've added the wiki page Programming plugins and custom phase scripts, which captures my notes above on Phase 0/1/post-install. Please have a read and let me know your thoughts. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I'm in the process of updating the Wiki and will be adding the Wiki sources to the github. I've added most of your comments above, still a few left to go through. I wanted to respond to one question you asked: "Would one typically have a separate plugin script for customizing and burning? Seems like it would be pretty easy to reference the appropriate one in the --customize or --burn command. If so, this might be worth mentioning." The great thing about plugins is that the exact same plugin code can be used during customization or burning. There's no need for two different versions. I can't envision a situation where this would be useful, but if plugin code needs to know whether it's part of a customize or a burn it can test something like |
Beta Was this translation helpful? Give feedback.
Great questions! I just looked at the docs, and indeed...the questions you are asking are not answered there, so will do some wordsmithing there once the extent of the gap is clear.
Here's what I think is the missing piece: How Plugins work
When a
--plugin plug-name
switch is given, all 3 phases of the pluginplug-name
are called, and in a context that is correct for each phase (Phase 0, Phase 1, post-install). This means thatIn the case of
--customize
, the 3 phases of the plugin are called by sdm at the…