penguins-eggs 9.3.27 → 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 (127) hide show
  1. package/.oclif.manifest.json +1 -1
  2. package/dist/classes/bleach.js +26 -24
  3. package/dist/classes/compressors.js +4 -2
  4. package/dist/classes/daddy.js +30 -28
  5. package/dist/classes/distro.js +7 -5
  6. package/dist/classes/family/archlinux.js +21 -19
  7. package/dist/classes/family/debian.js +28 -26
  8. package/dist/classes/family/fedora.js +19 -17
  9. package/dist/classes/family/suse.js +19 -17
  10. package/dist/classes/incubation/branding.js +4 -2
  11. package/dist/classes/incubation/distros/bionic.js +5 -3
  12. package/dist/classes/incubation/distros/buster.js +5 -3
  13. package/dist/classes/incubation/distros/focal.js +5 -3
  14. package/dist/classes/incubation/distros/jessie.js +5 -3
  15. package/dist/classes/incubation/distros/rolling.js +5 -3
  16. package/dist/classes/incubation/fisherman-helper/displaymanager.js +5 -3
  17. package/dist/classes/incubation/fisherman-helper/packages.js +9 -7
  18. package/dist/classes/incubation/fisherman.js +14 -12
  19. package/dist/classes/incubation/incubator.js +30 -28
  20. package/dist/classes/incubation/installer.js +8 -6
  21. package/dist/classes/initrd.js +5 -3
  22. package/dist/classes/keyboards.js +9 -7
  23. package/dist/classes/locales.js +10 -8
  24. package/dist/classes/n8.js +4 -2
  25. package/dist/classes/network.js +4 -2
  26. package/dist/classes/ovary.js +214 -211
  27. package/dist/classes/pacman.js +127 -125
  28. package/dist/classes/pve-live.js +7 -5
  29. package/dist/classes/pxe.js +66 -63
  30. package/dist/classes/settings.js +32 -30
  31. package/dist/classes/sources_list.js +12 -10
  32. package/dist/classes/systemctl.js +14 -12
  33. package/dist/classes/tailor.js +64 -62
  34. package/dist/classes/tools.js +7 -5
  35. package/dist/classes/users.js +6 -4
  36. package/dist/classes/utils.js +22 -20
  37. package/dist/classes/xdg.js +44 -42
  38. package/dist/classes/yolk.js +32 -30
  39. package/dist/commands/adapt.js +12 -10
  40. package/dist/commands/analyze.js +15 -13
  41. package/dist/commands/calamares.js +22 -20
  42. package/dist/commands/config.js +71 -69
  43. package/dist/commands/cuckoo.js +11 -9
  44. package/dist/commands/dad.js +12 -10
  45. package/dist/commands/export/deb.js +12 -10
  46. package/dist/commands/export/iso.js +11 -9
  47. package/dist/commands/install.js +16 -14
  48. package/dist/commands/kill.js +14 -12
  49. package/dist/commands/mom.js +9 -7
  50. package/dist/commands/produce.js +21 -19
  51. package/dist/commands/status.js +5 -3
  52. package/dist/commands/syncfrom.js +39 -37
  53. package/dist/commands/syncto.js +47 -45
  54. package/dist/commands/tools/clean.js +10 -8
  55. package/dist/commands/tools/ppa.js +21 -19
  56. package/dist/commands/tools/skel.js +15 -13
  57. package/dist/commands/tools/stat.js +7 -5
  58. package/dist/commands/tools/yolk.js +11 -9
  59. package/dist/commands/update.js +25 -23
  60. package/dist/commands/wardrobe/get.js +10 -8
  61. package/dist/commands/wardrobe/list.js +12 -10
  62. package/dist/commands/wardrobe/show.js +13 -11
  63. package/dist/commands/wardrobe/wear.js +16 -14
  64. package/dist/components/elements/information.js +21 -19
  65. package/dist/components/elements/steps.js +4 -2
  66. package/dist/components/elements/title.js +4 -2
  67. package/dist/components/finished.js +10 -8
  68. package/dist/components/install.js +10 -8
  69. package/dist/components/keyboard.js +10 -8
  70. package/dist/components/location.js +10 -8
  71. package/dist/components/network.js +10 -8
  72. package/dist/components/partitions.js +10 -8
  73. package/dist/components/summary.js +10 -8
  74. package/dist/components/users.js +33 -8
  75. package/dist/components/welcome.js +10 -8
  76. package/dist/krill/krill-prepare.js +92 -90
  77. package/dist/krill/krill-sequence.js +148 -145
  78. package/dist/krill/modules/add-user.js +9 -7
  79. package/dist/krill/modules/bootloader-config-ubuntu.js +24 -22
  80. package/dist/krill/modules/bootloader.js +9 -7
  81. package/dist/krill/modules/change-password.js +2 -2
  82. package/dist/krill/modules/del-live-user.js +8 -6
  83. package/dist/krill/modules/fstab.js +14 -12
  84. package/dist/krill/modules/grubcfg.js +7 -5
  85. package/dist/krill/modules/hostname.js +4 -2
  86. package/dist/krill/modules/initramfs-cfg.js +6 -4
  87. package/dist/krill/modules/initramfs.js +13 -11
  88. package/dist/krill/modules/locale-cfg.js +4 -2
  89. package/dist/krill/modules/locale.js +7 -5
  90. package/dist/krill/modules/m-keyboard.js +13 -11
  91. package/dist/krill/modules/m-timezone.js +7 -5
  92. package/dist/krill/modules/machine-id.js +7 -5
  93. package/dist/krill/modules/mkfs.js +6 -6
  94. package/dist/krill/modules/mount-fs.js +17 -15
  95. package/dist/krill/modules/mount-vfs.js +12 -12
  96. package/dist/krill/modules/network-cfg.js +8 -6
  97. package/dist/krill/modules/packages.js +15 -13
  98. package/dist/krill/modules/partition.js +74 -72
  99. package/dist/krill/modules/remove-installer-link.js +4 -2
  100. package/dist/krill/modules/umount.js +9 -7
  101. package/dist/krill/modules/unpackfs.js +7 -5
  102. package/dist/lib/cli-autologin.js +163 -163
  103. package/dist/lib/get_address.js +4 -2
  104. package/dist/lib/get_dns.js +4 -2
  105. package/dist/lib/get_domain.js +4 -2
  106. package/dist/lib/get_gateway.js +4 -2
  107. package/dist/lib/get_hostname.js +4 -2
  108. package/dist/lib/get_netmask.js +4 -2
  109. package/dist/lib/get_password.js +4 -2
  110. package/dist/lib/get_root_password.js +4 -2
  111. package/dist/lib/get_userfullname.js +4 -2
  112. package/dist/lib/get_username.js +4 -2
  113. package/dist/lib/select_address_type.js +4 -2
  114. package/dist/lib/select_filesystem_type.js +6 -4
  115. package/dist/lib/select_installation_device.js +5 -3
  116. package/dist/lib/select_installation_mode.js +4 -2
  117. package/dist/lib/select_interface.js +4 -2
  118. package/dist/lib/select_keyboard_layout.js +6 -4
  119. package/dist/lib/select_keyboard_model.js +6 -4
  120. package/dist/lib/select_keyboard_option.js +6 -4
  121. package/dist/lib/select_keyboard_variant.js +6 -4
  122. package/dist/lib/select_languages.js +6 -4
  123. package/dist/lib/select_regions.js +4 -2
  124. package/dist/lib/select_user_swap_choice.js +6 -4
  125. package/dist/lib/select_zones.js +4 -2
  126. package/package.json +6 -5
  127. package/dist/types/etrick.js +0 -1
