penguins-eggs 10.0.60 → 10.1.1

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 (138) hide show
  1. package/.oclif.manifest.json +62 -1
  2. package/README.md +145 -75
  3. package/addons/eggs/theme/calamares/modules/{_users.yml → users.yml} +3 -3
  4. package/addons/eggs/theme/livecd/grub.main.full.cfg +1 -1
  5. package/addons/eggs/theme/livecd/grub.main.simple.cfg +1 -1
  6. package/conf/derivatives.yaml +4 -3
  7. package/conf/derivatives_fedora.yaml +6 -0
  8. package/conf/distros/alpine/calamares/modules/users.yml +3 -3
  9. package/conf/distros/bionic/calamares/calamares-modules/grubcfg/grubcfg.yml +1 -1
  10. package/conf/distros/bionic/calamares/modules/users.yml +3 -3
  11. package/conf/distros/buster/calamares/modules/users.yml +4 -3
  12. package/conf/distros/fedora/calamares/modules/users.yml +3 -3
  13. package/conf/distros/noble/calamares/modules/focal-jammy/users.yml +3 -3
  14. package/conf/distros/noble/calamares/modules/users.yml +1 -0
  15. package/conf/distros/opensuse/calamares/modules/users.yml +3 -3
  16. package/conf/distros/rolling/calamares/modules/users.yml +3 -3
  17. package/conf/eggs.yaml +1 -1
  18. package/conf/love.yaml +4 -4
  19. package/dist/classes/compressors.js +1 -1
  20. package/dist/classes/distro.d.ts +27 -3
  21. package/dist/classes/distro.js +361 -289
  22. package/dist/classes/ovary.d/bind-live-fs.js +22 -30
  23. package/dist/classes/ovary.d/edit-live-fs.d.ts +1 -0
  24. package/dist/classes/ovary.d/edit-live-fs.js +9 -13
  25. package/dist/classes/ovary.d/fertilization.js +6 -1
  26. package/dist/classes/ovary.d/initrd.js +11 -15
  27. package/dist/classes/ovary.d/kernel-copy.js +2 -16
  28. package/dist/classes/ovary.d/make-efi.js +8 -5
  29. package/dist/classes/ovary.d/make-squashfs.d.ts +1 -1
  30. package/dist/classes/ovary.d/make-squashfs.js +17 -24
  31. package/dist/classes/ovary.d/merged.d.ts +9 -13
  32. package/dist/classes/ovary.d/merged.js +38 -48
  33. package/dist/classes/ovary.d/produce.d.ts +1 -1
  34. package/dist/classes/ovary.d/produce.js +38 -32
  35. package/dist/classes/ovary.d/syslinux.js +4 -4
  36. package/dist/classes/ovary.d/user-create-live.js +12 -5
  37. package/dist/classes/ovary.d.ts +8 -3
  38. package/dist/classes/ovary.js +8 -3
  39. package/dist/classes/pacman.d/archlinux.js +1 -5
  40. package/dist/classes/pacman.js +2 -1
  41. package/dist/classes/systemctl.d.ts +1 -1
  42. package/dist/classes/systemctl.js +1 -1
  43. package/dist/classes/tailor.js +2 -1
  44. package/dist/classes/utils.d/architecture.d.ts +41 -0
  45. package/dist/classes/utils.d/architecture.js +87 -0
  46. package/dist/classes/utils.d/console-output.d.ts +26 -0
  47. package/dist/classes/utils.d/console-output.js +46 -0
  48. package/dist/classes/utils.d/filesystem.d.ts +53 -0
  49. package/dist/classes/utils.d/filesystem.js +152 -0
  50. package/dist/classes/utils.d/formatters.d.ts +32 -0
  51. package/dist/classes/utils.d/formatters.js +64 -0
  52. package/dist/classes/utils.d/kernel.d.ts +83 -0
  53. package/dist/classes/utils.d/kernel.js +288 -0
  54. package/dist/classes/utils.d/network.d.ts +43 -0
  55. package/dist/classes/utils.d/network.js +133 -0
  56. package/dist/classes/utils.d/package-info.d.ts +55 -0
  57. package/dist/classes/utils.d/package-info.js +137 -0
  58. package/dist/classes/utils.d/snapshot.d.ts +44 -0
  59. package/dist/classes/utils.d/snapshot.js +102 -0
  60. package/dist/classes/utils.d/system.d.ts +63 -0
  61. package/dist/classes/utils.d/system.js +200 -0
  62. package/dist/classes/utils.d/user-interaction.d.ts +39 -0
  63. package/dist/classes/utils.d/user-interaction.js +104 -0
  64. package/dist/classes/utils.d.ts +90 -322
  65. package/dist/classes/utils.js +105 -1013
  66. package/dist/commands/dad.d.ts +1 -0
  67. package/dist/commands/dad.js +1 -0
  68. package/dist/commands/export/pkg.js +6 -6
  69. package/dist/commands/export/tarballs.js +11 -16
  70. package/dist/commands/kill.js +1 -1
  71. package/dist/commands/love.d.ts +1 -0
  72. package/dist/commands/love.js +21 -7
  73. package/dist/commands/pods.d.ts +22 -0
  74. package/dist/commands/pods.js +92 -0
  75. package/dist/commands/produce.d.ts +1 -0
  76. package/dist/commands/produce.js +21 -1
  77. package/dist/commands/update.js +2 -2
  78. package/dist/index.d.ts +6 -52
  79. package/dist/index.js +6 -145
  80. package/dist/krill/classes/krill_enums.d.ts +14 -1
  81. package/dist/krill/classes/krill_enums.js +16 -1
  82. package/dist/krill/classes/prepare.d/partitions.js +3 -3
  83. package/dist/krill/classes/prepare.d.ts +46 -21
  84. package/dist/krill/classes/prepare.js +187 -187
  85. package/dist/krill/classes/sequence.d/add_user.js +21 -3
  86. package/dist/krill/classes/sequence.d/partition.js +2 -2
  87. package/dist/krill/classes/sequence.d.ts +18 -21
  88. package/dist/krill/classes/sequence.js +156 -423
  89. package/dist/krill/components/information.js +13 -7
  90. package/dist/{krill/lib → lib}/kill_me_softly.js +2 -2
  91. package/dist/penguins-eggs_10.1.1-0_amd64.deb +0 -0
  92. package/dist/penguins-eggs_10.1.1-0_amd64.deb.sha256 +1 -0
  93. package/package.json +32 -27
  94. package/perrisbrewery/scripts/postinst +98 -0
  95. package/perrisbrewery/scripts/postrm +82 -0
  96. package/perrisbrewery/scripts/preinst +40 -0
  97. package/perrisbrewery/scripts/prerm +47 -0
  98. package/perrisbrewery/template/control.template +17 -0
  99. package/perrisbrewery/template/dependencies-bionic.yaml +33 -0
  100. package/perrisbrewery/template/dependencies.yaml +37 -0
  101. package/perrisbrewery/template/man.template.md +110 -0
  102. package/pods/README.md +14 -0
  103. package/pods/almalinux.sh +10 -0
  104. package/pods/archlinux.sh +10 -0
  105. package/pods/ci/README.md +5 -0
  106. package/pods/ci/kernel-overlay-install.sh +114 -0
  107. package/pods/ci/minimal/almalinux-container2host.sh +165 -0
  108. package/pods/ci/minimal/archlinux-container2host.sh +125 -0
  109. package/pods/ci/minimal/debian-container2host.sh +173 -0
  110. package/pods/ci/minimal/fedora-container2host.sh +170 -0
  111. package/pods/ci/minimal/manjaro-container2host.sh +123 -0
  112. package/pods/ci/minimal/opensuse-container2host.sh +143 -0
  113. package/pods/ci/penguins-eggs-execute.sh +22 -0
  114. package/pods/ci/penguins-eggs-install.sh +115 -0
  115. package/pods/ci/run +34 -0
  116. package/pods/ci/run-on-almalinux.sh +50 -0
  117. package/pods/ci/run-on-archlinux.sh +64 -0
  118. package/pods/ci/run-on-debian.sh +51 -0
  119. package/pods/ci/run-on-devuan.sh +48 -0
  120. package/pods/ci/run-on-fedora.sh +51 -0
  121. package/pods/ci/run-on-manjaro.sh +61 -0
  122. package/pods/ci/run-on-opensuse.sh +58 -0
  123. package/pods/ci/run-on-rockylinux.sh +51 -0
  124. package/pods/ci/run-on-ubuntu.sh +52 -0
  125. package/pods/debian.sh +23 -0
  126. package/pods/devuan.sh +26 -0
  127. package/pods/fedora.sh +12 -0
  128. package/pods/lmde.sh +22 -0
  129. package/pods/manjaro.sh +10 -0
  130. package/pods/opensuse.sh +12 -0
  131. package/pods/podman.command.sh +85 -0
  132. package/pods/rocky.sh +12 -0
  133. package/pods/run-build-packages-debs.sh +45 -0
  134. package/pods/run-create-debs.sh +23 -0
  135. package/pods/ubuntu.sh +24 -0
  136. package/scripts/_eggs +14 -5
  137. package/scripts/eggs.bash +5 -4
  138. /package/dist/{krill/lib → lib}/kill_me_softly.d.ts +0 -0
