penguins-eggs 9.3.26 → 9.3.28

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 (142) hide show
  1. package/.oclif.manifest.json +1 -1
  2. package/conf/derivatives.yaml +7 -0
  3. package/dist/classes/bleach.js +26 -24
  4. package/dist/classes/compressors.js +7 -5
  5. package/dist/classes/daddy.js +38 -36
  6. package/dist/classes/distro.js +30 -27
  7. package/dist/classes/family/archlinux.js +21 -19
  8. package/dist/classes/family/debian.js +33 -31
  9. package/dist/classes/family/fedora.js +19 -17
  10. package/dist/classes/family/suse.js +19 -17
  11. package/dist/classes/incubation/branding.js +8 -6
  12. package/dist/classes/incubation/distros/bionic.js +5 -3
  13. package/dist/classes/incubation/distros/buster.js +5 -3
  14. package/dist/classes/incubation/distros/focal.js +5 -3
  15. package/dist/classes/incubation/distros/jessie.js +6 -4
  16. package/dist/classes/incubation/distros/rolling.js +9 -7
  17. package/dist/classes/incubation/fisherman-helper/displaymanager.js +5 -3
  18. package/dist/classes/incubation/fisherman-helper/packages.js +17 -15
  19. package/dist/classes/incubation/fisherman.js +19 -19
  20. package/dist/classes/incubation/incubator.js +37 -35
  21. package/dist/classes/incubation/installer.js +8 -6
  22. package/dist/classes/initrd.js +5 -3
  23. package/dist/classes/keyboards.js +25 -23
  24. package/dist/classes/locales.js +19 -17
  25. package/dist/classes/n8.js +4 -2
  26. package/dist/classes/network.js +9 -9
  27. package/dist/classes/ovary.js +280 -281
  28. package/dist/classes/pacman.js +128 -128
  29. package/dist/classes/pve-live.js +7 -5
  30. package/dist/classes/pxe.js +141 -138
  31. package/dist/classes/settings.js +34 -32
  32. package/dist/classes/sources_list.js +31 -31
  33. package/dist/classes/systemctl.js +16 -14
  34. package/dist/classes/tailor.js +255 -262
  35. package/dist/classes/tools.js +7 -5
  36. package/dist/classes/users.js +30 -28
  37. package/dist/classes/utils.js +22 -20
  38. package/dist/classes/xdg.js +60 -58
  39. package/dist/classes/yolk.js +33 -33
  40. package/dist/commands/adapt.js +14 -12
  41. package/dist/commands/analyze.js +48 -15
  42. package/dist/commands/calamares.js +28 -26
  43. package/dist/commands/config.js +77 -79
  44. package/dist/commands/cuckoo.js +19 -17
  45. package/dist/commands/dad.js +16 -14
  46. package/dist/commands/export/deb.js +19 -17
  47. package/dist/commands/export/iso.js +17 -15
  48. package/dist/commands/install.js +31 -29
  49. package/dist/commands/kill.js +17 -15
  50. package/dist/commands/mom.js +11 -9
  51. package/dist/commands/produce.js +30 -28
  52. package/dist/commands/status.js +7 -5
  53. package/dist/commands/syncfrom.js +41 -41
  54. package/dist/commands/syncto.js +77 -80
  55. package/dist/commands/tools/clean.js +13 -11
  56. package/dist/commands/tools/ppa.js +26 -24
  57. package/dist/commands/tools/skel.js +18 -16
  58. package/dist/commands/tools/stat.js +12 -10
  59. package/dist/commands/tools/yolk.js +13 -11
  60. package/dist/commands/update.js +29 -27
  61. package/dist/commands/wardrobe/get.js +14 -12
  62. package/dist/commands/wardrobe/list.js +25 -23
  63. package/dist/commands/wardrobe/show.js +25 -23
  64. package/dist/commands/wardrobe/wear.js +24 -22
  65. package/dist/components/elements/information.js +21 -19
  66. package/dist/components/elements/steps.js +4 -2
  67. package/dist/components/elements/title.js +4 -2
  68. package/dist/components/finished.js +10 -8
  69. package/dist/components/install.js +10 -8
  70. package/dist/components/keyboard.js +10 -8
  71. package/dist/components/location.js +10 -8
  72. package/dist/components/network.js +10 -8
  73. package/dist/components/partitions.js +10 -8
  74. package/dist/components/summary.js +10 -8
  75. package/dist/components/users.js +33 -8
  76. package/dist/components/welcome.js +10 -8
  77. package/dist/interfaces/i-packages.js +1 -1
  78. package/dist/interfaces/i-pxe.js +39 -0
  79. package/dist/krill/krill-prepare.js +92 -90
  80. package/dist/krill/krill-sequence.js +148 -145
  81. package/dist/krill/modules/add-user.js +11 -9
  82. package/dist/krill/modules/bootloader-config-ubuntu.js +25 -23
  83. package/dist/krill/modules/bootloader.js +11 -9
  84. package/dist/krill/modules/change-password.js +2 -2
  85. package/dist/krill/modules/del-live-user.js +8 -6
  86. package/dist/krill/modules/fstab.js +35 -33
  87. package/dist/krill/modules/grubcfg.js +8 -6
  88. package/dist/krill/modules/hostname.js +19 -17
  89. package/dist/krill/modules/initramfs-cfg.js +6 -4
  90. package/dist/krill/modules/initramfs.js +17 -15
  91. package/dist/krill/modules/locale-cfg.js +12 -10
  92. package/dist/krill/modules/locale.js +13 -11
  93. package/dist/krill/modules/m-keyboard.js +33 -31
  94. package/dist/krill/modules/m-timezone.js +7 -5
  95. package/dist/krill/modules/machine-id.js +8 -6
  96. package/dist/krill/modules/mkfs.js +7 -7
  97. package/dist/krill/modules/mount-fs.js +22 -22
  98. package/dist/krill/modules/mount-vfs.js +12 -12
  99. package/dist/krill/modules/network-cfg.js +21 -21
  100. package/dist/krill/modules/packages.js +20 -18
  101. package/dist/krill/modules/partition.js +148 -139
  102. package/dist/krill/modules/remove-installer-link.js +5 -3
  103. package/dist/krill/modules/umount.js +9 -7
  104. package/dist/krill/modules/unpackfs.js +8 -6
  105. package/dist/lib/cli-autologin.js +163 -163
  106. package/dist/lib/dependencies.js +10 -10
  107. package/dist/lib/get_address.js +6 -4
  108. package/dist/lib/get_dns.js +6 -4
  109. package/dist/lib/get_domain.js +6 -4
  110. package/dist/lib/get_gateway.js +6 -4
  111. package/dist/lib/get_hostname.js +6 -4
  112. package/dist/lib/get_netmask.js +6 -4
  113. package/dist/lib/get_password.js +8 -6
  114. package/dist/lib/get_root_password.js +7 -5
  115. package/dist/lib/get_userfullname.js +6 -4
  116. package/dist/lib/get_username.js +6 -4
  117. package/dist/lib/select_address_type.js +6 -4
  118. package/dist/lib/select_filesystem_type.js +8 -6
  119. package/dist/lib/select_installation_device.js +7 -5
  120. package/dist/lib/select_installation_mode.js +6 -4
  121. package/dist/lib/select_interface.js +6 -4
  122. package/dist/lib/select_keyboard_layout.js +10 -8
  123. package/dist/lib/select_keyboard_model.js +10 -8
  124. package/dist/lib/select_keyboard_option.js +10 -8
  125. package/dist/lib/select_keyboard_variant.js +10 -8
  126. package/dist/lib/select_languages.js +9 -7
  127. package/dist/lib/select_regions.js +6 -4
  128. package/dist/lib/select_user_swap_choice.js +8 -6
  129. package/dist/lib/select_zones.js +12 -10
  130. package/dist/lib/utils.js +3 -3
  131. package/package.json +12 -5
  132. package/dist/dhcpd/dhcpd.js +0 -222
  133. package/dist/dhcpd/index.js +0 -7
  134. package/dist/dhcpd/packet/converters.js +0 -377
  135. package/dist/dhcpd/packet/options.js +0 -2
  136. package/dist/dhcpd/packet/types.js +0 -2
  137. package/dist/dhcpd/packet.js +0 -251
  138. package/dist/dhcpd/proxy.js +0 -152
  139. package/dist/dhcpd/server.js +0 -152
  140. package/dist/dhcpd/sprintf.js +0 -170
  141. package/dist/dhcpd/utils.js +0 -190
  142. package/dist/interfaces/i-pxe-options.js +0 -2
