Hi! One of the initial goal of the work done on improving the GTK+ frontend code was to make it provide a simple API for plugins. This work has been completed and integrated in the current cdebconf version, but useful plugins as yet to be written.
The first plugin to be written, obviously, is the graphical sibling to the plugin gathering entropy, used in partman-crypto. The code for this plugin was actually written while working on the rest of the GTK+ frontend [1] but as yet to be integrated properly. [1] http://people.debian.org/~lunar/fe_gtk-plugin-entropy.c I have taken another look at this, and I stumbled on a few issues on which I would welcome advices… The cdebconf-entropy source packages currently build a plugin named "newt/plugin-entropy-text.so" which will introduces a new question type, "entropy-text". This question type is only used currently in partman-crypto by the following template: Template: partman-crypto/entropy-text Type: entropy-text _Description: Enter random characters The encryption key for ${DEVICE} is now being created. . You can help speed up the process by entering random characters on the keyboard, or just wait until enough keydata has been collected. (NOTE: this can take a long time) The straightforward way to add an entropy gathering plugin would be to add another question type, for example "entropy-gui", add another template in partman-crypto, duplicate all code checking for the plugin and be done with it. But I think this would be sub-obtimal. :) I think it would make more sense to make a single question type, for both frontend, named "entropy", and to have a single question template in partman-crypto and a single code path handling both frontends. But the strings displayed to the user becomes problematic: we need to ask for random characters on the keyboard for the newt frontend, but it would be a shame not to mention random mouse movements for the GTK+ frontend. In the previous template, two strings are not actually relevant to the question asked, but to the frontend asking it: frontend specific vvvvvvvvvvvvvvvvvvvvvvv _Description: Enter random characters The encryption key for ${DEVICE} is now being created. . > You can help speed up the process by entering random same > characters on the keyboard, or just wait until enough here > keydata has been collected. (NOTE: this can take a long > time) I thought about using the newly introduced debconf directives, but I might just wanna play with a new toy here. So I really want to know other advices before hacking… Here is the proposed implementation, though: Using directives would make the previous template look like: _Description: ${!ENTROPY_SHORT_TITLE} The encryption key for ${DEVICE} is now being created. . ${!ENTROPY_GENERATE_MORE} A new text template would be introduced in each plugin built by cdebconf-entropy. Its short description would be used for ENTROPY_SHORT_TITLE and ENTROPY_GENERATE_MORE would be its extended description. I'm not totally happy with this approach. If anyone can think about anything (and I'm sure you can! ;)), please speak up. :) Cheers, -- Jérémy Bobbio .''`. [EMAIL PROTECTED] : :Ⓐ : # apt-get install anarchism `. `'` `-
signature.asc
Description: Digital signature