Repository navigation
Conversation
| option('supported_languages', type : 'string', value : 'aa;ab;ae;af;ak;am;an;ar;as;ast;av;ay;az;ba;be;bg;bh;bi;bm;bn;bo;br;bs;ca;ce;ch;ckb;co;cr;cs;cu;cv;cy;da;de;de_CH;de_DE;dv;dz;ee;el;en;en_US;en_AU;en_CA;en_GB;eo;es;et;eu;fa;ff;fi;fj;fo;fr;fr_BE;fr_CA;fr_FR;fy;ga;gd;gl;gn;gu;gv;ha;he;hi;ho;hr;ht;hu;hy;hz;ia;id;ie;ig;ii;ik;io;is;it;iu;ja;jv;ka;kab;kg;ki;kj;kk;kl;km;kn;ko;kr;ks;ku;kv;kw;ky;la;lb;lg;li;ln;lo;lt;lu;lv;mg;mh;mi;mk;ml;mn;mo;mr;ms;mt;my;na;nb;nd;ne;ng;nl;nn;nr;nv;ny;oc;oj;om;or;os;pa;pi;pl;ps;pt;pt_PT;pt_BR;qu;rm;rn;ro;ru;rue;rw;sa;sc;sd;se;sg;si;sk;sl;sm;sma;sn;so;sq;sr;ss;st;su;sv;sw;szl;ta;te;tg;th;ti;tk;tl;tn;to;tr;ts;tt;tw;ty;udm;ug;uk;ur;uz;ve;vi;vo;wa;wo;xh;yi;yo;za;zh;zh_CN;zh_HK;zh_TW;zu', description : 'The list of supported languages') | ||
| option('preferred_languages', type : 'string', value : 'en;zh;es;fr;pt;ru;de', description : 'A prioritized list of languages') | ||
| option('installer_backend', type : 'combo', choices : ['distinst'], value : 'distinst') | ||
| option('installer_backend', type : 'combo', choices : ['distinst', 'repart'], value : 'repart') |
There was a problem hiding this comment.
@danirabbit Do we want to set the default to repart at this time or leave it as distinst? I prefer to switch to repart.
There was a problem hiding this comment.
Tbh I don't think this is the way to go. We can detect this at runtime no? We'd have to build two packages this way if we want to have the classic install image.
There was a problem hiding this comment.
Can we do the runtime thing in a later PR? that will require UI changes to let the user pick which mode they want?
There was a problem hiding this comment.
Yeah, both options should be in the installer.
The iso contains both images
There was a problem hiding this comment.
Oh for some reason I thought it was two different images. I'm unsure how best to handle that 🤔
There was a problem hiding this comment.
Latest commits (very much still experimental WIP branch) enable runtime backend selection, please take a look when you can. I'm sure there's a cleaner more elegant way to do all this?
This comment was marked as resolved.
This comment was marked as resolved.
|
@danirabbit i've addressed your feedback. @jumpyvi i know both images are in the new ISO and i agree we should remove the compile time backend option and make it runtime user-selectable, but that can be in another PR, especially as I likely will fumble the UI changes lol. |
I believe I've addressed everything for now.
|
It also seems like you didn't really try very hard to not just run everything directly as Terminal commands when we have for example GLib functions |
You're right, it was a quick/lazy port from the bash script, I'll update the backend to use native stuff as much as available, thanks! |
Co-authored-by: Vishal Rao <vishalrao@gmail.com>
|
@danirabbit @jumpyvi @elementary/desktop-developers @elementary/ux if you could provide review feedback, this PR is close to what I can do, next is to break this up into separate PRs. |
|
|
||
| private void load_partitioning_view () { | ||
| var partitioning_view = new PartitioningView (MINIMUM_SPACE); | ||
| var partitioning_view = new PartitioningView (Daemon.get_default ().get_backend () == REPART ? MINIMUM_SPACE_MODERN : MINIMUM_SPACE); |
There was a problem hiding this comment.
Seems like the backend should return the correct value instead of having those values live here?
|
|
||
| [DBus (name = "io.elementary.InstallerDaemon")] | ||
| public class InstallerDaemon.BackendProxy : GLib.Object { | ||
| private InstallerDaemon.Backend backend = InstallerDaemon.Backend.UNKNOWN; |
There was a problem hiding this comment.
get; private set instead so we can get right of the get_backend func?
| case InstallerDaemon.Backend.DISTINST: | ||
| backend_proxy = new InstallerDaemon.DistinstBackend (); | ||
| break; | ||
| case InstallerDaemon.Backend.REPART: |
There was a problem hiding this comment.
You can use implicit namespace here
| case InstallerDaemon.Backend.DISTINST: | |
| backend_proxy = new InstallerDaemon.DistinstBackend (); | |
| break; | |
| case InstallerDaemon.Backend.REPART: | |
| case DISTINST: | |
| backend_proxy = new InstallerDaemon.DistinstBackend (); | |
| break; | |
| case REPART: |
| private const string SQUASH_MOUNT = "/mnt/source-image"; | ||
|
|
||
| private void log_message (InstallerDaemon.LogLevel level, string format, ...) { | ||
| var msg= format.vprintf (va_list ()); |
There was a problem hiding this comment.
| var msg= format.vprintf (va_list ()); | |
| var msg = format.vprintf (va_list ()); |
| public bool has_tpm2 () throws GLib.Error { | ||
| try { | ||
| var output = run_capture ({"systemd-analyze", "has-tpm2"}); | ||
| var lines = output.split ("\n"); | ||
| return lines.length > 0 && lines[0].strip () == "yes"; | ||
| } catch (GLib.Error e) { | ||
| log_message (InstallerDaemon.LogLevel.WARN, "TPM2 check failed: %s", e.message); | ||
| return false; | ||
| } | ||
| } |
There was a problem hiding this comment.
Isn't systemd-analyze available regardless of backend?
| public abstract bool has_tpm2 () throws GLib.Error; | ||
| protected bool default_has_tpm2 () { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
I think this is maybe not entirely telling the truth. There's 2 things here, one is whether the system has tpm2 (which presumably we can always check with systemd-analyze regardless of backend). The other is if the backend supports tpm2 (which should be false by default and then the backend can overwrite it).
Then we can early return in has_tpm2 () if !Backend.supports_tpm ()
| } | ||
|
|
||
| var apt_sources = File.new_for_path ("/etc/apt/sources.list.d/elementary.list"); | ||
| var apt_sources = File.new_for_path ("/etc/apt/sources.list.d/elementary.sources"); |
| private Gtk.CheckButton use_tpm_checkbutton; | ||
|
|
||
| private const string SKIP_STRING = _("Don’t Encrypt"); | ||
| private const string TPM_STRING = _("Encrypt Using TPM"); |
There was a problem hiding this comment.
Is there a reason why we wouldn't want to use TPM if it's available? Does this even need to be an option?
If it does need to be an option, we need to provide information that helps people decide which choice is right for them
| @@ -1,3 +1,2 @@ | |||
| option('supported_languages', type : 'string', value : 'aa;ab;ae;af;ak;am;an;ar;as;ast;av;ay;az;ba;be;bg;bh;bi;bm;bn;bo;br;bs;ca;ce;ch;ckb;co;cr;cs;cu;cv;cy;da;de;de_CH;de_DE;dv;dz;ee;el;en;en_US;en_AU;en_CA;en_GB;eo;es;et;eu;fa;ff;fi;fj;fo;fr;fr_BE;fr_CA;fr_FR;fy;ga;gd;gl;gn;gu;gv;ha;he;hi;ho;hr;ht;hu;hy;hz;ia;id;ie;ig;ii;ik;io;is;it;iu;ja;jv;ka;kab;kg;ki;kj;kk;kl;km;kn;ko;kr;ks;ku;kv;kw;ky;la;lb;lg;li;ln;lo;lt;lu;lv;mg;mh;mi;mk;ml;mn;mo;mr;ms;mt;my;na;nb;nd;ne;ng;nl;nn;nr;nv;ny;oc;oj;om;or;os;pa;pi;pl;ps;pt;pt_PT;pt_BR;qu;rm;rn;ro;ru;rue;rw;sa;sc;sd;se;sg;si;sk;sl;sm;sma;sn;so;sq;sr;ss;st;su;sv;sw;szl;ta;te;tg;th;ti;tk;tl;tn;to;tr;ts;tt;tw;ty;udm;ug;uk;ur;uz;ve;vi;vo;wa;wo;xh;yi;yo;za;zh;zh_CN;zh_HK;zh_TW;zu', description : 'The list of supported languages') | |||
| option('preferred_languages', type : 'string', value : 'en;zh;es;fr;pt;ru;de', description : 'A prioritized list of languages') | |||
| option('installer_backend', type : 'combo', choices : ['distinst'], value : 'distinst') | |||
There was a problem hiding this comment.
I think we should still keep this because there was talk about replacing distinst with calamares
|
Could distinst be optional so it can be built only with repart support? Distinst is not fun to build |
| private const int DBUS_TIMEOUT_MSEC = 600 * 1000; | ||
|
|
||
| [DBus (name = "io.elementary.InstallerDaemon")] | ||
| private interface InstallerInterface : GLib.DBusProxy { |
There was a problem hiding this comment.
We should probably move this to common instead of duplicating it
Fixes #941
EDIT: See #959 (comment) for as-on-date work-in-progress screenshots.