penguins-eggs 9.1.37 → 9.2.4

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 (153) hide show
  1. package/README.md +148 -170
  2. package/addons/eggs/adapt/applications/eggs-adapt.desktop +0 -0
  3. package/addons/eggs/adapt/bin/adapt +0 -0
  4. package/addons/eggs/ichoice/bin/eggs-ichoice.sh +0 -0
  5. package/addons/eggs/pve/applications/eggs-pve.desktop +0 -0
  6. package/addons/eggs/rsupport/applications/eggs-rsupport.desktop +0 -0
  7. package/addons/eggs/theme/applications/install-debian.desktop +0 -0
  8. package/addons/eggs/theme/livecd/isolinux.theme.cfg +36 -41
  9. package/addons/neon/theme/applications/install-debian.desktop +0 -0
  10. package/addons/telos/theme/applications/install-debian.desktop +0 -0
  11. package/addons/ufficiozero/theme/applications/install-debian.desktop +0 -0
  12. package/addons/waydroid/theme/applications/install-debian.desktop +0 -0
  13. package/assets/calamares/install-debian +0 -0
  14. package/assets/penguins-eggs.desktop +0 -0
  15. package/assets/penguins-krill.desktop +0 -0
  16. package/assets/penguins-links-add.desktop +0 -0
  17. package/assets/penguins-live-installer.desktop +0 -0
  18. package/bin/dev +0 -0
  19. package/conf/distros/bionic/calamares/calamares-modules/after-bootloader/after-bootloader.sh +0 -0
  20. package/conf/distros/bionic/calamares/calamares-modules/before-bootloader/before-bootloader.sh +0 -0
  21. package/conf/distros/bionic/calamares/calamares-modules/before-bootloader-mkdirs/before-bootloader-mkdirs.sh +0 -0
  22. package/conf/distros/bionic/calamares/calamares-modules/bug/bug.sh +0 -0
  23. package/conf/distros/bionic/calamares/calamares-modules/grubcfg/main.py +0 -0
  24. package/conf/distros/bionic/calamares/settings.yml +2 -2
  25. package/conf/distros/buster/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
  26. package/conf/distros/buster/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
  27. package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
  28. package/conf/distros/buster/calamares/settings.yml +2 -2
  29. package/conf/distros/focal/calamares/calamares-modules/automirror/main.py +0 -0
  30. package/conf/distros/focal/calamares/settings.yml +2 -2
  31. package/conf/distros/rolling/calamares/modules/machineid.yml +4 -0
  32. package/conf/distros/rolling/calamares/modules/packages.yml +1 -1
  33. package/conf/distros/rolling/calamares/modules/shellprocess_removelink.yml +6 -0
  34. package/conf/distros/rolling/calamares/settings.yml +4 -11
  35. package/conf/eggs.yaml +41 -73
  36. package/conf/exclude.list +1 -0
  37. package/conf/krill.yaml +38 -0
  38. package/lib/classes/bleach.js +6 -4
  39. package/lib/classes/daddy.d.ts +2 -2
  40. package/lib/classes/daddy.js +2 -1
  41. package/lib/classes/distro.d.ts +2 -0
  42. package/lib/classes/distro.js +10 -0
  43. package/lib/classes/family/archlinux.js +8 -4
  44. package/lib/classes/incubation/distros/bionic.d.ts +1 -1
  45. package/lib/classes/incubation/distros/bionic.js +1 -1
  46. package/lib/classes/incubation/distros/buster.d.ts +1 -1
  47. package/lib/classes/incubation/distros/buster.js +1 -1
  48. package/lib/classes/incubation/distros/focal.d.ts +1 -1
  49. package/lib/classes/incubation/distros/focal.js +1 -1
  50. package/lib/classes/incubation/distros/jessie.d.ts +1 -1
  51. package/lib/classes/incubation/distros/jessie.js +1 -1
  52. package/lib/classes/incubation/distros/rolling.d.ts +3 -3
  53. package/lib/classes/incubation/distros/rolling.js +4 -5
  54. package/lib/classes/incubation/fisherman-helper/packages.d.ts +4 -0
  55. package/lib/classes/incubation/fisherman-helper/packages.js +9 -16
  56. package/lib/classes/incubation/fisherman.d.ts +1 -1
  57. package/lib/classes/incubation/fisherman.js +24 -10
  58. package/lib/classes/incubation/incubator.js +26 -22
  59. package/lib/classes/ovary.d.ts +2 -1
  60. package/lib/classes/ovary.js +50 -20
  61. package/lib/classes/pacman.js +8 -7
  62. package/lib/classes/pxe.d.ts +42 -0
  63. package/lib/classes/pxe.js +242 -0
  64. package/lib/classes/settings.d.ts +3 -3
  65. package/lib/classes/settings.js +2 -1
  66. package/lib/classes/tools.d.ts +2 -2
  67. package/lib/classes/utils.d.ts +2 -2
  68. package/lib/classes/utils.js +4 -4
  69. package/lib/commands/calamares.js +1 -0
  70. package/lib/commands/{remove.d.ts → cuckoo.d.ts} +7 -4
  71. package/lib/commands/cuckoo.js +69 -0
  72. package/lib/commands/{krill.d.ts → install.d.ts} +2 -3
  73. package/lib/commands/install.js +53 -0
  74. package/lib/commands/produce.d.ts +1 -0
  75. package/lib/commands/produce.js +8 -10
  76. package/lib/commands/{info.d.ts → status.d.ts} +1 -1
  77. package/lib/commands/{info.js → status.js} +5 -5
  78. package/lib/commands/syncfrom.js +1 -1
  79. package/lib/commands/syncto.js +1 -1
  80. package/lib/components/summary.d.ts +6 -1
  81. package/lib/components/summary.js +25 -8
  82. package/lib/components/users.js +3 -4
  83. package/lib/interfaces/i-config-tools.d.ts +1 -1
  84. package/lib/interfaces/i-distro.d.ts +2 -0
  85. package/lib/interfaces/{i-config.d.ts → i-eggs-config.d.ts} +2 -4
  86. package/lib/interfaces/{i-config.js → i-eggs-config.js} +0 -0
  87. package/lib/interfaces/i-krill-config.d.ts +26 -0
  88. package/lib/interfaces/i-krill-config.js +2 -0
  89. package/lib/interfaces/i-packages.d.ts +6 -9
  90. package/lib/interfaces/i-packages.js +3 -0
  91. package/lib/interfaces/index.d.ts +1 -1
  92. package/lib/krill/krill-prepare.d.ts +8 -4
  93. package/lib/krill/krill-prepare.js +166 -36
  94. package/lib/krill/krill-sequence.d.ts +6 -3
  95. package/lib/krill/krill-sequence.js +31 -14
  96. package/lib/krill/modules/fstab.d.ts +5 -0
  97. package/lib/krill/modules/fstab.js +5 -0
  98. package/lib/krill/modules/grubcfg.d.ts +5 -0
  99. package/lib/krill/modules/grubcfg.js +5 -0
  100. package/lib/krill/modules/hostname.d.ts +5 -0
  101. package/lib/krill/modules/hostname.js +5 -0
  102. package/lib/krill/modules/hosts.d.ts +5 -0
  103. package/lib/krill/modules/hosts.js +5 -0
  104. package/lib/krill/modules/initramfs-cfg.d.ts +5 -0
  105. package/lib/krill/modules/initramfs-cfg.js +5 -0
  106. package/lib/krill/modules/initramfs.d.ts +5 -0
  107. package/lib/krill/modules/initramfs.js +5 -0
  108. package/lib/krill/modules/locale-cfg.d.ts +5 -0
  109. package/lib/krill/modules/locale-cfg.js +5 -0
  110. package/lib/krill/modules/locale.d.ts +5 -0
  111. package/lib/krill/modules/locale.js +5 -0
  112. package/lib/krill/modules/machine-id.d.ts +5 -0
  113. package/lib/krill/modules/machine-id.js +5 -0
  114. package/lib/krill/modules/mkfs.d.ts +5 -0
  115. package/lib/krill/modules/mkfs.js +5 -0
  116. package/lib/krill/modules/mount-fs.d.ts +5 -0
  117. package/lib/krill/modules/mount-fs.js +5 -0
  118. package/lib/krill/modules/mount-vfs.d.ts +5 -0
  119. package/lib/krill/modules/mount-vfs.js +5 -0
  120. package/lib/krill/modules/network-cfg.d.ts +5 -0
  121. package/lib/krill/modules/network-cfg.js +5 -0
  122. package/lib/krill/modules/packages.d.ts +14 -0
  123. package/lib/krill/modules/packages.js +65 -0
  124. package/lib/krill/modules/{partitions.d.ts → partition.d.ts} +5 -0
  125. package/lib/krill/modules/{partitions.js → partition.js} +5 -0
  126. package/lib/krill/modules/remove-installer-link.d.ts +5 -0
  127. package/lib/krill/modules/remove-installer-link.js +5 -0
  128. package/lib/krill/modules/set-keyboard.d.ts +5 -0
  129. package/lib/krill/modules/set-keyboard.js +37 -18
  130. package/lib/krill/modules/set-timezone.d.ts +5 -0
  131. package/lib/krill/modules/set-timezone.js +5 -0
  132. package/lib/krill/modules/umount.d.ts +5 -0
  133. package/lib/krill/modules/umount.js +5 -0
  134. package/lib/krill/modules/unpackfs.d.ts +5 -0
  135. package/lib/krill/modules/unpackfs.js +5 -0
  136. package/manpages/doc/man/eggs.1.gz +0 -0
  137. package/manpages/doc/man/eggs.html +72 -83
  138. package/package.json +117 -117
  139. package/scripts/_eggs +29 -29
  140. package/scripts/bros/waydroid-helper.sh +0 -0
  141. package/scripts/eggs-adapt.sh +0 -0
  142. package/scripts/eggs.bash +6 -6
  143. package/scripts/install-eggs-ppa.sh +0 -0
  144. package/scripts/mom-cli.sh +33 -89
  145. package/scripts/pve-live.service +0 -0
  146. package/scripts/pve-live.sh +0 -0
  147. package/scripts/resy.sh +0 -0
  148. package/scripts/userexist.sh +0 -0
  149. package/conf/distros/rolling/calamares/calamares-modules/remove-link/module.yml +0 -9
  150. package/conf/distros/rolling/calamares/calamares-modules/remove-link/remove-link.sh +0 -3
  151. package/lib/commands/krill.js +0 -77
  152. package/lib/commands/remove.js +0 -84
  153. package/manpages/doc/man/eggs.roll.gz +0 -0
