penguins-eggs 9.3.24 → 9.3.26
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.
- package/.oclif.manifest.json +1 -1
- package/README.md +65 -62
- package/addons/templates/isolinux.template +1 -1
- package/conf/distros/buster/calamares/calamares-modules/bootloader-config/bootloader-config.sh +2 -2
- package/conf/distros/jessie/krill/krill-modules/bootloader-config/bootloader-config.sh +2 -2
- package/dist/classes/incubation/fisherman.js +3 -6
- package/dist/classes/ovary.js +78 -58
- package/dist/classes/pxe.js +1 -1
- package/dist/classes/tools.js +1 -2
- package/dist/classes/utils.js +1 -1
- package/dist/commands/calamares.js +3 -1
- package/dist/commands/config.js +7 -6
- package/dist/commands/export/iso.js +0 -5
- package/dist/commands/install.js +4 -4
- package/dist/commands/kill.js +4 -2
- package/dist/commands/produce.js +17 -19
- package/dist/commands/syncfrom.js +8 -8
- package/dist/commands/syncto.js +2 -2
- package/dist/commands/tools/clean.js +3 -1
- package/dist/commands/tools/ppa.js +4 -2
- package/dist/components/elements/title.js +1 -1
- package/dist/krill/krill-prepare.js +6 -6
- package/dist/krill/krill-sequence.js +126 -114
- package/dist/krill/modules/remove-installer-link.js +2 -2
- package/eui/README.md +72 -0
- package/eui/eui-create-image.sh +12 -0
- package/eui/eui-start.sh +32 -0
- package/eui/eui-users +2 -0
- package/eui/eui.desktop +10 -0
- package/package.json +2 -1
- package/scripts/_eggs +55 -52
- package/scripts/eggs.bash +18 -18
- package/scripts/mom.sh +6 -7
|
@@ -18,8 +18,9 @@ class Clean extends core_1.Command {
|
|
|
18
18
|
if (flags.verbose) {
|
|
19
19
|
verbose = true;
|
|
20
20
|
}
|
|
21
|
+
let nointeractive = flags.nointeractive;
|
|
21
22
|
if (utils_1.default.isRoot()) {
|
|
22
|
-
if (await utils_1.default.customConfirm('Select yes to continue...')) {
|
|
23
|
+
if (nointeractive || await utils_1.default.customConfirm('Select yes to continue...')) {
|
|
23
24
|
const bleach = new bleach_1.default();
|
|
24
25
|
bleach.clean(verbose);
|
|
25
26
|
}
|
|
@@ -32,6 +33,7 @@ class Clean extends core_1.Command {
|
|
|
32
33
|
exports.default = Clean;
|
|
33
34
|
Clean.flags = {
|
|
34
35
|
help: core_1.Flags.help({ char: 'h' }),
|
|
36
|
+
nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
|
|
35
37
|
verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' })
|
|
36
38
|
};
|
|
37
39
|
Clean.description = 'clean system log, apt, etc';
|
|
@@ -25,18 +25,19 @@ class Ppa extends core_1.Command {
|
|
|
25
25
|
if (flags.verbose) {
|
|
26
26
|
verbose = true;
|
|
27
27
|
}
|
|
28
|
+
let nointeractive = flags.nointeractive;
|
|
28
29
|
const distro = new distro_1.default();
|
|
29
30
|
if (distro.familyId === 'debian') {
|
|
30
31
|
if (utils_1.default.isRoot()) {
|
|
31
32
|
if (flags.remove) {
|
|
32
33
|
utils_1.default.warning(`Are you sure to remove ${flist} to your repositories?`);
|
|
33
|
-
if (await utils_1.default.customConfirm('Select yes to continue...')) {
|
|
34
|
+
if (nointeractive || await utils_1.default.customConfirm('Select yes to continue...')) {
|
|
34
35
|
await remove();
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
if (flags.add) {
|
|
38
39
|
utils_1.default.warning(`Are you sure to add ${flist} to your repositories?`);
|
|
39
|
-
if (await utils_1.default.customConfirm('Select yes to continue...')) {
|
|
40
|
+
if (nointeractive || await utils_1.default.customConfirm('Select yes to continue...')) {
|
|
40
41
|
await clean();
|
|
41
42
|
await add();
|
|
42
43
|
}
|
|
@@ -52,6 +53,7 @@ exports.default = Ppa;
|
|
|
52
53
|
Ppa.flags = {
|
|
53
54
|
add: core_1.Flags.boolean({ char: 'a', description: 'add penguins-eggs PPA repository' }),
|
|
54
55
|
help: core_1.Flags.help({ char: 'h' }),
|
|
56
|
+
nointeractive: core_1.Flags.boolean({ char: 'n', description: 'no user interaction' }),
|
|
55
57
|
remove: core_1.Flags.boolean({ char: 'r', description: 'remove penguins-eggs PPA repository' }),
|
|
56
58
|
verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' })
|
|
57
59
|
};
|
|
@@ -12,7 +12,7 @@ function Title({ title = "krill" }) {
|
|
|
12
12
|
react_1.default.createElement(ink_1.Box, { flexDirection: "column" },
|
|
13
13
|
react_1.default.createElement(ink_1.Box, null),
|
|
14
14
|
react_1.default.createElement(ink_1.Box, null,
|
|
15
|
-
react_1.default.createElement(ink_1.Text, null, "
|
|
15
|
+
react_1.default.createElement(ink_1.Text, null, "E G G S: the reproductive system of penguins")),
|
|
16
16
|
react_1.default.createElement(ink_1.Box, null,
|
|
17
17
|
react_1.default.createElement(ink_1.Newline, null))),
|
|
18
18
|
react_1.default.createElement(ink_1.Box, { flexDirection: "row" },
|
|
@@ -110,7 +110,7 @@ class Krill {
|
|
|
110
110
|
/**
|
|
111
111
|
* @param cryped
|
|
112
112
|
*/
|
|
113
|
-
async prepare(unattended = false,
|
|
113
|
+
async prepare(unattended = false, nointeractive = false, krillConfig = {}, ip = false, random = false, domain = 'local', suspend = false, small = false, none = false, cryped = false, pve = false, verbose = false) {
|
|
114
114
|
/**
|
|
115
115
|
* Check for disk presence
|
|
116
116
|
*/
|
|
@@ -222,7 +222,7 @@ class Krill {
|
|
|
222
222
|
/**
|
|
223
223
|
* summary
|
|
224
224
|
*/
|
|
225
|
-
await this.summary(oLocation, oKeyboard, oPartitions, oUsers, unattended,
|
|
225
|
+
await this.summary(oLocation, oKeyboard, oPartitions, oUsers, unattended, nointeractive);
|
|
226
226
|
/**
|
|
227
227
|
* installation
|
|
228
228
|
*/
|
|
@@ -480,21 +480,21 @@ class Krill {
|
|
|
480
480
|
/**
|
|
481
481
|
* SUMMARY
|
|
482
482
|
*/
|
|
483
|
-
async summary(location, keyboard, partitions, users, unattended = false,
|
|
483
|
+
async summary(location, keyboard, partitions, users, unattended = false, nointeractive = false) {
|
|
484
484
|
//
|
|
485
485
|
let summaryElem;
|
|
486
486
|
let message = "Double check the installation disk: " + partitions.installationDevice;
|
|
487
|
-
if (unattended &&
|
|
487
|
+
if (unattended && nointeractive) {
|
|
488
488
|
message = "Unattended installation will start in 5 seconds, press CTRL-C to abort!";
|
|
489
489
|
}
|
|
490
490
|
while (true) {
|
|
491
491
|
summaryElem = react_1.default.createElement(summary_1.default, { name: users.name, password: users.password, rootPassword: users.rootPassword, hostname: users.hostname, region: location.region, zone: location.zone, language: location.language, keyboardModel: keyboard.keyboardModel, keyboardLayout: keyboard.keyboardLayout, installationDevice: partitions.installationDevice, message: message });
|
|
492
|
-
if (unattended &&
|
|
492
|
+
if (unattended && nointeractive) {
|
|
493
493
|
redraw(summaryElem);
|
|
494
494
|
await sleep(5000);
|
|
495
495
|
break;
|
|
496
496
|
}
|
|
497
|
-
else if (unattended && !
|
|
497
|
+
else if (unattended && !nointeractive) {
|
|
498
498
|
if (await confirm(summaryElem, "Read the Summary, confirm or abort")) {
|
|
499
499
|
break;
|
|
500
500
|
}
|
|
@@ -124,11 +124,14 @@ class Sequence {
|
|
|
124
124
|
this.settings = {};
|
|
125
125
|
this.remix = {};
|
|
126
126
|
this.distro = {};
|
|
127
|
-
|
|
128
|
-
this.
|
|
129
|
-
this.
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
127
|
+
// Crypted Clone
|
|
128
|
+
this.luksName = 'luks-eggs-data';
|
|
129
|
+
this.luksFile = `/run/live/medium/live/${this.luksName}`;
|
|
130
|
+
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
131
|
+
this.luksMountpoint = `/mnt`;
|
|
132
|
+
// Clone (Uncrypted)
|
|
133
|
+
this.is_clone = fs_1.default.existsSync('/etc/penguins-eggs.d/is_clone');
|
|
134
|
+
this.is_crypted_clone = fs_1.default.existsSync('/etc/penguins-eggs.d/is_crypted_clone');
|
|
132
135
|
this.unattended = false;
|
|
133
136
|
this.installer = (0, installer_1.installer)();
|
|
134
137
|
this.settings = new settings_1.default();
|
|
@@ -148,13 +151,6 @@ class Sequence {
|
|
|
148
151
|
this.devices.swap = {};
|
|
149
152
|
this.distro = new distro_1.default(this.remix);
|
|
150
153
|
this.efi = fs_1.default.existsSync('/sys/firmware/efi/efivars');
|
|
151
|
-
// Per il restore dei dati
|
|
152
|
-
this.luksName = 'luks-eggs-backup';
|
|
153
|
-
this.luksFile = `/run/live/medium/live/${this.luksName}`;
|
|
154
|
-
this.luksDevice = `/dev/mapper/${this.luksName}`;
|
|
155
|
-
this.luksMountpoint = `/mnt`;
|
|
156
|
-
// per il restore dei dati personali controllo esistenza di is-clone.md
|
|
157
|
-
this.personalFile = `/run/live/medium/live/is-clone.md`;
|
|
158
154
|
}
|
|
159
155
|
/**
|
|
160
156
|
* install
|
|
@@ -176,7 +172,7 @@ class Sequence {
|
|
|
176
172
|
let message = "";
|
|
177
173
|
let isPartitioned = false;
|
|
178
174
|
message = "Creating partitions";
|
|
179
|
-
percent = 0.
|
|
175
|
+
percent = 0.03;
|
|
180
176
|
try {
|
|
181
177
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
182
178
|
isPartitioned = await this.partition();
|
|
@@ -187,7 +183,7 @@ class Sequence {
|
|
|
187
183
|
if (isPartitioned) {
|
|
188
184
|
// formatting
|
|
189
185
|
message = "Formatting file system ";
|
|
190
|
-
percent = 0.
|
|
186
|
+
percent = 0.06;
|
|
191
187
|
try {
|
|
192
188
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
193
189
|
await this.mkfs();
|
|
@@ -197,7 +193,7 @@ class Sequence {
|
|
|
197
193
|
}
|
|
198
194
|
// mountFs
|
|
199
195
|
message = "Mounting target file system ";
|
|
200
|
-
percent = 0.
|
|
196
|
+
percent = 0.09;
|
|
201
197
|
try {
|
|
202
198
|
redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
203
199
|
await this.mountFs();
|
|
@@ -207,7 +203,7 @@ class Sequence {
|
|
|
207
203
|
}
|
|
208
204
|
// mountVfs
|
|
209
205
|
message = "Mounting on target VFS ";
|
|
210
|
-
percent = 0.
|
|
206
|
+
percent = 0.12;
|
|
211
207
|
try {
|
|
212
208
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
213
209
|
await this.mountVfs();
|
|
@@ -217,7 +213,7 @@ class Sequence {
|
|
|
217
213
|
}
|
|
218
214
|
// unpackfs
|
|
219
215
|
message = "Unpacking filesystem ";
|
|
220
|
-
percent = 0.
|
|
216
|
+
percent = 0.15;
|
|
221
217
|
try {
|
|
222
218
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
223
219
|
await this.unpackfs();
|
|
@@ -228,7 +224,7 @@ class Sequence {
|
|
|
228
224
|
// dpkg-unsafe-io
|
|
229
225
|
if (this.distro.familyId === 'debian') {
|
|
230
226
|
message = "dpkg-unsafe-io";
|
|
231
|
-
percent = 0.
|
|
227
|
+
percent = 0.40;
|
|
232
228
|
try {
|
|
233
229
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
234
230
|
await this.execCalamaresModule('dpkg-unsafe-io');
|
|
@@ -237,26 +233,10 @@ class Sequence {
|
|
|
237
233
|
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
238
234
|
}
|
|
239
235
|
}
|
|
240
|
-
/**
|
|
241
|
-
* IF RESTORE USERS DATA
|
|
242
|
-
*/
|
|
243
|
-
if (fs_1.default.existsSync(this.luksFile)) {
|
|
244
|
-
// restoring users data
|
|
245
|
-
message = "Restore private data from backup ";
|
|
246
|
-
percent = 0.37;
|
|
247
|
-
let cmd = 'eggs syncfrom --rootdir /tmp/calamares-krill-root/';
|
|
248
|
-
try {
|
|
249
|
-
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent, spinner: true }));
|
|
250
|
-
await (0, utils_2.exec)(cmd, utils_1.default.setEcho(true));
|
|
251
|
-
}
|
|
252
|
-
catch (error) {
|
|
253
|
-
await utils_1.default.pressKeyToExit(cmd);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
236
|
// sources-yolk
|
|
257
237
|
if (this.distro.familyId === 'debian') {
|
|
258
238
|
message = 'sources-yolk';
|
|
259
|
-
percent = 0.
|
|
239
|
+
percent = 0.43;
|
|
260
240
|
try {
|
|
261
241
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent, spinner: true }));
|
|
262
242
|
await this.execCalamaresModule('sources-yolk');
|
|
@@ -267,7 +247,7 @@ class Sequence {
|
|
|
267
247
|
}
|
|
268
248
|
// machineid
|
|
269
249
|
message = 'machineid';
|
|
270
|
-
percent = 0.
|
|
250
|
+
percent = 0.46;
|
|
271
251
|
try {
|
|
272
252
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent, spinner: true }));
|
|
273
253
|
await this.machineId();
|
|
@@ -277,7 +257,7 @@ class Sequence {
|
|
|
277
257
|
}
|
|
278
258
|
// fstab
|
|
279
259
|
message = "Creating fstab ";
|
|
280
|
-
percent = 0.
|
|
260
|
+
percent = 0.49;
|
|
281
261
|
try {
|
|
282
262
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
283
263
|
await this.fstab(this.partitions.installationDevice);
|
|
@@ -285,38 +265,30 @@ class Sequence {
|
|
|
285
265
|
catch (error) {
|
|
286
266
|
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
287
267
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
message = "localeCfg";
|
|
309
|
-
percent = 0.50;
|
|
310
|
-
try {
|
|
311
|
-
await this.localeCfg();
|
|
312
|
-
await (0, utils_2.exec)("chroot " + this.installTarget + " locale-gen");
|
|
313
|
-
}
|
|
314
|
-
catch (error) {
|
|
315
|
-
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
268
|
+
/**
|
|
269
|
+
* CryptedClone exec eggs syncfrom
|
|
270
|
+
*/
|
|
271
|
+
if (this.is_crypted_clone) {
|
|
272
|
+
message = "Restore private data from crypted clone ";
|
|
273
|
+
if (fs_1.default.existsSync(this.luksFile)) {
|
|
274
|
+
percent = 0.55;
|
|
275
|
+
let cmd = `eggs syncfrom --rootdir /tmp/calamares-krill-root/ --file ${this.luksFile}`;
|
|
276
|
+
try {
|
|
277
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent, spinner: true }));
|
|
278
|
+
await (0, utils_2.exec)(cmd, utils_1.default.setEcho(true));
|
|
279
|
+
this.is_clone = true; // Adesso è un clone
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
await utils_1.default.pressKeyToExit(cmd);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
await utils_1.default.pressKeyToExit(`Cannot find LUKS file ${this.luksFile}`);
|
|
287
|
+
}
|
|
316
288
|
}
|
|
317
289
|
// networkcfg
|
|
318
290
|
message = "networkcfg";
|
|
319
|
-
percent = 0.
|
|
291
|
+
percent = 0.61;
|
|
320
292
|
try {
|
|
321
293
|
await this.networkCfg();
|
|
322
294
|
}
|
|
@@ -325,7 +297,7 @@ class Sequence {
|
|
|
325
297
|
}
|
|
326
298
|
// hostname
|
|
327
299
|
message = "Create hostname ";
|
|
328
|
-
percent = 0.
|
|
300
|
+
percent = 0.64;
|
|
329
301
|
try {
|
|
330
302
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
331
303
|
await this.hostname(domain);
|
|
@@ -335,7 +307,7 @@ class Sequence {
|
|
|
335
307
|
}
|
|
336
308
|
// initramfsCfg
|
|
337
309
|
message = "initramfs configure";
|
|
338
|
-
percent = 0.
|
|
310
|
+
percent = 0.67;
|
|
339
311
|
try {
|
|
340
312
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
341
313
|
await this.initramfsCfg(this.partitions.installationDevice);
|
|
@@ -345,7 +317,7 @@ class Sequence {
|
|
|
345
317
|
}
|
|
346
318
|
// initramfs
|
|
347
319
|
message = "initramfs ";
|
|
348
|
-
percent = 0.
|
|
320
|
+
percent = 0.70;
|
|
349
321
|
try {
|
|
350
322
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
351
323
|
await this.initramfs();
|
|
@@ -356,7 +328,7 @@ class Sequence {
|
|
|
356
328
|
// dpkg-unsafe-io-undo
|
|
357
329
|
if (this.distro.familyId === 'debian') {
|
|
358
330
|
message = "dpkg-unsafe-io-undo";
|
|
359
|
-
percent = 0.
|
|
331
|
+
percent = 0.72;
|
|
360
332
|
try {
|
|
361
333
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
362
334
|
await this.execCalamaresModule('dpkg-unsafe-io-undo');
|
|
@@ -366,72 +338,102 @@ class Sequence {
|
|
|
366
338
|
}
|
|
367
339
|
}
|
|
368
340
|
/**
|
|
369
|
-
* IF NOT
|
|
341
|
+
* IF NOT CLONE:
|
|
342
|
+
* - locale
|
|
343
|
+
* - keyboard
|
|
344
|
+
* - localeCfg
|
|
345
|
+
* - delLiveUser
|
|
346
|
+
* - adduser
|
|
347
|
+
* - autologin
|
|
370
348
|
*/
|
|
371
|
-
if (!
|
|
372
|
-
//
|
|
373
|
-
message = "
|
|
374
|
-
percent = 0.
|
|
349
|
+
if (!this.is_clone) {
|
|
350
|
+
// locale
|
|
351
|
+
message = "Locale";
|
|
352
|
+
percent = 0.74;
|
|
375
353
|
try {
|
|
376
|
-
|
|
377
|
-
await this.
|
|
354
|
+
redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
355
|
+
await this.locale();
|
|
378
356
|
}
|
|
379
357
|
catch (error) {
|
|
380
358
|
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
381
359
|
}
|
|
382
|
-
//
|
|
383
|
-
message = "
|
|
384
|
-
percent = 0.
|
|
360
|
+
// keyboard
|
|
361
|
+
message = "settings keyboard";
|
|
362
|
+
percent = 0.75;
|
|
385
363
|
try {
|
|
386
|
-
await
|
|
387
|
-
await this.addUser(this.users.name, this.users.password, this.users.fullname, '', '', '');
|
|
364
|
+
await this.keyboard();
|
|
388
365
|
}
|
|
389
366
|
catch (error) {
|
|
390
367
|
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
391
368
|
}
|
|
392
|
-
//
|
|
393
|
-
message = "
|
|
394
|
-
percent = 0.
|
|
369
|
+
// localeCfg
|
|
370
|
+
message = "Locale Configuration";
|
|
371
|
+
percent = 0.76;
|
|
372
|
+
try {
|
|
373
|
+
await this.localeCfg();
|
|
374
|
+
await (0, utils_2.exec)("chroot " + this.installTarget + " locale-gen");
|
|
375
|
+
}
|
|
376
|
+
catch (error) {
|
|
377
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
378
|
+
}
|
|
379
|
+
// delLiveUser
|
|
380
|
+
message = "Remove user LIVE";
|
|
381
|
+
percent = 0.75;
|
|
395
382
|
try {
|
|
396
383
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
397
|
-
await this.
|
|
384
|
+
await this.delLiveUser();
|
|
398
385
|
}
|
|
399
386
|
catch (error) {
|
|
400
387
|
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
401
388
|
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
389
|
+
// addUser
|
|
390
|
+
message = "Add user";
|
|
391
|
+
percent = 0.76;
|
|
405
392
|
try {
|
|
406
|
-
message = "autologin GUI";
|
|
407
|
-
percent = 0.65;
|
|
408
|
-
if (this.users.autologin) {
|
|
409
|
-
await xdg_1.default.autologin(await utils_1.default.getPrimaryUser(), this.users.name, this.installTarget);
|
|
410
|
-
}
|
|
411
393
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
394
|
+
await this.addUser(this.users.name, this.users.password, this.users.fullname, '', '', '');
|
|
412
395
|
}
|
|
413
396
|
catch (error) {
|
|
414
397
|
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
415
398
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
percent = 0.66;
|
|
399
|
+
// changePassword root
|
|
400
|
+
message = "Add user password";
|
|
401
|
+
percent = 0.77;
|
|
420
402
|
try {
|
|
421
403
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
422
|
-
await
|
|
404
|
+
await this.changePassword('root', this.users.rootPassword);
|
|
423
405
|
}
|
|
424
406
|
catch (error) {
|
|
425
407
|
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
426
408
|
}
|
|
409
|
+
// autologin
|
|
410
|
+
if (pacman_1.default.isInstalledGui()) {
|
|
411
|
+
try {
|
|
412
|
+
message = "Autologin GUI";
|
|
413
|
+
percent = 0.78;
|
|
414
|
+
if (this.users.autologin) {
|
|
415
|
+
await xdg_1.default.autologin(await utils_1.default.getPrimaryUser(), this.users.name, this.installTarget);
|
|
416
|
+
}
|
|
417
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
418
|
+
}
|
|
419
|
+
catch (error) {
|
|
420
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
} // IF NOT CLONE END
|
|
424
|
+
// Remove ALWAYS autologin CLI
|
|
425
|
+
message = "Remove autologin CLI";
|
|
426
|
+
percent = 0.80;
|
|
427
|
+
try {
|
|
428
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
429
|
+
await cliAutologin.remove(this.installTarget);
|
|
430
|
+
}
|
|
431
|
+
catch (error) {
|
|
432
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
427
433
|
}
|
|
428
|
-
// cleanup
|
|
429
|
-
await cliAutologin.msgRemove(`${this.installTarget}/etc/motd`);
|
|
430
|
-
await cliAutologin.msgRemove(`${this.installTarget}/etc/issue`);
|
|
431
|
-
await cliAutologin.remove(this.installTarget);
|
|
432
434
|
// bootloader-config
|
|
433
435
|
message = "bootloader-config ";
|
|
434
|
-
percent = 0.
|
|
436
|
+
percent = 0.82;
|
|
435
437
|
try {
|
|
436
438
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
437
439
|
await this.bootloaderConfig();
|
|
@@ -441,7 +443,7 @@ class Sequence {
|
|
|
441
443
|
}
|
|
442
444
|
// grubcfg
|
|
443
445
|
message = "grubcfg ";
|
|
444
|
-
percent = 0.
|
|
446
|
+
percent = 0.84;
|
|
445
447
|
try {
|
|
446
448
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
447
449
|
await this.grubcfg();
|
|
@@ -451,7 +453,7 @@ class Sequence {
|
|
|
451
453
|
}
|
|
452
454
|
// bootloader (grub-install)
|
|
453
455
|
message = "bootloader ";
|
|
454
|
-
percent = 0.
|
|
456
|
+
percent = 0.86;
|
|
455
457
|
try {
|
|
456
458
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
457
459
|
await this.bootloader();
|
|
@@ -462,7 +464,7 @@ class Sequence {
|
|
|
462
464
|
// sources-yolk-undo
|
|
463
465
|
if (this.distro.familyId === 'debian') {
|
|
464
466
|
message = "sources-yolk-undo";
|
|
465
|
-
percent = 0.
|
|
467
|
+
percent = 0.88;
|
|
466
468
|
try {
|
|
467
469
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
468
470
|
await this.execCalamaresModule('sources-yolk-undo');
|
|
@@ -473,22 +475,21 @@ class Sequence {
|
|
|
473
475
|
}
|
|
474
476
|
// packages
|
|
475
477
|
message = "add/remove packages";
|
|
476
|
-
percent = 0.
|
|
478
|
+
percent = 0.90;
|
|
477
479
|
try {
|
|
478
480
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
479
481
|
await this.packages();
|
|
480
482
|
}
|
|
481
483
|
catch (error) {
|
|
482
484
|
console.log(JSON.stringify(error));
|
|
483
|
-
// await Utils.pressKeyToExit(JSON.stringify(error))
|
|
484
485
|
}
|
|
485
486
|
/**
|
|
486
487
|
*
|
|
487
|
-
* if calamares is present
|
|
488
|
+
* if calamares is present: remove GUI installer link
|
|
488
489
|
*/
|
|
489
490
|
if (await pacman_1.default.calamaresCheck()) {
|
|
490
|
-
message = "remove installer link";
|
|
491
|
-
percent = 0.
|
|
491
|
+
message = "remove GUI installer link";
|
|
492
|
+
percent = 0.92;
|
|
492
493
|
try {
|
|
493
494
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
494
495
|
await this.removeInstallerLink();
|
|
@@ -497,9 +498,20 @@ class Sequence {
|
|
|
497
498
|
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
498
499
|
}
|
|
499
500
|
}
|
|
501
|
+
// remove /etc/penguins_eggs.d/is_clone*
|
|
502
|
+
message = "Cleanup";
|
|
503
|
+
percent = 0.94;
|
|
504
|
+
try {
|
|
505
|
+
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
506
|
+
await (0, utils_2.exec)(`rm -f ${this.installTarget}/etc/penguins-eggs.d/is_clone`);
|
|
507
|
+
await (0, utils_2.exec)(`rm -f ${this.installTarget}/etc/penguins-eggs.d/is_crypted_clone`);
|
|
508
|
+
}
|
|
509
|
+
catch (error) {
|
|
510
|
+
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
511
|
+
}
|
|
500
512
|
// umountVfs
|
|
501
513
|
message = "umount VFS";
|
|
502
|
-
percent = 0.
|
|
514
|
+
percent = 0.96;
|
|
503
515
|
try {
|
|
504
516
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
505
517
|
await this.umountVfs();
|
|
@@ -509,7 +521,7 @@ class Sequence {
|
|
|
509
521
|
}
|
|
510
522
|
// umount
|
|
511
523
|
message = "umount";
|
|
512
|
-
percent = 0.
|
|
524
|
+
percent = 0.98;
|
|
513
525
|
try {
|
|
514
526
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
515
527
|
await this.umountFs();
|
|
@@ -25,10 +25,10 @@ async function removeInstallerLink() {
|
|
|
25
25
|
lines[i] += '#';
|
|
26
26
|
}
|
|
27
27
|
if (lines[i].search('penguins-clinstaller.desktop') !== -1) {
|
|
28
|
-
lines[i]
|
|
28
|
+
lines[i] = '#' + lines[i];
|
|
29
29
|
}
|
|
30
30
|
if (lines[i].search('install-debian.desktop') !== -1) {
|
|
31
|
-
lines[i]
|
|
31
|
+
lines[i] = '#' + lines[i];
|
|
32
32
|
}
|
|
33
33
|
content += lines[i] + '\n';
|
|
34
34
|
}
|
package/eui/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# eggs unattended install
|
|
2
|
+
|
|
3
|
+
Eggs unattended install è basato su semplici script ed, al momento,
|
|
4
|
+
per creare una ISO con possibilità di unattended-install, procedere come segue:
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
cd /usr/lib/penguins-eggs/eui
|
|
8
|
+
./eui-create-image.sh
|
|
9
|
+
```
|
|
10
|
+
Verrà generata una immagine fast, quindi abbastanza veloce, e lanciato il comando cuckoo.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Modifiche necessarie rispetto ad una normale immagine
|
|
14
|
+
|
|
15
|
+
Sono coinvolti 3 file:
|
|
16
|
+
* /etc/sudoers.d/eui-users
|
|
17
|
+
* /etc/xdg/autostart/eui.desktop
|
|
18
|
+
* /usr/bin/eui-start.ch
|
|
19
|
+
|
|
20
|
+
Vediamoli uno ad uno
|
|
21
|
+
|
|
22
|
+
## /etc/sudoers.d/eui-users
|
|
23
|
+
|
|
24
|
+
Create a file:
|
|
25
|
+
```
|
|
26
|
+
sudo nano /etc/sudoers.d/eui-users
|
|
27
|
+
```
|
|
28
|
+
and copy and past, following code:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
live ALL=(ALL) NOPASSWD: /usr/bin/eui-start.sh
|
|
32
|
+
artisan ALL=(ALL) NOPASSWD: /usr/bin/eui-start.sh
|
|
33
|
+
```
|
|
34
|
+
Change permissions to /etc/sudoers.d/eui-users
|
|
35
|
+
```
|
|
36
|
+
chmod 0440 /etc/sudoers.d/eui-users
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## /etc/xdg/autostart/eui.desktop
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
[Desktop Entry]
|
|
43
|
+
Type=Application
|
|
44
|
+
Name=Eggs unattended install
|
|
45
|
+
Exec=sudo /usr/bin/eui-start.sh
|
|
46
|
+
StartupNotify=false
|
|
47
|
+
NoDisplay=true
|
|
48
|
+
Terminal=true #basically will open terminal and people can see the script executing
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## /usr/bin/eui-start.sh
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
#!/bin/env bash
|
|
55
|
+
if mountpoint -q "/lib/live/mount"; then
|
|
56
|
+
# isLive
|
|
57
|
+
|
|
58
|
+
# try to read /etc/hostname from /dev/sda
|
|
59
|
+
sudo mount "/dev/sda2" "/mnt"
|
|
60
|
+
OS_HOSTNAME=$(/usr/bin/cat /mnt/etc/hostname)
|
|
61
|
+
sudo umount "/dev/sda2"
|
|
62
|
+
sudo echo "I will completely format local system: ${OS_HOSTNAME}"
|
|
63
|
+
echo -n "Wait a minute for installation or CTRL-C to abort.";
|
|
64
|
+
for _ in {1..60}; do read -rs -n1 -t1 || printf ".";done;echo
|
|
65
|
+
sudo eggs install -unrd .local
|
|
66
|
+
else
|
|
67
|
+
# isInstalled
|
|
68
|
+
sudo rm /etc/sudoers.d/eui-users
|
|
69
|
+
sudo rm /usr/bin/eui-start.sh
|
|
70
|
+
sudo rm /etc/xdg/autostart/eui.desktop
|
|
71
|
+
fi
|
|
72
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/bin/env bash
|
|
2
|
+
sudo eggs tools clean -n
|
|
3
|
+
sudo eggs tools ppa -n
|
|
4
|
+
sudo eggs kill -n
|
|
5
|
+
sudo cp eui-users /etc/sudoers.d/
|
|
6
|
+
sudo cp eui-start.sh /usr/bin/
|
|
7
|
+
sudo cp eui.desktop /etc/xdg/autostart/
|
|
8
|
+
sudo eggs produce --release -n
|
|
9
|
+
sudo rm /etc/sudoers.d/eui-users
|
|
10
|
+
sudo rm /usr/bin/eui-start.sh
|
|
11
|
+
sudo rm /etc/xdg/autostart/eui.desktop
|
|
12
|
+
sudo eggs cuckoo
|