@@ -1,10 +1,10 @@
1
1
  /**
2
- * ./src/krill/sequence.tsx
2
+ * Sequence - Simple Refactoring
3
+ * ./src/krill/sequence.ts
3
4
  * penguins-eggs v.10.0.0 / ecmascript 2020
4
5
  * author: Piero Proietti
5
6
  * email: piero.proietti@gmail.com
6
7
  * license: MIT
7
- * https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
8
8
  */
9
9
  import Settings from '../../classes/settings.js';
10
10
  import React from 'react';
@@ -20,9 +20,8 @@ import Pacman from '../../classes/pacman.js';
20
20
  import Utils from '../../classes/utils.js';
21
21
  import Xdg from '../../classes/xdg.js';
22
22
  import { exec } from '../../lib/utils.js';
23
- // import krill modules
23
+ // Import all modules (unchanged)
24
24
  import partition from './sequence.d/partition.js';
25
- // import createLvmPartitions from './sequence.d/partition.d/create-lvm-partitions.js'
26
25
  import biosStandard from './sequence.d/partition.d/bios_standard.js';
27
26
  import biosLuks from './sequence.d/partition.d/bios_luks.js';
28
27
  import uefiStandard from './sequence.d/partition.d/uefi_standard.js';
@@ -35,14 +34,9 @@ import fstab from './sequence.d/fstab.js';
35
34
  import locale from './sequence.d/locale.js';