@@ -0,0 +1,242 @@
1
+ "use strict";
2
+ /**
3
+ * penguins-eggs: pxe.ts
4
+ * author: Piero Proietti
5
+ * mail: piero.proietti@gmail.com
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const tslib_1 = require("tslib");
9
+ const os_1 = tslib_1.__importDefault(require("os"));
10
+ const fs_1 = tslib_1.__importDefault(require("fs"));
11
+ const netmask_1 = require("netmask");
12
+ const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
13
+ const settings_1 = tslib_1.__importDefault(require("../classes/settings"));
14
+ const http_1 = tslib_1.__importDefault(require("http"));
15
+ const node_static_1 = tslib_1.__importDefault(require("node-static"));
16
+ const utils_2 = require("../lib/utils");
17
+ const node_path_1 = tslib_1.__importDefault(require("node:path"));
18
+ const distro_1 = tslib_1.__importDefault(require("./distro"));
19
+ /**
20
+ * Pxe:
21
+ */
22
+ class Pxe {
23
+ constructor() {
24
+ this.verbose = false;
25
+ this.echo = {};
26
+ this.settings = {};
27
+ this.mainLabel = '';
28
+ this.pxeRoot = '';
29
+ this.isoRoot = '';
30
+ this.isos = [];
31
+ this.vmlinuz = '';
32
+ this.initrd = '';
33
+ }
34
+ /**
35
+ * fertilization()
36
+ */
37
+ async fertilization() {
38
+ this.settings = new settings_1.default();
39
+ await this.settings.load();
40
+ if (utils_1.default.isLive()) {
41
+ this.isoRoot = this.settings.distro.liveMediumPath;
42
+ }
43
+ else {
44
+ this.isoRoot = node_path_1.default.dirname(this.settings.work_dir.path) + '/ovarium/iso/';
45
+ }
46
+ if (!utils_1.default.isLive() && !fs_1.default.existsSync(this.settings.work_dir.path)) {
47
+ console.log('no image available, build an image with: sudo eggs produce');
48
+ process.exit();
49
+ }
50
+ /**
51
+ * se pxeRoot non esiste viene creato
52
+ */
53
+ this.pxeRoot = node_path_1.default.dirname(this.settings.work_dir.path) + '/pxe/';
54
+ if (!fs_1.default.existsSync(this.pxeRoot)) {
55
+ await (0, utils_2.exec)(`mkdir ${this.pxeRoot} -p`);
56
+ }
57
+ /**
58
+ * Ricerca delle immagini ISO
59
+ */
60
+ let isos = [];
61
+ if (!utils_1.default.isLive()) {
62
+ let isos = fs_1.default.readdirSync(node_path_1.default.dirname(this.settings.work_dir.path));
63
+ for (const iso of isos) {
64
+ if (node_path_1.default.extname(iso) === ".iso") {
65
+ this.isos.push(iso);
66
+ }
67
+ }
68
+ }
69
+ /**
70
+ * installed: /home/eggs/ovarium/iso/live
71
+ * live: this.iso/live
72
+ */
73
+ let pathFiles = this.isoRoot + '/live';
74
+ let files = fs_1.default.readdirSync(pathFiles);
75
+ for (const file of files) {
76
+ if (node_path_1.default.basename(file).substring(0, 7) === 'vmlinuz') {
77
+ this.vmlinuz = node_path_1.default.basename(file);
78
+ }
79
+ if (node_path_1.default.basename(file).substring(0, 6) === 'initrd') {
80
+ this.initrd = node_path_1.default.basename(file);
81
+ }
82
+ }
83
+ /**
84
+ * bootLabel
85
+ */
86
+ this.mainLabel = this.settings.config.snapshot_prefix + utils_1.default.getVolid(os_1.default.hostname());
87
+ }
88
+ /**
89
+ * structure
90
+ */
91
+ async structure() {
92
+ if (fs_1.default.existsSync(this.pxeRoot)) {
93
+ await this.tryCatch(`rm ${this.pxeRoot} -rf`);
94
+ }
95
+ let cmd = `mkdir -p ${this.pxeRoot}`;
96
+ await this.tryCatch(cmd);
97
+ const distro = new distro_1.default();
98
+ await this.tryCatch(`mkdir ${this.pxeRoot} -p`);
99
+ // boot efi isolinux live .disk
100
+ await this.tryCatch(`ln -s ${this.isoRoot}boot ${this.pxeRoot}/boot`);
101
+ await this.tryCatch(`ln -s ${this.isoRoot}efi ${this.pxeRoot}/efi`);
102
+ await this.tryCatch(`ln -s ${this.isoRoot}isolinux ${this.pxeRoot}/isolinux`);
103
+ await this.tryCatch(`ln -s ${this.isoRoot}live ${this.pxeRoot}/live`);
104
+ await this.tryCatch(`ln -s ${this.isoRoot}.disk ${this.pxeRoot}/.disk`);
105
+ // isolinux.theme.cfg, splash.png MUST to be on root
106
+ await this.tryCatch(`ln -s ${this.isoRoot}isolinux/isolinux.theme.cfg ${this.pxeRoot}/isolinux.theme.cfg`);
107
+ await this.tryCatch(`ln -s ${this.isoRoot}isolinux/splash.png ${this.pxeRoot}/splash.png`);
108
+ // pxe
109
+ await this.tryCatch(`ln ${distro.pxelinuxPath}pxelinux.0 ${this.pxeRoot}/pxelinux.0`);
110
+ await this.tryCatch(`ln ${distro.pxelinuxPath}lpxelinux.0 ${this.pxeRoot}/lpxelinux.0`);
111
+ // syslinux
112
+ await this.tryCatch(`ln ${distro.syslinuxPath}ldlinux.c32 ${this.pxeRoot}/ldlinux.c32`);
113
+ await this.tryCatch(`ln ${distro.syslinuxPath}vesamenu.c32 ${this.pxeRoot}/vesamenu.c32`);
114
+ await this.tryCatch(`ln ${distro.syslinuxPath}libcom32.c32 ${this.pxeRoot}/libcom32.c32`);
115
+ await this.tryCatch(`ln ${distro.syslinuxPath}libutil.c32 ${this.pxeRoot}/libutil.c32`);
116
+ await this.tryCatch(`ln /usr/lib/syslinux/memdisk ${this.pxeRoot}/memdisk`);
117
+ await this.tryCatch(`mkdir ${this.pxeRoot}/pxelinux.cfg`);
118
+ // link iso images in pxe
119
+ for (const iso of this.isos) {
120
+ await this.tryCatch(`ln /home/eggs/${iso} ${this.pxeRoot}/${iso}`);
121
+ }
122
+ let content = ``;
123
+ content += `# eggs: pxelinux.cfg/default\n`;
124
+ content += `# search path for the c32 support libraries (libcom32, libutil etc.)\n`;
125
+ content += `path\n`;
126
+ content += `include isolinux.theme.cfg\n`;
127
+ content += `UI vesamenu.c32\n`;
128
+ content += `\n`;
129
+ content += `menu title Penguin's eggs - Perri's brewery edition - ${utils_1.default.address()}\n`;
130
+ content += `PROMPT 0\n`;
131
+ content += `TIMEOUT 0\n`;
132
+ content += `\n`;
133
+ content += `LABEL http\n`;
134
+ content += `MENU LABEL ${this.mainLabel}\n`;
135
+ content += `MENU DEFAULT\n`;
136
+ content += `KERNEL http://${utils_1.default.address()}/live/${this.vmlinuz}\n`;
137
+ content += `APPEND initrd=http://${utils_1.default.address()}/live/${this.initrd} boot=live config noswap noprompt fetch=http://${utils_1.default.address()}/live/filesystem.squashfs\n`;
138
+ content += `SYSAPPEND 3\n`;
139
+ content += `\n`;
140
+ content += `MENU SEPARATOR\n`;
141
+ for (const iso of this.isos) {
142
+ content += `\n`;
143
+ content += `LABEL isos\n`;
144
+ content += `MENU LABEL ${iso}\n`;
145
+ content += `KERNEL memdisk\n`;
146
+ content += `APPEND iso initrd=http://${utils_1.default.address()}/${iso}\n`;
147
+ }
148
+ let file = `${this.pxeRoot}/pxelinux.cfg/default`;
149
+ fs_1.default.writeFileSync(file, content);
150
+ file = `${this.pxeRoot}/index.html`;
151
+ content = ``;
152
+ content += `<html><title>Penguin's eggs PXE server</title>`;
153
+ content += `<div style="background-image:url('/splash.png');background-repeat:no-repeat;width: 640;height:480;padding:5px;border:1px solid black;">`;
154
+ content += `<h1>Penguin's eggs PXE server</h1>`;
155
+ content += `<body>address: <a href=http://${utils_1.default.address()}>${utils_1.default.address()}</a><br/>`;
156
+ if (!utils_1.default.isLive()) {
157
+ content += `download: <a href='http://${utils_1.default.address()}/${this.isos[0]}'>${this.isos[0]}</a><br/>`;
158
+ }
159
+ else {
160
+ content += `started from live iso image<br/>`;
161
+ }
162
+ content += `<br/>`;
163
+ content += `source: <a href='https://github.com/pieroproietti/penguins-eggs'>https://github.com/pieroproietti/penguins-eggs</a><br/>`;
164
+ content += `manual: <a href='https://penguins-eggs.net/book/italiano9.2.html'>italiano</a>, <a href='https://penguins--eggs-net.translate.goog/book/italiano9.2?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en'>translated</a><br/>`;
165
+ content += `discuss: <a href='https://t.me/penguins_eggs'>Telegram group<br/></body</html>`;
166
+ fs_1.default.writeFileSync(file, content);
167
+ }
168
+ /**
169
+ *
170
+ */
171
+ async dnsMasq(full = false) {
172
+ await (0, utils_2.exec)(`systemctl stop dnsmasq.service`);
173
+ let domain = `penguins-eggs.lan`;
174
+ let n = new netmask_1.Netmask(`${utils_1.default.address()}/${utils_1.default.netmask()}`);
175
+ let content = ``;
176
+ content += `# cuckoo.conf\n`;
177
+ content += `port=0\n`;
178
+ content += `interface=${await utils_1.default.iface()}\n`;
179
+ content += `bind-interfaces\n`;
180
+ content += `domain=${domain}\n`;
181
+ content += `dhcp-no-override\n`;
182
+ content += `dhcp-option=option:router,${n.first}\n`;
183
+ content += `dhcp-option=option:dns-server,${n.first}\n`;
184
+ content += `dhcp-option=option:dns-server,8.8.8.8\n`;
185
+ content += `dhcp-option=option:dns-server,8.8.4.4\n`;
186
+ content += `enable-tftp\n`;
187
+ content += `tftp-root=${this.pxeRoot}\n`;
188
+ content += `# boot config for BIOS\n`;
189
+ content += `dhcp-match=set:bios-x86,option:client-arch,0\n`;
190
+ content += `dhcp-boot=tag:bios-x86,lpxelinux.0\n`;
191
+ content += `# boot config for UEFI\n`;
192
+ content += `dhcp-match=set:efi-x86_64,option:client-arch,7\n`;
193
+ content += `dhcp-match=set:efi-x86_64,option:client-arch,9\n`;
194
+ content += `dhcp-boot=tag:efi-x86_64,lpxelinux.0\n`;
195
+ /**
196
+ * https://thekelleys.org.uk/dnsmasq/CHANGELOG
197
+ *
198
+ * Don't do any PXE processing, even for clients with the
199
+ * correct vendorclass, unless at least one pxe-prompt or
200
+ * pxe-service option is given. This stops dnsmasq
201
+ * interfering with proxy PXE subsystems when it is just
202
+ * the DHCP server. Thanks to Spencer Clark for spotting this.
203
+ */
204
+ content += `pxe-service=X86PC,"penguin's eggs cuckoo",pxelinux.0\n`;
205
+ if (full) {
206
+ content += `dhcp-range=${await utils_1.default.iface()},${n.first},${n.last},${n.mask},8h\n`;
207
+ }
208
+ else {
209
+ content += `dhcp-range=${await utils_1.default.iface()},${utils_1.default.address()},proxy,${n.mask},${utils_1.default.broadcast()} # dhcp proxy\n`;
210
+ }
211
+ let file = '/etc/dnsmasq.d/cuckoo.conf';
212
+ fs_1.default.writeFileSync(file, content);
213
+ // console.log(content)
214
+ await (0, utils_2.exec)(`systemctl start dnsmasq.service`);
215
+ }
216
+ /**
217
+ *
218
+ * @param cmd
219
+ */
220
+ async tryCatch(cmd = '') {
221
+ try {
222
+ await (0, utils_2.exec)(cmd, this.echo);
223
+ }
224
+ catch (error) {
225
+ console.log(`Error: ${error}`);
226
+ await utils_1.default.pressKeyToExit(cmd);
227
+ }
228
+ }
229
+ /**
230
+ * start http server for images
231
+ *
232
+ */
233
+ async httpStart() {
234
+ const port = 80;
235
+ const httpRoot = this.pxeRoot + "/";
236
+ var file = new (node_static_1.default.Server)(httpRoot);
237
+ http_1.default.createServer(function (req, res) {
238
+ file.serve(req, res);
239
+ }).listen(port);
240
+ }
241
+ }
242
+ exports.default = Pxe;
@@ -6,13 +6,13 @@
6
6
  */
