penguins-eggs 9.6.34 → 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 (351) hide show
  1. package/.oclif.manifest.json +1458 -1
  2. package/README.md +823 -8
  3. package/addons/eggs/theme/livecd/grub.main.cfg +4 -4
  4. package/addons/eggs/theme/livecd/isolinux.main.cfg +5 -5
  5. package/bin/dev.cmd +1 -1
  6. package/bin/dev.js +6 -0
  7. package/bin/run.js +5 -0
  8. package/conf/derivatives.yaml +2 -0
  9. package/conf/distros/buster/calamares/calamares-modules/bootloader-config/bootloader-config.sh +3 -3
  10. package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +1 -1
  11. package/conf/distros/buster/calamares/modules/fstab.yml +1 -1
  12. package/conf/distros/focal/calamares/modules/fstab.yml +1 -1
  13. package/conf/{exclude.list.homes → exclude.list.d/home.list} +6 -1
  14. package/conf/{exclude.list.template → exclude.list.d/master.list} +15 -24
  15. package/conf/exclude.list.d/var.list +21 -0
  16. package/conf/tools.yaml +1 -3
  17. package/dist/classes/bleach.d.ts +37 -0
  18. package/dist/classes/bleach.js +43 -91
  19. package/dist/classes/cfs.d.ts +17 -0
  20. package/dist/classes/cfs.js +15 -12
  21. package/dist/classes/compressors.d.ts +53 -0
  22. package/dist/classes/compressors.js +51 -58
  23. package/dist/classes/daddy.d.ts +18 -0
  24. package/dist/classes/daddy.js +93 -101
  25. package/dist/classes/distro.d.ts +26 -0
  26. package/dist/classes/distro.js +45 -27
  27. package/dist/classes/families/archlinux.d.ts +61 -0
  28. package/dist/classes/families/archlinux.js +56 -113
  29. package/dist/classes/families/debian.d.ts +65 -0
  30. package/dist/classes/families/debian.js +68 -143
  31. package/dist/classes/families/fedora.d.ts +52 -0
  32. package/dist/classes/families/fedora.js +43 -99
  33. package/dist/classes/families/mockup.d.ts +60 -0
  34. package/dist/classes/families/mockup.js +27 -46
  35. package/dist/classes/families/suse.d.ts +52 -0
  36. package/dist/classes/families/suse.js +45 -97
  37. package/dist/classes/incubation/branding.d.ts +17 -0
  38. package/dist/classes/incubation/branding.js +33 -32
  39. package/dist/classes/incubation/distros/bionic.d.ts +32 -0
  40. package/dist/classes/incubation/distros/bionic.js +15 -15
  41. package/dist/classes/incubation/distros/buster.d.ts +32 -0
  42. package/dist/classes/incubation/distros/buster.js +15 -15
  43. package/dist/classes/incubation/distros/focal.d.ts +32 -0
  44. package/dist/classes/incubation/distros/focal.js +15 -15
  45. package/dist/classes/incubation/distros/jessie.d.ts +31 -0
  46. package/dist/classes/incubation/distros/jessie.js +11 -13
  47. package/dist/classes/incubation/distros/rolling.d.ts +32 -0
  48. package/dist/classes/incubation/distros/rolling.js +15 -16
  49. package/dist/classes/incubation/fisherman-helper/displaymanager.d.ts +11 -0
  50. package/dist/classes/incubation/fisherman-helper/displaymanager.js +8 -9
  51. package/dist/classes/incubation/fisherman-helper/packages.d.ts +20 -0
  52. package/dist/classes/incubation/fisherman-helper/packages.js +17 -17
  53. package/dist/classes/incubation/fisherman-helper/settings.d.ts +15 -0
  54. package/dist/classes/incubation/fisherman-helper/settings.js +30 -28
  55. package/dist/classes/incubation/fisherman.d.ts +77 -0
  56. package/dist/classes/incubation/fisherman.js +137 -132
  57. package/dist/classes/incubation/incubator.d.ts +40 -0
  58. package/dist/classes/incubation/incubator.js +93 -87
  59. package/dist/classes/incubation/installer.d.ts +13 -0
  60. package/dist/classes/incubation/installer.js +27 -12
  61. package/dist/classes/initrd.d.ts +41 -0
  62. package/dist/classes/initrd.js +42 -44
  63. package/dist/classes/keyboards.d.ts +50 -0
  64. package/dist/classes/keyboards.js +110 -107
  65. package/dist/classes/locales.d.ts +21 -0
  66. package/dist/classes/locales.js +30 -34
  67. package/dist/classes/n8.d.ts +17 -0
  68. package/dist/classes/n8.js +16 -22
  69. package/dist/classes/network.d.ts +37 -0
  70. package/dist/classes/network.js +21 -25
  71. package/dist/classes/ovary.d.ts +205 -0
  72. package/dist/classes/ovary.js +1262 -1334
  73. package/dist/classes/pacman.d.ts +149 -0
  74. package/dist/classes/pacman.js +347 -426
  75. package/dist/classes/pve-live.d.ts +17 -0
  76. package/dist/classes/pve-live.js +23 -25
  77. package/dist/classes/pxe.d.ts +65 -0
  78. package/dist/classes/pxe.js +206 -210
  79. package/dist/classes/settings.d.ts +53 -0
  80. package/dist/classes/settings.js +99 -102
  81. package/dist/classes/sources_list.d.ts +28 -0
  82. package/dist/classes/sources_list.js +35 -39
  83. package/dist/classes/systemctl.d.ts +47 -0
  84. package/dist/classes/systemctl.js +35 -39
  85. package/dist/classes/tailor.d.ts +46 -0
  86. package/dist/classes/tailor.js +225 -241
  87. package/dist/classes/tools.d.ts +30 -0
  88. package/dist/classes/tools.js +20 -26
  89. package/dist/classes/users.d.ts +28 -0
  90. package/dist/classes/users.js +22 -16
  91. package/dist/classes/utils.d.ts +318 -0
  92. package/dist/classes/utils.js +91 -76
  93. package/dist/classes/xdg.d.ts +45 -0
  94. package/dist/classes/xdg.js +129 -133
  95. package/dist/classes/yolk.d.ts +33 -0
  96. package/dist/classes/yolk.js +54 -60
  97. package/dist/commands/adapt.d.ts +17 -0
  98. package/dist/commands/adapt.js +21 -25
  99. package/dist/commands/analyze.d.ts +26 -0
  100. package/dist/commands/analyze.js +60 -74
  101. package/dist/commands/calamares.d.ts +29 -0
  102. package/dist/commands/calamares.js +53 -60
  103. package/dist/commands/config.d.ts +36 -0
  104. package/dist/commands/config.js +120 -142
  105. package/dist/commands/cuckoo.d.ts +16 -0
  106. package/dist/commands/cuckoo.js +24 -28
  107. package/dist/commands/dad.d.ts +19 -0
  108. package/dist/commands/dad.js +26 -30
  109. package/dist/commands/export/deb.d.ts +19 -0
  110. package/dist/commands/export/deb.js +33 -42
  111. package/dist/commands/export/iso.d.ts +19 -0
  112. package/dist/commands/export/iso.js +24 -28
  113. package/dist/commands/install.d.ts +37 -0
  114. package/dist/commands/install.js +68 -68
  115. package/dist/commands/kill.d.ts +24 -0
  116. package/dist/commands/kill.js +31 -38
  117. package/dist/commands/mom.d.ts +16 -0
  118. package/dist/commands/mom.js +20 -22
  119. package/dist/commands/produce.d.ts +33 -0
  120. package/dist/commands/produce.js +100 -92
  121. package/dist/commands/status.d.ts +23 -0
  122. package/dist/commands/status.js +14 -20
  123. package/dist/commands/syncfrom.d.ts +45 -0
  124. package/dist/commands/syncfrom.js +99 -109
  125. package/dist/commands/syncto.d.ts +40 -0
  126. package/dist/commands/syncto.js +152 -216
  127. package/dist/commands/tools/clean.d.ts +18 -0
  128. package/dist/commands/tools/clean.js +21 -25
  129. package/dist/commands/tools/ppa.d.ts +26 -0
  130. package/dist/commands/tools/ppa.js +46 -50
  131. package/dist/commands/tools/skel.d.ts +18 -0
  132. package/dist/commands/tools/skel.js +27 -31
  133. package/dist/commands/tools/stat.d.ts +31 -0
  134. package/dist/commands/tools/stat.js +21 -25
  135. package/dist/commands/tools/yolk.d.ts +24 -0
  136. package/dist/commands/tools/yolk.js +23 -27
  137. package/dist/commands/update.d.ts +47 -0
  138. package/dist/commands/update.js +66 -70
  139. package/dist/commands/wardrobe/get.d.ts +23 -0
  140. package/dist/commands/wardrobe/get.js +26 -28
  141. package/dist/commands/wardrobe/list.d.ts +24 -0
  142. package/dist/commands/wardrobe/list.js +69 -67
  143. package/dist/commands/wardrobe/show.d.ts +25 -0
  144. package/dist/commands/wardrobe/show.js +57 -52
  145. package/dist/commands/wardrobe/wear.d.ts +26 -0
  146. package/dist/commands/wardrobe/wear.js +39 -41
  147. package/dist/components/finished.d.ts +15 -0
  148. package/dist/components/finished.js +37 -42
  149. package/dist/components/information.d.ts +8 -0
  150. package/dist/components/information.js +155 -0
  151. package/dist/components/install.d.ts +15 -0
  152. package/dist/components/install.js +31 -35
  153. package/dist/components/keyboard.d.ts +16 -0
  154. package/dist/components/keyboard.js +37 -40
  155. package/dist/components/location.d.ts +16 -0
  156. package/dist/components/location.js +38 -38
  157. package/dist/components/network.d.ts +19 -0
  158. package/dist/components/network.js +47 -48
  159. package/dist/components/partitions.d.ts +16 -0
  160. package/dist/components/partitions.js +47 -51
  161. package/dist/components/steps.d.ts +13 -0
  162. package/dist/components/steps.js +148 -0
  163. package/dist/components/summary.d.ts +24 -0
  164. package/dist/components/summary.js +53 -54
  165. package/dist/components/title.d.ts +12 -0
  166. package/dist/components/title.js +35 -0
  167. package/dist/components/users.d.ts +24 -0
  168. package/dist/components/users.js +43 -43
  169. package/dist/components/welcome.d.ts +13 -0
  170. package/dist/components/welcome.js +37 -38
  171. package/dist/index.d.ts +8 -0
  172. package/dist/index.js +8 -5
  173. package/dist/interfaces/i-addons.d.ts +13 -0
  174. package/dist/interfaces/i-addons.js +8 -3
  175. package/dist/interfaces/i-analyze.d.ts +17 -0
  176. package/dist/interfaces/i-analyze.js +11 -16
  177. package/dist/interfaces/i-app.d.ts +14 -0
  178. package/dist/interfaces/i-app.js +8 -2
  179. package/dist/interfaces/i-branding.d.ts +36 -0
  180. package/dist/interfaces/i-branding.js +8 -2
  181. package/dist/interfaces/i-calamares-partition.d.ts +18 -0
  182. package/dist/interfaces/i-calamares-partition.js +3 -4
  183. package/dist/interfaces/i-config-tools.d.ts +18 -0
  184. package/dist/interfaces/i-config-tools.js +8 -2
  185. package/dist/interfaces/i-devices.d.ts +20 -0
  186. package/dist/interfaces/i-devices.js +8 -2
  187. package/dist/interfaces/i-distro.d.ts +27 -0
  188. package/dist/interfaces/i-distro.js +3 -4
  189. package/dist/interfaces/i-drive-list.d.ts +33 -0
  190. package/dist/interfaces/i-drive-list.js +3 -4
  191. package/dist/interfaces/i-eggs-config.d.ts +32 -0
  192. package/dist/interfaces/i-eggs-config.js +3 -4
  193. package/dist/interfaces/i-excludes.d.ts +14 -0
  194. package/dist/interfaces/i-excludes.js +8 -0
  195. package/dist/interfaces/i-exec.d.ts +11 -0
  196. package/dist/interfaces/i-exec.js +3 -4
  197. package/dist/interfaces/i-initrd.d.ts +13 -0
  198. package/dist/interfaces/i-initrd.js +8 -2
  199. package/dist/interfaces/i-install.d.ts +16 -0
  200. package/dist/interfaces/i-install.js +8 -2
  201. package/dist/interfaces/i-installer.d.ts +17 -0
  202. package/dist/interfaces/i-installer.js +8 -2
  203. package/dist/interfaces/i-krill-config.d.ts +33 -0
  204. package/dist/interfaces/i-krill-config.js +3 -4
  205. package/dist/interfaces/i-krill.d.ts +42 -0
  206. package/dist/interfaces/i-krill.js +8 -2
  207. package/dist/interfaces/i-materia.d.ts +41 -0
  208. package/dist/interfaces/i-materia.js +8 -2
  209. package/dist/interfaces/i-net.d.ts +16 -0
  210. package/dist/interfaces/i-net.js +8 -2
  211. package/dist/interfaces/i-packages.d.ts +29 -0
  212. package/dist/interfaces/i-packages.js +3 -4
  213. package/dist/interfaces/i-partitions.d.ts +16 -0
  214. package/dist/interfaces/i-partitions.js +8 -2
  215. package/dist/interfaces/i-pxe.d.ts +21 -0
  216. package/dist/interfaces/i-pxe.js +8 -39
  217. package/dist/interfaces/i-remix.d.ts +21 -0
  218. package/dist/interfaces/i-remix.js +3 -4
  219. package/dist/interfaces/i-settings.d.ts +39 -0
  220. package/dist/interfaces/i-settings.js +8 -2
  221. package/dist/interfaces/i-user.d.ts +14 -0
  222. package/dist/interfaces/i-user.js +8 -2
  223. package/dist/interfaces/i-workdir.d.ts +14 -0
  224. package/dist/interfaces/i-workdir.js +8 -2
  225. package/dist/interfaces/i-xkb-model.d.ts +24 -0
  226. package/dist/interfaces/i-xkb-model.js +8 -2
  227. package/dist/interfaces/index.d.ts +25 -0
  228. package/dist/interfaces/index.js +3 -4
  229. package/dist/krill/modules/add-user.d.ts +20 -0
  230. package/dist/krill/modules/add-user.js +11 -15
  231. package/dist/krill/modules/bootloader-config-arch.d.ts +14 -0
  232. package/dist/krill/modules/bootloader-config-arch.js +15 -11
  233. package/dist/krill/modules/bootloader-config-debian.d.ts +10 -0
  234. package/dist/krill/modules/bootloader-config-debian.js +20 -16
  235. package/dist/krill/modules/bootloader-config.d.ts +10 -0
  236. package/dist/krill/modules/bootloader-config.js +3 -6
  237. package/dist/krill/modules/bootloader.d.ts +14 -0
  238. package/dist/krill/modules/bootloader.js +9 -13
  239. package/dist/krill/modules/change-password.d.ts +15 -0
  240. package/dist/krill/modules/change-password.js +5 -8
  241. package/dist/krill/modules/del-live-user.d.ts +14 -0
  242. package/dist/krill/modules/del-live-user.js +8 -12
  243. package/dist/krill/modules/fstab.d.ts +14 -0
  244. package/dist/krill/modules/fstab.js +69 -46
  245. package/dist/krill/modules/grubcfg.d.ts +17 -0
  246. package/dist/krill/modules/grubcfg.js +8 -17
  247. package/dist/krill/modules/hostname.d.ts +13 -0
  248. package/dist/krill/modules/hostname.js +11 -17
  249. package/dist/krill/modules/initramfs-cfg.d.ts +14 -0
  250. package/dist/krill/modules/initramfs-cfg.js +6 -15
  251. package/dist/krill/modules/initramfs.d.ts +13 -0
  252. package/dist/krill/modules/initramfs.js +17 -19
  253. package/dist/krill/modules/locale-cfg.d.ts +10 -0
  254. package/dist/krill/modules/locale-cfg.js +8 -12
  255. package/dist/krill/modules/locale.d.ts +13 -0
  256. package/dist/krill/modules/locale.js +7 -11
  257. package/dist/krill/modules/m-keyboard.d.ts +14 -0
  258. package/dist/krill/modules/m-keyboard.js +14 -18
  259. package/dist/krill/modules/m-timezone.d.ts +14 -0
  260. package/dist/krill/modules/m-timezone.js +8 -12
  261. package/dist/krill/modules/machine-id.d.ts +15 -0
  262. package/dist/krill/modules/machine-id.js +6 -10
  263. package/dist/krill/modules/mkfs.d.ts +13 -0
  264. package/dist/krill/modules/mkfs.js +33 -23
  265. package/dist/krill/modules/mount-fs.d.ts +17 -0
  266. package/dist/krill/modules/mount-fs.js +20 -26
  267. package/dist/krill/modules/mount-vfs.d.ts +17 -0
  268. package/dist/krill/modules/mount-vfs.js +16 -21
  269. package/dist/krill/modules/network-cfg.d.ts +19 -0
  270. package/dist/krill/modules/network-cfg.js +28 -31
  271. package/dist/krill/modules/packages.d.ts +14 -0
  272. package/dist/krill/modules/packages.js +17 -21
  273. package/dist/krill/modules/partition.d.ts +20 -0
  274. package/dist/krill/modules/partition.js +80 -86
  275. package/dist/krill/modules/remove-installer-link.d.ts +13 -0
  276. package/dist/krill/modules/remove-installer-link.js +7 -11
  277. package/dist/krill/modules/umount.d.ts +14 -0
  278. package/dist/krill/modules/umount.js +9 -13
  279. package/dist/krill/modules/unpackfs.d.ts +13 -0
  280. package/dist/krill/modules/unpackfs.js +7 -11
  281. package/dist/krill/prepare.d.ts +77 -0
  282. package/dist/krill/{krill-prepare.js → prepare.js} +136 -130
  283. package/dist/krill/sequence.d.ts +156 -0
  284. package/dist/krill/sequence.js +640 -0
  285. package/dist/lib/cli-autologin.d.ts +43 -0
  286. package/dist/lib/cli-autologin.js +88 -92
  287. package/dist/lib/get_address.d.ts +8 -0
  288. package/dist/lib/get_address.js +9 -11
  289. package/dist/lib/get_dns.d.ts +8 -0
  290. package/dist/lib/get_dns.js +9 -11
  291. package/dist/lib/get_domain.d.ts +8 -0
  292. package/dist/lib/get_domain.js +9 -11
  293. package/dist/lib/get_gateway.d.ts +8 -0
  294. package/dist/lib/get_gateway.js +9 -11
  295. package/dist/lib/get_hostname.d.ts +8 -0
  296. package/dist/lib/get_hostname.js +9 -11
  297. package/dist/lib/get_netmask.d.ts +8 -0
  298. package/dist/lib/get_netmask.js +9 -11
  299. package/dist/lib/get_password.d.ts +8 -0
  300. package/dist/lib/get_password.js +10 -13
  301. package/dist/lib/get_userfullname.d.ts +8 -0
  302. package/dist/lib/get_userfullname.js +9 -11
  303. package/dist/lib/get_username.d.ts +8 -0
  304. package/dist/lib/get_username.js +9 -12
  305. package/dist/lib/kill_me_softly.d.ts +11 -0
  306. package/dist/lib/kill_me_softly.js +19 -24
  307. package/dist/lib/select_address_type.d.ts +8 -0
  308. package/dist/lib/select_address_type.js +9 -12
  309. package/dist/lib/select_filesystem_type.d.ts +8 -0
  310. package/dist/lib/select_filesystem_type.js +19 -17
  311. package/dist/lib/select_installation_device.d.ts +8 -0
  312. package/dist/lib/select_installation_device.js +11 -15
  313. package/dist/lib/select_installation_mode.d.ts +8 -0
  314. package/dist/lib/select_installation_mode.js +9 -11
  315. package/dist/lib/select_interface.d.ts +8 -0
  316. package/dist/lib/select_interface.js +9 -12
  317. package/dist/lib/select_keyboard_layout.d.ts +11 -0
  318. package/dist/lib/select_keyboard_layout.js +11 -15
  319. package/dist/lib/select_keyboard_model.d.ts +11 -0
  320. package/dist/lib/select_keyboard_model.js +11 -15
  321. package/dist/lib/select_keyboard_option.d.ts +11 -0
  322. package/dist/lib/select_keyboard_option.js +11 -15
  323. package/dist/lib/select_keyboard_variant.d.ts +11 -0
  324. package/dist/lib/select_keyboard_variant.js +11 -15
  325. package/dist/lib/select_languages.d.ts +8 -0
  326. package/dist/lib/select_languages.js +11 -15
  327. package/dist/lib/select_regions.d.ts +8 -0
  328. package/dist/lib/select_regions.js +9 -11
  329. package/dist/lib/select_user_swap_choice.d.ts +8 -0
  330. package/dist/lib/select_user_swap_choice.js +13 -17
  331. package/dist/lib/select_zones.d.ts +8 -0
  332. package/dist/lib/select_zones.js +9 -11
  333. package/dist/lib/utils.d.ts +34 -0
  334. package/dist/lib/utils.js +24 -14
  335. package/manpages/doc/man/eggs.1.gz +0 -0
  336. package/manpages/doc/man/eggs.html +130 -76
  337. package/package.json +55 -74
  338. package/scripts/_eggs +9 -7
  339. package/scripts/eggs.bash +4 -4
  340. package/LICENSE +0 -339
  341. package/bin/dev +0 -17
  342. package/bin/run +0 -5
  343. package/conf/exclude.list.custom +0 -3
  344. package/dist/components/elements/information.js +0 -194
  345. package/dist/components/elements/steps.js +0 -152
  346. package/dist/components/elements/title.js +0 -36
  347. package/dist/interfaces/i-filters.js +0 -3
  348. package/dist/krill/krill-sequence.js +0 -645
  349. package/dist/lib/dependencies.js +0 -120
  350. package/manpages/doc/man/README.md +0 -0
  351. /package/conf/{exclude.list.usr → exclude.list.d/usr.list} +0 -0