@@ -1,21 +1,24 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
6
  /**
5
7
  * penguins-eggs: pxe.ts
6
8
  * author: Piero Proietti
7
9
  * mail: piero.proietti@gmail.com
8
10
  */
9
- const fs_1 = tslib_1.__importDefault(require("fs"));
10
- const node_static_1 = tslib_1.__importDefault(require("node-static"));
11
- const http_1 = tslib_1.__importDefault(require("http"));
12
- const node_path_1 = tslib_1.__importDefault(require("node:path"));
13
- const utils_1 = tslib_1.__importDefault(require("./utils"));
14
- const distro_1 = tslib_1.__importDefault(require("./distro"));
15
- const settings_1 = tslib_1.__importDefault(require("./settings"));
16
- const utils_2 = require("../lib/utils");
17
- const tftp = require('tftp');
18
- const dhcpd = require('../dhcpd/dhcpd');
11
+ const utils_js_1 = require("../lib/utils.js");
12
+ const distro_js_1 = __importDefault(require("./distro.js"));
13
+ const fs_1 = __importDefault(require("fs"));
14
+ const http_1 = __importDefault(require("http"));
15
+ const node_static_1 = __importDefault(require("node-static"));
16
+ const node_path_1 = __importDefault(require("node:path"));
17
+ const settings_js_1 = __importDefault(require("./settings.js"));
18
+ const utils_js_2 = __importDefault(require("./utils.js"));
19
+ const tftp_1 = __importDefault(require("tftp"));
20
+ // @ts-ignore
21
+ const etrick_1 = __importDefault(require("etrick"));
19
22
  /**
20
23
  * Pxe:
21
24
  */