7
7
  import { IRemix, IDistro, IApp, IWorkDir } from '../interfaces';
8
8
  import Incubator from './incubation/incubator';
9
- import { IConfig } from '../interfaces';
9
+ import { IEggsConfig } from '../interfaces';
10
10
  /**
11
11
  * Setting
12
12
  */
13
13
  export default class Settings {
14
14
  app: IApp;
15
- config: IConfig;
15
+ config: IEggsConfig;
16
16
  remix: IRemix;
17
17
  work_dir: IWorkDir;
18
18
  distro: IDistro;
@@ -31,7 +31,7 @@ export default class Settings {
31
31
  *
32
32
  * @param config
33
33
  */
34
- save(config: IConfig): Promise<void>;
34
+ save(config: IEggsConfig): Promise<void>;
35
35
  /**
36
36
  * Load configuration from config_file
37
37
  * @returns {boolean} Success
@@ -79,7 +79,8 @@ class Settings {
79
79
  this.work_dir.merged = this.work_dir.path + 'filesystem.squashfs';
80
80
  this.efi_work = this.work_dir.path + 'efi-work/';
81
81
  this.work_dir.pathIso = this.work_dir.path + 'iso/';
82
- if (this.config.snapshot_basename === 'hostname') {
82
+ // remember: before was hostname, not empty
83
+ if (this.config.snapshot_basename === '') {
83
84
  this.config.snapshot_basename = node_os_1.default.hostname();
84
85
  }
85
86
  if (this.config.make_efi && !pacman_1.default.isUefi()) {
@@ -4,7 +4,7 @@
4
4
  * email: piero.proietti@gmail.com
5
5
  * license: MIT
6
6
  */
7
- interface IConfigTools {
7
+ interface IEggsConfigTools {
8
8
  remoteHost: string;
9
9
  remoteUser: string;
10
10
  remotePathDeb: string;
@@ -23,7 +23,7 @@ export default class Tools {
23
23
  tools_yaml: string;
24
24
  snapshot_dir: string;
25
25
  snapshot_name: string;
26
- config: IConfigTools;
26
+ config: IEggsConfigTools;
27
27
  loadSettings(): Promise<boolean>;
28
28
  }
29
29
  export {};
@@ -194,7 +194,7 @@ export default class Utils {
194
194
  /**
195
195
  * return the name of network device
196
196
  */
197
- static iface(): string;
197
+ static iface(): Promise<string>;
198
198
  /**
199
199
  * address
200
200
  */
@@ -273,7 +273,7 @@ export default class Utils {
273
273
  /**
274
274
  *
275
275
  */
276
- static pressKeyToExit(warming?: string, stopProcess?: boolean): Promise<void>;
276
+ static pressKeyToExit(warming?: string, procContinue?: boolean): Promise<void>;
277
277
  /**
278
278
  * titles
279
279
  * Penguin's are gettings alive!
@@ -541,7 +541,7 @@ class Utils {
541
541
  /**
542
542
  * return the name of network device
543
543
  */
544
- static iface() {
544
+ static async iface() {
545
545
  // return shx.exec(`ifconfig | awk 'FNR==1 { print $1 }' | tr --d :`, { silent: true }).stdout.trim()
546
546
  const interfaces = Object.keys(os_1.default.networkInterfaces());
547
547
  let netDeviceName = '';
@@ -742,15 +742,15 @@ class Utils {
742
742
  /**
743
743
  *
744
744
  */
745
- static async pressKeyToExit(warming = 'Process will end', stopProcess = true) {
745
+ static async pressKeyToExit(warming = 'Process will end', procContinue = true) {
746
746
  Utils.warning(warming);
747
747
  let msg = 'Press a key to exit...';
748
- if (stopProcess) {
748
+ if (procContinue) {
749
749
  msg = 'Press a key to continue...';
750
750
  }
751
751
  console.log(msg);
752
752
  const pressKeyToExit = (0, child_process_1.spawnSync)('read _ ', { shell: true, stdio: [0, 1, 2] });
753
- if (!stopProcess) {
753
+ if (!procContinue) {
754
754
  process.exit(0);
755
755
  }
756
756
  }
@@ -92,6 +92,7 @@ class Calamares extends core_1.Command {
92
92
  utils_1.default.warning('Configuring krill');
93
93
  await this.settings.loadRemix(this.settings.config.snapshot_basename, theme);
94
94
  this.incubator = new incubator_1.default(this.settings.remix, this.settings.distro, this.settings.config.user_opt, verbose);
95
+ console.log('calamares relase: ' + release);
95
96
  await this.incubator.config(release);
96
97
  }
97
98
  }
@@ -5,17 +5,20 @@
5
5
  * license: MIT
6
6
  */
7
7
  import { Command } from '@oclif/core';
8
+ import { IWorkDir } from '../interfaces/i-workdir';
8
9
  /**
9
10
  *
10
11
  */
11
- export default class Remove extends Command {
12
+ export default class Cuckoo extends Command {
13
+ config_file: string;
14
+ snapshot_dir: string;
15
+ work_dir: IWorkDir;
12
16
  static description: string;
13
- static examples: string[];
14
17
  static flags: {
15
- purge: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
- autoremove: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
+ full: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
19
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
18
20
  verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
21
  };
22
+ static examples: string[];
20
23
  run(): Promise<void>;
21
24
  }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /**
5
+ * penguins-eggs-v7 based on Debian live
6
+ * author: Piero Proietti
7
+ * email: piero.proietti@gmail.com
8
+ * license: MIT
9
+ */
10
+ const core_1 = require("@oclif/core");
11
+ const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
12
+ const pacman_1 = tslib_1.__importDefault(require("../classes/pacman"));
13
+ const pxe_1 = tslib_1.__importDefault(require("../classes/pxe"));
14
+ const utils_2 = require("../lib/utils");
15
+ const distro_1 = tslib_1.__importDefault(require("../classes/distro"));
16
+ /**
17
+ *
18
+ */
19
+ class Cuckoo extends core_1.Command {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.config_file = '/etc/penguins-eggs.d/eggs.yaml';
23
+ this.snapshot_dir = '';
24
+ this.work_dir = {};
25
+ }
26
+ async run() {
27
+ utils_1.default.titles(this.id + ' ' + this.argv);
28
+ const { flags } = await this.parse(Cuckoo);
29
+ let verbose = flags.verbose;
30
+ const echo = utils_1.default.setEcho(verbose);
31
+ let full = flags.full;
32
+ const distro = new distro_1.default();
33
+ if (distro.familyId === 'debian') {
34
+ if (utils_1.default.isRoot()) {
35
+ if (!pacman_1.default.packageIsInstalled('dnsmasq') ||
36
+ (!pacman_1.default.packageIsInstalled("pxelinux"))) {
37
+ console.log('eggs cuckoo need to nstall dnsmasq and pxelinux.');
38
+ if (await utils_1.default.customConfirm()) {
39
+ console.log('Installing dnsmasq and pxelinux... wait a moment');
40
+ await (0, utils_2.exec)('sudo apt-get update -y', utils_1.default.setEcho(false));
41
+ await (0, utils_2.exec)('sudo apt-get install dnsmasq pxelinux -y', utils_1.default.setEcho(false));
42
+ }
43
+ else {
44
+ console.log('You need to install dnsmasq to start cuckoo PXE server');
45
+ process.exit();
46
+ }
47
+ }
48
+ const pxe = new pxe_1.default();
49
+ await pxe.fertilization();
50
+ await pxe.structure();
51
+ await pxe.dnsMasq(full);
52
+ await pxe.httpStart();
53
+ console.log(`Serving PXE boot, read more at: http://${utils_1.default.address()}`);
54
+ console.log(`CTRL-c to quit`);
55
+ }
56
+ }
57
+ else {
58
+ console.log(`Sorry: actually cuckoo is enabled just for debian family!`);
59
+ }
60
+ }
61
+ }
62
+ exports.default = Cuckoo;
63
+ Cuckoo.description = 'cuckoo start a PXE boot server serving the live image';
64
+ Cuckoo.flags = {
65
+ full: core_1.Flags.boolean({ char: 'f' }),
66
+ help: core_1.Flags.help({ char: 'h' }),
67
+ verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' })
68
+ };
69
+ Cuckoo.examples = ['$ sudo eggs cuckoo\nstart a PXE boot server'];
@@ -6,17 +6,16 @@
6
6
  */
7
7
  import { Command } from '@oclif/core';
8
8
  /**
9
- * Class Install
9
+ * Class Krill
10
10
  */
11
11
  export default class Install extends Command {
12
12
  static flags: {
13
- cli: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ unattended: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
14
  crypted: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
15
  pve: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
16
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
17
17
  verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
18
  };
19
- static aliases: string[];
20
19
  static description: string;
21
20
  static examples: string[];
22
21
  /**
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /**
3
+ * penguins-eggs-v7 based on Debian live
4
+ * author: Piero Proietti
5
+ * email: piero.proietti@gmail.com
6
+ * license: MIT
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const tslib_1 = require("tslib");
10
+ const core_1 = require("@oclif/core");
11
+ const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
12
+ const krill_prepare_1 = tslib_1.__importDefault(require("../krill/krill-prepare"));
13
+ /**
14
+ * Class Krill
15
+ */
16
+ class Install extends core_1.Command {
17
+ /**
18
+ * Execute
19
+ */
20
+ async run() {
21
+ utils_1.default.titles(this.id + ' ' + this.argv);
22
+ const { flags } = await this.parse(Install);
23
+ let unattended = flags.unattended;
24
+ let crypted = flags.crypted;
25
+ let pve = flags.pve;
26
+ if (pve) {
27
+ crypted = false;
28
+ }
29
+ let verbose = flags.verbose;
30
+ if (utils_1.default.isRoot()) {
31
+ if (utils_1.default.isLive()) {
32
+ const krill = new krill_prepare_1.default();
33
+ await krill.prepare(unattended, crypted, pve, verbose);
34
+ }
35
+ else {
36
+ utils_1.default.warning('You are in an installed system!');
37
+ }
38
+ }
39
+ else {
40
+ utils_1.default.useRoot(this.id);
41
+ }
42
+ }
43
+ }
44
+ exports.default = Install;
45
+ Install.flags = {
46
+ unattended: core_1.Flags.boolean({ char: 'u', description: 'unattended CLI installation' }),
47
+ crypted: core_1.Flags.boolean({ char: 'k', description: 'crypted CLI installation' }),
48
+ pve: core_1.Flags.boolean({ char: 'p', description: 'Proxmox VE install' }),
49
+ help: core_1.Flags.help({ char: 'h' }),
50
+ verbose: core_1.Flags.boolean({ char: 'v', description: 'verbose' })
51
+ };
52
+ Install.description = 'command-line system installer - the egg became a penguin!';
53
+ Install.examples = ['$ eggs install\nInstall the system using krill installer\n'];
@@ -10,6 +10,7 @@ export default class Produce extends Command {
10
10
  prefix: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
11
11
  basename: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
12
12
  backup: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ clone: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
14
  fast: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
15
  normal: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
16
  max: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- /* eslint-disable unicorn/no-process-exit */
5
- /* eslint-disable no-process-exit */
6
- /* eslint-disable no-console */
7
4
  /**
8
5
  * penguins-eggs-v7 based on Debian live
9
6
  * author: Piero Proietti
@@ -69,10 +66,11 @@ class Produce extends core_1.Command {
69
66
  compression = compressors.fast();
70
67
  }
71
68
  const release = flags.release;
72
- if (release) {
73
- compression = compressors.max();
74
- }
69
+ // if (release) {
70
+ // compression = compressors.max()
71
+ // }
75
72
  const backup = flags.backup;
73
+ const clone = flags.clone;
76
74
  const verbose = flags.verbose;
77
75
  const scriptOnly = flags.script;
78
76
  const yolkRenew = flags.yolk;
@@ -107,7 +105,7 @@ class Produce extends core_1.Command {
107
105
  const ovary = new ovary_1.default();
108
106
  utils_1.default.warning('Produce an egg...');
109
107
  if (await ovary.fertilization(prefix, basename, theme, compression)) {
110
- await ovary.produce(backup, scriptOnly, yolkRenew, release, myAddons, verbose);
108
+ await ovary.produce(backup, clone, scriptOnly, yolkRenew, release, myAddons, verbose);
111
109
  ovary.finished(scriptOnly);
112
110
  }
113
111
  }
@@ -120,7 +118,8 @@ exports.default = Produce;
120
118
  Produce.flags = {
121
119
  prefix: core_1.Flags.string({ char: 'p', description: 'prefix' }),
122
120
  basename: core_1.Flags.string({ description: 'basename' }),
123
- backup: core_1.Flags.boolean({ char: 'b', description: 'backup mode' }),
121
+ backup: core_1.Flags.boolean({ char: 'b', description: 'backup mode (CRYPTED)' }),
122
+ clone: core_1.Flags.boolean({ char: 'c', description: 'clone mode' }),
124
123
  fast: core_1.Flags.boolean({ char: 'f', description: 'fast compression' }),
125
124
  normal: core_1.Flags.boolean({ char: 'n', description: 'normal compression' }),
126
125
  max: core_1.Flags.boolean({ char: 'm', description: 'max compression' }),
@@ -130,10 +129,9 @@ Produce.flags = {
130
129
  help: core_1.Flags.help({ char: 'h' }),
131
130
  theme: core_1.Flags.string({ description: 'theme for livecd, calamares branding and partitions' }),
132
131
  addons: core_1.Flags.string({ multiple: true, description: 'addons to be used: adapt, ichoice, pve, rsupport' }),
133
- release: core_1.Flags.boolean({ description: 'release: configure GUI installer to remove eggs and calamares after installation' })
132
+ release: core_1.Flags.boolean({ description: 'release: max compression, remove penguins-eggs and calamares after installation' })
134
133
  };
135
134
  Produce.description = 'produce a live image from your system whithout your data';
136
- // static aliases = ['spawn', 'lay']
137
135
  Produce.examples = [
138
136
  '$ sudo eggs produce \nproduce an ISO called [hostname]-[arch]-YYYY-MM-DD_HHMM.iso, compressed xz (standard compression).\nIf hostname=ugo and arch=i386 ugo-x86-2020-08-25_1215.iso\n',
139
137
  '$ sudo eggs produce -v\nsame as previuos, but with --verbose output\n',
@@ -5,7 +5,7 @@ import { Command } from '@oclif/core';
5
5
  /**
6
6
  *
7
7
  */
8
- export default class Info extends Command {
8
+ export default class Status extends Command {
9
9
  static description: string;
10
10
  static flags: {
11
11
  verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -9,12 +9,12 @@ const information_1 = tslib_1.__importDefault(require("../components/elements/in
9
9
  /**
10
10
  *
11
11
  */
12
- class Info extends core_1.Command {
12
+ class Status extends core_1.Command {
13
13
  /**
14
14
  *
15
15
  */
16
16
  async run() {
17
- const { flags } = await this.parse(Info);
17
+ const { flags } = await this.parse(Status);
18
18
  let verbose = false;
19
19
  if (flags.verbose) {
20
20
  verbose = true;
@@ -22,9 +22,9 @@ class Info extends core_1.Command {
22
22
  await (0, information_1.default)(verbose);
23
23
  }
24
24
  }
25
- exports.default = Info;
26
- Info.description = 'informations about eggs configuration';
27
- Info.flags = {
25
+ exports.default = Status;
26
+ Status.description = 'informations about eggs status';
27
+ Status.flags = {
28
28
  verbose: core_1.Flags.boolean({ char: 'v' }),
29
29
  help: core_1.Flags.help({ char: 'h' })
30
30
  };
@@ -152,7 +152,7 @@ class Syncfrom extends core_1.Command {
152
152
  }
153
153
  }
154
154
  exports.default = Syncfrom;
155
- Syncfrom.description = 'Restore users, server and datas from luks-eggs-backup';
155
+ Syncfrom.description = 'restore users and user data from a LUKS volumes';
156
156
  Syncfrom.flags = {
157
157
  delete: core_1.Flags.string({ description: 'rsync --delete delete extraneous files from dest dirs' }),
158
158
  // excludeFrom: Flags.string({ description: 'same as rsync --exclude-from=FILE read exclude patterns from FILE' }),
@@ -234,7 +234,7 @@ class Syncto extends core_1.Command {
234
234
  }
235
235
  }
236
236
  exports.default = Syncto;
237
- Syncto.description = `saving users' datas and accounts on LUKS volume`;
237
+ Syncto.description = `saves users and user data in a LUKS volume inside the iso`;
238
238
  Syncto.flags = {
239
239
  delete: core_1.Flags.string({ description: 'rsync --delete delete extraneous files from dest dirs' }),
240
240
  file: core_1.Flags.string({ char: 'f', description: "file LUKS volume encrypted" }),
@@ -6,6 +6,11 @@ declare type SummaryProps = {
6
6
  keyboardModel: string;
7
7
  keyboardLayout: string;
8
8
  installationDevice: string;
9
+ name: string;
10
+ password: string;
11
+ rootPassword: string;
12
+ hostname: string;
13
+ message: string;
9
14
  };
10
- export default function Summary({ region, zone, language, keyboardModel, keyboardLayout, installationDevice }: SummaryProps): JSX.Element;
15
+ export default function Summary({ name, password, rootPassword, hostname, region, zone, language, keyboardModel, keyboardLayout, installationDevice, message }: SummaryProps): JSX.Element;
11
16
  export {};