@@ -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 utils_1 = require("../lib/utils");
10
- const distro_1 = tslib_1.__importDefault(require("./distro"));
11
- const fs_1 = tslib_1.__importDefault(require("fs"));
12
- const http_1 = tslib_1.__importDefault(require("http"));
13
- const node_static_1 = tslib_1.__importDefault(require("node-static"));
14
- const node_path_1 = tslib_1.__importDefault(require("node:path"));
15
- const settings_1 = tslib_1.__importDefault(require("./settings"));
16
- const utils_2 = tslib_1.__importDefault(require("./utils"));
17
- const tftp_1 = tslib_1.__importDefault(require("tftp"));
18
- const etrick_1 = tslib_1.__importDefault(require("etrick"));
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,36 +41,36 @@ 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_2.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_1.exec)(`mkdir ${this.eggRoot} -p`);
48
- await (0, utils_1.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_2.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_1.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
- */
70
+ * Ricerca delle uova
71
+ */
69
72
  const isos = [];
70
- if (!utils_2.default.isLive()) {
73
+ if (!utils_js_2.default.isLive()) {
71
74
  const isos = fs_1.default.readdirSync(this.nest);
72
75
  for (const iso of isos) {
73
76
  if (node_path_1.default.extname(iso) === '.iso') {
@@ -77,9 +80,9 @@ class Pxe {
77
80
  }
78
81
  }
79
82
  /**
80
- * installed: /home/eggs/ovarium/iso/live
81
- * live: this.iso/live
82
- */
83
+ * installed: /home/eggs/ovarium/iso/live
84
+ * live: this.iso/live
85
+ */
83
86
  const pathFiles = this.eggRoot + 'live';
84
87
  const files = fs_1.default.readdirSync(pathFiles);
85
88
  for (const file of files) {
@@ -101,8 +104,8 @@ class Pxe {
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
111
  const a = fs_1.default.readFileSync(this.eggRoot + '/.disk/mkisofs', 'utf-8');
@@ -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
@@ -174,7 +177,7 @@ class Pxe {
174
177
  content += 'include isolinux.theme.cfg\n';
175
178
  content += 'UI vesamenu.c32\n';
176
179
  content += '\n';
177
- content += `menu title cuckoo: when you need a flying PXE server! ${utils_2.default.address()}\n`;
180
+ content += `menu title cuckoo: when you need a flying PXE server! ${utils_js_2.default.address()}\n`;
178
181
  content += 'PROMPT 0\n';
179
182
  content += 'TIMEOUT 200\n';
180
183
  content += '\n';
@@ -182,28 +185,28 @@ class Pxe {
182
185
  content += `menu label ${this.bootLabel.replace('.iso', '')}\n`;
183
186
  if (this.settings.distro.familyId === 'debian') {
184
187
  /**
185
- * DEBIAN
186
- */
188
+ * DEBIAN
189
+ */
187
190
  const clid = this.settings.distro.codenameLikeId;
188
191
  if (clid === 'bionic' || clid === 'stretch' || clid === 'jessie') {
189
192
  content += 'kernel vmlinuz\n';
190
- content += `append initrd=initrd boot=live config noswap noprompt fetch=http://${utils_2.default.address()}/live/filesystem.squashfs\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_2.default.address()}/vmlinuz\n`;
194
- content += `append initrd=http://${utils_2.default.address()}/initrd boot=live config noswap noprompt fetch=http://${utils_2.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_2.default.address()}/vmlinuz\n`;
206
- content += `append initrd=http://${utils_2.default.address()}/initrd boot=live config noswap noprompt ${tool}_http_srv=http://${utils_2.default.address()}/\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`;
207
210
  content += 'sysappend 3\n';
208
211
  content += '\n';
209
212
  }
@@ -213,8 +216,8 @@ class Pxe {
213
216
  content += '\n';
214
217
  content += `label ${iso}\n`;
215
218
  content += `menu label ${iso}\n`;
216
- content += `kernel http://${utils_2.default.address()}/memdisk\n`;
217
- content += `initrd http://${utils_2.default.address()}/${iso}\n`;
219
+ content += `kernel http://${utils_js_2.default.address()}/memdisk\n`;
220
+ content += `initrd http://${utils_js_2.default.address()}/${iso}\n`;
218
221
  content += 'append iso raw sysappend 3\n';
219
222
  }
220
223
  }
@@ -229,13 +232,13 @@ class Pxe {
229
232
  let content = '#!ipxe\n';
230
233
  content += 'dhcp\n';
231
234
  content += 'set net0/ip=dhcp\n';
232
- content += `console --picture http://${utils_2.default.address()}/splash.png -x 1024 -y 768\n`;
235
+ content += `console --picture http://${utils_js_2.default.address()}/splash.png -x 1024 -y 768\n`;
233
236
  content += 'goto start ||\n';
234
237
  content += '\n';
235
238
  content += ':start\n';
236
- content += `set server_root http://${utils_2.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_2.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) {
@@ -252,27 +255,27 @@ class Pxe {
252
255
  content += 'goto ${target}\n';
253
256
  content += '\n';
254
257
  content += ':egg-menu\n';
255
- content += `kernel http://${utils_2.default.address()}/vmlinuz\n`;
256
- content += `initrd http://${utils_2.default.address()}/initrd\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_2.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_2.default.address()}/ boot=live dhcp initrd=initrd ro\n`;
278
+ content += `imgargs vmlinuz ${tool}_http_srv=http://${utils_js_2.default.address()}/ boot=live dhcp initrd=initrd ro\n`;
276
279
  // content += 'ipappend 3\n'
277
280
  }
278
281
  content += 'sleep 5\n';
@@ -286,8 +289,8 @@ class Pxe {
286
289
  }
287
290
  }
288
291
  /**
289
- * netboot.xyz
290
- */
292
+ * netboot.xyz
293
+ */
291
294
  content += ':netboot\n';
292
295
  content += 'ifopen net0\n';
293
296
  content += 'set conn_type https\n';
@@ -308,11 +311,11 @@ class Pxe {
308
311
  content += '<html><title>Penguin\'s eggs PXE server</title>';
309
312
  content += '<div style="background-image:url(\'/splash.png\');background-repeat:no-repeat;width: 640;height:480;padding:5px;border:1px solid black;">';
310
313
  content += '<h1>Cucko PXE server</h1>';
311
- content += `<body>address: <a href=http://${utils_2.default.address()}>${utils_2.default.address()}</a><br/>`;
312
- if (!utils_2.default.isLive()) {
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()) {
313
316
  content += 'Serving:<li>';
314
317
  for (const iso of this.isos) {
315
- content += `<ul><a href='http://${utils_2.default.address()}/${iso}'>${iso}</a></ul>`;
318
+ content += `<ul><a href='http://${utils_js_2.default.address()}/${iso}'>${iso}</a></ul>`;
316
319
  }
317
320
  content += '</li>';
318
321
  }
@@ -372,11 +375,11 @@ class Pxe {
372
375
  if (echo) {
373
376
  console.log(cmd);
374
377
  }
375
- await (0, utils_1.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_2.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,8 +183,8 @@ 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}'`, {
@@ -190,7 +192,7 @@ class Settings {
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,8 +211,8 @@ 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.versionNumber = utils_js_1.default.getPackageVersion();
215
+ this.remix.kernel = utils_js_1.default.kernelVersion();
214
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;
@@ -5,12 +5,14 @@
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
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
11
- const utils_1 = tslib_1.__importDefault(require("./utils"));
12
- const utils_2 = require("../lib/utils");
13
- const distro_1 = tslib_1.__importDefault(require("./distro"));
12
+ const chalk_1 = __importDefault(require("chalk"));
13
+ const utils_js_1 = __importDefault(require("./utils.js"));
14
+ const utils_js_2 = require("../lib/utils.js");
15
+ const distro_js_1 = __importDefault(require("./distro.js"));
14
16
  /**
15
17
  *
16
18
  */
@@ -26,7 +28,7 @@ class SourcesList {
26
28
  */
27
29
  let checked = true;
28
30
  checked = false;
29
- const distro = new distro_1.default();
31
+ const distro = new distro_js_1.default();
30
32
  for (const distribution of distributions) {
31
33
  if (distribution.includes(distro.codenameLikeId)) {
32
34
  checked = true;
@@ -56,10 +58,10 @@ class SourcesList {
56
58
  }
57
59
  }
58
60
  if (checked) {
59
- utils_1.default.warning('repositories checked');
61
+ utils_js_1.default.warning('repositories checked');
60
62
  }
61
63
  else {
62
- utils_1.default.pressKeyToExit('component warning, check your /etc/apt/sources.list', true);
64
+ utils_js_1.default.pressKeyToExit('component warning, check your /etc/apt/sources.list', true);
63
65
  }
64
66
  }
65
67
  return checked;
@@ -69,12 +71,12 @@ class SourcesList {
69
71
  */
70
72
  async get() {
71
73
  let universalSourcesList = '/etc/apt/sources.list';
72
- const distro = new distro_1.default();
74
+ const distro = new distro_js_1.default();
73
75
  if (distro.distroId === 'Linuxmint') {
74
76
  universalSourcesList = '/etc/apt/sources.list.d/official-package-repositories.list';
75
77
  }
76
78
  // deb uri distribution [component1] [component2] [...]
77
- const checkRepos = await (0, utils_2.exec)(`grep "deb http"<${universalSourcesList}`, { echo: false, capture: true });
79
+ const checkRepos = await (0, utils_js_2.exec)(`grep "deb http"<${universalSourcesList}`, { echo: false, capture: true });
78
80
  let tmp = [];
79
81
  if (checkRepos.code === 0) {
80
82
  tmp = checkRepos.data.split('\n');
@@ -7,26 +7,28 @@
7
7
  * gestione systemd
8
8
  * Presa da https://github.com/VolantisDev/node-systemctl
9
9
  */
10
+ var __importDefault = (this && this.__importDefault) || function (mod) {
11
+ return (mod && mod.__esModule) ? mod : { "default": mod };
12
+ };
10
13
  Object.defineProperty(exports, "__esModule", { value: true });
11
- const tslib_1 = require("tslib");
12
- const utils_1 = require("../lib/utils");
13
- const utils_2 = tslib_1.__importDefault(require("./utils"));
14
+ const utils_js_1 = require("../lib/utils.js");
15
+ const utils_js_2 = __importDefault(require("./utils.js"));
14
16
  class SistemdCtl {
15
17
  constructor(verbose = false) {
16
18
  this.echo = {};
17
- this.echo = utils_2.default.setEcho(verbose);
19
+ this.echo = utils_js_2.default.setEcho(verbose);
18
20
  }
19
21
  /**
20
22
  *
21
23
  */
22
24
  async reload(service) {
23
- await (0, utils_1.exec)(`systemctl reload ${service}`, this.echo);
25
+ await (0, utils_js_1.exec)(`systemctl reload ${service}`, this.echo);
24
26
  }
25
27
  /**
26
28
  *
27
29
  */
28
30
  async disable(service, chroot = '/', report = false) {
29
- await (0, utils_1.exec)(`chroot ${chroot}} systemctl disable ${service}`, this.echo);
31
+ await (0, utils_js_1.exec)(`chroot ${chroot}} systemctl disable ${service}`, this.echo);
30
32
  if (report) {
31
33
  console.log(`systemctl: disabled ${service} on ${chroot}`);
32
34
  }
@@ -35,25 +37,25 @@ class SistemdCtl {
35
37
  *
36
38
  */
37
39
  async enable(service) {
38
- await (0, utils_1.exec)(`systemctl enable ${service}`, this.echo);
40
+ await (0, utils_js_1.exec)(`systemctl enable ${service}`, this.echo);
39
41
  }
40
42
  /**
41
43
  *
42
44
  */
43
45
  async restart(service) {
44
- await (0, utils_1.exec)(`systemctl restart ${service}`, this.echo);
46
+ await (0, utils_js_1.exec)(`systemctl restart ${service}`, this.echo);
45
47
  }
46
48
  /**
47
49
  *
48
50
  */
49
51
  async start(service) {
50
- await (0, utils_1.exec)(`systemctl start ${service}`, this.echo);
52
+ await (0, utils_js_1.exec)(`systemctl start ${service}`, this.echo);
51
53
  }
52
54
  /**
53
55
  *
54
56
  */
55
57
  async stop(service) {
56
- await (0, utils_1.exec)(`systemctl stop ${service}`, this.echo);
58
+ await (0, utils_js_1.exec)(`systemctl stop ${service}`, this.echo);
57
59
  }
58
60
  /**
59
61
  *
@@ -62,7 +64,7 @@ class SistemdCtl {
62
64
  */
63
65
  async isActive(service) {
64
66
  return new Promise((resolve, reject) => {
65
- (0, utils_1.exec)(`systemctl is-active ${service}`, this.echo)
67
+ (0, utils_js_1.exec)(`systemctl is-active ${service}`, this.echo)
66
68
  .then(result => {
67
69
  resolve(!result.data.includes('inactive'));
68
70
  })
@@ -76,7 +78,7 @@ class SistemdCtl {
76
78
  */
77
79
  async isEnabled(service) {
78
80
  return new Promise((resolve, reject) => {
79
- (0, utils_1.exec)(`systemctl is-enabled ${service}`, this.echo)
81
+ (0, utils_js_1.exec)(`systemctl is-enabled ${service}`, this.echo)
80
82
  .then(result => {
81
83
  resolve(result.data.includes('enabled'));
82
84
  })