@@ -38,77 +41,77 @@ class Pxe {
38
41
  * cuckoo's nest
39
42
  */
40
43
  async fertilization() {
41
- this.settings = new settings_1.default();
44
+ this.settings = new settings_js_1.default();
42
45
  await this.settings.load();
43
- if (utils_1.default.isLive()) {
46
+ if (utils_js_2.default.isLive()) {
44
47
  this.eggRoot = this.settings.distro.liveMediumPath;
45
48
  if (this.settings.distro.distroId === 'Arch' || this.settings.distro.distroId === 'RebornOS') {
46
49
  this.eggRoot = '/run/archiso/bootmnt/';
47
- await (0, utils_2.exec)(`mkdir ${this.eggRoot} -p`);
48
- await (0, utils_2.exec)(`mount /dev/sr0 ${this.eggRoot}`);
50
+ await (0, utils_js_1.exec)(`mkdir ${this.eggRoot} -p`);
51
+ await (0, utils_js_1.exec)(`mount /dev/sr0 ${this.eggRoot}`);
49
52
  }
50
53
  }
51
54
  else {
52
55
  this.eggRoot = node_path_1.default.dirname(this.settings.work_dir.path) + '/ovarium/iso/';
53
56
  }
54
- if (!utils_1.default.isLive() && !fs_1.default.existsSync(this.settings.work_dir.path)) {
57
+ if (!utils_js_2.default.isLive() && !fs_1.default.existsSync(this.settings.work_dir.path)) {
55
58
  console.log('no image available, build an image with: sudo eggs produce');
56
59
  process.exit();
57
60
  }
58
61
  this.nest = '/home/eggs';
59
62
  this.pxeRoot = this.nest + '/pxe';
60
63
  /**
61
- * se pxeRoot non esiste viene creato
62
- */
64
+ * se pxeRoot non esiste viene creato
65
+ */
63
66
  if (!fs_1.default.existsSync(this.pxeRoot)) {
64
- await (0, utils_2.exec)(`mkdir ${this.pxeRoot} -p`);
67
+ await (0, utils_js_1.exec)(`mkdir ${this.pxeRoot} -p`);
65
68
  }
66
69
  /**
67
- * Ricerca delle uova
68
- */
69
- let isos = [];
70
- if (!utils_1.default.isLive()) {
71
- let isos = fs_1.default.readdirSync(this.nest);
70
+ * Ricerca delle uova
71
+ */
72
+ const isos = [];
73
+ if (!utils_js_2.default.isLive()) {
74
+ const isos = fs_1.default.readdirSync(this.nest);
72
75
  for (const iso of isos) {
73
- if (node_path_1.default.extname(iso) === ".iso") {
76
+ if (node_path_1.default.extname(iso) === '.iso') {
74
77
  this.isos.push(iso);
75
78
  }
76
79
  this.isos = this.isos.sort();
77
80
  }
78
81
  }
79
82
  /**
80
- * installed: /home/eggs/ovarium/iso/live
81
- * live: this.iso/live
82
- */
83
- let pathFiles = this.eggRoot + 'live';
84
- let files = fs_1.default.readdirSync(pathFiles);
83
+ * installed: /home/eggs/ovarium/iso/live
84
+ * live: this.iso/live
85
+ */
86
+ const pathFiles = this.eggRoot + 'live';
87
+ const files = fs_1.default.readdirSync(pathFiles);
85
88
  for (const file of files) {
86
89
  if (this.settings.distro.familyId === 'debian') {
87
- if (node_path_1.default.basename(file).substring(0, 7) === 'vmlinuz') {
90
+ if (node_path_1.default.basename(file).slice(0, 7) === 'vmlinuz') {
88
91
  this.vmlinuz = node_path_1.default.basename(file);
89
92
  }
90
- if (node_path_1.default.basename(file).substring(0, 6) === 'initrd') {
93
+ if (node_path_1.default.basename(file).slice(0, 6) === 'initrd') {
91
94
  this.initrdImg = node_path_1.default.basename(file);
92
95
  }
93
96
  }
94
97
  else if (this.settings.distro.familyId === 'archlinux') {
95
- if (node_path_1.default.basename(file).substring(0, 7) === 'vmlinuz') {
98
+ if (node_path_1.default.basename(file).slice(0, 7) === 'vmlinuz') {
96
99
  this.vmlinuz = node_path_1.default.basename(file);
97
100
  }
98
- if (node_path_1.default.basename(file).substring(0, 9) === 'initramfs') {
101
+ if (node_path_1.default.basename(file).slice(0, 9) === 'initramfs') {
99
102
  this.initrdImg = node_path_1.default.basename(file);
100
103
  }
101
104
  }
102
105
  }
103
106
  /**
104
- * bootLabel
105
- */
107
+ * bootLabel
108
+ */
106
109
  this.bootLabel = 'not found';
107
110
  if (fs_1.default.existsSync(this.eggRoot + '/.disk/mkisofs')) {
108
- const a = fs_1.default.readFileSync(this.eggRoot + '/.disk/mkisofs', "utf-8");
109
- const b = a.substring(a.indexOf('-o ') + 3);
110
- const c = b.substring(0, b.indexOf(' '));
111
- this.bootLabel = c.substring(c.lastIndexOf('/') + 1);
111
+ const a = fs_1.default.readFileSync(this.eggRoot + '/.disk/mkisofs', 'utf-8');
112
+ const b = a.slice(Math.max(0, a.indexOf('-o ') + 3));
113
+ const c = b.slice(0, Math.max(0, b.indexOf(' ')));
114
+ this.bootLabel = c.slice(Math.max(0, c.lastIndexOf('/') + 1));
112
115
  }
113
116
  console.log(`bootLabel: ${this.bootLabel}`);
114
117
  console.log(`vmlinuz: ${this.vmlinuz}`);
@@ -153,11 +156,11 @@ class Pxe {
153
156
  await this.tryCatch(`cp ${__dirname}/../../addons/eggs/theme/livecd/isolinux.theme.cfg ${this.pxeRoot}/isolinux.theme.cfg`);
154
157
  await this.tryCatch(`cp ${__dirname}/../../addons/eggs/theme/livecd/splash.png ${this.pxeRoot}/splash.png`);
155
158
  /**
156
- * ipxe.efi
157
- */
159
+ * ipxe.efi
160
+ */
158
161
  await this.tryCatch(`ln -s ${__dirname}/../../ipxe/ipxe.efi ${this.pxeRoot}/ipxe.efi`);
159
162
  // pxe
160
- const distro = new distro_1.default();
163
+ const distro = new distro_js_1.default();
161
164
  await this.tryCatch(`ln -s ${distro.pxelinuxPath}pxelinux.0 ${this.pxeRoot}/pxelinux.0`);
162
165
  await this.tryCatch(`ln -s ${distro.pxelinuxPath}lpxelinux.0 ${this.pxeRoot}/lpxelinux.0`);
163
166
  // syslinux
@@ -167,58 +170,58 @@ class Pxe {
167
170
  await this.tryCatch(`ln -s ${distro.syslinuxPath}libutil.c32 ${this.pxeRoot}/libutil.c32`);
168
171
  await this.tryCatch(`ln -s ${distro.memdiskPath}memdisk ${this.pxeRoot}/memdisk`);
169
172
  await this.tryCatch(`mkdir ${this.pxeRoot}/pxelinux.cfg`);
170
- let content = ``;
171
- content += `# eggs: pxelinux.cfg/default\n`;
172
- content += `# search path for the c32 support libraries (libcom32, libutil etc.)\n`;
173
- content += `path\n`;
174
- content += `include isolinux.theme.cfg\n`;
175
- content += `UI vesamenu.c32\n`;
176
- content += `\n`;
177
- content += `menu title cuckoo: when you need a flying PXE server! ${utils_1.default.address()}\n`;
178
- content += `PROMPT 0\n`;
179
- content += `TIMEOUT 200\n`;
180
- content += `\n`;
181
- content += `label egg\n`;
173
+ let content = '';
174
+ content += '# eggs: pxelinux.cfg/default\n';
175
+ content += '# search path for the c32 support libraries (libcom32, libutil etc.)\n';
176
+ content += 'path\n';
177
+ content += 'include isolinux.theme.cfg\n';
178
+ content += 'UI vesamenu.c32\n';
179
+ content += '\n';
180
+ content += `menu title cuckoo: when you need a flying PXE server! ${utils_js_2.default.address()}\n`;
181
+ content += 'PROMPT 0\n';
182
+ content += 'TIMEOUT 200\n';
183
+ content += '\n';
184
+ content += 'label egg\n';
182
185
  content += `menu label ${this.bootLabel.replace('.iso', '')}\n`;
183
186
  if (this.settings.distro.familyId === 'debian') {
184
187
  /**
185
- * DEBIAN
186
- */
187
- let clid = this.settings.distro.codenameLikeId;
188
+ * DEBIAN
189
+ */
190
+ const clid = this.settings.distro.codenameLikeId;
188
191
  if (clid === 'bionic' || clid === 'stretch' || clid === 'jessie') {
189
- content += `kernel vmlinuz\n`;
190
- content += `append initrd=initrd boot=live config noswap noprompt fetch=http://${utils_1.default.address()}/live/filesystem.squashfs\n`;
192
+ content += 'kernel vmlinuz\n';
193
+ content += `append initrd=initrd boot=live config noswap noprompt fetch=http://${utils_js_2.default.address()}/live/filesystem.squashfs\n`;
191
194
  }
192
195
  else {
193
- content += `kernel http://${utils_1.default.address()}/vmlinuz\n`;
194
- content += `append initrd=http://${utils_1.default.address()}/initrd boot=live config noswap noprompt fetch=http://${utils_1.default.address()}/live/filesystem.squashfs\n`;
196
+ content += `kernel http://${utils_js_2.default.address()}/vmlinuz\n`;
197
+ content += `append initrd=http://${utils_js_2.default.address()}/initrd boot=live config noswap noprompt fetch=http://${utils_js_2.default.address()}/live/filesystem.squashfs\n`;
195
198
  }
196
199
  }
197
200
  else if (distro.familyId === 'archlinux') {
198
201
  /**
199
- * ARCH LINUX
200
- */
202
+ * ARCH LINUX
203
+ */
201
204
  let tool = 'archiso';
202
205
  if (distro.codenameId === 'Qonos' || distro.codenameId === 'Ruah' || distro.codenameId === 'Sikaris') {
203
206
  tool = 'miso';
204
207
  }
205
- content += `kernel http://${utils_1.default.address()}/vmlinuz\n`;
206
- content += `append initrd=http://${utils_1.default.address()}/initrd boot=live config noswap noprompt ${tool}_http_srv=http://${utils_1.default.address()}/\n`;
207
- content += `sysappend 3\n`;
208
- content += `\n`;
208
+ content += `kernel http://${utils_js_2.default.address()}/vmlinuz\n`;
209
+ content += `append initrd=http://${utils_js_2.default.address()}/initrd boot=live config noswap noprompt ${tool}_http_srv=http://${utils_js_2.default.address()}/\n`;
210
+ content += 'sysappend 3\n';
211
+ content += '\n';
209
212
  }
210
213
  if (this.isos.length > 0) {
211
- content += `menu separator\n`;
214
+ content += 'menu separator\n';
212
215
  for (const iso of this.isos) {
213
- content += `\n`;
216
+ content += '\n';
214
217
  content += `label ${iso}\n`;
215
218
  content += `menu label ${iso}\n`;
216
- content += `kernel http://${utils_1.default.address()}/memdisk\n`;
217
- content += `initrd http://${utils_1.default.address()}/${iso}\n`;
218
- content += `append iso raw sysappend 3\n`;
219
+ content += `kernel http://${utils_js_2.default.address()}/memdisk\n`;
220
+ content += `initrd http://${utils_js_2.default.address()}/${iso}\n`;
221
+ content += 'append iso raw sysappend 3\n';
219
222
  }
220
223
  }
221
- let file = `${this.pxeRoot}/pxelinux.cfg/default`;
224
+ const file = `${this.pxeRoot}/pxelinux.cfg/default`;
222
225
  fs_1.default.writeFileSync(file, content);
223
226
  }
224
227
  /**
@@ -226,16 +229,16 @@ class Pxe {
226
229
  */
227
230
  async ipxe() {
228
231
  console.log('creating cuckoo configuration pxe: UEFI');
229
- let content = "#!ipxe\n";
230
- content += `dhcp\n`;
231
- content += `set net0/ip=dhcp\n`;
232
- content += `console --picture http://${utils_1.default.address()}/splash.png -x 1024 -y 768\n`;
233
- content += "goto start ||\n";
234
- content += "\n";
232
+ let content = '#!ipxe\n';
233
+ content += 'dhcp\n';
234
+ content += 'set net0/ip=dhcp\n';
235
+ content += `console --picture http://${utils_js_2.default.address()}/splash.png -x 1024 -y 768\n`;
236
+ content += 'goto start ||\n';
237
+ content += '\n';
235
238
  content += ':start\n';
236
- content += `set server_root http://${utils_1.default.address()}:80/\n`;
239
+ content += `set server_root http://${utils_js_2.default.address()}:80/\n`;
237
240
  const serverRootVars = '${server_root}';
238
- content += `menu cuckoo: when you need a flying PXE server! ${utils_1.default.address()}\n`;
241
+ content += `menu cuckoo: when you need a flying PXE server! ${utils_js_2.default.address()}\n`;
239
242
  content += 'item --gap boot from ovarium\n';
240
243
  content += `item egg-menu \${space} ${this.bootLabel.replaceAll('.iso', '')}\n\n`;
241
244
  if (this.isos.length > 0) {
@@ -247,55 +250,55 @@ class Pxe {
247
250
  }
248
251
  }
249
252
  content += 'item --gap boot from internet\n';
250
- content += `item netboot \${space} netboot\n`;
253
+ content += 'item netboot ${space} netboot\n';
251
254
  content += 'choose target || goto start\n';
252
255
  content += 'goto ${target}\n';
253
256
  content += '\n';
254
- content += `:egg-menu\n`;
255
- content += `kernel http://${utils_1.default.address()}/vmlinuz\n`;
256
- content += `initrd http://${utils_1.default.address()}/initrd\n`;
257
+ content += ':egg-menu\n';
258
+ content += `kernel http://${utils_js_2.default.address()}/vmlinuz\n`;
259
+ content += `initrd http://${utils_js_2.default.address()}/initrd\n`;
257
260
  /**
258
- * CORRECT:
259
- * content += `imgargs vmlinuz fetch=http://${Utils.address()}/live/filesystem.squashfs boot=live dhcp initrd=initrd ro\n`
260
- */
261
+ * CORRECT:
262
+ * content += `imgargs vmlinuz fetch=http://${Utils.address()}/live/filesystem.squashfs boot=live dhcp initrd=initrd ro\n`
263
+ */
261
264
  if (this.settings.distro.familyId === 'debian') {
262
265
  /**
263
- * DEBIAN
264
- */
265
- content += `imgargs vmlinuz fetch=http://${utils_1.default.address()}/live/filesystem.squashfs boot=live dhcp initrd=initrd ro\n`;
266
+ * DEBIAN
267
+ */
268
+ content += `imgargs vmlinuz fetch=http://${utils_js_2.default.address()}/live/filesystem.squashfs boot=live dhcp initrd=initrd ro\n`;
266
269
  }
267
270
  else if (this.settings.distro.familyId === 'archlinux') {
268
271
  /**
269
- * ARCH LINUX
270
- */
272
+ * ARCH LINUX
273
+ */
271
274
  let tool = 'archiso';
272
275
  if (this.settings.distro.codenameId === 'Qonos' || this.settings.distro.codenameId === 'Ruah' || this.settings.distro.codenameId === 'Sikaris') {
273
276
  tool = 'miso';
274
277
  }
275
- content += `imgargs vmlinuz ${tool}_http_srv=http://${utils_1.default.address()}/ boot=live dhcp initrd=initrd ro\n`;
276
- //content += 'ipappend 3\n'
278
+ content += `imgargs vmlinuz ${tool}_http_srv=http://${utils_js_2.default.address()}/ boot=live dhcp initrd=initrd ro\n`;
279
+ // content += 'ipappend 3\n'
277
280
  }
278
- content += `sleep 5\n`;
279
- content += `boot || goto start\n\n`;
281
+ content += 'sleep 5\n';
282
+ content += 'boot || goto start\n\n';
280
283
  if (this.isos.length > 0) {
281
284
  for (const iso of this.isos) {
282
285
  const menu = iso.replace('.iso', '');
283
286
  content += `:${menu}\n`;
284
287
  content += `sanboot ${serverRootVars}/${iso}\n`;
285
- content += `boot || goto start\n\n`;
288
+ content += 'boot || goto start\n\n';
286
289
  }
287
290
  }
288
291
  /**
289
- * netboot.xyz
290
- */
291
- content += `:netboot\n`;
292
- content += `ifopen net0\n`;
293
- content += `set conn_type https\n`;
294
- content += `chain --autofree https://boot.netboot.xyz/menu.ipxe || echo HTTPS failed... attempting HTTP...\n`;
295
- content += `set conn_type http\n`;
296
- content += `chain --autofree http://boot.netboot.xyz/menu.ipxe || echo HTTP failed, localbooting...\n`;
297
- content += `goto start\n\n`;
298
- let file = `${this.pxeRoot}/autoexec.ipxe`;
292
+ * netboot.xyz
293
+ */
294
+ content += ':netboot\n';
295
+ content += 'ifopen net0\n';
296
+ content += 'set conn_type https\n';
297
+ content += 'chain --autofree https://boot.netboot.xyz/menu.ipxe || echo HTTPS failed... attempting HTTP...\n';
298
+ content += 'set conn_type http\n';
299
+ content += 'chain --autofree http://boot.netboot.xyz/menu.ipxe || echo HTTP failed, localbooting...\n';
300
+ content += 'goto start\n\n';
301
+ const file = `${this.pxeRoot}/autoexec.ipxe`;
299
302
  fs_1.default.writeFileSync(file, content);
300
303
  }
301
304
  /**
@@ -303,25 +306,25 @@ class Pxe {
303
306
  */
304
307
  async http() {
305
308
  console.log('creating cuckoo configuration: PXE html');
306
- let file = `${this.pxeRoot}/index.html`;
307
- let content = ``;
308
- content += `<html><title>Penguin's eggs PXE server</title>`;
309
- content += `<div style="background-image:url('/splash.png');background-repeat:no-repeat;width: 640;height:480;padding:5px;border:1px solid black;">`;
310
- content += `<h1>Cucko PXE server</h1>`;
311
- content += `<body>address: <a href=http://${utils_1.default.address()}>${utils_1.default.address()}</a><br/>`;
312
- if (!utils_1.default.isLive()) {
313
- content += `Serving:<li>`;
309
+ const file = `${this.pxeRoot}/index.html`;
310
+ let content = '';
311
+ content += '<html><title>Penguin\'s eggs PXE server</title>';
312
+ content += '<div style="background-image:url(\'/splash.png\');background-repeat:no-repeat;width: 640;height:480;padding:5px;border:1px solid black;">';
313
+ content += '<h1>Cucko PXE server</h1>';
314
+ content += `<body>address: <a href=http://${utils_js_2.default.address()}>${utils_js_2.default.address()}</a><br/>`;
315
+ if (!utils_js_2.default.isLive()) {
316
+ content += 'Serving:<li>';
314
317
  for (const iso of this.isos) {
315
- content += `<ul><a href='http://${utils_1.default.address()}/${iso}'>${iso}</a></ul>`;
318
+ content += `<ul><a href='http://${utils_js_2.default.address()}/${iso}'>${iso}</a></ul>`;
316
319
  }
317
- content += `</li>`;
320
+ content += '</li>';
318
321
  }
319
322
  else {
320
- content += `started from live iso image<br/>`;
323
+ content += 'started from live iso image<br/>';
321
324
  }
322
- content += `source: <a href='https://github.com/pieroproietti/penguins-eggs'>https://github.com/pieroproietti/penguins-eggs</a><br/>`;
323
- 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/>`;
324
- content += `discuss: <a href='https://t.me/penguins_eggs'>Telegram group<br/></body</html>`;
325
+ content += 'source: <a href=\'https://github.com/pieroproietti/penguins-eggs\'>https://github.com/pieroproietti/penguins-eggs</a><br/>';
326
+ 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/>';
327
+ content += 'discuss: <a href=\'https://t.me/penguins_eggs\'>Telegram group<br/></body</html>';
325
328
  fs_1.default.writeFileSync(file, content);
326
329
  }
327
330
  /**
@@ -329,7 +332,7 @@ class Pxe {
329
332
  * @param dhcpOptions
330
333
  */
331
334
  dhcpStart(dhcpOptions) {
332
- let dhcpdProxy = new dhcpd(dhcpOptions);
335
+ new etrick_1.default(dhcpOptions);
333
336
  }
334
337
  /**
335
338
  * start http server for images
@@ -337,9 +340,9 @@ class Pxe {
337
340
  */
338
341
  async httpStart() {
339
342
  const port = 80;
340
- const httpRoot = this.pxeRoot + "/";
341
- console.log(`http listening: 0.0.0.0:` + port);
342
- var file = new (node_static_1.default.Server)(httpRoot);
343
+ const httpRoot = this.pxeRoot + '/';
344
+ console.log('http listening: 0.0.0.0:' + port);
345
+ const file = new (node_static_1.default.Server)(httpRoot);
343
346
  http_1.default.createServer(function (req, res) {
344
347
  file.serve(req, res);
345
348
  }).listen(port);
@@ -348,17 +351,17 @@ class Pxe {
348
351
  * start tftp
349
352
  */
350
353
  async tftpStart(tftpOptions) {
351
- let tftpServer = tftp.createServer(tftpOptions);
352
- tftpServer.on("error", function (error) {
353
- // Errors from the main socket
354
- // The current transfers are not aborted
354
+ const tftpServer = tftp_1.default.createServer(tftpOptions);
355
+ tftpServer.on('error', function (error) {
356
+ // Errors from the main socket
357
+ // The current transfers are not aborted
355
358
  console.error(error);
356
359
  });
357
- tftpServer.on("request", function (req, res) {
358
- req.on("error", function (error) {
359
- //Error from the request
360
- //The connection is already closed
361
- console.error("[" + req.stats.remoteAddress + ":" + req.stats.remotePort + "] (" + req.file + ") " + error.message);
360
+ tftpServer.on('request', function (req, res) {
361
+ req.on('error', function (error) {
362
+ // Error from the request
363
+ // The connection is already closed
364
+ console.error('[' + req.stats.remoteAddress + ':' + req.stats.remotePort + '] (' + req.file + ') ' + error.message);
362
365
  });
363
366
  });
364
367
  tftpServer.listen();
@@ -372,11 +375,11 @@ class Pxe {
372
375
  if (echo) {
373
376
  console.log(cmd);
374
377
  }
375
- await (0, utils_2.exec)(cmd, this.echo);
378
+ await (0, utils_js_1.exec)(cmd, this.echo);
376
379
  }
377
380
  catch (error) {
378
381
  console.log(`Error: ${error}`);
379
- await utils_1.default.pressKeyToExit(cmd);
382
+ await utils_js_2.default.pressKeyToExit(cmd);
380
383
  }
381
384
  }
382
385
  }
@@ -5,19 +5,21 @@
5
5
  * mail: piero.proietti@gmail.com
6
6
  *
7
7
  */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
8
11
  Object.defineProperty(exports, "__esModule", { value: true });
9
- const tslib_1 = require("tslib");
10
12
  // packages
11
- const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
12
- const node_os_1 = tslib_1.__importDefault(require("node:os"));
13
- const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
14
- const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
15
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
13
+ const node_fs_1 = __importDefault(require("node:fs"));
14
+ const node_os_1 = __importDefault(require("node:os"));
15
+ const js_yaml_1 = __importDefault(require("js-yaml"));
16
+ const shelljs_1 = __importDefault(require("shelljs"));
17
+ const chalk_1 = __importDefault(require("chalk"));
16
18
  const pjson = require('../../package.json');
17
19
  // classes
18
- const utils_1 = tslib_1.__importDefault(require("./utils"));
19
- const distro_1 = tslib_1.__importDefault(require("./distro"));
20
- const pacman_1 = tslib_1.__importDefault(require("./pacman"));
20
+ const utils_js_1 = __importDefault(require("./utils.js"));
21
+ const distro_js_1 = __importDefault(require("./distro.js"));
22
+ const pacman_js_1 = __importDefault(require("./pacman.js"));
21
23
  const config_file = '/etc/penguins-eggs.d/eggs.yaml';
22
24
  /**
23
25
  * Setting
@@ -45,9 +47,9 @@ class Settings {
45
47
  this.app.mail = 'piero.proietti@gmail.com';
46
48
  this.app.name = pjson.name;
47
49
  this.app.version = pjson.version;
48
- this.isLive = utils_1.default.isLive();
49
- this.i686 = utils_1.default.isi686();
50
- this.distro = new distro_1.default(this.remix);
50
+ this.isLive = utils_js_1.default.isLive();
51
+ this.i686 = utils_js_1.default.isi686();
52
+ this.distro = new distro_js_1.default(this.remix);
51
53
  }
52
54
  /**
53
55
  *
@@ -83,11 +85,11 @@ class Settings {
83
85
  if (this.config.snapshot_basename === '') {
84
86
  this.config.snapshot_basename = node_os_1.default.hostname();
85
87
  }
86
- if (this.config.make_efi && !pacman_1.default.isUefi()) {
87
- utils_1.default.error('You choose to create an UEFI image, but miss to install grub-efi-amd64-bin package.');
88
- utils_1.default.error('Please install it before to create an UEFI image:');
89
- utils_1.default.warning('sudo apt install grub-efi-amd64-bin');
90
- utils_1.default.error('or edit /etc/penguins-eggs.d/eggs.yaml and set the valuer of make_efi = false');
88
+ if (this.config.make_efi && !pacman_js_1.default.isUefi()) {
89
+ utils_js_1.default.error('You choose to create an UEFI image, but miss to install grub-efi-amd64-bin package.');
90
+ utils_js_1.default.error('Please install it before to create an UEFI image:');
91
+ utils_js_1.default.warning('sudo apt install grub-efi-amd64-bin');
92
+ utils_js_1.default.error('or edit /etc/penguins-eggs.d/eggs.yaml and set the valuer of make_efi = false');
91
93
  this.config.make_efi = false;
92
94
  }
93
95
  this.kernel_image = this.config.vmlinuz;
@@ -153,16 +155,16 @@ class Settings {
153
155
  console.log(`locale default: ${this.config.locales_default}`);
154
156
  // console.log(`ssh_pass: ${this.config.ssh_pass}`)
155
157
  if (this.config.make_efi) {
156
- if (!pacman_1.default.isUefi()) {
157
- utils_1.default.error('You choose to create an UEFI image, but miss to install grub-efi-amd64-bin package.');
158
- utils_1.default.error('Please install it before to create an UEFI image:');
159
- utils_1.default.warning('sudo apt install grub-efi-amd64-bin');
158
+ if (!pacman_js_1.default.isUefi()) {
159
+ utils_js_1.default.error('You choose to create an UEFI image, but miss to install grub-efi-amd64-bin package.');
160
+ utils_js_1.default.error('Please install it before to create an UEFI image:');
161
+ utils_js_1.default.warning('sudo apt install grub-efi-amd64-bin');
160
162
  this.config.make_efi = false;
161
163
  }
162
- else if (!pacman_1.default.packageIsInstalled('dosfstools')) {
163
- utils_1.default.error('You choose to create an UEFI image, but miss to install dosfstools package.');
164
- utils_1.default.error('Please install it before to create an UEFI image:');
165
- utils_1.default.warning('sudo apt install dosfstools');
164
+ else if (!pacman_js_1.default.packageIsInstalled('dosfstools')) {
165
+ utils_js_1.default.error('You choose to create an UEFI image, but miss to install dosfstools package.');
166
+ utils_js_1.default.error('Please install it before to create an UEFI image:');
167
+ utils_js_1.default.warning('sudo apt install dosfstools');
166
168
  this.config.make_efi = false;
167
169
  }
168
170
  }
@@ -181,16 +183,16 @@ class Settings {
181
183
  */
182
184
  const gb = 1048576;
183
185
  let spaceAvailable = 0;
184
- if (!utils_1.default.isLive()) {
185
- console.log(`Disk space used: ${Math.round((utils_1.default.getUsedSpace() / gb) * 10) / 10} GB`);
186
+ if (!utils_js_1.default.isLive()) {
187
+ console.log(`Disk space used: ${Math.round((utils_js_1.default.getUsedSpace() / gb) * 10) / 10} GB`);
186
188
  }
187
189
  spaceAvailable = Number(shelljs_1.default
188
190
  .exec(`df "${path}" | /usr/bin/awk 'NR==2 {print $4}'`, {
189
- silent: true
191
+ silent: true,
190
192
  })
191
193
  .stdout.trim());
192
194
  console.log(`Space available: ${Math.round((spaceAvailable / gb) * 10) / 10} GB`);
193
- console.log(`There are ${utils_1.default.getSnapshotCount(this.config.snapshot_dir)} snapshots taking ${Math.round((utils_1.default.getSnapshotSize() / gb) * 10) / 10} GB of disk space.`);
195
+ console.log(`There are ${utils_js_1.default.getSnapshotCount(this.config.snapshot_dir)} snapshots taking ${Math.round((utils_js_1.default.getSnapshotSize() / gb) * 10) / 10} GB of disk space.`);
194
196
  console.log();
195
197
  if (spaceAvailable > gb * 3) {
196
198
  console.log(chalk_1.default.cyanBright('The free space should be sufficient to hold the'));
@@ -209,9 +211,9 @@ class Settings {
209
211
  * @param theme
210
212
  */
211
213
  async loadRemix(basename = '', theme = '') {
212
- this.remix.versionNumber = utils_1.default.getPackageVersion();
213
- this.remix.kernel = utils_1.default.kernelVersion();
214
- this.remix.branding = theme === '' ? 'eggs' : this.remix.branding = theme.substring(theme.lastIndexOf('/') + 1);
214
+ this.remix.versionNumber = utils_js_1.default.getPackageVersion();
215
+ this.remix.kernel = utils_js_1.default.kernelVersion();
216
+ this.remix.branding = theme === '' ? 'eggs' : this.remix.branding = theme.slice(Math.max(0, theme.lastIndexOf('/') + 1));
215
217
  this.remix.name = this.config.snapshot_basename;
216
218
  let name = this.config.snapshot_prefix + this.config.snapshot_basename;
217
219
  name = name.replace(/-/g, ' ').replace('egg of ', '');