36
35
  import mKeyboard from './sequence.d/m_keyboard.js';
37
36
  import localeCfg from './sequence.d/locale_cfg.js';
38
- // users
39
37
  import addUser from './sequence.d/add_user.js';
40
38
  import changePassword from './sequence.d/change_password.js';
41
- // displaymanager: autologin
42
39
  import networkCfg from './sequence.d/network_cfg.js';
43
- // hwclock:
44
- // services-systemd:
45
- // bootloader-config
46
40
  import bootloaderConfig from './sequence.d/bootloader_config.js';
47
41
  import grubcfg from './sequence.d/grubcfg.js';
48
42
  import bootloader from './sequence.d/bootloader.js';
@@ -59,41 +53,31 @@ import Title from '../components/title.js';
59
53
  import cliCursor from 'cli-cursor';
60
54
  import { spawnSync } from 'child_process';
61
55
  /**
62
- * hatching: installazione o cova!!!
56
+ * Main Sequence class - Simple Refactoring
63
57
  */
64
58
  export default class Sequence {
59
+ // All module references (unchanged)
65
60
  partition = partition;
66
- // createLvmPartitions = createLvmPartitions
67
61
  partitionBiosStandard = biosStandard;
68
62
  partitionUefiStandard = uefiStandard;
69
63
  partitionBiosLuks = biosLuks;
70
64
  partitionUefiLuks = uefiLuks;
71
- // mount
72
65
  mountFs = mountFs;
73
66
  mountVfs = mountVfs;
74
- //
75
67
  unpackfs = unpackfs;
76
68
  machineId = machineId;
77
69
  fstab = fstab;
78
70
  locale = locale;
79
71
  keyboard = mKeyboard;
80
72
  localeCfg = localeCfg;
81
- // users
82
73
  addUser = addUser;
83
74
  changePassword = changePassword;
84
- // displaumanager: autologin
85
75
  networkCfg = networkCfg;
86
- // hwclock:
87
- // services-systemd:
88
- // bootloader-config
89
76
  bootloaderConfig = bootloaderConfig;
90
- //
91
77
  grubcfg = grubcfg;
92
78
  bootloader = bootloader;
93
79
  packages = packages;
94
80
  removeInstallerLink = removeInstallerLink;
95
- // luksbootkeyfile:
96
- // plymouthcfg;
97
81
  initramfsCfg = initramfsCfg;
98
82
  initramfs = initramfs;
99
83
  delLiveUser = delLiveUser;
@@ -102,6 +86,7 @@ export default class Sequence {
102
86
  umount = umount;
103
87
  mkfs = mkfs;
104
88
  hostname = hostname;
89
+ // All properties (unchanged)
105
90
  installer = {};
106
91
  installTarget = '/tmp/calamares-krill-root';
107
92
  verbose = false;
@@ -123,7 +108,6 @@ export default class Sequence {
123
108
  settings = {};
124
109
  remix = {};
125
110
  distro = {};
126
- // Crypted Clone
127
111
  luksName = 'luks-volume';
128
112
  luksFile = ``;
129
113
  luksDevice = `/dev/mapper/${this.luksName}`;
@@ -136,7 +120,7 @@ export default class Sequence {
136
120
  halt = false;
137
121
  cliAutologin = new CliAutologin();
138
122
  /**
139
- * constructor
123
+ * Constructor (unchanged)
140
124
  */
141
125
  constructor(location, keyboard, partitions, users, network) {
142
126
  this.installer = installer();
@@ -160,22 +144,45 @@ export default class Sequence {
160
144
  this.luksFile = `${this.distro.liveMediumPath}live/${this.luksName}`;
161
145
  }
162
146
  /**
163
- * install
164
- * @param verbose
165
- * @param umount
166
- * @returns
147
+ * Helper method to execute a step with standard error handling
148
+ */
149
+ async executeStep(message, percent, action) {
150
+ await redraw(React.createElement(Install, { message: message, percent: percent, spinner: this.spinner }));
151
+ try {
152
+ await action();
153
+ }
154
+ catch (error) {
155
+ await this.showProblem(message, error);
156
+ }
157
+ }
158
+ /**
159
+ * Main start method - Much cleaner sequence
167
160
  */
168
161
  async start(domain = '', unattended = false, nointeractive = false, chroot = false, halt = false, verbose = false) {
169
- // Imposta il domain per flag
162
+ // Setup (unchanged)
163
+ await this.setupInstallation(domain, unattended, nointeractive, chroot, halt, verbose);
164
+ // Installation sequence - each step clearly visible
165
+ await this.runInstallationSequence();
166
+ // Handle chroot if requested
167
+ if (chroot) {
168
+ const message = `You are in chroot mode under ${this.installTarget}, type "exit" to exit.`;
169
+ await this.emergencyShell(message);
170
+ }
171
+ // Completion
172
+ await this.completeInstallation();
173
+ }
174
+ /**
175
+ * Setup installation parameters and environment
176
+ */
177
+ async setupInstallation(domain, unattended, nointeractive, chroot, halt, verbose) {
178
+ // Set domain
170
179
  if (domain !== '') {
171
180
  if (domain.at(0) !== '.') {
172
181
  domain = '.' + domain;
173
182
  }
174
183
  this.network.domain = domain;
175
184
  }
176
- /**
177
- * To let krill to work with Arch we need:
178
- */
185
+ // Arch-specific setup
179
186
  if (this.distro.familyId === 'archlinux') {
180
187
  if (this.distro.distroId === 'Manjarolinux') {
181
188
  await exec(`ln -s /run/miso/bootmnt/live/ /live`);
@@ -184,12 +191,11 @@ export default class Sequence {
184
191
  await exec(`ln -s /run/archiso/bootmnt/live/ /live`);
185
192
  }
186
193
  }
187
- /**
188
- * dmsetup remove_all
189
- */
194
+ // OpenSUSE-specific setup
190
195
  if (this.distro.familyId === 'opensuse') {
191
196
  await exec('dmsetup remove_all');
192
197
  }
198
+ // Set flags
193
199
  this.unattended = unattended;
194
200
  this.nointeractive = nointeractive;
195
201
  this.chroot = chroot;
@@ -200,397 +206,140 @@ export default class Sequence {
200
206
  this.toNull = '';
201
207
  this.spinner = false;
202
208
  }
203
- // start
204
209
  await this.settings.load();
210
+ }
211
+ /**
212
+ * Main installation sequence - Linear and clear
213
+ */
214
+ async runInstallationSequence() {
215
+ // 1. Partitioning and formatting
205
216
  let isPartitioned = false;
206
- let message = "Creating partitions";
207
- await redraw(React.createElement(Install, { message: message, percent: 0, spinner: this.spinner }));
208
- try {
217
+ await this.executeStep("Creating partitions", 0, async () => {
209
218
  isPartitioned = await this.partition();
219
+ });
220
+ if (!isPartitioned)
221
+ return;
222
+ await this.executeStep("Formatting file system", 6, () => this.mkfs());
223
+ // 2. Mounting
224
+ await this.executeStep("Mounting target file system", 9, async () => {
225
+ await this.mountFs();
226
+ await sleep(500); // Give time to mount
227
+ });
228
+ await this.executeStep("Mounting on target VFS", 12, () => this.mountVfs());
229
+ // 3. System setup
230
+ await this.executeStep("Unpacking filesystem", 15, () => this.unpackfs());
231
+ // 4. Debian-specific steps
232
+ if (this.distro.familyId === 'debian') {
233
+ await this.executeStep("Force dpkg-unsafe-io", 40, () => this.execCalamaresModule('dpkg-unsafe-io'));
234
+ await this.executeStep("Add sources-yolk", 43, () => this.execCalamaresModule('sources-yolk'));
210
235
  }
211
- catch (error) {
212
- await this.showProblem(message, error);
213
- }
214
- if (isPartitioned) {
215
- // formatting
216
- message = "Formatting file system";
217
- await redraw(React.createElement(Install, { message: message, percent: 6, spinner: this.spinner }));
218
- try {
219
- await this.mkfs();
220
- }
221
- catch (error) {
222
- await this.showProblem(message, error);
223
- }
224
- // mountFs
225
- message = "Mounting target file system";
226
- redraw(React.createElement(Install, { message: message, percent: 9, spinner: this.spinner }));
227
- try {
228
- let success = await this.mountFs();
229
- await sleep(500); // diamo il tempo di montare
230
- }
231
- catch (error) {
232
- await this.showProblem(message, error);
233
- }
234
- // mountVfs
235
- message = "Mounting on target VFS";
236
- await redraw(React.createElement(Install, { message: message, percent: 12, spinner: this.spinner }));
237
- try {
238
- await this.mountVfs();
239
- }
240
- catch (error) {
241
- await this.showProblem(message, error);
242
- }
243
- // unpackfs
244
- message = "Unpacking filesystem";
245
- await redraw(React.createElement(Install, { message: message, percent: 15, spinner: this.spinner }));
246
- try {
247
- await this.unpackfs();
248
- }
249
- catch (error) {
250
- await this.showProblem(message, error);
251
- }
252
- // dpkg-unsafe-io
253
- if (this.distro.familyId === 'debian') {
254
- message = "Force dpkg-unsafe-io";
255
- await redraw(React.createElement(Install, { message: message, percent: 40, spinner: this.spinner }));
256
- try {
257
- await this.execCalamaresModule('dpkg-unsafe-io');
258
- }
259
- catch (error) {
260
- await this.showProblem(message, error);
261
- }
262
- }
263
- // sources-yolk
264
- if (this.distro.familyId === 'debian') {
265
- message = 'Add sources-yolk';
266
- await redraw(React.createElement(Install, { message: message, percent: 43, spinner: this.spinner }));
267
- try {
268
- await this.execCalamaresModule('sources-yolk');
269
- }
270
- catch (error) {
271
- await this.showProblem(message, error);
272
- }
273
- }
274
- // machineid
275
- message = 'machineid';
276
- await redraw(React.createElement(Install, { message: message, percent: 46, spinner: this.spinner }));
277
- try {
278
- await this.machineId();
279
- }
280
- catch (error) {
281
- await this.showProblem(message, error);
282
- }
283
- // fstab
284
- message = "Creating fstab";
285
- await redraw(React.createElement(Install, { message: message, percent: 49, spinner: this.spinner }));
286
- try {
287
- await this.fstab(this.partitions.installationDevice);
288
- }
289
- catch (error) {
290
- await this.showProblem(message, error);
291
- }
292
- /**
293
- * CryptedClone exec eggs syncfrom
294
- */
295
- if (this.is_crypted_clone) {
296
- message = "Restore private data from crypted clone";
297
- await redraw(React.createElement(Install, { message: message, percent: 55, spinner: this.spinner }));
236
+ // 5. Core system configuration
237
+ await this.executeStep("machineid", 46, () => this.machineId());
238
+ await this.executeStep("Creating fstab", 49, () => this.fstab(this.partitions.installationDevice));
239
+ // 6. Crypted clone restoration
240
+ if (this.is_crypted_clone) {
241
+ await this.executeStep("Restore private data from crypted clone", 55, async () => {
298
242
  if (fs.existsSync(this.luksFile)) {
299
- let cmd = `eggs syncfrom --rootdir /tmp/calamares-krill-root/ --file ${this.luksFile}`;
300
- try {
301
- await exec(cmd, Utils.setEcho(true));
302
- this.is_clone = true; // Adesso è un clone
303
- }
304
- catch (error) {
305
- await this.showProblem(message, error);
306
- }
243
+ const cmd = `eggs syncfrom --rootdir /tmp/calamares-krill-root/ --file ${this.luksFile}`;
244
+ await exec(cmd, Utils.setEcho(true));
245
+ this.is_clone = true;
307
246
  }
308
247
  else {
309
248
  await Utils.pressKeyToExit(`Cannot find luks-volume file ${this.luksFile}`);
310
249
  }
311
- }
312
- // networkcfg
313
- message = "Network configuration";
314
- await redraw(React.createElement(Install, { message: message, percent: 61, spinner: this.spinner }));
315
- try {
316
- await this.networkCfg();
317
- }
318
- catch (error) {
319
- await this.showProblem(message, error);
320
- }
321
- // hostname
322
- message = "Create hostname";
323
- await redraw(React.createElement(Install, { message: message, percent: 64, spinner: this.spinner }));
324
- try {
325
- await this.hostname(this.network.domain);
326
- }
327
- catch (error) {
328
- await this.showProblem(message, error);
329
- }
330
- // dpkg-unsafe-io-undo
331
- if (this.distro.familyId === 'debian') {
332
- message = "Remove dpkg-unsafe-io";
333
- await redraw(React.createElement(Install, { message: message, percent: 65, spinner: this.spinner }));
334
- try {
335
- await this.execCalamaresModule('dpkg-unsafe-io-undo');
336
- }
337
- catch (error) {
338
- await this.showProblem(message, error);
339
- }
340
- }
341
- /**
342
- * IF NOT CLONE:
343
- * locale,
344
- * keyboard,
345
- * localeCfg,
346
- * delLiveUser,
347
- * adduser,
348
- * addRootPassword,
349
- * autologin GUI
350
- */
351
- if (!this.is_clone) {
352
- // NOT_CLONE: locale
353
- message = "Locale";
354
- redraw(React.createElement(Install, { message: message, percent: 70, spinner: this.spinner }));
355
- try {
356
- if (this.distro.familyId === 'alpine' ||
357
- this.distro.familyId === 'archlinux' ||
358
- this.distro.familyId === 'debian') {
359
- await this.locale();
360
- }
361
- }
362
- catch (error) {
363
- await this.showProblem(message, error);
364
- }
365
- // NOT_CLONE: keyboard
366
- message = "Settings keyboard";
367
- redraw(React.createElement(Install, { message: message, percent: 71, spinner: this.spinner }));
368
- try {
369
- await this.keyboard();
370
- }
371
- catch (error) {
372
- await this.showProblem(message, error);
373
- }
374
- // NOT_CLONE: localeCfg
375
- if (this.distro.familyId === 'archlinux' ||
250
+ });
251
+ }
252
+ // 7. Network and hostname
253
+ await this.executeStep("Network configuration", 61, () => this.networkCfg());
254
+ await this.executeStep("Create hostname", 64, () => this.hostname(this.network.domain));
255
+ // 8. Debian cleanup
256
+ if (this.distro.familyId === 'debian') {
257
+ await this.executeStep("Remove dpkg-unsafe-io", 65, () => this.execCalamaresModule('dpkg-unsafe-io-undo'));
258
+ }
259
+ // 9. User configuration (only if not clone)
260
+ if (!this.is_clone) {
261
+ // Locale
262
+ await this.executeStep("Locale", 70, async () => {
263
+ if (this.distro.familyId === 'alpine' ||
264
+ this.distro.familyId === 'archlinux' ||
376
265
  this.distro.familyId === 'debian') {
377
- message = "Locale Configuration";
378
- redraw(React.createElement(Install, { message: message, percent: 72, spinner: this.spinner }));
379
- try {
380
- await this.localeCfg();
381
- await exec("chroot " + this.installTarget + " locale-gen" + this.toNull);
382
- }
383
- catch (error) {
384
- await this.showProblem(message, error);
385
- }
386
- }
387
- // NOT_CLONE: delLiveUser
388
- message = "Remove live user";
389
- await redraw(React.createElement(Install, { message: message, percent: 73, spinner: this.spinner }));
390
- try {
391
- await this.delLiveUser();
392
- }
393
- catch (error) {
394
- await this.showProblem(message, error);
395
- }
396
- // NOT_CLONE: addUser
397
- message = `Add user ${this.users.username}`;
398
- await redraw(React.createElement(Install, { message: message, percent: 74, spinner: this.spinner }));
399
- try {
400
- await this.addUser(this.users.username, this.users.password, this.users.fullname, '', '', '');
401
- }
402
- catch (error) {
403
- await this.showProblem(message, error);
404
- }
405
- // NOT_CLONE: addRootPassword
406
- message = "Add root password";
407
- await redraw(React.createElement(Install, { message: message, percent: 75, spinner: this.spinner }));
408
- try {
409
- await this.changePassword('root', this.users.rootPassword);
410
- }
411
- catch (error) {
412
- await this.showProblem(message, error);
266
+ await this.locale();
413
267
  }
414
- // NOT_CLONE: autologin GUI
415
- if (Pacman.isInstalledGui()) {
416
- try {
417
- message = "Autologin GUI";
418
- await redraw(React.createElement(Install, { message: message, percent: 78, spinner: this.spinner }));
419
- if (this.users.autologin) {
420
- await Xdg.autologin(await Utils.getPrimaryUser(), this.users.username, this.installTarget);
421
- if (this.distro.distroLike === 'Arch') {
422
- await exec(`chroot ${this.installTarget} groupadd autologin ${this.toNull}`);
423
- await exec(`chroot ${this.installTarget} gpasswd -a ${this.users.username} autologin ${this.toNull}`);
424
- }
268
+ });
269
+ await this.executeStep("Settings keyboard", 71, () => this.keyboard());
270
+ // Locale configuration
271
+ if (this.distro.familyId === 'archlinux' || this.distro.familyId === 'debian') {
272
+ await this.executeStep("Locale Configuration", 72, async () => {
273
+ await this.localeCfg();
274
+ await exec("chroot " + this.installTarget + " locale-gen" + this.toNull);
275
+ });
276
+ }
277
+ await this.executeStep("Remove live user", 73, () => this.delLiveUser());
278
+ await this.executeStep(`Add user ${this.users.username}`, 74, () => this.addUser(this.users.username, this.users.password, this.users.fullname, '', '', ''));
279
+ await this.executeStep("Add root password", 75, () => this.changePassword('root', this.users.rootPassword));
280
+ // GUI autologin
281
+ if (Pacman.isInstalledGui()) {
282
+ await this.executeStep("Autologin GUI", 78, async () => {
283
+ if (this.users.autologin) {
284
+ await Xdg.autologin(await Utils.getPrimaryUser(), this.users.username, this.installTarget);
285
+ if (this.distro.distroLike === 'Arch') {
286
+ await exec(`chroot ${this.installTarget} groupadd autologin ${this.toNull}`);
287
+ await exec(`chroot ${this.installTarget} gpasswd -a ${this.users.username} autologin ${this.toNull}`);
425
288
  }
426
289
  }
427
- catch (error) {
428
- await this.showProblem(message, error);
429
- }
430
- }
431
- } // IF NOT CLONE END
432
- // ALWAYS remove autologin CLI
433
- message = "Remove autologin CLI";
434
- await redraw(React.createElement(Install, { message: message, percent: 80, spinner: this.spinner }));
435
- try {
436
- await this.cliAutologin.remove(this.installTarget);
437
- }
438
- catch (error) {
439
- await this.showProblem(message, error);
440
- }
441
- // bootloader-config
442
- message = "bootloader-config";
443
- await redraw(React.createElement(Install, { message: message, percent: 81, spinner: this.spinner }));
444
- try {
445
- await this.bootloaderConfig();
446
- }
447
- catch (error) {
448
- await this.showProblem(message, error);
449
- }
450
- // grubcfg
451
- message = "grubcfg";
452
- await redraw(React.createElement(Install, { message: message, percent: 82, spinner: this.spinner }));
453
- try {
454
- await this.grubcfg();
455
- }
456
- catch (error) {
457
- await this.showProblem(message, error);
458
- }
459
- // bootloader (grub-install)
460
- message = "bootloader";
461
- await redraw(React.createElement(Install, { message: message, percent: 83, spinner: this.spinner }));
462
- try {
463
- await this.bootloader();
464
- }
465
- catch (error) {
466
- await this.showProblem(message, error);
467
- }
468
- // sources-yolk-undo
469
- if (this.distro.familyId === 'debian') {
470
- message = "Remove sources-yolk";
471
- await redraw(React.createElement(Install, { message: message, percent: 84, spinner: this.spinner }));
472
- try {
473
- await this.execCalamaresModule('sources-yolk-undo');
474
- }
475
- catch (error) {
476
- await this.showProblem(message, error);
477
- }
478
- }
479
- // packages
480
- message = "Add/remove packages";
481
- await redraw(React.createElement(Install, { message: message, percent: 85, spinner: this.spinner }));
482
- try {
483
- await this.packages();
484
- }
485
- catch (error) {
486
- await this.showProblem(message, error);
487
- }
488
- // initramfsCfg
489
- message = "initramfs configure";
490
- await redraw(React.createElement(Install, { message: message, percent: 86, spinner: this.spinner }));
491
- try {
492
- await this.initramfsCfg(this.partitions.installationDevice);
493
- }
494
- catch (error) {
495
- await this.showProblem(message, error);
496
- }
497
- // initramfs
498
- message = "initramfs";
499
- await redraw(React.createElement(Install, { message: message, percent: 87, spinner: this.spinner }));
500
- try {
501
- await this.initramfs();
502
- }
503
- catch (error) {
504
- await this.showProblem(message, error);
505
- }
506
- /**
507
- *
508
- * remove CLI/GUI installer link
509
- */
510
- message = "Remove GUI installer link";
511
- await redraw(React.createElement(Install, { message: message, percent: 88, spinner: this.spinner }));
512
- try {
513
- await this.removeInstallerLink();
514
- }
515
- catch (error) {
516
- await this.showProblem(message, error);
517
- }
518
- // remove /etc/penguins_eggs.d/is_clone*
519
- message = "Cleanup";
520
- await redraw(React.createElement(Install, { message: message, percent: 89, spinner: this.spinner }));
521
- try {
522
- await exec(`rm -f ${this.installTarget}/etc/penguins-eggs.d/is_clone`);
523
- await exec(`rm -f ${this.installTarget}/etc/penguins-eggs.d/is_crypted_clone`);
290
+ });
524
291
  }
525
- catch (error) {
526
- await this.showProblem(message, error);
527
- }
528
- /**
529
- * custom final steps
530
- */
531
- const cfs = new CFS();
532
- const steps = await cfs.steps();
533
- if (steps.length > 0) {
534
- for (const step of steps) {
535
- message = `running ${step}`;
536
- await redraw(React.createElement(Install, { message: message, percent: 90, spinner: this.spinner }));
537
- try {
538
- await this.execCalamaresModule(step);
539
- }
540
- catch (error) {
541
- await this.showProblem(message, error);
542
- }
543
- }
544
- }
545
- // chroot
546
- if (chroot) {
547
- message = `You are in chroot mode under ${this.installTarget}, type "exit" to exit.`;
548
- await this.emergencyShell(message);
549
- }
550
- // umountVfs
551
- message = "umount Virtual File System";
552
- await redraw(React.createElement(Install, { message: message, percent: 96, spinner: this.spinner }));
553
- try {
554
- await this.umountVfs();
555
- }
556
- catch (error) {
557
- await this.showProblem(message, error);
558
- }
559
- //await Utils.pressKeyToExit('passed:' + message)
560
- message = "umount File system";
561
- await redraw(React.createElement(Install, { message: message, percent: 99, spinner: this.spinner }));
562
- try {
563
- await this.umountFs();
564
- }
565
- catch (error) {
566
- await this.showProblem(message, error);
567
- }
568
- await sleep(500); // wait 0,5 seconds
569
- /**
570
- * Finished
571
- */
572
- let cmd = "reboot";
573
- if (this.halt) {
574
- cmd = "poweroff";
575
- }
576
- message = `Press a key to ${cmd}`;
577
- if (this.unattended && this.nointeractive) {
578
- message = `System will ${cmd} in 5 seconds...`;
579
- }
580
- await redraw(React.createElement(Finished, { installationDevice: this.partitions.installationDevice, hostName: this.users.hostname, userName: this.users.username, message: message }));
581
- // await Utils.pressKeyToExit('passed:' + message)
582
- if (this.unattended && this.nointeractive) {
583
- await sleep(5000);
584
- }
585
- else {
586
- spawnSync('read _ ', { shell: true, stdio: [0, 1, 2] });
292
+ }
293
+ // 10. Always remove CLI autologin
294
+ await this.executeStep("Remove autologin CLI", 80, () => this.cliAutologin.remove(this.installTarget));
295
+ // 11. Bootloader configuration
296
+ await this.executeStep("bootloader-config", 81, () => this.bootloaderConfig());
297
+ await this.executeStep("grubcfg", 82, () => this.grubcfg());
298
+ await this.executeStep("bootloader", 83, () => this.bootloader());
299
+ // 12. Final system setup
300
+ if (this.distro.familyId === 'debian') {
301
+ await this.executeStep("Remove sources-yolk", 84, () => this.execCalamaresModule('sources-yolk-undo'));
302
+ }
303
+ await this.executeStep("Add/remove packages", 85, () => this.packages());
304
+ await this.executeStep("initramfs configure", 86, () => this.initramfsCfg(this.partitions.installationDevice));
305
+ await this.executeStep("initramfs", 87, () => this.initramfs());
306
+ await this.executeStep("Remove GUI installer link", 88, () => this.removeInstallerLink());
307
+ await this.executeStep("Cleanup", 89, async () => {
308
+ await exec(`rm -f ${this.installTarget}/etc/penguins-eggs.d/is_clone`);
309
+ await exec(`rm -f ${this.installTarget}/etc/penguins-eggs.d/is_crypted_clone`);
310
+ });
311
+ // 13. Custom final steps
312
+ const cfs = new CFS();
313
+ const steps = await cfs.steps();
314
+ if (steps.length > 0) {
315
+ for (const step of steps) {
316
+ await this.executeStep(`running ${step}`, 90, () => this.execCalamaresModule(step));
587
317
  }
588
- await exec(cmd, { echo: false });
589
318
  }
319
+ // 14. Unmounting
320
+ await this.executeStep("umount Virtual File System", 96, () => this.umountVfs());
321
+ await this.executeStep("umount File system", 99, () => this.umountFs());
590
322
  }
591
323
  /**
592
- *
324
+ * Complete installation with reboot/halt
593
325
  */
326
+ async completeInstallation() {
327
+ await sleep(500);
328
+ const cmd = this.halt ? "poweroff" : "reboot";
329
+ let message = `Press a key to ${cmd}`;
330
+ if (this.unattended && this.nointeractive) {
331
+ message = `System will ${cmd} in 5 seconds...`;
332
+ }
333
+ await redraw(React.createElement(Finished, { installationDevice: this.partitions.installationDevice, hostName: this.users.hostname, userName: this.users.username, message: message }));
334
+ if (this.unattended && this.nointeractive) {
335
+ await sleep(5000);
336
+ }
337
+ else {
338
+ spawnSync('read _ ', { shell: true, stdio: [0, 1, 2] });
339
+ }
340
+ await exec(cmd, { echo: false });
341
+ }
342
+ // Keep all existing methods unchanged
594
343
  async execCalamaresModule(name) {
595
344
  const moduleName = this.installer.multiarchModules + name + '/module.desc';
596
345
  if (fs.existsSync(moduleName)) {
@@ -602,10 +351,6 @@ export default class Sequence {
602
351
  }
603
352
  }
604
353
  }
605
- /**
606
- *
607
- * @param message
608
- */
609
354
  async emergencyShell(message) {
610
355
  try {
611
356
  await redraw(React.createElement(React.Fragment, null,
@@ -620,10 +365,6 @@ export default class Sequence {
620
365
  await Utils.pressKeyToExit(JSON.stringify(error));
621
366
  }
622
367
  }
623
- /**
624
- *
625
- * @param message
626
- */
627
368
  async showProblem(message, currErr) {
628
369
  message = `We was on "${message}", get error: ${JSON.stringify(currErr)}, type "exit" to exit from krill emergency shell.`;
629
370
  try {
@@ -640,10 +381,7 @@ export default class Sequence {
640
381
  }
641
382
  }
642
383
  }
643
- /**
644
- *
645
- * @param elem
646
- */
384
+ // Helper functions (unchanged)
647
385
  async function redraw(elem) {
648
386
  let opt = {};
649
387
  opt.patchConsole = false;
@@ -651,11 +389,6 @@ async function redraw(elem) {
651
389
  console.clear();
652
390
  render(elem, opt);
653
391
  }
654
- /**
655
- *
656
- * @param ms
657
- * @returns
658
- */
659
392
  function sleep(ms = 0) {
660
393
  return new Promise((resolve) => {
661
394
  setTimeout(resolve, ms);