@@ -1,30 +1,29 @@
1
- "use strict";
2
1
  /**
3
- * penguins-eggs
4
- * class: initrd.ts
5
- * author: Piero Proietti
6
- * email: piero.proietti@gmail.com
7
- * license: MIT
2
+ * ./src/classes/initrd.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
+ /**
8
9
  * Schema from "refractasnapshot-10.2.10 (20191218)"
9
10
  * Copyright: fsmithred@gmail.com 2011-2019
10
11
  */
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const tslib_1 = require("tslib");
13
12
  // packages
14
- const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
15
- const shelljs_1 = tslib_1.__importDefault(require("shelljs"));
13
+ import fs from 'node:fs';
14
+ import shx from 'shelljs';
16
15
  /**
17
16
  * initrd
18
17
  * Controlla e rimuove, se necessario cryptroot, resume
19
18
  * cryptsetup
20
19
  */
21
- class Initrd {
20
+ export default class Initrd {
21
+ compression = 'gzip';
22
+ fsLive = '/home/eggs/ovarium/filesystem';
23
+ initrdDest = '/home/eggs/ovarium/iso/live';
24
+ initrdSrc = '/initrd.img';
25
+ workDir = '/tmp/initrd-extracted';
22
26
  constructor(initrdSrc = '/initrd.img', initrdDest = '/home/eggs/mnt/ovarium/iso/live/initrd.img', fsLive = '/home/eggs/ovarium/filesystem') {
23
- this.workDir = '/tmp/initrd-extracted';
24
- this.compression = 'gzip';
25
- this.initrdSrc = '/initrd.img';
26
- this.initrdDest = '/home/eggs/ovarium/iso/live';
27
- this.fsLive = '/home/eggs/ovarium/filesystem';
28
27
  this.initrdSrc = initrdSrc;
29
28
  this.initrdDest = initrdDest;
30
29
  this.fsLive = fsLive;
@@ -32,21 +31,13 @@ class Initrd {
32
31
  console.log('destinazione: ' + this.initrdDest);
33
32
  console.log('fsLive: ' + this.fsLive);
34
33
  }
35
- /**
36
- * clean
37
- */
38
- clean() {
39
- this.extract();
40
- this.edit();
41
- this.rebuild();
42
- }
43
34
  /**
44
35
  * Check initrd for cryptroot, resume, cryptsetup.
45
36
  */
46
37
  check() {
47
38
  const initrd = {};
48
39
  const cmdCheck = `lsinitramfs ${this.initrdSrc} | egrep 'conf/conf.d/cryptroot|cryptroot/crypttab|conf/conf.d/resume|conf/conf.d/zz-resume-auto'`;
49
- const check = shelljs_1.default.exec(cmdCheck, { silent: true });
40
+ const check = shx.exec(cmdCheck, { silent: true });
50
41
  if (check.includes('conf/conf.d/cryptroot')) {
51
42
  initrd.cryptoroot = true;
52
43
  }
@@ -61,6 +52,14 @@ class Initrd {
61
52
  }
62
53
  return initrd;
63
54
  }
55
+ /**
56
+ * clean
57
+ */
58
+ clean() {
59
+ this.extract();
60
+ this.edit();
61
+ this.rebuild();
62
+ }
64
63
  /**
65
64
  * extract
66
65
  */
@@ -71,14 +70,14 @@ class Initrd {
71
70
  }
72
71
  const savedState = process.cwd();
73
72
  // cancello e ricreo la cartella di lavore
74
- if (node_fs_1.default.existsSync(this.workDir)) {
75
- shelljs_1.default.exec(`rm ${this.workDir} -rf`);
73
+ if (fs.existsSync(this.workDir)) {
74
+ shx.exec(`rm ${this.workDir} -rf`);
76
75
  }
77
- shelljs_1.default.mkdir(this.workDir);
76
+ shx.mkdir(this.workDir);
78
77
  process.chdir(this.workDir);
79
78
  // Verifico il tipo di compressione
80
79
  const cmd = `file -L ${this.initrdSrc} | egrep -o 'gzip compressed|XZ compressed|cpio archive'`;
81
- const compressionShell = shelljs_1.default.exec(cmd).trimStart().trimEnd();
80
+ const compressionShell = shx.exec(cmd).trimStart().trimEnd();
82
81
  switch (compressionShell) {
83
82
  case 'gzip compressed': {
84
83
  break;
@@ -96,13 +95,13 @@ class Initrd {
96
95
  // Estratto initrd nella cartella di lavoro
97
96
  console.log('compression: [' + this.compression + ']');
98
97
  if ((this.compression = 'gzip')) {
99
- shelljs_1.default.exec(`zcat ${initrd} | cpio -i`);
98
+ shx.exec(`zcat ${initrd} | cpio -i`);
100
99
  }
101
100
  else if (this.compression === 'xz') {
102
- shelljs_1.default.exec(`xzcat ${initrd} | cpio -d -i -m`);
101
+ shx.exec(`xzcat ${initrd} | cpio -d -i -m`);
103
102
  }
104
103
  else if (this.compression === 'cpio') {
105
- shelljs_1.default.exec(`(cpio -i ; zcat | cpio -i) < ${initrd}`);
104
+ shx.exec(`(cpio -i ; zcat | cpio -i) < ${initrd}`);
106
105
  }
107
106
  process.chdir(savedState);
108
107
  }
@@ -111,23 +110,23 @@ class Initrd {
111
110
  */
112
111
  edit(verbose = true) {
113
112
  // Analizzo per cryptroot
114
- if (node_fs_1.default.existsSync(`${this.workDir}/conf/conf.d/cryptroot`)) {
113
+ if (fs.existsSync(`${this.workDir}/conf/conf.d/cryptroot`)) {
115
114
  console.log('Removing cryptroot');
116
- shelljs_1.default.exec(`rm -f ${this.workDir}/conf/conf.d/cryptroot`);
115
+ shx.exec(`rm -f ${this.workDir}/conf/conf.d/cryptroot`);
117
116
  }
118
- else if (node_fs_1.default.existsSync(`${this.workDir}/cryptroot/crypttab`)) {
117
+ else if (fs.existsSync(`${this.workDir}/cryptroot/crypttab`)) {
119
118
  console.log('Removing crypttab');
120
- shelljs_1.default.exec(`rm -f ${this.workDir}/cryptroot/crypttab`);
119
+ shx.exec(`rm -f ${this.workDir}/cryptroot/crypttab`);
121
120
  }
122
121
  // Analizzo per resume
123
- if (node_fs_1.default.existsSync(`${this.workDir}/conf/conf.d/resume`)) {
122
+ if (fs.existsSync(`${this.workDir}/conf/conf.d/resume`)) {
124
123
  console.log('Removing resume');
125
- shelljs_1.default.exec(`rm -f ${this.workDir}/conf/conf.d/resume`);
126
- shelljs_1.default.exec(`rm -f ${this.fsLive}/etc/initramfs-tools/conf.d/resume`);
124
+ shx.exec(`rm -f ${this.workDir}/conf/conf.d/resume`);
125
+ shx.exec(`rm -f ${this.fsLive}/etc/initramfs-tools/conf.d/resume`);
127
126
  }
128
127
  else if (`${this.workDir}/conf/conf.d/zz-resume-auto`) {
129
- shelljs_1.default.exec(`rm -f ${this.workDir}/rm -f conf/conf.d/zz-resume-auto`);
130
- shelljs_1.default.exec(`rm -f ${this.fsLive}/etc/initramfs-tools/conf.d/resume`);
128
+ shx.exec(`rm -f ${this.workDir}/rm -f conf/conf.d/zz-resume-auto`);
129
+ shx.exec(`rm -f ${this.fsLive}/etc/initramfs-tools/conf.d/resume`);
131
130
  }
132
131
  }
133
132
  /**
@@ -143,12 +142,11 @@ class Initrd {
143
142
  process.chdir(this.workDir);
144
143
  console.log('work_dir: ' + this.workDir);
145
144
  if (this.compression === 'gzip') {
146
- shelljs_1.default.exec(`find . -print0 | cpio -0 -H newc -o | gzip -c > ${this.initrdDest}`);
145
+ shx.exec(`find . -print0 | cpio -0 -H newc -o | gzip -c > ${this.initrdDest}`);
147
146
  }
148
147
  else if (this.compression === 'xz') {
149
- shelljs_1.default.exec(`find . | cpio -o -H newc | xz --check=crc32 --x86 --lzma2=dict=512KiB > ${this.initrdDest}`);
148
+ shx.exec(`find . | cpio -o -H newc | xz --check=crc32 --x86 --lzma2=dict=512KiB > ${this.initrdDest}`);
150
149
  }
151
150
  process.chdir(savedState);
152
151
  }
153
152
  }
154
- exports.default = Initrd;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * ./src/classes/keyboards.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 { IXkbLayout, IXkbModel, IXkbOption, IXkbVariant } from '../interfaces/i-xkb-model.js';
9
+ /**
10
+ * /usr/share/X11/xkb/rules/xorg.lst
11
+ */
12
+ export default class Keyboard {
13
+ layouts: string[];
14
+ models: string[];
15
+ options: string[];
16
+ variants: string[];
17
+ constructor();
18
+ /**
19
+ * XKBLAYOUT='us'
20
+ */
21
+ getLayout(): Promise<string>;
22
+ /**
23
+ * XKBLAYOUT=[]
24
+ */
25
+ getLayouts(): IXkbLayout[];
26
+ /**
27
+ * XKBMODEL='pc105'
28
+ */
29
+ getModel(): Promise<string>;
30
+ /**
31
+ * XKBMODEL[]
32
+ */
33
+ getModels(): IXkbModel[];
34
+ /**
35
+ * XKBOPTIONS=''
36
+ */
37
+ getOption(): Promise<string>;
38
+ /**
39
+ * XKBOPTIONS[]
40
+ */
41
+ getOptions(): IXkbOption[];
42
+ /**
43
+ * XKBVARIANT=''
44
+ */
45
+ getVariant(): Promise<string>;
46
+ /**
47
+ * IXkbVariant[]
48
+ */
49
+ getVariants(layout: string): IXkbVariant[];
50
+ }
@@ -1,15 +1,12 @@
1
- "use strict";
2
1
  /**
3
- * penguins-eggs
4
- * class: keyboard.ts
5
- * author: Piero Proietti
6
- * email: piero.proietti@gmail.com
7
- * license: MIT
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- const tslib_1 = require("tslib");
11
- const utils_1 = require("../lib/utils");
12
- const fs_1 = tslib_1.__importDefault(require("fs"));
2
+ * ./src/classes/keyboards.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 fs from 'node:fs';
9
+ import { exec } from '../lib/utils.js';
13
10
  // XkbModel - name of the model of your keyboard type
14
11
  // XkbLayout - layout(s) you intend to use
15
12
  // XkbVariant - variant(s) of the layout you intend to use
@@ -17,15 +14,15 @@ const fs_1 = tslib_1.__importDefault(require("fs"));
17
14
  /**
18
15
  * /usr/share/X11/xkb/rules/xorg.lst
19
16
  */
20
- class Keyboard {
17
+ export default class Keyboard {
18
+ layouts = [];
19
+ models = [];
20
+ options = [];
21
+ variants = [];
21
22
  constructor() {
22
- this.models = [];
23
- this.layouts = [];
24
- this.variants = [];
25
- this.options = [];
26
23
  const xorg = '/usr/share/X11/xkb/rules/xorg.lst';
27
- if (fs_1.default.existsSync(xorg)) {
28
- const lines = fs_1.default.readFileSync(xorg, 'utf-8').split('\n');
24
+ if (fs.existsSync(xorg)) {
25
+ const lines = fs.readFileSync(xorg, 'utf8').split('\n');
29
26
  const lenght = lines.length;
30
27
  let isModel = false;
31
28
  let isLayout = false;
@@ -33,29 +30,36 @@ class Keyboard {
33
30
  let isOption = false;
34
31
  for (let i = 0; i < lenght; i++) {
35
32
  if (lines[i].slice(0, 1) === '!') {
36
- if (lines[i] === '! model') {
37
- isModel = true;
38
- isLayout = false;
39
- isVariant = false;
40
- isOption = false;
41
- }
42
- else if (lines[i] === '! layout') {
43
- isModel = false;
44
- isLayout = true;
45
- isVariant = false;
46
- isOption = false;
47
- }
48
- else if (lines[i] === '! variant') {
49
- isModel = false;
50
- isLayout = false;
51
- isVariant = true;
52
- isOption = false;
53
- }
54
- else if (lines[i] === '! option') {
55
- isModel = false;
56
- isLayout = false;
57
- isVariant = false;
58
- isOption = true;
33
+ switch (lines[i]) {
34
+ case '! model': {
35
+ isModel = true;
36
+ isLayout = false;
37
+ isVariant = false;
38
+ isOption = false;
39
+ break;
40
+ }
41
+ case '! layout': {
42
+ isModel = false;
43
+ isLayout = true;
44
+ isVariant = false;
45
+ isOption = false;
46
+ break;
47
+ }
48
+ case '! variant': {
49
+ isModel = false;
50
+ isLayout = false;
51
+ isVariant = true;
52
+ isOption = false;
53
+ break;
54
+ }
55
+ case '! option': {
56
+ isModel = false;
57
+ isLayout = false;
58
+ isVariant = false;
59
+ isOption = true;
60
+ break;
61
+ }
62
+ // No default
59
63
  }
60
64
  i++;
61
65
  }
@@ -75,19 +79,19 @@ class Keyboard {
75
79
  }
76
80
  }
77
81
  /**
78
- * XKBMODEL[]
82
+ * XKBLAYOUT='us'
79
83
  */
80
- getModels() {
81
- // 0123456789012345678901234567890123456789
82
- // pc101 Generic 101-key PC
83
- const oModels = [];
84
- for (const model of this.models) {
85
- const m = {};
86
- m.code = model.slice(0, 15).trim();
87
- m.description = model.slice(16);
88
- oModels.push(m);
84
+ async getLayout() {
85
+ const file = '/etc/default/keyboard';
86
+ const cmd = 'grep XKBLAYOUT < /etc/default/keyboard | cut -f2 -d= | cut -f2 "-d\\""';
87
+ let keyboardLayout = 'us';
88
+ if (fs.existsSync(file)) {
89
+ const result = await exec(cmd, { capture: true, echo: false, ignore: false });
90
+ if (result.code === 0) {
91
+ keyboardLayout = result.data.trim();
92
+ }
89
93
  }
90
- return oModels;
94
+ return keyboardLayout;
91
95
  }
92
96
  /**
93
97
  * XKBLAYOUT=[]
@@ -103,67 +107,64 @@ class Keyboard {
103
107
  return oLayouts;
104
108
  }
105
109
  /**
106
- * IXkbVariant[]
110
+ * XKBMODEL='pc105'
107
111
  */
108
- getVariants(layout) {
109
- // 0123456789012345678901234567890123456789
110
- // chr us: Cherokee
111
- const aoVariants = [];
112
- for (const variant of this.variants) {
113
- const v = {};
114
- v.code = variant.slice(0, 15).trim();
115
- v.lang = variant.substring(16, variant.indexOf(':')).trim();
116
- v.description = variant.slice(Math.max(0, variant.indexOf(':')));
117
- if (v.lang === layout) {
118
- aoVariants.push(v);
112
+ async getModel() {
113
+ const file = '/etc/default/keyboard';
114
+ const cmd = `grep XKBMODEL < ${file} |cut -f2 -d= | cut -f2 "-d\\""`;
115
+ let keyboardModel = 'pc105';
116
+ if (fs.existsSync(file)) {
117
+ const result = await exec(cmd, { capture: true, echo: false, ignore: false });
118
+ if (result.code === 0) {
119
+ keyboardModel = result.data.trim();
119
120
  }
120
121
  }
121
- return aoVariants;
122
+ return keyboardModel;
122
123
  }
123
124
  /**
124
- * XKBOPTIONS[]
125
+ * XKBMODEL[]
125
126
  */
126
- getOptions() {
127
+ getModels() {
127
128
  // 0123456789012345678901234567890123456789
128
- // grp:switch Right Alt (while pressed)
129
- const aoOptions = [];
130
- for (const option of this.options) {
131
- const o = {};
132
- o.code = option.slice(0, 15).trim();
133
- o.description = option.slice(21);
134
- aoOptions.push(o);
129
+ // pc101 Generic 101-key PC
130
+ const oModels = [];
131
+ for (const model of this.models) {
132
+ const m = {};
133
+ m.code = model.slice(0, 15).trim();
134
+ m.description = model.slice(16);
135
+ oModels.push(m);
135
136
  }
136
- return aoOptions;
137
+ return oModels;
137
138
  }
138
139
  /**
139
- * XKBMODEL='pc105'
140
+ * XKBOPTIONS=''
140
141
  */
141
- async getModel() {
142
+ async getOption() {
142
143
  const file = '/etc/default/keyboard';
143
- const cmd = `grep XKBMODEL < ${file} |cut -f2 -d= | cut -f2 "-d\\""`;
144
- let keyboardModel = 'pc105';
145
- if (fs_1.default.existsSync(file)) {
146
- const result = await (0, utils_1.exec)(cmd, { capture: true, echo: false, ignore: false });
144
+ const cmd = `grep XKBOPTIONS < ${file} | cut -f2 -d= | cut -f2 "-d\\""`;
145
+ let keyboardOption = '';
146
+ if (fs.existsSync(file)) {
147
+ const result = await exec(cmd, { capture: true, echo: false, ignore: false });
147
148
  if (result.code === 0) {
148
- keyboardModel = result.data.trim();
149
+ keyboardOption = result.data.trim();
149
150
  }
150
151
  }
151
- return keyboardModel;
152
+ return keyboardOption;
152
153
  }
153
154
  /**
154
- * XKBLAYOUT='us'
155
+ * XKBOPTIONS[]
155
156
  */
156
- async getLayout() {
157
- const file = '/etc/default/keyboard';
158
- const cmd = 'grep XKBLAYOUT < /etc/default/keyboard | cut -f2 -d= | cut -f2 "-d\\""';
159
- let keyboardLayout = 'us';
160
- if (fs_1.default.existsSync(file)) {
161
- const result = await (0, utils_1.exec)(cmd, { capture: true, echo: false, ignore: false });
162
- if (result.code === 0) {
163
- keyboardLayout = result.data.trim();
164
- }
157
+ getOptions() {
158
+ // 0123456789012345678901234567890123456789
159
+ // grp:switch Right Alt (while pressed)
160
+ const aoOptions = [];
161
+ for (const option of this.options) {
162
+ const o = {};
163
+ o.code = option.slice(0, 15).trim();
164
+ o.description = option.slice(21);
165
+ aoOptions.push(o);
165
166
  }
166
- return keyboardLayout;
167
+ return aoOptions;
167
168
  }
168
169
  /**
169
170
  * XKBVARIANT=''
@@ -172,8 +173,8 @@ class Keyboard {
172
173
  const file = '/etc/default/keyboard';
173
174
  const cmd = `grep XKBVARIANT < ${file} | cut -f2 -d=|cut -f2 "-d\\""`;
174
175
  let keyboardVariant = '';
175
- if (fs_1.default.existsSync(file)) {
176
- const result = await (0, utils_1.exec)(cmd, { capture: true, echo: false, ignore: false });
176
+ if (fs.existsSync(file)) {
177
+ const result = await exec(cmd, { capture: true, echo: false, ignore: false });
177
178
  if (result.code === 0) {
178
179
  keyboardVariant = result.data.trim();
179
180
  }
@@ -181,19 +182,21 @@ class Keyboard {
181
182
  return keyboardVariant;
182
183
  }
183
184
  /**
184
- * XKBOPTIONS=''
185
+ * IXkbVariant[]
185
186
  */
186
- async getOption() {
187
- const file = '/etc/default/keyboard';
188
- const cmd = `grep XKBOPTIONS < ${file} | cut -f2 -d= | cut -f2 "-d\\""`;
189
- let keyboardOption = '';
190
- if (fs_1.default.existsSync(file)) {
191
- const result = await (0, utils_1.exec)(cmd, { capture: true, echo: false, ignore: false });
192
- if (result.code === 0) {
193
- keyboardOption = result.data.trim();
187
+ getVariants(layout) {
188
+ // 0123456789012345678901234567890123456789
189
+ // chr us: Cherokee
190
+ const aoVariants = [];
191
+ for (const variant of this.variants) {
192
+ const v = {};
193
+ v.code = variant.slice(0, 15).trim();
194
+ v.lang = variant.substring(16, variant.indexOf(':')).trim();
195
+ v.description = variant.slice(Math.max(0, variant.indexOf(':')));
196
+ if (v.lang === layout) {
197
+ aoVariants.push(v);
194
198
  }
195
199
  }
196
- return keyboardOption;
200
+ return aoVariants;
197
201
  }
198
202
  }
199
- exports.default = Keyboard;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * ./src/classes/locales.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 Locales {
9
+ /**
10
+ *
11
+ */
12
+ getDefault(): Promise<string>;
13
+ /**
14
+ *
15
+ */
16
+ getEnabled(): Promise<string[]>;
17
+ /**
18
+ *
19
+ */
20
+ getSupported(): Promise<string[]>;
21
+ }
@@ -1,17 +1,29 @@
1
- "use strict";
2
1
  /**
3
- * penguins-eggs
4
- * class: locales.ts
5
- * author: Piero Proietti
6
- * email: piero.proietti@gmail.com
7
- * license: MIT
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- const tslib_1 = require("tslib");
11
- const utils_1 = require("../lib/utils");
12
- const fs_1 = tslib_1.__importDefault(require("fs"));
13
- const distro_1 = tslib_1.__importDefault(require("./distro"));
14
- class Locales {
2
+ * ./src/classes/locales.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 fs from 'node:fs';
9
+ import { exec } from '../lib/utils.js';
10
+ import Distro from './distro.js';
11
+ export default class Locales {
12
+ /**
13
+ *
14
+ */
15
+ async getDefault() {
16
+ const file = '/etc/default/locale';
17
+ const cmd = `grep LANG < ${file}|cut -f2 -d=`;
18
+ let defaultLanguage = 'en_US.UTF-8';
19
+ if (fs.existsSync(file)) {
20
+ const result = await exec(cmd, { capture: true, echo: false, ignore: false });
21
+ if (result.code === 0) {
22
+ defaultLanguage = result.data.replaceAll('"', '').replaceAll('\'', '').trim();
23
+ }
24
+ }
25
+ return defaultLanguage;
26
+ }
15
27
  /**
16
28
  *
17
29
  */
@@ -20,11 +32,11 @@ class Locales {
20
32
  // in /etc/locale.gen anche se #disabilitati
21
33
  const cmd = 'localectl list-locales';
22
34
  const enabledLocales = [];
23
- const result = await (0, utils_1.exec)(cmd, { capture: true, echo: false, ignore: false });
35
+ const result = await exec(cmd, { capture: true, echo: false, ignore: false });
24
36
  if (result.code === 0) {
25
37
  const lines = result.data.split('\n');
26
38
  for (const line of lines) {
27
- enabledLocales.push(line.replace(/"/g, '').replace(/'/g, '').trim());
39
+ enabledLocales.push(line.replaceAll('"', '').replaceAll('\'', '').trim());
28
40
  }
29
41
  }
30
42
  return enabledLocales;
@@ -33,13 +45,13 @@ class Locales {
33
45
  *
34
46
  */
35
47
  async getSupported() {
36
- const distro = new distro_1.default();
48
+ const distro = new Distro();
37
49
  let supporteds = [];
38
50
  if (distro.familyId === 'debian') {
39
- supporteds = fs_1.default.readFileSync('/usr/share/i18n/SUPPORTED', 'utf-8').split('\n');
51
+ supporteds = fs.readFileSync('/usr/share/i18n/SUPPORTED', 'utf8').split('\n');
40
52
  }
41
53
  else if (distro.familyId === 'archlinux') {
42
- supporteds = (await (0, utils_1.exec)('localectl list-locales', { capture: true, echo: false, ignore: false })).data.split('\n');
54
+ supporteds = (await exec('localectl list-locales', { capture: true, echo: false, ignore: false })).data.split('\n');
43
55
  }
44
56
  const elements = [];
45
57
  for (const elem of supporteds) {
@@ -47,20 +59,4 @@ class Locales {
47
59
  }
48
60
  return elements;
49
61
  }
50
- /**
51
- *
52
- */
53
- async getDefault() {
54
- const file = '/etc/default/locale';
55
- const cmd = `grep LANG < ${file}|cut -f2 -d=`;
56
- let defaultLanguage = 'en_US.UTF-8';
57
- if (fs_1.default.existsSync(file)) {
58
- const result = await (0, utils_1.exec)(cmd, { capture: true, echo: false, ignore: false });
59
- if (result.code === 0) {
60
- defaultLanguage = result.data.replace(/"/g, '').replace(/'/g, '').trim();
61
- }
62
- }
63
- return defaultLanguage;
64
- }
65
62
  }
66
- exports.default = Locales;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * ./src/classes/n8.ts (node 8)
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 n8 {
9
+ static dirent2string(dir: any): string;
10
+ /**
11
+ *
12
+ * @param dirPath
13
+ */
14
+ static isDirectory(name: string): boolean;
15
+ static isFile(name: string): boolean;
16
+ static isSymbolicLink(name: string): boolean;
17
+ }