penguins-eggs 9.8.1 → 10.0.0

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 (334) hide show
  1. package/.oclif.manifest.json +242 -242
  2. package/README.md +43 -40
  3. package/bin/dev.cmd +1 -1
  4. package/bin/dev.js +6 -6
  5. package/bin/run.js +3 -5
  6. package/conf/tools.yaml +1 -1
  7. package/dist/classes/bleach.d.ts +37 -0
  8. package/dist/classes/bleach.js +43 -91
  9. package/dist/classes/cfs.d.ts +17 -0
  10. package/dist/classes/cfs.js +15 -12
  11. package/dist/classes/compressors.d.ts +53 -0
  12. package/dist/classes/compressors.js +42 -47
  13. package/dist/classes/daddy.d.ts +18 -0
  14. package/dist/classes/daddy.js +92 -98
  15. package/dist/classes/distro.d.ts +26 -0
  16. package/dist/classes/distro.js +36 -37
  17. package/dist/classes/families/archlinux.d.ts +61 -0
  18. package/dist/classes/families/archlinux.js +52 -107
  19. package/dist/classes/families/debian.d.ts +65 -0
  20. package/dist/classes/families/debian.js +67 -142
  21. package/dist/classes/families/fedora.d.ts +52 -0
  22. package/dist/classes/families/fedora.js +42 -98
  23. package/dist/classes/families/mockup.d.ts +60 -0
  24. package/dist/classes/families/mockup.js +27 -46
  25. package/dist/classes/families/suse.d.ts +52 -0
  26. package/dist/classes/families/suse.js +44 -96
  27. package/dist/classes/incubation/branding.d.ts +17 -0
  28. package/dist/classes/incubation/branding.js +32 -36
  29. package/dist/classes/incubation/distros/bionic.d.ts +32 -0
  30. package/dist/classes/incubation/distros/bionic.js +11 -16
  31. package/dist/classes/incubation/distros/buster.d.ts +32 -0
  32. package/dist/classes/incubation/distros/buster.js +13 -18
  33. package/dist/classes/incubation/distros/focal.d.ts +32 -0
  34. package/dist/classes/incubation/distros/focal.js +11 -16
  35. package/dist/classes/incubation/distros/jessie.d.ts +31 -0
  36. package/dist/classes/incubation/distros/jessie.js +8 -13
  37. package/dist/classes/incubation/distros/rolling.d.ts +32 -0
  38. package/dist/classes/incubation/distros/rolling.js +11 -16
  39. package/dist/classes/incubation/fisherman-helper/displaymanager.d.ts +11 -0
  40. package/dist/classes/incubation/fisherman-helper/displaymanager.js +8 -9
  41. package/dist/classes/incubation/fisherman-helper/packages.d.ts +20 -0
  42. package/dist/classes/incubation/fisherman-helper/packages.js +17 -20
  43. package/dist/classes/incubation/fisherman-helper/settings.d.ts +15 -0
  44. package/dist/classes/incubation/fisherman-helper/settings.js +30 -28
  45. package/dist/classes/incubation/fisherman.d.ts +77 -0
  46. package/dist/classes/incubation/fisherman.js +135 -131
  47. package/dist/classes/incubation/incubator.d.ts +40 -0
  48. package/dist/classes/incubation/incubator.js +90 -89
  49. package/dist/classes/incubation/installer.d.ts +13 -0
  50. package/dist/classes/incubation/installer.js +27 -12
  51. package/dist/classes/initrd.d.ts +41 -0
  52. package/dist/classes/initrd.js +40 -42
  53. package/dist/classes/keyboards.d.ts +50 -0
  54. package/dist/classes/keyboards.js +108 -105
  55. package/dist/classes/locales.d.ts +21 -0
  56. package/dist/classes/locales.js +30 -34
  57. package/dist/classes/n8.d.ts +17 -0
  58. package/dist/classes/n8.js +16 -22
  59. package/dist/classes/network.d.ts +37 -0
  60. package/dist/classes/network.js +14 -18
  61. package/dist/classes/ovary.d.ts +205 -0
  62. package/dist/classes/ovary.js +1281 -1294
  63. package/dist/classes/pacman.d.ts +149 -0
  64. package/dist/classes/pacman.js +344 -418
  65. package/dist/classes/pve-live.d.ts +17 -0
  66. package/dist/classes/pve-live.js +22 -24
  67. package/dist/classes/pxe.d.ts +65 -0
  68. package/dist/classes/pxe.js +204 -206
  69. package/dist/classes/settings.d.ts +53 -0
  70. package/dist/classes/settings.js +91 -94
  71. package/dist/classes/sources_list.d.ts +28 -0
  72. package/dist/classes/sources_list.js +35 -39
  73. package/dist/classes/systemctl.d.ts +47 -0
  74. package/dist/classes/systemctl.js +34 -38
  75. package/dist/classes/tailor.d.ts +46 -0
  76. package/dist/classes/tailor.js +223 -239
  77. package/dist/classes/tools.d.ts +30 -0
  78. package/dist/classes/tools.js +18 -22
  79. package/dist/classes/users.d.ts +28 -0
  80. package/dist/classes/users.js +18 -22
  81. package/dist/classes/utils.d.ts +318 -0
  82. package/dist/classes/utils.js +78 -78
  83. package/dist/classes/xdg.d.ts +45 -0
  84. package/dist/classes/xdg.js +129 -133
  85. package/dist/classes/yolk.d.ts +33 -0
  86. package/dist/classes/yolk.js +53 -57
  87. package/dist/commands/adapt.d.ts +17 -0
  88. package/dist/commands/adapt.js +17 -21
  89. package/dist/commands/analyze.d.ts +26 -0
  90. package/dist/commands/analyze.js +56 -67
  91. package/dist/commands/calamares.d.ts +29 -0
  92. package/dist/commands/calamares.js +44 -48
  93. package/dist/commands/config.d.ts +36 -0
  94. package/dist/commands/config.js +115 -137
  95. package/dist/commands/cuckoo.d.ts +16 -0
  96. package/dist/commands/cuckoo.js +20 -24
  97. package/dist/commands/dad.d.ts +19 -0
  98. package/dist/commands/dad.js +20 -24
  99. package/dist/commands/export/deb.d.ts +19 -0
  100. package/dist/commands/export/deb.js +19 -23
  101. package/dist/commands/export/iso.d.ts +19 -0
  102. package/dist/commands/export/iso.js +19 -23
  103. package/dist/commands/install.d.ts +37 -0
  104. package/dist/commands/install.js +46 -50
  105. package/dist/commands/kill.d.ts +24 -0
  106. package/dist/commands/kill.js +25 -29
  107. package/dist/commands/mom.d.ts +16 -0
  108. package/dist/commands/mom.js +16 -18
  109. package/dist/commands/produce.d.ts +33 -0
  110. package/dist/commands/produce.js +64 -66
  111. package/dist/commands/status.d.ts +23 -0
  112. package/dist/commands/status.js +10 -14
  113. package/dist/commands/syncfrom.d.ts +45 -0
  114. package/dist/commands/syncfrom.js +85 -89
  115. package/dist/commands/syncto.d.ts +40 -0
  116. package/dist/commands/syncto.js +91 -95
  117. package/dist/commands/tools/clean.d.ts +18 -0
  118. package/dist/commands/tools/clean.js +17 -21
  119. package/dist/commands/tools/ppa.d.ts +26 -0
  120. package/dist/commands/tools/ppa.js +41 -45
  121. package/dist/commands/tools/skel.d.ts +18 -0
  122. package/dist/commands/tools/skel.js +22 -26
  123. package/dist/commands/tools/stat.d.ts +31 -0
  124. package/dist/commands/tools/stat.js +15 -19
  125. package/dist/commands/tools/yolk.d.ts +24 -0
  126. package/dist/commands/tools/yolk.js +19 -23
  127. package/dist/commands/update.d.ts +47 -0
  128. package/dist/commands/update.js +62 -66
  129. package/dist/commands/wardrobe/get.d.ts +23 -0
  130. package/dist/commands/wardrobe/get.js +19 -23
  131. package/dist/commands/wardrobe/list.d.ts +24 -0
  132. package/dist/commands/wardrobe/list.js +61 -60
  133. package/dist/commands/wardrobe/show.d.ts +25 -0
  134. package/dist/commands/wardrobe/show.js +50 -47
  135. package/dist/commands/wardrobe/wear.d.ts +26 -0
  136. package/dist/commands/wardrobe/wear.js +32 -36
  137. package/dist/components/finished.d.ts +15 -0
  138. package/dist/components/finished.js +37 -42
  139. package/dist/components/information.d.ts +8 -0
  140. package/dist/components/information.js +155 -0
  141. package/dist/components/install.d.ts +15 -0
  142. package/dist/components/install.js +31 -35
  143. package/dist/components/keyboard.d.ts +16 -0
  144. package/dist/components/keyboard.js +37 -40
  145. package/dist/components/location.d.ts +16 -0
  146. package/dist/components/location.js +38 -38
  147. package/dist/components/network.d.ts +19 -0
  148. package/dist/components/network.js +47 -48
  149. package/dist/components/partitions.d.ts +16 -0
  150. package/dist/components/partitions.js +47 -51
  151. package/dist/components/steps.d.ts +13 -0
  152. package/dist/components/steps.js +148 -0
  153. package/dist/components/summary.d.ts +24 -0
  154. package/dist/components/summary.js +50 -54
  155. package/dist/components/title.d.ts +12 -0
  156. package/dist/components/title.js +35 -0
  157. package/dist/components/users.d.ts +24 -0
  158. package/dist/components/users.js +43 -43
  159. package/dist/components/welcome.d.ts +13 -0
  160. package/dist/components/welcome.js +37 -38
  161. package/dist/index.d.ts +8 -0
  162. package/dist/index.js +8 -5
  163. package/dist/interfaces/i-addons.d.ts +13 -0
  164. package/dist/interfaces/i-addons.js +8 -3
  165. package/dist/interfaces/i-analyze.d.ts +17 -0
  166. package/dist/interfaces/i-analyze.js +7 -10
  167. package/dist/interfaces/i-app.d.ts +14 -0
  168. package/dist/interfaces/i-app.js +8 -2
  169. package/dist/interfaces/i-branding.d.ts +36 -0
  170. package/dist/interfaces/i-branding.js +8 -2
  171. package/dist/interfaces/i-calamares-partition.d.ts +18 -0
  172. package/dist/interfaces/i-calamares-partition.js +3 -4
  173. package/dist/interfaces/i-config-tools.d.ts +18 -0
  174. package/dist/interfaces/i-config-tools.js +8 -2
  175. package/dist/interfaces/i-devices.d.ts +20 -0
  176. package/dist/interfaces/i-devices.js +8 -2
  177. package/dist/interfaces/i-distro.d.ts +27 -0
  178. package/dist/interfaces/i-distro.js +3 -4
  179. package/dist/interfaces/i-drive-list.d.ts +33 -0
  180. package/dist/interfaces/i-drive-list.js +3 -4
  181. package/dist/interfaces/i-eggs-config.d.ts +32 -0
  182. package/dist/interfaces/i-eggs-config.js +3 -4
  183. package/dist/interfaces/i-excludes.d.ts +14 -0
  184. package/dist/interfaces/i-excludes.js +8 -2
  185. package/dist/interfaces/i-exec.d.ts +11 -0
  186. package/dist/interfaces/i-exec.js +3 -4
  187. package/dist/interfaces/i-initrd.d.ts +13 -0
  188. package/dist/interfaces/i-initrd.js +8 -2
  189. package/dist/interfaces/i-install.d.ts +16 -0
  190. package/dist/interfaces/i-install.js +8 -2
  191. package/dist/interfaces/i-installer.d.ts +17 -0
  192. package/dist/interfaces/i-installer.js +8 -2
  193. package/dist/interfaces/i-krill-config.d.ts +33 -0
  194. package/dist/interfaces/i-krill-config.js +3 -4
  195. package/dist/interfaces/i-krill.d.ts +42 -0
  196. package/dist/interfaces/i-krill.js +8 -2
  197. package/dist/interfaces/i-materia.d.ts +41 -0
  198. package/dist/interfaces/i-materia.js +8 -2
  199. package/dist/interfaces/i-net.d.ts +16 -0
  200. package/dist/interfaces/i-net.js +8 -2
  201. package/dist/interfaces/i-packages.d.ts +29 -0
  202. package/dist/interfaces/i-packages.js +3 -4
  203. package/dist/interfaces/i-partitions.d.ts +16 -0
  204. package/dist/interfaces/i-partitions.js +8 -2
  205. package/dist/interfaces/i-pxe.d.ts +21 -0
  206. package/dist/interfaces/i-pxe.js +8 -39
  207. package/dist/interfaces/i-remix.d.ts +21 -0
  208. package/dist/interfaces/i-remix.js +3 -4
  209. package/dist/interfaces/i-settings.d.ts +39 -0
  210. package/dist/interfaces/i-settings.js +8 -2
  211. package/dist/interfaces/i-user.d.ts +14 -0
  212. package/dist/interfaces/i-user.js +8 -2
  213. package/dist/interfaces/i-workdir.d.ts +14 -0
  214. package/dist/interfaces/i-workdir.js +8 -2
  215. package/dist/interfaces/i-xkb-model.d.ts +24 -0
  216. package/dist/interfaces/i-xkb-model.js +8 -2
  217. package/dist/interfaces/index.d.ts +25 -0
  218. package/dist/interfaces/index.js +3 -4
  219. package/dist/krill/modules/add-user.d.ts +20 -0
  220. package/dist/krill/modules/add-user.js +11 -15
  221. package/dist/krill/modules/bootloader-config-arch.d.ts +14 -0
  222. package/dist/krill/modules/bootloader-config-arch.js +15 -11
  223. package/dist/krill/modules/bootloader-config-debian.d.ts +10 -0
  224. package/dist/krill/modules/bootloader-config-debian.js +20 -16
  225. package/dist/krill/modules/bootloader-config.d.ts +10 -0
  226. package/dist/krill/modules/bootloader-config.js +3 -6
  227. package/dist/krill/modules/bootloader.d.ts +14 -0
  228. package/dist/krill/modules/bootloader.js +9 -13
  229. package/dist/krill/modules/change-password.d.ts +15 -0
  230. package/dist/krill/modules/change-password.js +5 -8
  231. package/dist/krill/modules/del-live-user.d.ts +14 -0
  232. package/dist/krill/modules/del-live-user.js +8 -12
  233. package/dist/krill/modules/fstab.d.ts +14 -0
  234. package/dist/krill/modules/fstab.js +33 -37
  235. package/dist/krill/modules/grubcfg.d.ts +17 -0
  236. package/dist/krill/modules/grubcfg.js +8 -17
  237. package/dist/krill/modules/hostname.d.ts +13 -0
  238. package/dist/krill/modules/hostname.js +11 -17
  239. package/dist/krill/modules/initramfs-cfg.d.ts +14 -0
  240. package/dist/krill/modules/initramfs-cfg.js +6 -15
  241. package/dist/krill/modules/initramfs.d.ts +13 -0
  242. package/dist/krill/modules/initramfs.js +17 -19
  243. package/dist/krill/modules/locale-cfg.d.ts +10 -0
  244. package/dist/krill/modules/locale-cfg.js +8 -12
  245. package/dist/krill/modules/locale.d.ts +13 -0
  246. package/dist/krill/modules/locale.js +7 -11
  247. package/dist/krill/modules/m-keyboard.d.ts +14 -0
  248. package/dist/krill/modules/m-keyboard.js +14 -18
  249. package/dist/krill/modules/m-timezone.d.ts +14 -0
  250. package/dist/krill/modules/m-timezone.js +8 -12
  251. package/dist/krill/modules/machine-id.d.ts +15 -0
  252. package/dist/krill/modules/machine-id.js +6 -10
  253. package/dist/krill/modules/mkfs.d.ts +13 -0
  254. package/dist/krill/modules/mkfs.js +10 -13
  255. package/dist/krill/modules/mount-fs.d.ts +17 -0
  256. package/dist/krill/modules/mount-fs.js +20 -26
  257. package/dist/krill/modules/mount-vfs.d.ts +17 -0
  258. package/dist/krill/modules/mount-vfs.js +16 -21
  259. package/dist/krill/modules/network-cfg.d.ts +19 -0
  260. package/dist/krill/modules/network-cfg.js +16 -20
  261. package/dist/krill/modules/packages.d.ts +14 -0
  262. package/dist/krill/modules/packages.js +17 -21
  263. package/dist/krill/modules/partition.d.ts +20 -0
  264. package/dist/krill/modules/partition.js +78 -84
  265. package/dist/krill/modules/remove-installer-link.d.ts +13 -0
  266. package/dist/krill/modules/remove-installer-link.js +7 -11
  267. package/dist/krill/modules/umount.d.ts +14 -0
  268. package/dist/krill/modules/umount.js +9 -13
  269. package/dist/krill/modules/unpackfs.d.ts +13 -0
  270. package/dist/krill/modules/unpackfs.js +7 -11
  271. package/dist/krill/prepare.d.ts +77 -0
  272. package/dist/krill/{krill-prepare.js → prepare.js} +118 -124
  273. package/dist/krill/sequence.d.ts +156 -0
  274. package/dist/krill/{krill-sequence.js → sequence.js} +166 -170
  275. package/dist/lib/cli-autologin.d.ts +43 -0
  276. package/dist/lib/cli-autologin.js +88 -92
  277. package/dist/lib/get_address.d.ts +8 -0
  278. package/dist/lib/get_address.js +9 -11
  279. package/dist/lib/get_dns.d.ts +8 -0
  280. package/dist/lib/get_dns.js +9 -11
  281. package/dist/lib/get_domain.d.ts +8 -0
  282. package/dist/lib/get_domain.js +9 -11
  283. package/dist/lib/get_gateway.d.ts +8 -0
  284. package/dist/lib/get_gateway.js +9 -11
  285. package/dist/lib/get_hostname.d.ts +8 -0
  286. package/dist/lib/get_hostname.js +9 -11
  287. package/dist/lib/get_netmask.d.ts +8 -0
  288. package/dist/lib/get_netmask.js +9 -11
  289. package/dist/lib/get_password.d.ts +8 -0
  290. package/dist/lib/get_password.js +10 -13
  291. package/dist/lib/get_userfullname.d.ts +8 -0
  292. package/dist/lib/get_userfullname.js +9 -11
  293. package/dist/lib/get_username.d.ts +8 -0
  294. package/dist/lib/get_username.js +9 -12
  295. package/dist/lib/kill_me_softly.d.ts +11 -0
  296. package/dist/lib/kill_me_softly.js +19 -24
  297. package/dist/lib/select_address_type.d.ts +8 -0
  298. package/dist/lib/select_address_type.js +9 -12
  299. package/dist/lib/select_filesystem_type.d.ts +8 -0
  300. package/dist/lib/select_filesystem_type.js +15 -18
  301. package/dist/lib/select_installation_device.d.ts +8 -0
  302. package/dist/lib/select_installation_device.js +11 -15
  303. package/dist/lib/select_installation_mode.d.ts +8 -0
  304. package/dist/lib/select_installation_mode.js +9 -11
  305. package/dist/lib/select_interface.d.ts +8 -0
  306. package/dist/lib/select_interface.js +9 -12
  307. package/dist/lib/select_keyboard_layout.d.ts +11 -0
  308. package/dist/lib/select_keyboard_layout.js +11 -15
  309. package/dist/lib/select_keyboard_model.d.ts +11 -0
  310. package/dist/lib/select_keyboard_model.js +11 -15
  311. package/dist/lib/select_keyboard_option.d.ts +11 -0
  312. package/dist/lib/select_keyboard_option.js +11 -15
  313. package/dist/lib/select_keyboard_variant.d.ts +11 -0
  314. package/dist/lib/select_keyboard_variant.js +11 -15
  315. package/dist/lib/select_languages.d.ts +8 -0
  316. package/dist/lib/select_languages.js +11 -15
  317. package/dist/lib/select_regions.d.ts +8 -0
  318. package/dist/lib/select_regions.js +9 -11
  319. package/dist/lib/select_user_swap_choice.d.ts +8 -0
  320. package/dist/lib/select_user_swap_choice.js +13 -17
  321. package/dist/lib/select_zones.d.ts +8 -0
  322. package/dist/lib/select_zones.js +9 -11
  323. package/dist/lib/utils.d.ts +34 -0
  324. package/dist/lib/utils.js +24 -14
  325. package/manpages/doc/man/eggs.1.gz +0 -0
  326. package/manpages/doc/man/eggs.html +10 -10
  327. package/package.json +49 -70
  328. package/LICENSE +0 -339
  329. package/bin/dev +0 -17
  330. package/bin/run +0 -5
  331. package/dist/components/elements/information.js +0 -194
  332. package/dist/components/elements/steps.js +0 -152
  333. package/dist/components/elements/title.js +0 -36
  334. package/dist/lib/dependencies.js +0 -121
