penguins-eggs 9.2.5 → 9.2.6
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/README.md +16 -15
- package/conf/distros/jessie/krill/settings.yml +48 -9
- package/lib/classes/distro.js +2 -0
- package/lib/classes/incubation/distros/jessie.js +1 -1
- package/lib/classes/incubation/fisherman.js +1 -1
- package/lib/classes/pxe.js +31 -7
- package/lib/commands/install.d.ts +1 -0
- package/lib/commands/install.js +3 -1
- package/lib/interfaces/i-installer.d.ts +1 -1
- package/lib/krill/krill-prepare.d.ts +1 -1
- package/lib/krill/krill-prepare.js +6 -3
- package/lib/krill/krill-sequence.d.ts +2 -3
- package/lib/krill/krill-sequence.js +5 -15
- package/lib/krill/modules/hostname.js +32 -2
- package/lib/krill/modules/partition.js +25 -14
- package/lib/krill/modules/set-keyboard.js +5 -1
- package/lib/lib/cli-autologin.js +1 -1
- package/package.json +1 -1
- package/lib/krill/modules/hosts.d.ts +0 -14
- package/lib/krill/modules/hosts.js +0 -35
package/README.md
CHANGED
|
@@ -197,7 +197,7 @@ DESCRIPTION
|
|
|
197
197
|
adapt monitor resolution for VM only
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
_See code: [src/commands/adapt.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
200
|
+
_See code: [src/commands/adapt.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/adapt.ts)_
|
|
201
201
|
|
|
202
202
|
## `eggs analyze`
|
|
203
203
|
|
|
@@ -218,7 +218,7 @@ EXAMPLES
|
|
|
218
218
|
$ sudo eggs analyze
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
-
_See code: [src/commands/analyze.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
221
|
+
_See code: [src/commands/analyze.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/analyze.ts)_
|
|
222
222
|
|
|
223
223
|
## `eggs autocomplete [SHELL]`
|
|
224
224
|
|
|
@@ -276,7 +276,7 @@ EXAMPLES
|
|
|
276
276
|
install calamares and create it's configuration's files
|
|
277
277
|
```
|
|
278
278
|
|
|
279
|
-
_See code: [src/commands/calamares.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
279
|
+
_See code: [src/commands/calamares.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/calamares.ts)_
|
|
280
280
|
|
|
281
281
|
## `eggs config`
|
|
282
282
|
|
|
@@ -300,7 +300,7 @@ EXAMPLES
|
|
|
300
300
|
Configure and install prerequisites deb packages to run it
|
|
301
301
|
```
|
|
302
302
|
|
|
303
|
-
_See code: [src/commands/config.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
303
|
+
_See code: [src/commands/config.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/config.ts)_
|
|
304
304
|
|
|
305
305
|
## `eggs cuckoo`
|
|
306
306
|
|
|
@@ -323,7 +323,7 @@ EXAMPLES
|
|
|
323
323
|
start a PXE boot server
|
|
324
324
|
```
|
|
325
325
|
|
|
326
|
-
_See code: [src/commands/cuckoo.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
326
|
+
_See code: [src/commands/cuckoo.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/cuckoo.ts)_
|
|
327
327
|
|
|
328
328
|
## `eggs dad`
|
|
329
329
|
|
|
@@ -343,7 +343,7 @@ DESCRIPTION
|
|
|
343
343
|
ask help from daddy - configuration helper
|
|
344
344
|
```
|
|
345
345
|
|
|
346
|
-
_See code: [src/commands/dad.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
346
|
+
_See code: [src/commands/dad.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/dad.ts)_
|
|
347
347
|
|
|
348
348
|
## `eggs export deb`
|
|
349
349
|
|
|
@@ -424,10 +424,11 @@ command-line system installer - the egg became a penguin!
|
|
|
424
424
|
|
|
425
425
|
```
|
|
426
426
|
USAGE
|
|
427
|
-
$ eggs install [-u] [-k] [-p] [-h] [-v]
|
|
427
|
+
$ eggs install [-u] [-i] [-k] [-p] [-h] [-v]
|
|
428
428
|
|
|
429
429
|
FLAGS
|
|
430
430
|
-h, --help Show CLI help.
|
|
431
|
+
-i, --ip add ip to hostname
|
|
431
432
|
-k, --crypted crypted CLI installation
|
|
432
433
|
-p, --pve Proxmox VE install
|
|
433
434
|
-u, --unattended unattended CLI installation
|
|
@@ -441,7 +442,7 @@ EXAMPLES
|
|
|
441
442
|
Install the system using krill installer
|
|
442
443
|
```
|
|
443
444
|
|
|
444
|
-
_See code: [src/commands/install.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
445
|
+
_See code: [src/commands/install.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/install.ts)_
|
|
445
446
|
|
|
446
447
|
## `eggs kill`
|
|
447
448
|
|
|
@@ -463,7 +464,7 @@ EXAMPLES
|
|
|
463
464
|
kill the eggs/free the nest
|
|
464
465
|
```
|
|
465
466
|
|
|
466
|
-
_See code: [src/commands/kill.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
467
|
+
_See code: [src/commands/kill.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/kill.ts)_
|
|
467
468
|
|
|
468
469
|
## `eggs mom`
|
|
469
470
|
|
|
@@ -480,7 +481,7 @@ DESCRIPTION
|
|
|
480
481
|
ask for mommy - gui helper
|
|
481
482
|
```
|
|
482
483
|
|
|
483
|
-
_See code: [src/commands/mom.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
484
|
+
_See code: [src/commands/mom.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/mom.ts)_
|
|
484
485
|
|
|
485
486
|
## `eggs produce`
|
|
486
487
|
|
|
@@ -542,7 +543,7 @@ EXAMPLES
|
|
|
542
543
|
in /home/eggs/ovarium and you can customize all you need
|
|
543
544
|
```
|
|
544
545
|
|
|
545
|
-
_See code: [src/commands/produce.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
546
|
+
_See code: [src/commands/produce.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/produce.ts)_
|
|
546
547
|
|
|
547
548
|
## `eggs status`
|
|
548
549
|
|
|
@@ -560,7 +561,7 @@ DESCRIPTION
|
|
|
560
561
|
informations about eggs status
|
|
561
562
|
```
|
|
562
563
|
|
|
563
|
-
_See code: [src/commands/status.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
564
|
+
_See code: [src/commands/status.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/status.ts)_
|
|
564
565
|
|
|
565
566
|
## `eggs syncfrom`
|
|
566
567
|
|
|
@@ -584,7 +585,7 @@ EXAMPLES
|
|
|
584
585
|
$ sudo eggs restore
|
|
585
586
|
```
|
|
586
587
|
|
|
587
|
-
_See code: [src/commands/syncfrom.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
588
|
+
_See code: [src/commands/syncfrom.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/syncfrom.ts)_
|
|
588
589
|
|
|
589
590
|
## `eggs syncto`
|
|
590
591
|
|
|
@@ -607,7 +608,7 @@ EXAMPLES
|
|
|
607
608
|
$ sudo eggs syncto
|
|
608
609
|
```
|
|
609
610
|
|
|
610
|
-
_See code: [src/commands/syncto.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
611
|
+
_See code: [src/commands/syncto.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/syncto.ts)_
|
|
611
612
|
|
|
612
613
|
## `eggs tools clean`
|
|
613
614
|
|
|
@@ -702,7 +703,7 @@ EXAMPLES
|
|
|
702
703
|
update/upgrade the penguin's eggs tool
|
|
703
704
|
```
|
|
704
705
|
|
|
705
|
-
_See code: [src/commands/update.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.
|
|
706
|
+
_See code: [src/commands/update.ts](https://github.com/pieroproietti/penguins-eggs/blob/v9.2.6/src/commands/update.ts)_
|
|
706
707
|
|
|
707
708
|
## `eggs version`
|
|
708
709
|
|
|
@@ -1,8 +1,46 @@
|
|
|
1
|
-
# Debian
|
|
2
|
-
# settings
|
|
1
|
+
# Debian jessie, stretch
|
|
3
2
|
---
|
|
4
3
|
# "local" is LIBDIR/calamares/modules with settings in SHARE/calamares/modules
|
|
5
|
-
modules-search: [local, /usr/lib/calamares/modules]
|
|
4
|
+
modules-search: [ local, /usr/lib/calamares/modules ]
|
|
5
|
+
|
|
6
|
+
# If this is set to true, Calamares refers to itself as a "setup program"
|
|
7
|
+
# rather than an "installer". Defaults to the value of dont-chroot, but
|
|
8
|
+
# Calamares will complain if this is not explicitly set.
|
|
9
|
+
oem-setup: false
|
|
10
|
+
|
|
11
|
+
# If this is set to true, the "Cancel" button will be disabled entirely.
|
|
12
|
+
# The button is also hidden from view.
|
|
13
|
+
#
|
|
14
|
+
# This can be useful if when e.g. Calamares is used as a post-install
|
|
15
|
+
# configuration tool and you require the user to go through all the
|
|
16
|
+
# configuration steps.
|
|
17
|
+
#
|
|
18
|
+
# Default is false, but Calamares will complain if this is not explicitly set.
|
|
19
|
+
#
|
|
20
|
+
# YAML: boolean.
|
|
21
|
+
disable-cancel: false
|
|
22
|
+
|
|
23
|
+
# If this is set to true, the "Cancel" button will be disabled once
|
|
24
|
+
# you start the 'Installation', meaning there won't be a way to cancel
|
|
25
|
+
# the Installation until it has finished or installation has failed.
|
|
26
|
+
#
|
|
27
|
+
# Default is false, but Calamares will complain if this is not explicitly set.
|
|
28
|
+
#
|
|
29
|
+
# YAML: boolean.
|
|
30
|
+
disable-cancel-during-exec: false
|
|
31
|
+
|
|
32
|
+
# If this is set to true, then once the end of the sequence has
|
|
33
|
+
# been reached, the quit (done) button is clicked automatically
|
|
34
|
+
# and Calamares will close. Default is false: the user will see
|
|
35
|
+
# that the end of installation has been reached, and that things are ok.
|
|
36
|
+
#
|
|
37
|
+
#
|
|
38
|
+
quit-at-end: false
|
|
39
|
+
|
|
40
|
+
instances:
|
|
41
|
+
- id: cleanup
|
|
42
|
+
module: shellprocess
|
|
43
|
+
config: shellprocess_cleanup.conf
|
|
6
44
|
|
|
7
45
|
sequence:
|
|
8
46
|
# Phase 1 - prepare.
|
|
@@ -14,7 +52,7 @@ sequence:
|
|
|
14
52
|
- locale
|
|
15
53
|
- keyboard
|
|
16
54
|
- partition
|
|
17
|
-
|
|
55
|
+
{{createUsers}}users
|
|
18
56
|
- summary
|
|
19
57
|
|
|
20
58
|
# Phase 2 - install.
|
|
@@ -27,17 +65,18 @@ sequence:
|
|
|
27
65
|
- partition
|
|
28
66
|
- mount
|
|
29
67
|
- unpackfs
|
|
68
|
+
# dpkg-unsafe-io
|
|
30
69
|
- sources-yolk
|
|
31
|
-
{{
|
|
70
|
+
{{hasSystemd}}machineid
|
|
32
71
|
- fstab
|
|
33
72
|
- locale
|
|
34
73
|
- keyboard
|
|
35
74
|
- localecfg
|
|
36
|
-
|
|
37
|
-
|
|
75
|
+
{{createUsers}}users
|
|
76
|
+
{{hasDisplaymanager}}displaymanager
|
|
38
77
|
- networkcfg
|
|
39
78
|
- hwclock
|
|
40
|
-
{{
|
|
79
|
+
{{hasSystemd}}services-systemd
|
|
41
80
|
- bootloader-config
|
|
42
81
|
- grubcfg
|
|
43
82
|
- bootloader
|
|
@@ -46,6 +85,7 @@ sequence:
|
|
|
46
85
|
- plymouthcfg
|
|
47
86
|
- initramfscfg
|
|
48
87
|
- initramfs
|
|
88
|
+
# dpkg-unsafe-io-undo
|
|
49
89
|
- removeuser
|
|
50
90
|
- sources-yolk-unmount
|
|
51
91
|
- cleanup
|
|
@@ -88,4 +128,3 @@ prompt-install: false
|
|
|
88
128
|
#
|
|
89
129
|
# YAML: boolean.
|
|
90
130
|
dont-chroot: false
|
|
91
|
-
|
package/lib/classes/distro.js
CHANGED
|
@@ -120,6 +120,7 @@ class Distro {
|
|
|
120
120
|
this.distroLike = 'Debian';
|
|
121
121
|
this.codenameLikeId = 'jessie';
|
|
122
122
|
this.liveMediumPath = '/lib/live/mount/medium/';
|
|
123
|
+
this.isCalamaresAvailable = false;
|
|
123
124
|
break;
|
|
124
125
|
}
|
|
125
126
|
case 'stretch': {
|
|
@@ -127,6 +128,7 @@ class Distro {
|
|
|
127
128
|
this.distroLike = 'Debian';
|
|
128
129
|
this.codenameLikeId = 'stretch';
|
|
129
130
|
this.liveMediumPath = '/lib/live/mount/medium/';
|
|
131
|
+
this.isCalamaresAvailable = false;
|
|
130
132
|
break;
|
|
131
133
|
}
|
|
132
134
|
case 'buster': {
|
package/lib/classes/pxe.js
CHANGED
|
@@ -98,9 +98,10 @@ class Pxe {
|
|
|
98
98
|
await this.tryCatch(`mkdir ${this.pxeRoot} -p`);
|
|
99
99
|
await this.tryCatch(`ln -s ${this.isoRoot}live ${this.pxeRoot}/live`);
|
|
100
100
|
await this.tryCatch(`ln -s ${this.isoRoot}.disk ${this.pxeRoot}/.disk`);
|
|
101
|
-
|
|
101
|
+
// Qua copio vmlinuz e initrd per renderli scrivibili
|
|
102
|
+
await this.tryCatch(`cp ${this.isoRoot}live/${this.vmlinuz} ${this.pxeRoot}/vmlinuz`);
|
|
102
103
|
await this.tryCatch(`chmod 777 ${this.pxeRoot}/vmlinuz`);
|
|
103
|
-
await this.tryCatch(`
|
|
104
|
+
await this.tryCatch(`cp ${this.isoRoot}live/${this.initrd} ${this.pxeRoot}/initrd`);
|
|
104
105
|
await this.tryCatch(`chmod 777 ${this.pxeRoot}/initrd`);
|
|
105
106
|
// link iso images in pxe
|
|
106
107
|
for (const iso of this.isos) {
|
|
@@ -142,8 +143,15 @@ class Pxe {
|
|
|
142
143
|
content += `LABEL http\n`;
|
|
143
144
|
content += `MENU LABEL ${this.bootLabel}\n`;
|
|
144
145
|
content += `MENU DEFAULT\n`;
|
|
145
|
-
|
|
146
|
-
|
|
146
|
+
let clid = this.settings.distro.codenameLikeId;
|
|
147
|
+
if (clid === 'bionic' || clid === 'stretch' || clid === 'jessie') {
|
|
148
|
+
content += `KERNEL vmlinuz\n`;
|
|
149
|
+
content += `APPEND initrd=initrd boot=live config noswap noprompt fetch=http://${utils_1.default.address()}/live/filesystem.squashfs\n`;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
content += `KERNEL http://${utils_1.default.address()}/vmlinuz\n`;
|
|
153
|
+
content += `APPEND initrd=http://${utils_1.default.address()}/initrd boot=live config noswap noprompt fetch=http://${utils_1.default.address()}/live/filesystem.squashfs\n`;
|
|
154
|
+
}
|
|
147
155
|
content += `SYSAPPEND 3\n`;
|
|
148
156
|
content += `\n`;
|
|
149
157
|
if (this.isos.length > 0) {
|
|
@@ -278,7 +286,12 @@ class Pxe {
|
|
|
278
286
|
* @param real
|
|
279
287
|
*/
|
|
280
288
|
async dnsmasq(real = false) {
|
|
281
|
-
|
|
289
|
+
if (utils_1.default.isSystemd()) {
|
|
290
|
+
await (0, utils_2.exec)(`systemctl stop dnsmasq.service`);
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
await (0, utils_2.exec)(`service dnsmasq stop`);
|
|
294
|
+
}
|
|
282
295
|
let domain = `penguins-eggs.lan`;
|
|
283
296
|
let n = new netmask_1.Netmask(`${utils_1.default.address()}/${utils_1.default.netmask()}`);
|
|
284
297
|
let content = ``;
|
|
@@ -311,7 +324,13 @@ class Pxe {
|
|
|
311
324
|
* interfering with proxy PXE subsystems when it is just
|
|
312
325
|
* the DHCP server. Thanks to Spencer Clark for spotting this.
|
|
313
326
|
*/
|
|
314
|
-
|
|
327
|
+
const addZero = this.settings.distro.codenameId !== 'jessie';
|
|
328
|
+
if (addZero) {
|
|
329
|
+
content += `pxe-service=X86PC,"penguin's eggs cuckoo",lpxelinux.0\n`;
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
content += `pxe-service=X86PC,"penguin's eggs cuckoo",lpxelinux\n`;
|
|
333
|
+
}
|
|
315
334
|
if (real) {
|
|
316
335
|
content += `dhcp-range=${await utils_1.default.iface()},${n.first},${n.last},${n.mask},8h\n`;
|
|
317
336
|
}
|
|
@@ -321,7 +340,12 @@ class Pxe {
|
|
|
321
340
|
let file = '/etc/dnsmasq.d/cuckoo.conf';
|
|
322
341
|
fs_1.default.writeFileSync(file, content);
|
|
323
342
|
// console.log(content)
|
|
324
|
-
|
|
343
|
+
if (utils_1.default.isSystemd()) {
|
|
344
|
+
await (0, utils_2.exec)(`systemctl start dnsmasq.service`);
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
await (0, utils_2.exec)(`service dnsmasq start`);
|
|
348
|
+
}
|
|
325
349
|
}
|
|
326
350
|
/**
|
|
327
351
|
* start http server for images
|
|
@@ -11,6 +11,7 @@ import { Command } from '@oclif/core';
|
|
|
11
11
|
export default class Install extends Command {
|
|
12
12
|
static flags: {
|
|
13
13
|
unattended: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
ip: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
15
|
crypted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
pve: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
17
|
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
package/lib/commands/install.js
CHANGED
|
@@ -21,6 +21,7 @@ class Install extends core_1.Command {
|
|
|
21
21
|
utils_1.default.titles(this.id + ' ' + this.argv);
|
|
22
22
|
const { flags } = await this.parse(Install);
|
|
23
23
|
let unattended = flags.unattended;
|
|
24
|
+
let ip = flags.ip;
|
|
24
25
|
let crypted = flags.crypted;
|
|
25
26
|
let pve = flags.pve;
|
|
26
27
|
if (pve) {
|
|
@@ -30,7 +31,7 @@ class Install extends core_1.Command {
|
|
|
30
31
|
if (utils_1.default.isRoot()) {
|
|
31
32
|
if (utils_1.default.isLive()) {
|
|
32
33
|
const krill = new krill_prepare_1.default();
|
|
33
|
-
await krill.prepare(unattended, crypted, pve, verbose);
|
|
34
|
+
await krill.prepare(unattended, ip, crypted, pve, verbose);
|
|
34
35
|
}
|
|
35
36
|
else {
|
|
36
37
|
utils_1.default.warning('You are in an installed system!');
|
|
@@ -44,6 +45,7 @@ class Install extends core_1.Command {
|
|
|
44
45
|
exports.default = Install;
|
|
45
46
|
Install.flags = {
|
|
46
47
|
unattended: core_1.Flags.boolean({ char: 'u', description: 'unattended CLI installation' }),
|
|
48
|
+
ip: core_1.Flags.boolean({ char: 'i', description: 'add ip to hostname' }),
|
|
47
49
|
crypted: core_1.Flags.boolean({ char: 'k', description: 'crypted CLI installation' }),
|
|
48
50
|
pve: core_1.Flags.boolean({ char: 'p', description: 'Proxmox VE install' }),
|
|
49
51
|
help: core_1.Flags.help({ char: 'h' }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* name = 'calamares' oppure 'krill'
|
|
3
|
-
* configuration = '/etc/calamares/'
|
|
3
|
+
* configuration = '/etc/calamares/' o '/etc/penguins-eggs.d/krill/'
|
|
4
4
|
* modules = configuration + 'modules/'
|
|
5
5
|
* modulesMultiarch = '/usr/lib/' + arch-linux-gnu + '/' + installer + '/'
|
|
6
6
|
*
|
|
@@ -20,7 +20,7 @@ export default class Krill {
|
|
|
20
20
|
/**
|
|
21
21
|
* @param cryped
|
|
22
22
|
*/
|
|
23
|
-
prepare(unattended?: boolean, cryped?: boolean, pve?: boolean, verbose?: boolean): Promise<void>;
|
|
23
|
+
prepare(unattended?: boolean, ip?: boolean, cryped?: boolean, pve?: boolean, verbose?: boolean): Promise<void>;
|
|
24
24
|
/**
|
|
25
25
|
* WELCOME
|
|
26
26
|
*/
|
|
@@ -79,7 +79,7 @@ class Krill {
|
|
|
79
79
|
/**
|
|
80
80
|
* @param cryped
|
|
81
81
|
*/
|
|
82
|
-
async prepare(unattended = false, cryped = false, pve = false, verbose = false) {
|
|
82
|
+
async prepare(unattended = false, ip = false, cryped = false, pve = false, verbose = false) {
|
|
83
83
|
/**
|
|
84
84
|
* Check for disk presence
|
|
85
85
|
*/
|
|
@@ -142,6 +142,9 @@ class Krill {
|
|
|
142
142
|
if (hostname === '') {
|
|
143
143
|
hostname = shelljs_1.default.exec('cat /etc/hostname').trim();
|
|
144
144
|
}
|
|
145
|
+
if (ip) {
|
|
146
|
+
hostname = 'ip-' + utils_1.default.address().replaceAll('.', '-');
|
|
147
|
+
}
|
|
145
148
|
oUsers = {
|
|
146
149
|
name: this.krillConfig.name,
|
|
147
150
|
fullname: this.krillConfig.fullname,
|
|
@@ -434,13 +437,13 @@ class Krill {
|
|
|
434
437
|
let summaryElem;
|
|
435
438
|
let message = "";
|
|
436
439
|
if (unattended) {
|
|
437
|
-
message = "Unattended installation will start in
|
|
440
|
+
message = "Unattended installation will start in 5 seconds, press CTRL-C to abort!";
|
|
438
441
|
}
|
|
439
442
|
while (true) {
|
|
440
443
|
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 });
|
|
441
444
|
if (unattended) {
|
|
442
445
|
redraw(summaryElem);
|
|
443
|
-
await sleep(
|
|
446
|
+
await sleep(5000);
|
|
444
447
|
break;
|
|
445
448
|
}
|
|
446
449
|
else if (await confirm(summaryElem, "Confirm Summary datas?")) {
|
|
@@ -71,7 +71,6 @@ import setTimezone from './modules/set-timezone';
|
|
|
71
71
|
import umount from './modules/umount';
|
|
72
72
|
import mkfs from './modules/mkfs';
|
|
73
73
|
import hostname from './modules/hostname';
|
|
74
|
-
import hosts from './modules/hosts';
|
|
75
74
|
/**
|
|
76
75
|
* hatching: installazione o cova!!!
|
|
77
76
|
*/
|
|
@@ -104,7 +103,6 @@ export default class Sequence {
|
|
|
104
103
|
umount: typeof umount;
|
|
105
104
|
mkfs: typeof mkfs;
|
|
106
105
|
hostname: typeof hostname;
|
|
107
|
-
hosts: typeof hosts;
|
|
108
106
|
installer: IInstaller;
|
|
109
107
|
installTarget: string;
|
|
110
108
|
verbose: boolean;
|
|
@@ -129,6 +127,7 @@ export default class Sequence {
|
|
|
129
127
|
luksDevice: string;
|
|
130
128
|
luksMountpoint: string;
|
|
131
129
|
personalFile: string;
|
|
130
|
+
unattended: boolean;
|
|
132
131
|
/**
|
|
133
132
|
* constructor
|
|
134
133
|
*/
|
|
@@ -147,5 +146,5 @@ export default class Sequence {
|
|
|
147
146
|
/**
|
|
148
147
|
* only show the result
|
|
149
148
|
*/
|
|
150
|
-
finished(
|
|
149
|
+
finished(): Promise<void>;
|
|
151
150
|
}
|
|
@@ -60,7 +60,6 @@ const set_timezone_1 = tslib_1.__importDefault(require("./modules/set-timezone")
|
|
|
60
60
|
const umount_1 = tslib_1.__importDefault(require("./modules/umount"));
|
|
61
61
|
const mkfs_1 = tslib_1.__importDefault(require("./modules/mkfs"));
|
|
62
62
|
const hostname_1 = tslib_1.__importDefault(require("./modules/hostname"));
|
|
63
|
-
const hosts_1 = tslib_1.__importDefault(require("./modules/hosts"));
|
|
64
63
|
/**
|
|
65
64
|
* hatching: installazione o cova!!!
|
|
66
65
|
*/
|
|
@@ -108,7 +107,6 @@ class Sequence {
|
|
|
108
107
|
this.umount = umount_1.default;
|
|
109
108
|
this.mkfs = mkfs_1.default;
|
|
110
109
|
this.hostname = hostname_1.default;
|
|
111
|
-
this.hosts = hosts_1.default;
|
|
112
110
|
this.installer = {};
|
|
113
111
|
this.installTarget = '/tmp/calamares-krill-root';
|
|
114
112
|
this.verbose = false;
|
|
@@ -133,6 +131,7 @@ class Sequence {
|
|
|
133
131
|
this.luksDevice = '';
|
|
134
132
|
this.luksMountpoint = '';
|
|
135
133
|
this.personalFile = '';
|
|
134
|
+
this.unattended = false;
|
|
136
135
|
this.installer = (0, installer_1.installer)();
|
|
137
136
|
this.settings = new settings_1.default();
|
|
138
137
|
this.language = location.language;
|
|
@@ -166,6 +165,7 @@ class Sequence {
|
|
|
166
165
|
* @returns
|
|
167
166
|
*/
|
|
168
167
|
async install(unattended = false, verbose = false) {
|
|
168
|
+
this.unattended = unattended;
|
|
169
169
|
this.verbose = verbose;
|
|
170
170
|
this.echo = utils_1.default.setEcho(this.verbose);
|
|
171
171
|
if (this.verbose) {
|
|
@@ -322,16 +322,6 @@ class Sequence {
|
|
|
322
322
|
catch (error) {
|
|
323
323
|
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
324
324
|
}
|
|
325
|
-
// hosts
|
|
326
|
-
message = "Creating hosts ";
|
|
327
|
-
percent = 0.60;
|
|
328
|
-
try {
|
|
329
|
-
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
330
|
-
await this.hosts();
|
|
331
|
-
}
|
|
332
|
-
catch (error) {
|
|
333
|
-
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
334
|
-
}
|
|
335
325
|
// bootloader-config
|
|
336
326
|
message = "bootloader-config ";
|
|
337
327
|
percent = 0.62;
|
|
@@ -502,7 +492,7 @@ class Sequence {
|
|
|
502
492
|
percent = 100.0;
|
|
503
493
|
try {
|
|
504
494
|
await redraw(react_1.default.createElement(install_1.default, { message: message, percent: percent }));
|
|
505
|
-
await this.finished(
|
|
495
|
+
await this.finished();
|
|
506
496
|
}
|
|
507
497
|
catch (error) {
|
|
508
498
|
await utils_1.default.pressKeyToExit(JSON.stringify(error));
|
|
@@ -526,9 +516,9 @@ class Sequence {
|
|
|
526
516
|
/**
|
|
527
517
|
* only show the result
|
|
528
518
|
*/
|
|
529
|
-
async finished(
|
|
519
|
+
async finished() {
|
|
530
520
|
await redraw(react_1.default.createElement(finished_1.default, { installationDevice: this.partitions.installationDevice, hostName: this.users.hostname, userName: this.users.name }));
|
|
531
|
-
if (!unattended) {
|
|
521
|
+
if (!this.unattended) {
|
|
532
522
|
utils_1.default.pressKeyToExit('Press a key to reboot...');
|
|
533
523
|
}
|
|
534
524
|
shelljs_1.default.exec('reboot');
|
|
@@ -8,11 +8,41 @@
|
|
|
8
8
|
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
const
|
|
11
|
+
const tslib_1 = require("tslib");
|
|
12
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
12
13
|
/**
|
|
13
14
|
* hostname
|
|
14
15
|
*/
|
|
15
16
|
async function hostname() {
|
|
16
|
-
|
|
17
|
+
let hostname = this.users.hostname;
|
|
18
|
+
/**
|
|
19
|
+
* hostname
|
|
20
|
+
*/
|
|
21
|
+
{
|
|
22
|
+
let file = this.installTarget + '/etc/hostname';
|
|
23
|
+
let text = hostname;
|
|
24
|
+
fs_1.default.writeFileSync(file, text);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* hosts
|
|
28
|
+
*/
|
|
29
|
+
{
|
|
30
|
+
let file = this.installTarget + '/etc/hosts';
|
|
31
|
+
let text = '127.0.0.1 localhost localhost.localdomain\n';
|
|
32
|
+
if (this.network.addressType === 'static') {
|
|
33
|
+
text += `${this.network.address} ${hostname} pvelocalhost\n`;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
text += `127.0.1.1 ${hostname} \n`;
|
|
37
|
+
}
|
|
38
|
+
text += `# The following lines are desirable for IPv6 capable hosts\n`;
|
|
39
|
+
text += `:: 1 ip6 - localhost ip6 - loopback\n`;
|
|
40
|
+
text += `fe00:: 0 ip6 - localnet\n`;
|
|
41
|
+
text += `ff00:: 0 ip6 - mcastprefix\n`;
|
|
42
|
+
text += `ff02:: 1 ip6 - allnodes\n`;
|
|
43
|
+
text += `ff02:: 2 ip6 - allrouters\n`;
|
|
44
|
+
text += `ff02:: 3 ip6 - allhosts\n`;
|
|
45
|
+
fs_1.default.writeFileSync(file, text);
|
|
46
|
+
}
|
|
17
47
|
}
|
|
18
48
|
exports.default = hostname;
|
|
@@ -13,8 +13,7 @@ const tslib_1 = require("tslib");
|
|
|
13
13
|
const utils_1 = require("../../lib/utils");
|
|
14
14
|
const utils_2 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
15
15
|
const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
|
|
16
|
-
|
|
17
|
-
// import { render, RenderOptions } from 'ink'
|
|
16
|
+
const os_1 = tslib_1.__importDefault(require("os"));
|
|
18
17
|
/**
|
|
19
18
|
*
|
|
20
19
|
* @param this
|
|
@@ -33,6 +32,18 @@ async function partition() {
|
|
|
33
32
|
p = 'p';
|
|
34
33
|
}
|
|
35
34
|
const installMode = this.partitions.installationMode;
|
|
35
|
+
let swapSize = Math.round(os_1.default.totalmem() / 1073741824) * 1024;
|
|
36
|
+
if (this.partitions.userSwapChoice === 'none') {
|
|
37
|
+
swapSize = 0;
|
|
38
|
+
}
|
|
39
|
+
else if (this.partitions.userSwapChoice === 'small') {
|
|
40
|
+
}
|
|
41
|
+
else if (this.partitions.userSwapChoice === 'suspend') {
|
|
42
|
+
swapSize *= 2;
|
|
43
|
+
}
|
|
44
|
+
else if (this.partitions.userSwapChoice === 'file') {
|
|
45
|
+
swapSize = 0;
|
|
46
|
+
}
|
|
36
47
|
if (installMode === 'standard' && !this.efi) {
|
|
37
48
|
/**
|
|
38
49
|
* ===========================================================================================
|
|
@@ -40,8 +51,8 @@ async function partition() {
|
|
|
40
51
|
* ===========================================================================================
|
|
41
52
|
*/
|
|
42
53
|
await (0, utils_1.exec)(`parted --script ${installDevice} mklabel msdos`, this.echo);
|
|
43
|
-
await (0, utils_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary linux-swap
|
|
44
|
-
await (0, utils_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary ext4
|
|
54
|
+
await (0, utils_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary linux-swap 1MiB ${swapSize + 1}MiB`, this.echo); //dev/sda1 swap
|
|
55
|
+
await (0, utils_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary ext4 ${swapSize + 1}MiB 100%`, this.echo); //dev/sda2 root
|
|
45
56
|
await (0, utils_1.exec)(`parted ${installDevice} set 1 boot on`, this.echo);
|
|
46
57
|
await (0, utils_1.exec)(`parted ${installDevice} set 1 esp on`, this.echo);
|
|
47
58
|
// SWAP
|
|
@@ -65,9 +76,9 @@ async function partition() {
|
|
|
65
76
|
* ===========================================================================================
|
|
66
77
|
*/
|
|
67
78
|
await (0, utils_1.exec)(`parted --script ${installDevice} mklabel msdos`, this.echo);
|
|
68
|
-
await (0, utils_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary ext4
|
|
69
|
-
await (0, utils_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary linux-swap
|
|
70
|
-
await (0, utils_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary ext4
|
|
79
|
+
await (0, utils_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary ext4 1MiB 512MiB`, this.echo); // sda1
|
|
80
|
+
await (0, utils_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary linux-swap 512MiB ${swapSize + 512}MiB`, this.echo); // sda2
|
|
81
|
+
await (0, utils_1.exec)(`parted --script --align optimal ${installDevice} mkpart primary ext4 ${swapSize + 512}MiB 100%`, this.echo); // sda3
|
|
71
82
|
await (0, utils_1.exec)(`parted --script ${installDevice} set 1 boot on`, this.echo); // sda1
|
|
72
83
|
await (0, utils_1.exec)(`parted --script ${installDevice} set 1 esp on`, this.echo); // sda1
|
|
73
84
|
// BOOT 512M
|
|
@@ -120,9 +131,9 @@ async function partition() {
|
|
|
120
131
|
* ===========================================================================================
|
|
121
132
|
*/
|
|
122
133
|
await (0, utils_1.exec)(`parted --script ${installDevice} mklabel gpt`, this.echo);
|
|
123
|
-
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart efi fat32
|
|
124
|
-
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart swap linux-swap
|
|
125
|
-
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart root ext4
|
|
134
|
+
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart efi fat32 34s 256MiB`, this.echo); // sda1 EFI
|
|
135
|
+
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart swap linux-swap 256MiB ${swapSize + 256}Mib`, this.echo); // sda2 swap
|
|
136
|
+
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart root ext4 ${swapSize + 256}MiB 100%`, this.echo); // sda3 root
|
|
126
137
|
await (0, utils_1.exec)(`parted --script ${installDevice} set 1 boot on`, this.echo); // sda1
|
|
127
138
|
await (0, utils_1.exec)(`parted --script ${installDevice} set 1 esp on`, this.echo); // sda1
|
|
128
139
|
this.devices.efi.name = `${installDevice}${p}1`;
|
|
@@ -147,10 +158,10 @@ async function partition() {
|
|
|
147
158
|
* ===========================================================================================
|
|
148
159
|
*/
|
|
149
160
|
await (0, utils_1.exec)(`parted --script ${installDevice} mklabel gpt`, this.echo);
|
|
150
|
-
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart efi fat32
|
|
151
|
-
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart boot ext4
|
|
152
|
-
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart swap linux-swap
|
|
153
|
-
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart root ext4
|
|
161
|
+
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart efi fat32 34s 256MiB`, this.echo); // sda1 EFI
|
|
162
|
+
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart boot ext4 256MiB 768MiB`, this.echo); // sda2 boot
|
|
163
|
+
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart swap linux-swap 768MiB ${swapSize + 768}MiB`, this.echo); // sda3 swap
|
|
164
|
+
await (0, utils_1.exec)(`parted --script ${installDevice} mkpart root ext4 ${swapSize + 768}MiB 100%`, this.echo); // sda4 root
|
|
154
165
|
await (0, utils_1.exec)(`parted --script ${installDevice} set 1 boot on`, this.echo); // sda1
|
|
155
166
|
await (0, utils_1.exec)(`parted --script ${installDevice} set 1 esp on`, this.echo); // sda1
|
|
156
167
|
// EFI 256M
|
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
11
11
|
const tslib_1 = require("tslib");
|
|
12
12
|
const utils_1 = tslib_1.__importDefault(require("../../classes/utils"));
|
|
13
13
|
const utils_2 = require("../../lib/utils");
|
|
14
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
14
15
|
async function setKeyboard() {
|
|
15
16
|
/**
|
|
16
17
|
* influence: - /etc/default/keyboard (x11)
|
|
@@ -63,7 +64,10 @@ async function setKeyboard() {
|
|
|
63
64
|
content += ` MatchIsKeyboard "on"\n`;
|
|
64
65
|
content += ` Option "XkbLayout" "` + this.keyboardLayout + `"\n`;
|
|
65
66
|
content += `EndSection\n`;
|
|
66
|
-
|
|
67
|
+
// Not always exist /etc/X11/xorg.conf.d
|
|
68
|
+
if (fs_1.default.existsSync(`this.installTarget + '/etc/X11/xorg.conf.d`)) {
|
|
69
|
+
utils_1.default.write(this.installTarget + '/etc/X11/xorg.conf.d/00-keyboard.conf', content);
|
|
70
|
+
}
|
|
67
71
|
}
|
|
68
72
|
}
|
|
69
73
|
exports.default = setKeyboard;
|
package/lib/lib/cli-autologin.js
CHANGED
|
@@ -110,7 +110,7 @@ exports.remove = remove;
|
|
|
110
110
|
*/
|
|
111
111
|
async function addMotd(distro, version, user, userPasswd, rootPasswd, chroot = '/') {
|
|
112
112
|
const fileMotd = `${chroot}/etc/motd`;
|
|
113
|
-
let installer = 'sudo eggs
|
|
113
|
+
let installer = 'sudo eggs install';
|
|
114
114
|
if (pacman_1.default.packageIsInstalled('calamares')) {
|
|
115
115
|
if (pacman_1.default.packageIsInstalled('plasma-desktop')) {
|
|
116
116
|
installer = 'startplasma-wayland to run GUI and launch calamares, or from terminal sudo eggs krill -c';
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* krill: module hosts
|
|
3
|
-
*
|
|
4
|
-
* author: Piero Proietti
|
|
5
|
-
* mail: piero.proietti@gmail.com
|
|
6
|
-
*
|
|
7
|
-
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
8
|
-
*/
|
|
9
|
-
import Sequence from '../krill-sequence';
|
|
10
|
-
/**
|
|
11
|
-
* hosts
|
|
12
|
-
* @param this
|
|
13
|
-
*/
|
|
14
|
-
export default function hosts(this: Sequence): Promise<void>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* krill: module hosts
|
|
4
|
-
*
|
|
5
|
-
* author: Piero Proietti
|
|
6
|
-
* mail: piero.proietti@gmail.com
|
|
7
|
-
*
|
|
8
|
-
* https://stackoverflow.com/questions/23876782/how-do-i-split-a-typescript-class-into-multiple-files
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
const tslib_1 = require("tslib");
|
|
12
|
-
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
13
|
-
/**
|
|
14
|
-
* hosts
|
|
15
|
-
* @param this
|
|
16
|
-
*/
|
|
17
|
-
async function hosts() {
|
|
18
|
-
const file = this.installTarget + '/etc/hosts';
|
|
19
|
-
let text = '127.0.0.1 localhost localhost.localdomain\n';
|
|
20
|
-
if (this.network.addressType === 'static') {
|
|
21
|
-
text += `${this.network.address} ${this.users.hostname} pvelocalhost\n`;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
text += `127.0.1.1 ${this.users.hostname} \n`;
|
|
25
|
-
}
|
|
26
|
-
text += `# The following lines are desirable for IPv6 capable hosts\n`;
|
|
27
|
-
text += `:: 1 ip6 - localhost ip6 - loopback\n`;
|
|
28
|
-
text += `fe00:: 0 ip6 - localnet\n`;
|
|
29
|
-
text += `ff00:: 0 ip6 - mcastprefix\n`;
|
|
30
|
-
text += `ff02:: 1 ip6 - allnodes\n`;
|
|
31
|
-
text += `ff02:: 2 ip6 - allrouters\n`;
|
|
32
|
-
text += `ff02:: 3 ip6 - allhosts\n`;
|
|
33
|
-
fs_1.default.writeFileSync(file, text);
|
|
34
|
-
}
|
|
35
|
-
exports.default = hosts;
|