penguins-eggs 10.0.37 → 10.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/.oclif.manifest.json +1 -1
  2. package/README.md +31 -30
  3. package/conf/derivatives.yaml +3 -2
  4. package/conf/distros/opensuse/README.md +3 -0
  5. package/conf/distros/opensuse/calamares/calamares-modules/bootloader-config/bootloader-config.sh +40 -0
  6. package/conf/distros/opensuse/calamares/calamares-modules/bootloader-config/module.yml +9 -0
  7. package/conf/distros/opensuse/calamares/calamares-modules/cleanup/cleanup.sh +13 -0
  8. package/conf/distros/opensuse/calamares/calamares-modules/cleanup/module.yml +9 -0
  9. package/conf/distros/opensuse/calamares/modules/bootloader.yml +57 -0
  10. package/conf/distros/opensuse/calamares/modules/displaymanager.yml +23 -0
  11. package/conf/distros/opensuse/calamares/modules/finished.yml +5 -0
  12. package/conf/distros/opensuse/calamares/modules/fstab.yml +12 -0
  13. package/conf/distros/opensuse/calamares/modules/locale.yml +98 -0
  14. package/conf/distros/opensuse/calamares/modules/luksopenswaphookcfg.yml +5 -0
  15. package/conf/distros/opensuse/calamares/modules/machineid.yml +17 -0
  16. package/conf/distros/opensuse/calamares/modules/mount.yml +56 -0
  17. package/conf/distros/opensuse/calamares/modules/packages.yml +6 -0
  18. package/conf/distros/opensuse/calamares/modules/partition.yml +242 -0
  19. package/conf/distros/opensuse/calamares/modules/removeuser.yml +15 -0
  20. package/conf/distros/opensuse/calamares/modules/unpackfs.yml +6 -0
  21. package/conf/distros/opensuse/calamares/modules/users.yml +18 -0
  22. package/conf/distros/opensuse/calamares/modules/welcome.yml +19 -0
  23. package/conf/distros/opensuse/calamares/settings.yml +57 -0
  24. package/conf/distros/rolling/calamares/modules/finished.yml +2 -1
  25. package/conf/distros/rolling/calamares/modules/partition.yml +1 -1
  26. package/conf/distros/rolling/calamares/settings.yml +3 -1
  27. package/dist/classes/bleach.js +5 -1
  28. package/dist/classes/cli-autologin.js +33 -27
  29. package/dist/classes/distro.js +48 -47
  30. package/dist/classes/families/fedora.js +1 -1
  31. package/dist/classes/incubation/fisherman.d.ts +1 -1
  32. package/dist/classes/incubation/fisherman.js +1 -1
  33. package/dist/classes/incubation/incubator.js +8 -0
  34. package/dist/classes/locales.js +1 -1
  35. package/dist/classes/ovary.d.ts +2 -6
  36. package/dist/classes/ovary.js +25 -32
  37. package/dist/classes/pacman.js +11 -11
  38. package/dist/classes/tailor.d.ts +11 -14
  39. package/dist/classes/tailor.js +184 -247
  40. package/dist/classes/utils.js +1 -1
  41. package/dist/commands/wardrobe/wear.js +3 -0
  42. package/dist/components/finished.js +5 -4
  43. package/dist/components/install.js +12 -8
  44. package/dist/interfaces/i-materia.d.ts +9 -14
  45. package/dist/krill/modules/add-user.js +9 -12
  46. package/dist/krill/modules/bootloader-config.js +15 -0
  47. package/dist/krill/modules/bootloader.js +2 -2
  48. package/dist/krill/modules/del-live-user.js +3 -2
  49. package/dist/krill/modules/fstab.js +2 -0
  50. package/dist/krill/modules/initramfs.js +10 -0
  51. package/dist/krill/modules/locale.js +5 -5
  52. package/dist/krill/modules/m-keyboard.js +3 -16
  53. package/dist/krill/modules/machine-id.js +3 -3
  54. package/dist/krill/modules/mkfs.d.ts +2 -0
  55. package/dist/krill/modules/mkfs.js +2 -0
  56. package/dist/krill/modules/unpackfs.js +3 -2
  57. package/dist/krill/sequence.d.ts +9 -6
  58. package/dist/krill/sequence.js +162 -259
  59. package/dracut/dracut.conf.d/01-live.conf +2 -1
  60. package/manpages/doc/man/eggs.1.gz +0 -0
  61. package/manpages/doc/man/eggs.html +4 -4
  62. package/mkinitcpio/arch/README.md +48 -0
  63. package/mkinitcpio/arch/mkinitcpio.conf +4 -3
  64. package/mkinitfs/initramfs-init.in +4 -3
  65. package/package.json +12 -9
  66. package/syslinux/chain.c32 +0 -0
  67. package/syslinux/isolinux.bin +0 -0
  68. package/syslinux/ldlinux.c32 +0 -0
  69. package/syslinux/libcom32.c32 +0 -0
  70. package/syslinux/libutil.c32 +0 -0
  71. package/syslinux/vesamenu.c32 +0 -0