@@ -1,13 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const fs_1 = tslib_1.__importDefault(require("fs"));
5
- const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
6
- const pacman_1 = tslib_1.__importDefault(require("./pacman"));
1
+ /**
2
+ * ./src/classes/families/cfs.ts (custom final steps)
3
+ * penguins-eggs v.10.0.0 / ecmascript 2020
4
+ * author: Piero Proietti
5
+ * email: piero.proietti@gmail.com
6
+ * license: MIT
7
+ */
8
+ import yaml from 'js-yaml';
9
+ import fs from 'node:fs';
10
+ import Pacman from './pacman.js';
7
11
  /**
8
12
  * cfs
9
13
  */
10
- class CFS {
14
+ export default class CFS {
11
15
  /**
12
16
  * steps
13
17
  * @returns
@@ -15,13 +19,13 @@ class CFS {
15
19
  async steps() {
16
20
  const cfs = [];
17
21
  let configRoot = '/etc/penguins-eggs.d/krill/';
18
- if (pacman_1.default.calamaresExists()) {
22
+ if (Pacman.calamaresExists()) {
19
23
  configRoot = '/etc/calamares/';
20
24
  }
21
25
  // solo se esiste settings.conf CALAMARES
22
- if (fs_1.default.existsSync(`${configRoot}settings.conf`)) {
23
- const settingsVar = fs_1.default.readFileSync(`${configRoot}settings.conf`, 'utf8');
24
- const settingsYaml = js_yaml_1.default.load(settingsVar);
26
+ if (fs.existsSync(`${configRoot}settings.conf`)) {
27
+ const settingsVar = fs.readFileSync(`${configRoot}settings.conf`, 'utf8');
28
+ const settingsYaml = yaml.load(settingsVar);
25
29
  const execSequence = settingsYaml.sequence[1];
26
30
  const steps = execSequence.exec;
27
31
  for (const step of steps) {
@@ -33,4 +37,3 @@ class CFS {
33
37
  return cfs;
34
38
  }
35
39
  }
36
- exports.default = CFS;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * ./src/classes/compressors.ts
3
+ * penguins-eggs v.10.0.0 / ecmascript 2020
4
+ * author: Piero Proietti
5
+ * email: piero.proietti@gmail.com
6
+ * license: MIT
7
+ */
8
+ export default class Compressors {
9
+ dest: string;
10
+ isEnabled: {
11
+ error: boolean;
12
+ gzip: boolean;
13
+ lz4: boolean;
14
+ lzma: boolean;
15
+ lzo: boolean;
16
+ xz: boolean;
17
+ zstd: boolean;
18
+ };
19
+ source: string;
20
+ /**
21
+ * fast
22
+ * @returns
23
+ */
24
+ fast(): string;
25
+ /**
26
+ * max
27
+ * @returns
28
+ */
29
+ max(): string;
30
+ /**
31
+ * populate
32
+ */
33
+ populate(): Promise<void>;
34
+ /**
35
+ * standard
36
+ * @returns
37
+ */
38
+ standard(): string;
39
+ /**
40
+ * check mksquashfs exists
41
+ * @param compressor
42
+ * @returns
43
+ */
44
+ private check;
45
+ /**
46
+ * prepareCheck
47
+ */
48
+ private prepareCheck;
49
+ /**
50
+ * removeCheck
51
+ */
52
+ private removeCheck;
53
+ }
@@ -1,40 +1,23 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
1
  /**
5
- * penguins-eggs
6
- * class: compressor.ts
7
- * test available compressor
8
- * author: Piero Proietti
9
- * email: piero.proietti@gmail.com
10
- * license: MIT
11
- */
12
- const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
13
- class Compressors {
2
+ * ./src/classes/compressors.ts
3
+ * penguins-eggs v.10.0.0 / ecmascript 2020
4
+ * author: Piero Proietti
5
+ * email: piero.proietti@gmail.com
6
+ * license: MIT
7
+ */
8
+ import shx from 'shelljs';
9
+ export default class Compressors {
10
+ dest = '/tmp/eggs-mksquash-dest';
14
11
  isEnabled = {
15
12
  error: false,
16
13
  gzip: true,
14
+ lz4: false,
17
15
  lzma: false,
18
16
  lzo: false,
19
- lz4: false,
20
17
  xz: false,
21
18
  zstd: false,
22
19
  };
23
20
  source = '/tmp/eggs-mksquash-test';
24
- dest = '/tmp/eggs-mksquash-dest';
25
- /**
26
- * populate
27
- */
28
- async populate() {
29
- await this.prepareCheck();
30
- this.isEnabled.error = await this.check('error');
31
- this.isEnabled.lzma = await this.check('lzma');
32
- this.isEnabled.lzo = await this.check('lzo');
33
- this.isEnabled.lz4 = await this.check('lz4');
34
- this.isEnabled.xz = await this.check('xz');
35
- this.isEnabled.zstd = await this.check('zstd');
36
- await this.removeCheck();
37
- }
38
21
  /**
39
22
  * fast
40
23
  * @returns
@@ -49,14 +32,6 @@ class Compressors {
49
32
  }
50
33
  return comp;
51
34
  }
52
- /**
53
- * standard
54
- * @returns
55
- */
56
- standard() {
57
- let comp = 'xz -b 1M';
58
- return comp;
59
- }
60
35
  /**
61
36
  * max
62
37
  * @returns
@@ -66,26 +41,33 @@ class Compressors {
66
41
  if (process.arch === 'arm64') {
67
42
  filter = 'arm';
68
43
  }
69
- let options = '-b 1M -no-duplicates -no-recovery -always-use-fragments';
44
+ const options = '-b 1M -no-duplicates -no-recovery -always-use-fragments';
70
45
  if (process.arch === 'ia32') {
71
46
  // options = '-b 1M'
72
47
  }
73
- let comp = `xz -Xbcj ${filter} ${options}`;
48
+ const comp = `xz -Xbcj ${filter} ${options}`;
74
49
  return comp;
75
50
  }
76
51
  /**
77
- * prepareCheck
52
+ * populate
78
53
  */
79
- async prepareCheck() {
80
- shelljs_1.default.exec('rm -rf ' + this.source, { silent: true });
81
- shelljs_1.default.exec('mkdir ' + this.source, { silent: true });
54
+ async populate() {
55
+ await this.prepareCheck();
56
+ this.isEnabled.error = await this.check('error');
57
+ this.isEnabled.lzma = await this.check('lzma');
58
+ this.isEnabled.lzo = await this.check('lzo');
59
+ this.isEnabled.lz4 = await this.check('lz4');
60
+ this.isEnabled.xz = await this.check('xz');
61
+ this.isEnabled.zstd = await this.check('zstd');
62
+ await this.removeCheck();
82
63
  }
83
64
  /**
84
- * removeCheck
65
+ * standard
66
+ * @returns
85
67
  */
86
- async removeCheck() {
87
- shelljs_1.default.exec('rm -rf ' + this.source, { silent: true });
88
- shelljs_1.default.exec('rm -f ' + this.dest, { silent: true });
68
+ standard() {
69
+ const comp = 'xz -b 1M';
70
+ return comp;
89
71
  }
90
72
  /**
91
73
  * check mksquashfs exists
@@ -94,11 +76,24 @@ class Compressors {
94
76
  */
95
77
  async check(compressor) {
96
78
  let result = false;
97
- const stderr = shelljs_1.default.exec('mksquashfs ' + this.source + ' ' + this.dest + ' -comp ' + compressor + ' -ef ' + this.dest, { silent: true }).stderr;
79
+ const { stderr } = shx.exec('mksquashfs ' + this.source + ' ' + this.dest + ' -comp ' + compressor + ' -ef ' + this.dest, { silent: true });
98
80
  if (stderr === '') {
99
81
  result = true;
100
82
  }
101
83
  return result;
102
84
  }
85
+ /**
86
+ * prepareCheck
87
+ */
88
+ async prepareCheck() {
89
+ shx.exec('rm -rf ' + this.source, { silent: true });
90
+ shx.exec('mkdir ' + this.source, { silent: true });
91
+ }
92
+ /**
93
+ * removeCheck
94
+ */
95
+ async removeCheck() {
96
+ shx.exec('rm -rf ' + this.source, { silent: true });
97
+ shx.exec('rm -f ' + this.dest, { silent: true });
98
+ }
103
99
  }
104
- exports.default = Compressors;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * ./src/classes/daddy.ts
3
+ * penguins-eggs v.10.0.0 / ecmascript 2020
4
+ * author: Piero Proietti
5
+ * email: piero.proietti@gmail.com
6
+ * license: MIT
7
+ */
8
+ import Settings from '../classes/settings.js';
9
+ import { IEggsConfig } from '../interfaces/i-eggs-config.js';
10
+ export default class Daddy {
11
+ settings: Settings;
12
+ /**
13
+ *
14
+ * @param c
15
+ */
16
+ editConfig(c: IEggsConfig): Promise<string>;
17
+ helpMe(loadDefault?: boolean, verbose?: boolean): Promise<void>;
18
+ }
@@ -1,87 +1,27 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
1
  /**
5
- * penguins-eggs
6
- * class: daddy.ts
7
- * author: Piero Proietti
8
- * email: piero.proietti@gmail.com
9
- * license: MIT
10
- */
11
- const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
12
- const pacman_1 = tslib_1.__importDefault(require("../classes/pacman"));
13
- const settings_1 = tslib_1.__importDefault(require("../classes/settings"));
14
- const inquirer = require('inquirer');
15
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
16
- class Daddy {
2
+ * ./src/classes/daddy.ts
3
+ * penguins-eggs v.10.0.0 / ecmascript 2020
4
+ * author: Piero Proietti
5
+ * email: piero.proietti@gmail.com
6
+ * license: MIT
7
+ */
8
+ import chalk from 'chalk';
9
+ import inquirer from 'inquirer';
10
+ // _dirname
11
+ import path from 'node:path';
12
+ import Pacman from '../classes/pacman.js';
13
+ import Settings from '../classes/settings.js';
14
+ import Utils from '../classes/utils.js';
15
+ const __dirname = path.dirname(new URL(import.meta.url).pathname);
16
+ export default class Daddy {
17
17
  settings = {};
18
- async helpMe(loadDefault = false, verbose = false) {
19
- // Controllo configurazione
20
- if (!pacman_1.default.configurationCheck()) {
21
- console.log('- creating configuration dir...');
22
- await pacman_1.default.configurationInstall(verbose);
23
- }
24
- // Controllo prerequisites
25
- if (!(await pacman_1.default.prerequisitesCheck())) {
26
- console.log('- installing prerequisites...');
27
- await pacman_1.default.prerequisitesInstall(verbose);
28
- }
29
- // Templates
30
- if (!pacman_1.default.distroTemplateCheck()) {
31
- console.log('- distro template install...');
32
- await pacman_1.default.distroTemplateInstall(verbose);
33
- }
34
- // show and edit configuration
35
- this.settings = new settings_1.default();
36
- let config = {};
37
- if (await this.settings.load()) {
38
- config = this.settings.config;
39
- let jsonConf;
40
- if (!loadDefault) {
41
- jsonConf = await this.editConfig(config);
42
- }
43
- else {
44
- if (config.snapshot_prefix === '') {
45
- config.snapshot_prefix = utils_1.default.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId);
46
- config.compression = 'fast';
47
- }
48
- jsonConf = JSON.stringify(config);
49
- }
50
- const newConf = JSON.parse(jsonConf);
51
- // salvo le modifiche
52
- config.snapshot_basename = newConf.snapshot_basename;
53
- config.snapshot_prefix = newConf.snapshot_prefix;
54
- config.user_opt = newConf.user_opt;
55
- config.user_opt_passwd = newConf.user_opt_passwd;
56
- config.root_passwd = newConf.root_passwd;
57
- config.theme = newConf.theme;
58
- await this.settings.save(config);
59
- console.log();
60
- console.log(chalk_1.default.cyan('Your configuration was saved on: /etc/penguins-eggs.d'));
61
- console.log();
62
- console.log(chalk_1.default.cyan(`You can create a clean ISO with: `) + chalk_1.default.white(`sudo eggs produce`));
63
- console.log(chalk_1.default.cyan(`or a full personal clone: `) + chalk_1.default.white(`sudo eggs produce --clone`));
64
- console.log();
65
- console.log(chalk_1.default.cyan(`If you don't have enough space to remaster, you can mount`));
66
- console.log(chalk_1.default.cyan(`some remote or local space. Follow the samples:`));
67
- console.log(chalk_1.default.cyan(`- first, create an hidden mountpoint under the nest:`));
68
- console.log(chalk_1.default.white(`sudo mkdir /home/eggs/.mnt -p`));
69
- console.log(chalk_1.default.cyan(`- then, mount remote space:`));
70
- console.log(chalk_1.default.white(`sudo sshfs -o allow_other root@192.168.1.2:/zfs/iso /home/eggs/.mnt`));
71
- console.log(chalk_1.default.cyan('- or, mount a local partition:'));
72
- console.log(chalk_1.default.white(`sudo mount /dev/sdx1 /home/eggs/.mnt`));
73
- console.log();
74
- console.log(chalk_1.default.cyan('More help? ') + chalk_1.default.white('eggs mom'));
75
- // await exec(`cat /etc/penguins-eggs.d/eggs.yaml`)
76
- }
77
- }
78
18
  /**
79
19
  *
80
20
  * @param c
81
21
  */
82
22
  editConfig(c) {
83
23
  // Utils.titles('dad')
84
- console.log(chalk_1.default.cyan('Edit and save Live system parameters'));
24
+ console.log(chalk.cyan('Edit and save Live system parameters'));
85
25
  console.log();
86
26
  let compressionOpt = 0;
87
27
  if (c.compression === 'xz') {
@@ -91,52 +31,106 @@ class Daddy {
91
31
  compressionOpt = 2;
92
32
  }
93
33
  if (c.snapshot_prefix === '') {
94
- c.snapshot_prefix = utils_1.default.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId);
34
+ c.snapshot_prefix = Utils.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId);
95
35
  }
96
- return new Promise(function (resolve) {
36
+ return new Promise((resolve) => {
97
37
  const questions = [
98
38
  {
99
- type: 'input',
100
- name: 'snapshot_prefix',
101
- message: 'LiveCD iso prefix: ',
102
39
  default: c.snapshot_prefix,
40
+ message: 'LiveCD iso prefix: ',
41
+ name: 'snapshot_prefix',
42
+ type: 'input',
103
43
  },
104
44
  {
105
- type: 'input',
106
- name: 'snapshot_basename',
107
- message: 'LiveCD iso basename: ',
108
45
  default: c.snapshot_basename,
46
+ message: 'LiveCD iso basename: ',
47
+ name: 'snapshot_basename',
48
+ type: 'input',
109
49
  },
110
50
  {
111
- type: 'input',
112
- name: 'user_opt',
113
- message: 'LiveCD user:',
114
51
  default: c.user_opt,
52
+ message: 'LiveCD user:',
53
+ name: 'user_opt',
54
+ type: 'input',
115
55
  },
116
56
  {
117
- type: 'input',
118
- name: 'user_opt_passwd',
119
- message: 'LiveCD user password: ',
120
57
  default: c.user_opt_passwd,
58
+ message: 'LiveCD user password: ',
59
+ name: 'user_opt_passwd',
60
+ type: 'input',
121
61
  },
122
62
  {
123
- type: 'input',
124
- name: 'root_passwd',
125
- message: 'LiveCD root password: ',
126
63
  default: c.root_passwd,
64
+ message: 'LiveCD root password: ',
65
+ name: 'root_passwd',
66
+ type: 'input',
127
67
  },
128
68
  {
129
- type: 'list',
130
- name: 'compression',
131
- message: 'LiveCD compression: ',
132
69
  choices: ['fast', 'max'],
133
70
  default: compressionOpt,
71
+ message: 'LiveCD compression: ',
72
+ name: 'compression',
73
+ type: 'list',
134
74
  },
135
75
  ];
136
- inquirer.prompt(questions).then(function (options) {
76
+ inquirer.prompt(questions).then((options) => {
137
77
  resolve(JSON.stringify(options));
138
78
  });
139
79
  });
140
80
  }
81
+ async helpMe(loadDefault = false, verbose = false) {
82
+ // Controllo configurazione
83
+ if (!Pacman.configurationCheck()) {
84
+ console.log('- creating configuration dir...');
85
+ await Pacman.configurationInstall(verbose);
86
+ }
87
+ // Templates
88
+ if (!Pacman.distroTemplateCheck()) {
89
+ console.log('- distro template install...');
90
+ await Pacman.distroTemplateInstall(verbose);
91
+ }
92
+ // show and edit configuration
93
+ this.settings = new Settings();
94
+ let config = {};
95
+ if (await this.settings.load()) {
96
+ config = this.settings.config;
97
+ let jsonConf;
98
+ if (loadDefault) {
99
+ if (config.snapshot_prefix === '') {
100
+ config.snapshot_prefix = Utils.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId);
101
+ config.compression = 'fast';
102
+ }
103
+ jsonConf = JSON.stringify(config);
104
+ }
105
+ else {
106
+ jsonConf = await this.editConfig(config);
107
+ }
108
+ const newConf = JSON.parse(jsonConf);
109
+ // salvo le modifiche
110
+ config.snapshot_basename = newConf.snapshot_basename;
111
+ config.snapshot_prefix = newConf.snapshot_prefix;
112
+ config.user_opt = newConf.user_opt;
113
+ config.user_opt_passwd = newConf.user_opt_passwd;
114
+ config.root_passwd = newConf.root_passwd;
115
+ config.theme = newConf.theme;
116
+ await this.settings.save(config);
117
+ console.log();
118
+ console.log(chalk.cyan('Your configuration was saved on: /etc/penguins-eggs.d'));
119
+ console.log();
120
+ console.log(chalk.cyan(`You can create a clean ISO with: `) + chalk.white(`sudo eggs produce`));
121
+ console.log(chalk.cyan(`or a full personal clone: `) + chalk.white(`sudo eggs produce --clone`));
122
+ console.log();
123
+ console.log(chalk.cyan(`If you don't have enough space to remaster, you can mount`));
124
+ console.log(chalk.cyan(`some remote or local space. Follow the samples:`));
125
+ console.log(chalk.cyan(`- first, create an hidden mountpoint under the nest:`));
126
+ console.log(chalk.white(`sudo mkdir /home/eggs/.mnt -p`));
127
+ console.log(chalk.cyan(`- then, mount remote space:`));
128
+ console.log(chalk.white(`sudo sshfs -o allow_other root@192.168.1.2:/zfs/iso /home/eggs/.mnt`));
129
+ console.log(chalk.cyan('- or, mount a local partition:'));
130
+ console.log(chalk.white(`sudo mount /dev/sdx1 /home/eggs/.mnt`));
131
+ console.log();
132
+ console.log(chalk.cyan('More help? ') + chalk.white('eggs mom'));
133
+ // await exec(`cat /etc/penguins-eggs.d/eggs.yaml`)
134
+ }
135
+ }
141
136
  }
142
- exports.default = Daddy;
@@ -0,0 +1,26 @@
1
+ import { IDistro, IRemix } from '../interfaces/index.js';
2
+ /**
3
+ * Classe
4
+ */
5
+ declare class Distro implements IDistro {
6
+ bugReportUrl: string;
7
+ codenameId: string;
8
+ codenameLikeId: string;
9
+ distroId: string;
10
+ distroLike: string;
11
+ familyId: string;
12
+ homeUrl: string;
13
+ isCalamaresAvailable: boolean;
14
+ isolinuxPath: string;
15
+ liveMediumPath: string;
16
+ memdiskPath: string;
17
+ pxelinuxPath: string;
18
+ releaseId: string;
19
+ releaseLike: string;
20
+ squashfs: string;
21
+ supportUrl: string;
22
+ syslinuxPath: string;
23
+ usrLibPath: string;
24
+ constructor(remix?: IRemix);
25
+ }
26
+ export default Distro;
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-console */
2
1
  /**
3
2
  * penguins-eggs
4
3
  * class: distro.ts
@@ -7,35 +6,35 @@
7
6
  * license: MIT
8
7
  */
9
8
  'use strict';
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- const tslib_1 = require("tslib");
12
- const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
13
- const node_path_1 = tslib_1.__importDefault(require("node:path"));
14
- const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
15
- const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
16
- const utils_1 = tslib_1.__importDefault(require("./utils"));
9
+ import yaml from 'js-yaml';
10
+ import fs from 'node:fs';
11
+ import path from 'node:path';
12
+ import shell from 'shelljs';
13
+ import Utils from './utils.js';
14
+ // _dirname
15
+ const __dirname = path.dirname(new URL(import.meta.url).pathname);
17
16
  /**
18
17
  * Classe
19
18
  */
20
19
  class Distro {
21
- familyId;
22
- distroId;
23
- distroLike;
20
+ bugReportUrl;
24
21
  codenameId;
25
22
  codenameLikeId;
26
- releaseId;
27
- releaseLike;
28
- usrLibPath;
23
+ distroId;
24
+ distroLike;
25
+ familyId;
26
+ homeUrl;
27
+ isCalamaresAvailable;
29
28
  isolinuxPath;
30
- syslinuxPath;
31
- pxelinuxPath;
32
- memdiskPath;
33
29
  liveMediumPath;
30
+ memdiskPath;
31
+ pxelinuxPath;
32
+ releaseId;
33
+ releaseLike;
34
34
  squashfs;
35
- homeUrl;
36
35
  supportUrl;
37
- bugReportUrl;
38
- isCalamaresAvailable;
36
+ syslinuxPath;
37
+ usrLibPath;
39
38
  constructor(remix = {}) {
40
39
  this.familyId = 'debian';
41
40
  this.distroId = '';
@@ -57,8 +56,8 @@ class Distro {
57
56
  this.isCalamaresAvailable = true;
58
57
  const file = '/etc/os-release';
59
58
  let data;
60
- if (node_fs_1.default.existsSync(file)) {
61
- data = node_fs_1.default.readFileSync(file, 'utf8');
59
+ if (fs.existsSync(file)) {
60
+ data = fs.readFileSync(file, 'utf8');
62
61
  }
63
62
  // inizio
64
63
  let info;
@@ -73,13 +72,13 @@ class Distro {
73
72
  os[info.BUG_REPORT_URL] = 'BUG_REPORT_URL=';
74
73
  for (const temp in data) {
75
74
  if (!data[temp].search(os[info.HOME_URL])) {
76
- this.homeUrl = data[temp].slice(os[info.HOME_URL].length).replace(/"/g, '');
75
+ this.homeUrl = data[temp].slice(os[info.HOME_URL].length).replaceAll('"', '');
77
76
  }
78
77
  if (!data[temp].search(os[info.SUPPORT_URL])) {
79
- this.supportUrl = data[temp].slice(os[info.SUPPORT_URL].length).replace(/"/g, '');
78
+ this.supportUrl = data[temp].slice(os[info.SUPPORT_URL].length).replaceAll('"', '');
80
79
  }
81
80
  if (!data[temp].search(os[info.BUG_REPORT_URL])) {
82
- this.bugReportUrl = data[temp].slice(os[info.BUG_REPORT_URL].length).replace(/"/g, '');
81
+ this.bugReportUrl = data[temp].slice(os[info.BUG_REPORT_URL].length).replaceAll('"', '');
83
82
  }
84
83
  }
85
84
  /**
@@ -87,9 +86,9 @@ class Distro {
87
86
  * lsb_release -is per distribuzione
88
87
  * lsb_release -rs per release
89
88
  */
90
- this.codenameId = shelljs_1.default.exec('lsb_release -cs', { silent: true }).stdout.toString().trim();
91
- this.releaseId = shelljs_1.default.exec('lsb_release -rs', { silent: true }).stdout.toString().trim();
92
- this.distroId = shelljs_1.default.exec('lsb_release -is', { silent: true }).stdout.toString().trim();
89
+ this.codenameId = shell.exec('lsb_release -cs', { silent: true }).stdout.toString().trim();
90
+ this.releaseId = shell.exec('lsb_release -rs', { silent: true }).stdout.toString().trim();
91
+ this.distroId = shell.exec('lsb_release -is', { silent: true }).stdout.toString().trim();
93
92
  /**
94
93
  * releaseLike = releaseId
95
94
  */
@@ -217,12 +216,12 @@ class Distro {
217
216
  * patch per Roy VERIFICARE
218
217
  */
219
218
  let found = false;
220
- let file = node_path_1.default.resolve(__dirname, '../../conf/derivatives.yaml');
221
- if (node_fs_1.default.existsSync('/etc/penguins-eggs.d/derivatives.yaml')) {
219
+ let file = path.resolve(__dirname, '../../conf/derivatives.yaml');
220
+ if (fs.existsSync('/etc/penguins-eggs.d/derivatives.yaml')) {
222
221
  file = '/etc/penguins-eggs.d/derivatives.yaml';
223
222
  }
224
- const content = node_fs_1.default.readFileSync(file, 'utf8');
225
- const distros = js_yaml_1.default.load(content);
223
+ const content = fs.readFileSync(file, 'utf8');
224
+ const distros = yaml.load(content);
226
225
  for (const distro of distros) {
227
226
  if (distro.ids !== undefined) {
228
227
  for (let n = 0; n < distro.ids.length; n++) {
@@ -255,7 +254,7 @@ class Distro {
255
254
  this.syslinuxPath = '/usr/lib/syslinux/modules/bios/';
256
255
  this.pxelinuxPath = '/usr/lib/PXELINUX/';
257
256
  this.memdiskPath = '/usr/lib/syslinux/';
258
- this.usrLibPath = '/usr/lib/' + utils_1.default.usrLibPath();
257
+ this.usrLibPath = '/usr/lib/' + Utils.usrLibPath();
259
258
  break;
260
259
  }
261
260
  case 'archlinux': {
@@ -272,9 +271,9 @@ class Distro {
272
271
  * if lsb-release exists
273
272
  */
274
273
  const lsbConfig = '/etc/lsb-release';
275
- if (node_fs_1.default.existsSync(lsbConfig)) {
276
- this.distroId = utils_1.default.searchOnFile(lsbConfig, `DISTRIB_ID`);
277
- this.codenameId = utils_1.default.searchOnFile(lsbConfig, `DISTRIB_CODENAME`);
274
+ if (fs.existsSync(lsbConfig)) {
275
+ this.distroId = Utils.searchOnFile(lsbConfig, `DISTRIB_ID`);
276
+ this.codenameId = Utils.searchOnFile(lsbConfig, `DISTRIB_CODENAME`);
278
277
  }
279
278
  /**
280
279
  * ManjaroLinux and BigLinux
@@ -285,4 +284,4 @@ class Distro {
285
284
  }
286
285
  }
287
286
  }
288
- exports.default = Distro;
287
+ export default Distro;