@@ -47,7 +47,7 @@ import initramfsCfg from './modules/initramfs-cfg.js';
47
47
  import initramfs from './modules/initramfs.js';
48
48
  import delLiveUser from './modules/del-live-user.js';
49
49
  // umount already imported
50
- // to order in same wat
50
+ // to order in same way
51
51
  import umount from './modules/umount.js';
52
52
  import mkfs from './modules/mkfs.js';
53
53
  import hostname from './modules/hostname.js';
@@ -111,6 +111,7 @@ export default class Sequence {
111
111
  keyboardLayout = '';
112
112
  keyboardVariant = '';
113
113
  toNull = ' > /dev/null 2>&1';
114
+ spinner = true;
114
115
  settings = {};
115
116
  remix = {};
116
117
  distro = {};
@@ -119,7 +120,6 @@ export default class Sequence {
119
120
  luksFile = ``;
120
121
  luksDevice = `/dev/mapper/${this.luksName}`;
121
122
  luksMountpoint = `/mnt`;
122
- // Clone (Uncrypted)
123
123
  is_clone = fs.existsSync('penguins-eggs.d/is_clone');
124
124
  is_crypted_clone = fs.existsSync('/etc/penguins-eggs.d/is_crypted_clone');
125
125
  unattended = false;
@@ -176,6 +176,12 @@ export default class Sequence {
176
176
  await exec(`sudo ln -s /run/archiso/bootmnt/live/ /live`);
177
177
  }
178
178
  }
179
+ /**
180
+ * dmsetup remove_all
181
+ */
182
+ if (this.distro.familyId === 'opensuse') {
183
+ await exec('dmsetup remove_all');
184
+ }
179
185
  this.unattended = unattended;
180
186
  this.nointeractive = nointeractive;
181
187
  this.chroot = chroot;
@@ -184,418 +190,333 @@ export default class Sequence {
184
190
  this.echo = Utils.setEcho(this.verbose);
185
191
  if (this.verbose) {
186
192
  this.toNull = '';
193
+ this.spinner = false;
187
194
  }
188
195
  // start
189
196
  await this.settings.load();
190
- // partition
191
- let percent = 0.0;
192
- let message = "";
193
197
  let isPartitioned = false;
194
- message = "Creating partitions";
195
- percent = 0.03;
198
+ let message = "Creating partitions";
199
+ await redraw(React.createElement(Install, { message: message, percent: 0, spinner: this.spinner }));
196
200
  try {
197
- await redraw(React.createElement(Install, { message: message, percent: percent }));
198
201
  isPartitioned = await this.partition();
199
202
  }
200
203
  catch (error) {
201
- console.log(JSON.stringify(error));
204
+ await this.showProblem(message, error);
202
205
  }
203
- if (this.verbose)
204
- await Utils.pressKeyToExit(message);
205
206
  if (isPartitioned) {
206
207
  // formatting
207
208
  message = "Formatting file system ";
208
- percent = 0.06;
209
+ await redraw(React.createElement(Install, { message: message, percent: 6, spinner: this.spinner }));
209
210
  try {
210
- await redraw(React.createElement(Install, { message: message, percent: percent }));
211
211
  await this.mkfs();
212
212
  }
213
213
  catch (error) {
214
- console.log(JSON.stringify(error));
214
+ await this.showProblem(message, error);
215
215
  }
216
- if (this.verbose)
217
- await Utils.pressKeyToExit(message);
218
216
  // mountFs
219
217
  message = "Mounting target file system ";
220
- percent = 0.09;
218
+ redraw(React.createElement(Install, { message: message, percent: 9, spinner: this.spinner }));
221
219
  try {
222
- redraw(React.createElement(Install, { message: message, percent: percent }));
223
- await this.mountFs();
220
+ let success = await this.mountFs();
221
+ await sleep(500); // diamo il tempo di montare
224
222
  }
225
223
  catch (error) {
226
- console.log(JSON.stringify(error));
224
+ await this.showProblem(message, error);
227
225
  }
228
- await sleep(500); // diamo il tempo di montare
229
- if (this.verbose)
230
- await Utils.pressKeyToExit(message);
231
226
  // mountVfs
232
227
  message = "Mounting on target VFS ";
233
- percent = 0.12;
228
+ await redraw(React.createElement(Install, { message: message, percent: 12, spinner: this.spinner }));
234
229
  try {
235
- await redraw(React.createElement(Install, { message: message, percent: percent }));
236
230
  await this.mountVfs();
237
231
  }
238
232
  catch (error) {
239
- console.log(JSON.stringify(error));
233
+ await this.showProblem(message, error);
240
234
  }
241
- if (this.verbose)
242
- await Utils.pressKeyToExit(message);
243
235
  // unpackfs
244
236
  message = "Unpacking filesystem ";
245
- percent = 0.15;
237
+ await redraw(React.createElement(Install, { message: message, percent: 15, spinner: this.spinner }));
246
238
  try {
247
- await redraw(React.createElement(Install, { message: message, percent: percent }));
248
239
  await this.unpackfs();
249
240
  }
250
241
  catch (error) {
251
- console.log(JSON.stringify(error));
242
+ await this.showProblem(message, error);
252
243
  }
253
- if (this.verbose)
254
- await Utils.pressKeyToExit(message);
255
244
  // dpkg-unsafe-io
256
245
  if (this.distro.familyId === 'debian') {
257
- message = "dpkg-unsafe-io";
258
- percent = 0.40;
246
+ message = "Debian: dpkg-unsafe-io";
247
+ await redraw(React.createElement(Install, { message: message, percent: 40, spinner: this.spinner }));
259
248
  try {
260
- await redraw(React.createElement(Install, { message: message, percent: percent }));
261
249
  await this.execCalamaresModule('dpkg-unsafe-io');
262
250
  }
263
251
  catch (error) {
264
- console.log(JSON.stringify(error));
252
+ await this.showProblem(message, error);
265
253
  }
266
254
  }
267
- if (this.verbose)
268
- await Utils.pressKeyToExit(message);
269
255
  // sources-yolk
270
256
  if (this.distro.familyId === 'debian') {
271
- message = 'sources-yolk';
272
- percent = 0.43;
257
+ message = 'Debian sources-yolk';
258
+ await redraw(React.createElement(Install, { message: message, percent: 43, spinner: this.spinner }));
273
259
  try {
274
- await redraw(React.createElement(Install, { message: message, percent: percent, spinner: true }));
275
260
  await this.execCalamaresModule('sources-yolk');
276
261
  }
277
262
  catch (error) {
278
- console.log(JSON.stringify(error));
263
+ await this.showProblem(message, error);
279
264
  }
280
265
  }
281
- if (this.verbose)
282
- await Utils.pressKeyToExit(message);
283
266
  // machineid
284
267
  message = 'machineid';
285
- percent = 0.46;
268
+ await redraw(React.createElement(Install, { message: message, percent: 46, spinner: this.spinner }));
286
269
  try {
287
- await redraw(React.createElement(Install, { message: message, percent: percent, spinner: true }));
288
270
  await this.machineId();
289
271
  }
290
272
  catch (error) {
291
- console.log(JSON.stringify(error));
273
+ await this.showProblem(message, error);
292
274
  }
293
- if (this.verbose)
294
- await Utils.pressKeyToExit(message);
295
275
  // fstab
296
276
  message = "Creating fstab ";
297
- percent = 0.49;
277
+ await redraw(React.createElement(Install, { message: message, percent: 49, spinner: this.spinner }));
298
278
  try {
299
- await redraw(React.createElement(Install, { message: message, percent: percent }));
300
279
  await this.fstab(this.partitions.installationDevice);
301
280
  }
302
281
  catch (error) {
303
- console.log(JSON.stringify(error));
282
+ await this.showProblem(message, error);
304
283
  }
305
- if (this.verbose)
306
- await Utils.pressKeyToExit(message);
307
284
  /**
308
285
  * CryptedClone exec eggs syncfrom
309
286
  */
310
287
  if (this.is_crypted_clone) {
311
288
  message = "Restore private data from crypted clone ";
289
+ await redraw(React.createElement(Install, { message: message, percent: 55, spinner: this.spinner }));
312
290
  if (fs.existsSync(this.luksFile)) {
313
- percent = 0.55;
314
291
  let cmd = `eggs syncfrom --rootdir /tmp/calamares-krill-root/ --file ${this.luksFile}`;
315
292
  try {
316
- await redraw(React.createElement(Install, { message: message, percent: percent, spinner: true }));
317
293
  await exec(cmd, Utils.setEcho(true));
318
294
  this.is_clone = true; // Adesso è un clone
319
295
  }
320
296
  catch (error) {
321
- console.log(JSON.stringify(error));
297
+ await this.showProblem(message, error);
322
298
  }
323
299
  }
324
300
  else {
325
301
  await Utils.pressKeyToExit(`Cannot find luks-volume file ${this.luksFile}`);
326
302
  }
327
303
  }
328
- if (this.verbose)
329
- await Utils.pressKeyToExit(message);
330
304
  // networkcfg
331
- message = "networkcfg";
332
- percent = 0.61;
305
+ message = "Network configuration";
306
+ await redraw(React.createElement(Install, { message: message, percent: 61, spinner: this.spinner }));
333
307
  try {
334
308
  await this.networkCfg();
335
309
  }
336
310
  catch (error) {
337
- console.log(JSON.stringify(error));
311
+ await this.showProblem(message, error);
338
312
  }
339
- if (this.verbose)
340
- await Utils.pressKeyToExit(message);
341
313
  // hostname
342
314
  message = "Create hostname ";
343
- percent = 0.64;
315
+ await redraw(React.createElement(Install, { message: message, percent: 64, spinner: this.spinner }));
344
316
  try {
345
- await redraw(React.createElement(Install, { message: message, percent: percent }));
346
317
  await this.hostname(this.network.domain);
347
318
  }
348
319
  catch (error) {
349
- console.log(JSON.stringify(error));
320
+ await this.showProblem(message, error);
350
321
  }
351
- if (this.verbose)
352
- await Utils.pressKeyToExit(message);
353
322
  // dpkg-unsafe-io-undo
354
323
  if (this.distro.familyId === 'debian') {
355
- message = "dpkg-unsafe-io-undo";
356
- percent = 0.65;
324
+ message = "Debian dpkg-unsafe-io-undo";
325
+ await redraw(React.createElement(Install, { message: message, percent: 65, spinner: this.spinner }));
357
326
  try {
358
- await redraw(React.createElement(Install, { message: message, percent: percent }));
359
327
  await this.execCalamaresModule('dpkg-unsafe-io-undo');
360
328
  }
361
329
  catch (error) {
362
- console.log(JSON.stringify(error));
330
+ await this.showProblem(message, error);
363
331
  }
364
332
  }
365
- if (this.verbose)
366
- await Utils.pressKeyToExit(message);
367
333
  /**
368
334
  * IF NOT CLONE:
369
- * - locale
370
- * - keyboard
371
- * - localeCfg
372
- * - delLiveUser
373
- * - adduser
374
- * - autologin
335
+ * locale,
336
+ * keyboard,
337
+ * localeCfg,
338
+ * delLiveUser,
339
+ * adduser,
340
+ * addRootPassword,
341
+ * autologin GUI
375
342
  */
376
343
  if (!this.is_clone) {
377
- // locale
344
+ // NOT_CLONE: locale
378
345
  message = "Locale";
379
- percent = 0.70;
346
+ redraw(React.createElement(Install, { message: message, percent: 70, spinner: this.spinner }));
380
347
  try {
381
- redraw(React.createElement(Install, { message: message, percent: percent }));
382
- if (this.distro.familyId !== 'fedora') {
348
+ if (this.distro.familyId === 'alpine' ||
349
+ this.distro.familyId === 'archlinux' ||
350
+ this.distro.familyId === 'debian') {
383
351
  await this.locale();
384
352
  }
385
353
  }
386
354
  catch (error) {
387
- console.log(JSON.stringify(error));
355
+ await this.showProblem(message, error);
388
356
  }
389
- if (this.verbose)
390
- await Utils.pressKeyToExit(message);
391
- // keyboard
392
- message = "settings keyboard";
393
- percent = 0.71;
357
+ // NOT_CLONE: keyboard
358
+ message = "Settings keyboard";
359
+ redraw(React.createElement(Install, { message: message, percent: 71, spinner: this.spinner }));
394
360
  try {
395
361
  await this.keyboard();
396
362
  }
397
363
  catch (error) {
398
- console.log(JSON.stringify(error));
364
+ await this.showProblem(message, error);
399
365
  }
400
- if (this.verbose)
401
- await Utils.pressKeyToExit(message);
402
- // localeCfg: no alpine, no fedora
403
- if (this.distro.familyId === 'debian' || this.distro.familyId === 'archlinux') {
366
+ // NOT_CLONE: localeCfg
367
+ if (this.distro.familyId === 'archlinux' ||
368
+ this.distro.familyId === 'debian') {
404
369
  message = "Locale Configuration";
405
- percent = 0.72;
370
+ redraw(React.createElement(Install, { message: message, percent: 72, spinner: this.spinner }));
406
371
  try {
407
372
  await this.localeCfg();
408
- await exec("chroot " + this.installTarget + " locale-gen");
373
+ await exec("chroot " + this.installTarget + " locale-gen" + this.toNull);
409
374
  }
410
375
  catch (error) {
411
- console.log(JSON.stringify(error));
376
+ await this.showProblem(message, error);
412
377
  }
413
378
  }
414
- if (this.verbose)
415
- await Utils.pressKeyToExit(message);
416
- // delLiveUser
417
- message = "Remove user LIVE";
418
- percent = 0.73;
379
+ // NOT_CLONE: delLiveUser
380
+ message = "Remove live user";
381
+ await redraw(React.createElement(Install, { message: message, percent: 73, spinner: this.spinner }));
419
382
  try {
420
- await redraw(React.createElement(Install, { message: message, percent: percent }));
421
383
  await this.delLiveUser();
422
384
  }
423
385
  catch (error) {
424
- console.log(JSON.stringify(error));
386
+ await this.showProblem(message, error);
425
387
  }
426
- if (this.verbose)
427
- await Utils.pressKeyToExit(message);
428
- // addUser
429
- message = "Add user";
430
- percent = 0.74;
388
+ // NOT_CLONE: addUser
389
+ message = `Add user ${this.users.username}`;
390
+ await redraw(React.createElement(Install, { message: message, percent: 74, spinner: this.spinner }));
431
391
  try {
432
- await redraw(React.createElement(Install, { message: message, percent: percent }));
433
392
  await this.addUser(this.users.username, this.users.password, this.users.fullname, '', '', '');
434
393
  }
435
394
  catch (error) {
436
- console.log(JSON.stringify(error));
395
+ await this.showProblem(message, error);
437
396
  }
438
- if (this.verbose)
439
- await Utils.pressKeyToExit(message);
440
- // changePassword root
397
+ // NOT_CLONE: addRootPassword
441
398
  message = "Add root password";
442
- percent = 0.75;
399
+ await redraw(React.createElement(Install, { message: message, percent: 75, spinner: this.spinner }));
443
400
  try {
444
- await redraw(React.createElement(Install, { message: message, percent: percent }));
445
401
  await this.changePassword('root', this.users.rootPassword);
446
402
  }
447
403
  catch (error) {
448
- console.log(JSON.stringify(error));
404
+ await this.showProblem(message, error);
449
405
  }
450
- if (this.verbose)
451
- await Utils.pressKeyToExit(message);
452
- // autologin GUI
406
+ // NOT_CLONE: autologin GUI
453
407
  if (Pacman.isInstalledGui()) {
454
408
  try {
455
409
  message = "Autologin GUI";
456
- percent = 0.78;
410
+ await redraw(React.createElement(Install, { message: message, percent: 78, spinner: this.spinner }));
457
411
  if (this.users.autologin) {
458
412
  await Xdg.autologin(await Utils.getPrimaryUser(), this.users.username, this.installTarget);
459
413
  if (this.distro.distroLike === 'Arch') {
460
- await exec(`chroot ${this.installTarget} groupadd autologin`);
461
- await exec(`chroot ${this.installTarget} gpasswd -a ${this.users.username} autologin`);
414
+ await exec(`chroot ${this.installTarget} groupadd autologin ${this.toNull}`);
415
+ await exec(`chroot ${this.installTarget} gpasswd -a ${this.users.username} autologin ${this.toNull}`);
462
416
  }
463
417
  }
464
- await redraw(React.createElement(Install, { message: message, percent: percent }));
465
418
  }
466
419
  catch (error) {
467
- console.log(JSON.stringify(error));
420
+ await this.showProblem(message, error);
468
421
  }
469
422
  }
470
- if (this.verbose)
471
- await Utils.pressKeyToExit(message);
472
423
  } // IF NOT CLONE END
473
- // Remove ALWAYS autologin CLI
424
+ // ALWAYS remove autologin CLI
474
425
  message = "Remove autologin CLI";
475
- percent = 0.80;
426
+ await redraw(React.createElement(Install, { message: message, percent: 80, spinner: this.spinner }));
476
427
  try {
477
- await redraw(React.createElement(Install, { message: message, percent: percent }));
478
428
  await this.cliAutologin.remove(this.installTarget);
479
429
  }
480
430
  catch (error) {
481
- console.log(JSON.stringify(error));
431
+ await this.showProblem(message, error);
482
432
  }
483
- if (this.verbose)
484
- await Utils.pressKeyToExit(message);
485
433
  // bootloader-config
486
434
  message = "bootloader-config ";
487
- percent = 0.81;
435
+ await redraw(React.createElement(Install, { message: message, percent: 81, spinner: this.spinner }));
488
436
  try {
489
- await redraw(React.createElement(Install, { message: message, percent: percent }));
490
437
  await this.bootloaderConfig();
491
438
  }
492
439
  catch (error) {
493
- console.log(JSON.stringify(error));
440
+ await this.showProblem(message, error);
494
441
  }
495
- if (this.verbose)
496
- await Utils.pressKeyToExit(message);
497
442
  // grubcfg
498
443
  message = "grubcfg ";
499
- percent = 0.82;
444
+ await redraw(React.createElement(Install, { message: message, percent: 82, spinner: this.spinner }));
500
445
  try {
501
- await redraw(React.createElement(Install, { message: message, percent: percent }));
502
446
  await this.grubcfg();
503
447
  }
504
448
  catch (error) {
505
- console.log(JSON.stringify(error));
449
+ await this.showProblem(message, error);
506
450
  }
507
- if (this.verbose)
508
- await Utils.pressKeyToExit(message);
509
451
  // bootloader (grub-install)
510
452
  message = "bootloader ";
511
- percent = 0.83;
453
+ await redraw(React.createElement(Install, { message: message, percent: 83, spinner: this.spinner }));
512
454
  try {
513
- await redraw(React.createElement(Install, { message: message, percent: percent }));
514
455
  await this.bootloader();
515
456
  }
516
457
  catch (error) {
517
- console.log(JSON.stringify(error));
458
+ await this.showProblem(message, error);
518
459
  }
519
- if (this.verbose)
520
- await Utils.pressKeyToExit(message);
521
460
  // sources-yolk-undo
522
461
  if (this.distro.familyId === 'debian') {
523
- message = "sources-yolk-undo";
524
- percent = 0.84;
462
+ message = "Debian sources-yolk-undo";
463
+ await redraw(React.createElement(Install, { message: message, percent: 84, spinner: this.spinner }));
525
464
  try {
526
- await redraw(React.createElement(Install, { message: message, percent: percent }));
527
465
  await this.execCalamaresModule('sources-yolk-undo');
528
466
  }
529
467
  catch (error) {
530
- console.log(JSON.stringify(error));
468
+ await this.showProblem(message, error);
531
469
  }
532
470
  }
533
- if (this.verbose)
534
- await Utils.pressKeyToExit(message);
535
471
  // packages
536
- message = "add/remove same packages";
537
- percent = 0.85;
472
+ message = "Add/remove packages...";
473
+ await redraw(React.createElement(Install, { message: message, percent: 85, spinner: this.spinner }));
538
474
  try {
539
- await redraw(React.createElement(Install, { message: message, percent: percent }));
540
475
  await this.packages();
541
476
  }
542
477
  catch (error) {
543
- console.log(JSON.stringify(error));
478
+ await this.showProblem(message, error);
544
479
  }
545
- if (this.verbose)
546
- await Utils.pressKeyToExit(message);
547
480
  // initramfsCfg
548
481
  message = "initramfs configure";
549
- percent = 0.86;
482
+ await redraw(React.createElement(Install, { message: message, percent: 86, spinner: this.spinner }));
550
483
  try {
551
- await redraw(React.createElement(Install, { message: message, percent: percent }));
552
484
  await this.initramfsCfg(this.partitions.installationDevice);
553
485
  }
554
486
  catch (error) {
555
- console.log(JSON.stringify(error));
487
+ await this.showProblem(message, error);
556
488
  }
557
- if (this.verbose)
558
- await Utils.pressKeyToExit(message);
559
489
  // initramfs
560
490
  message = "initramfs ";
561
- percent = 0.87;
491
+ await redraw(React.createElement(Install, { message: message, percent: 87, spinner: this.spinner }));
562
492
  try {
563
- await redraw(React.createElement(Install, { message: message, percent: percent }));
564
493
  await this.initramfs();
565
494
  }
566
495
  catch (error) {
567
- console.log(JSON.stringify(error));
496
+ await this.showProblem(message, error);
568
497
  }
569
- if (this.verbose)
570
- await Utils.pressKeyToExit(message);
571
498
  /**
572
499
  *
573
500
  * remove CLI/GUI installer link
574
501
  */
575
502
  message = "remove GUI installer link";
576
- percent = 0.88;
503
+ await redraw(React.createElement(Install, { message: message, percent: 88, spinner: this.spinner }));
577
504
  try {
578
- await redraw(React.createElement(Install, { message: message, percent: percent }));
579
505
  await this.removeInstallerLink();
580
506
  }
581
507
  catch (error) {
582
- console.log(JSON.stringify(error));
508
+ await this.showProblem(message, error);
583
509
  }
584
- if (this.verbose)
585
- await Utils.pressKeyToExit(message);
586
510
  // remove /etc/penguins_eggs.d/is_clone*
587
511
  message = "Cleanup";
588
- percent = 0.89;
512
+ await redraw(React.createElement(Install, { message: message, percent: 89, spinner: this.spinner }));
589
513
  try {
590
- await redraw(React.createElement(Install, { message: message, percent: percent }));
591
514
  await exec(`rm -f ${this.installTarget}/etc/penguins-eggs.d/is_clone`);
592
515
  await exec(`rm -f ${this.installTarget}/etc/penguins-eggs.d/is_crypted_clone`);
593
516
  }
594
517
  catch (error) {
595
- console.log(JSON.stringify(error));
518
+ await this.showProblem(message, error);
596
519
  }
597
- if (this.verbose)
598
- await Utils.pressKeyToExit(message);
599
520
  /**
600
521
  * custom final steps
601
522
  */
@@ -604,72 +525,54 @@ export default class Sequence {
604
525
  if (steps.length > 0) {
605
526
  for (const step of steps) {
606
527
  message = `running ${step}`;
607
- percent = 0.90;
528
+ await redraw(React.createElement(Install, { message: message, percent: 90, spinner: this.spinner }));
608
529
  try {
609
- await redraw(React.createElement(Install, { message: message, percent: percent }));
610
530
  await this.execCalamaresModule(step);
611
531
  }
612
532
  catch (error) {
613
- console.log(JSON.stringify(error));
533
+ await this.showProblem(message, error);
614
534
  }
615
535
  }
616
- if (this.verbose)
617
- await Utils.pressKeyToExit(message);
618
536
  }
619
537
  // chroot
620
538
  if (chroot) {
621
539
  message = `You are in chroot mode under ${this.installTarget}, type "exit" to exit.`;
622
- percent = 0.95;
623
- try {
624
- await redraw(React.createElement(React.Fragment, null,
625
- React.createElement(Title, null),
626
- React.createElement(Box, null,
627
- React.createElement(Text, null, message))));
628
- cliCursor.show();
629
- await exec(`chroot ${this.installTarget} /bin/bash`);
630
- cliCursor.hide();
631
- }
632
- catch (error) {
633
- console.log(JSON.stringify(error));
634
- }
540
+ await this.emergencyShell(message);
635
541
  }
636
- if (this.verbose)
637
- await Utils.pressKeyToExit(message);
638
542
  // umountVfs
639
543
  message = "umount VFS";
640
- percent = 0.96;
544
+ await redraw(React.createElement(Install, { message: message, percent: 96, spinner: this.spinner }));
641
545
  try {
642
- await redraw(React.createElement(Install, { message: message, percent: percent }));
643
546
  await this.umountVfs();
644
547
  }
645
548
  catch (error) {
646
- console.log(JSON.stringify(error));
549
+ await this.showProblem(message, error);
647
550
  }
648
- if (this.verbose)
649
- await Utils.pressKeyToExit(message);
650
551
  message = "umount";
651
- percent = 0.97;
552
+ await redraw(React.createElement(Install, { message: message, percent: 99, spinner: this.spinner }));
652
553
  try {
653
- await redraw(React.createElement(Install, { message: message, percent: percent }));
654
554
  await this.umountFs();
655
555
  }
656
556
  catch (error) {
657
- console.log(JSON.stringify(error));
557
+ await this.showProblem(message, error);
658
558
  }
659
- if (this.verbose)
660
- await Utils.pressKeyToExit(message);
661
- // finished
662
- message = "finished";
663
- percent = 100.0;
664
- try {
665
- await redraw(React.createElement(Install, { message: message, percent: percent }));
666
- await this.finished();
559
+ // Finished
560
+ let cmd = "reboot";
561
+ if (this.halt) {
562
+ cmd = "poweroff";
667
563
  }
668
- catch (error) {
669
- console.log(JSON.stringify(error));
564
+ message = `Press a key to ${cmd}`;
565
+ if (this.unattended && this.nointeractive) {
566
+ message = `System will ${cmd} in 5 seconds...`;
567
+ }
568
+ await redraw(React.createElement(Finished, { installationDevice: this.partitions.installationDevice, hostName: this.users.hostname, userName: this.users.username, message: message }));
569
+ if (this.unattended && this.nointeractive) {
570
+ await sleep(5000);
571
+ }
572
+ else {
573
+ spawnSync('read _ ', { shell: true, stdio: [0, 1, 2] });
670
574
  }
671
- if (this.verbose)
672
- await Utils.pressKeyToExit(message);
575
+ await exec(cmd, { echo: false });
673
576
  }
674
577
  }
675
578
  /**
@@ -687,25 +590,44 @@ export default class Sequence {
687
590
  }
688
591
  }
689
592
  /**
690
- * only show the result
691
- */
692
- async finished() {
693
- let cmd = "reboot";
694
- if (this.halt) {
695
- cmd = "poweroff";
593
+ *
594
+ * @param message
595
+ */
596
+ async emergencyShell(message) {
597
+ try {
598
+ await redraw(React.createElement(React.Fragment, null,
599
+ React.createElement(Title, null),
600
+ React.createElement(Box, null,
601
+ React.createElement(Text, null, message))));
602
+ cliCursor.show();
603
+ await exec(`chroot ${this.installTarget} /bin/bash`);
604
+ cliCursor.hide();
696
605
  }
697
- let message = `Press a key to ${cmd}`;
698
- if (this.unattended && this.nointeractive) {
699
- message = `System will ${cmd} in 5 seconds...`;
606
+ catch (error) {
607
+ await Utils.pressKeyToExit(JSON.stringify(error));
700
608
  }
701
- await redraw(React.createElement(Finished, { installationDevice: this.partitions.installationDevice, hostName: this.users.hostname, userName: this.users.username }));
702
- if (this.unattended && this.nointeractive) {
703
- await sleep(5000);
704
- await exec(cmd, { echo: false });
609
+ }
610
+ /**
611
+ *
612
+ * @param message
613
+ */
614
+ async showProblem(message, currErr) {
615
+ message = `We was on "${message}", get error: ${JSON.stringify(currErr)}, type "exit" to exit from krill emergency shell.`;
616
+ try {
617
+ await redraw(React.createElement(React.Fragment, null,
618
+ React.createElement(Title, null),
619
+ React.createElement(Box, null,
620
+ React.createElement(Text, null, message)),
621
+ React.createElement(Box, null,
622
+ React.createElement(Text, null,
623
+ "Error: ",
624
+ currErr))));
625
+ cliCursor.show();
626
+ await exec("/bin/bash");
627
+ cliCursor.hide();
705
628
  }
706
- else {
707
- spawnSync('read _ ', { shell: true, stdio: [0, 1, 2] });
708
- await exec(cmd, { echo: false });
629
+ catch (error) {
630
+ await Utils.pressKeyToExit(JSON.stringify(error));
709
631
  }
710
632
  }
711
633
  }
@@ -716,7 +638,7 @@ export default class Sequence {
716
638
  async function redraw(elem) {
717
639
  let opt = {};
718
640
  opt.patchConsole = false;
719
- opt.debug = false;
641
+ opt.debug = true;
720
642
  console.clear();
721
643
  render(elem, opt);
722
644
  }
@@ -730,22 +652,3 @@ function sleep(ms = 0) {
730
652
  setTimeout(resolve, ms);
731
653
  });
732
654
  }
733
- /**
734
- *
735
- * @param message
736
- */
737
- async function emergencyShell(message) {
738
- message = message + `type "exit" to exit.`;
739
- try {
740
- await redraw(React.createElement(React.Fragment, null,
741
- React.createElement(Title, null),
742
- React.createElement(Box, null,
743
- React.createElement(Text, null, message))));
744
- cliCursor.show();
745
- await exec("/bin/bash");
746
- cliCursor.hide();
747
- }
748
- catch (error) {
749
- await Utils.pressKeyToExit(JSON.stringify(error));
750
- }
751
- }