penguins-eggs 10.0.26 → 10.0.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 (324) hide show
  1. package/.oclif.manifest.json +2 -1463
  2. package/README.md +3 -741
  3. package/manpages/doc/man/eggs.1.gz +0 -0
  4. package/manpages/doc/man/eggs.html +4 -4
  5. package/package.json +3 -3
  6. package/scripts/love +13 -18
  7. package/dist/classes/bleach.d.ts +0 -32
  8. package/dist/classes/bleach.js +0 -136
  9. package/dist/classes/cfs.d.ts +0 -17
  10. package/dist/classes/cfs.js +0 -39
  11. package/dist/classes/cli-autologin.d.ts +0 -52
  12. package/dist/classes/cli-autologin.js +0 -230
  13. package/dist/classes/compressors.d.ts +0 -54
  14. package/dist/classes/compressors.js +0 -109
  15. package/dist/classes/daddy.d.ts +0 -26
  16. package/dist/classes/daddy.js +0 -161
  17. package/dist/classes/distro.d.ts +0 -36
  18. package/dist/classes/distro.js +0 -346
  19. package/dist/classes/families/alpine.d.ts +0 -55
  20. package/dist/classes/families/alpine.js +0 -108
  21. package/dist/classes/families/archlinux.d.ts +0 -61
  22. package/dist/classes/families/archlinux.js +0 -140
  23. package/dist/classes/families/debian.d.ts +0 -65
  24. package/dist/classes/families/debian.js +0 -138
  25. package/dist/classes/families/fedora.d.ts +0 -52
  26. package/dist/classes/families/fedora.js +0 -100
  27. package/dist/classes/families/mockup.d.ts +0 -60
  28. package/dist/classes/families/mockup.js +0 -79
  29. package/dist/classes/families/opensuse.d.ts +0 -52
  30. package/dist/classes/families/opensuse.js +0 -104
  31. package/dist/classes/incubation/branding.d.ts +0 -17
  32. package/dist/classes/incubation/branding.js +0 -89
  33. package/dist/classes/incubation/distros/bionic.d.ts +0 -32
  34. package/dist/classes/incubation/distros/bionic.js +0 -83
  35. package/dist/classes/incubation/distros/buster.d.ts +0 -32
  36. package/dist/classes/incubation/distros/buster.js +0 -85
  37. package/dist/classes/incubation/distros/jessie.d.ts +0 -31
  38. package/dist/classes/incubation/distros/jessie.js +0 -44
  39. package/dist/classes/incubation/distros/noble.d.ts +0 -32
  40. package/dist/classes/incubation/distros/noble.js +0 -85
  41. package/dist/classes/incubation/distros/rolling.d.ts +0 -32
  42. package/dist/classes/incubation/distros/rolling.js +0 -82
  43. package/dist/classes/incubation/fisherman-helper/displaymanager.d.ts +0 -11
  44. package/dist/classes/incubation/fisherman-helper/displaymanager.js +0 -39
  45. package/dist/classes/incubation/fisherman-helper/packages.d.ts +0 -20
  46. package/dist/classes/incubation/fisherman-helper/packages.js +0 -72
  47. package/dist/classes/incubation/fisherman-helper/settings.d.ts +0 -15
  48. package/dist/classes/incubation/fisherman-helper/settings.js +0 -83
  49. package/dist/classes/incubation/fisherman.d.ts +0 -77
  50. package/dist/classes/incubation/fisherman.js +0 -251
  51. package/dist/classes/incubation/incubator.d.ts +0 -40
  52. package/dist/classes/incubation/incubator.js +0 -328
  53. package/dist/classes/incubation/installer.d.ts +0 -13
  54. package/dist/classes/incubation/installer.js +0 -64
  55. package/dist/classes/keyboards.d.ts +0 -50
  56. package/dist/classes/keyboards.js +0 -217
  57. package/dist/classes/locales.d.ts +0 -21
  58. package/dist/classes/locales.js +0 -80
  59. package/dist/classes/n8.d.ts +0 -18
  60. package/dist/classes/n8.js +0 -36
  61. package/dist/classes/network.d.ts +0 -37
  62. package/dist/classes/network.js +0 -98
  63. package/dist/classes/ovary.d.ts +0 -214
  64. package/dist/classes/ovary.js +0 -1879
  65. package/dist/classes/pacman.d.ts +0 -149
  66. package/dist/classes/pacman.js +0 -699
  67. package/dist/classes/pve-live.d.ts +0 -17
  68. package/dist/classes/pve-live.js +0 -52
  69. package/dist/classes/pxe.d.ts +0 -74
  70. package/dist/classes/pxe.js +0 -410
  71. package/dist/classes/settings.d.ts +0 -53
  72. package/dist/classes/settings.js +0 -185
  73. package/dist/classes/sources_list.d.ts +0 -28
  74. package/dist/classes/sources_list.js +0 -89
  75. package/dist/classes/systemctl.d.ts +0 -47
  76. package/dist/classes/systemctl.js +0 -86
  77. package/dist/classes/tailor.d.ts +0 -46
  78. package/dist/classes/tailor.js +0 -539
  79. package/dist/classes/tools.d.ts +0 -30
  80. package/dist/classes/tools.js +0 -54
  81. package/dist/classes/users.d.ts +0 -28
  82. package/dist/classes/users.js +0 -143
  83. package/dist/classes/utils.d.ts +0 -323
  84. package/dist/classes/utils.js +0 -946
  85. package/dist/classes/xdg.d.ts +0 -45
  86. package/dist/classes/xdg.js +0 -329
  87. package/dist/classes/yolk.d.ts +0 -33
  88. package/dist/classes/yolk.js +0 -114
  89. package/dist/commands/adapt.d.ts +0 -17
  90. package/dist/commands/adapt.js +0 -33
  91. package/dist/commands/analyze.d.ts +0 -26
  92. package/dist/commands/analyze.js +0 -95
  93. package/dist/commands/calamares.d.ts +0 -29
  94. package/dist/commands/calamares.js +0 -110
  95. package/dist/commands/config.d.ts +0 -35
  96. package/dist/commands/config.js +0 -192
  97. package/dist/commands/cuckoo.d.ts +0 -16
  98. package/dist/commands/cuckoo.js +0 -62
  99. package/dist/commands/dad.d.ts +0 -20
  100. package/dist/commands/dad.js +0 -46
  101. package/dist/commands/export/deb.d.ts +0 -19
  102. package/dist/commands/export/deb.js +0 -51
  103. package/dist/commands/export/iso.d.ts +0 -19
  104. package/dist/commands/export/iso.js +0 -55
  105. package/dist/commands/install.d.ts +0 -37
  106. package/dist/commands/install.js +0 -92
  107. package/dist/commands/kill.d.ts +0 -24
  108. package/dist/commands/kill.js +0 -50
  109. package/dist/commands/mom.d.ts +0 -16
  110. package/dist/commands/mom.js +0 -30
  111. package/dist/commands/produce.d.ts +0 -34
  112. package/dist/commands/produce.js +0 -199
  113. package/dist/commands/status.d.ts +0 -23
  114. package/dist/commands/status.js +0 -31
  115. package/dist/commands/syncfrom.d.ts +0 -45
  116. package/dist/commands/syncfrom.js +0 -152
  117. package/dist/commands/syncto.d.ts +0 -40
  118. package/dist/commands/syncto.js +0 -175
  119. package/dist/commands/tools/clean.d.ts +0 -18
  120. package/dist/commands/tools/clean.js +0 -37
  121. package/dist/commands/tools/ppa.d.ts +0 -26
  122. package/dist/commands/tools/ppa.js +0 -138
  123. package/dist/commands/tools/skel.d.ts +0 -18
  124. package/dist/commands/tools/skel.js +0 -44
  125. package/dist/commands/tools/stat.d.ts +0 -31
  126. package/dist/commands/tools/stat.js +0 -70
  127. package/dist/commands/tools/yolk.d.ts +0 -24
  128. package/dist/commands/tools/yolk.js +0 -45
  129. package/dist/commands/update.d.ts +0 -47
  130. package/dist/commands/update.js +0 -140
  131. package/dist/commands/wardrobe/get.d.ts +0 -23
  132. package/dist/commands/wardrobe/get.js +0 -52
  133. package/dist/commands/wardrobe/list.d.ts +0 -24
  134. package/dist/commands/wardrobe/list.js +0 -125
  135. package/dist/commands/wardrobe/show.d.ts +0 -25
  136. package/dist/commands/wardrobe/show.js +0 -97
  137. package/dist/commands/wardrobe/wear.d.ts +0 -26
  138. package/dist/commands/wardrobe/wear.js +0 -81
  139. package/dist/components/finished.d.ts +0 -15
  140. package/dist/components/finished.js +0 -55
  141. package/dist/components/information.d.ts +0 -8
  142. package/dist/components/information.js +0 -153
  143. package/dist/components/install.d.ts +0 -15
  144. package/dist/components/install.js +0 -56
  145. package/dist/components/keyboard.d.ts +0 -16
  146. package/dist/components/keyboard.js +0 -54
  147. package/dist/components/location.d.ts +0 -16
  148. package/dist/components/location.js +0 -59
  149. package/dist/components/network.d.ts +0 -19
  150. package/dist/components/network.js +0 -65
  151. package/dist/components/partitions.d.ts +0 -16
  152. package/dist/components/partitions.js +0 -73
  153. package/dist/components/steps.d.ts +0 -13
  154. package/dist/components/steps.js +0 -148
  155. package/dist/components/summary.d.ts +0 -24
  156. package/dist/components/summary.js +0 -82
  157. package/dist/components/title.d.ts +0 -11
  158. package/dist/components/title.js +0 -35
  159. package/dist/components/users.d.ts +0 -24
  160. package/dist/components/users.js +0 -80
  161. package/dist/components/welcome.d.ts +0 -13
  162. package/dist/components/welcome.js +0 -63
  163. package/dist/index.d.ts +0 -8
  164. package/dist/index.js +0 -8
  165. package/dist/interfaces/i-addons.d.ts +0 -13
  166. package/dist/interfaces/i-addons.js +0 -8
  167. package/dist/interfaces/i-analyze.d.ts +0 -17
  168. package/dist/interfaces/i-analyze.js +0 -17
  169. package/dist/interfaces/i-app.d.ts +0 -14
  170. package/dist/interfaces/i-app.js +0 -8
  171. package/dist/interfaces/i-branding.d.ts +0 -36
  172. package/dist/interfaces/i-branding.js +0 -8
  173. package/dist/interfaces/i-calamares-partition.d.ts +0 -18
  174. package/dist/interfaces/i-calamares-partition.js +0 -8
  175. package/dist/interfaces/i-config-tools.d.ts +0 -18
  176. package/dist/interfaces/i-config-tools.js +0 -8
  177. package/dist/interfaces/i-devices.d.ts +0 -20
  178. package/dist/interfaces/i-devices.js +0 -8
  179. package/dist/interfaces/i-distro.d.ts +0 -27
  180. package/dist/interfaces/i-distro.js +0 -8
  181. package/dist/interfaces/i-drive-list.d.ts +0 -33
  182. package/dist/interfaces/i-drive-list.js +0 -8
  183. package/dist/interfaces/i-eggs-config.d.ts +0 -32
  184. package/dist/interfaces/i-eggs-config.js +0 -8
  185. package/dist/interfaces/i-excludes.d.ts +0 -14
  186. package/dist/interfaces/i-excludes.js +0 -8
  187. package/dist/interfaces/i-exec.d.ts +0 -11
  188. package/dist/interfaces/i-exec.js +0 -8
  189. package/dist/interfaces/i-initrd.d.ts +0 -13
  190. package/dist/interfaces/i-initrd.js +0 -8
  191. package/dist/interfaces/i-install.d.ts +0 -16
  192. package/dist/interfaces/i-install.js +0 -8
  193. package/dist/interfaces/i-installer.d.ts +0 -17
  194. package/dist/interfaces/i-installer.js +0 -8
  195. package/dist/interfaces/i-krill-config.d.ts +0 -33
  196. package/dist/interfaces/i-krill-config.js +0 -8
  197. package/dist/interfaces/i-krill.d.ts +0 -42
  198. package/dist/interfaces/i-krill.js +0 -8
  199. package/dist/interfaces/i-materia.d.ts +0 -41
  200. package/dist/interfaces/i-materia.js +0 -8
  201. package/dist/interfaces/i-net.d.ts +0 -16
  202. package/dist/interfaces/i-net.js +0 -8
  203. package/dist/interfaces/i-packages.d.ts +0 -16
  204. package/dist/interfaces/i-packages.js +0 -8
  205. package/dist/interfaces/i-partitions.d.ts +0 -16
  206. package/dist/interfaces/i-partitions.js +0 -8
  207. package/dist/interfaces/i-pxe.d.ts +0 -45
  208. package/dist/interfaces/i-pxe.js +0 -1
  209. package/dist/interfaces/i-remix.d.ts +0 -21
  210. package/dist/interfaces/i-remix.js +0 -8
  211. package/dist/interfaces/i-settings.d.ts +0 -33
  212. package/dist/interfaces/i-settings.js +0 -8
  213. package/dist/interfaces/i-user.d.ts +0 -14
  214. package/dist/interfaces/i-user.js +0 -8
  215. package/dist/interfaces/i-workdir.d.ts +0 -14
  216. package/dist/interfaces/i-workdir.js +0 -8
  217. package/dist/interfaces/i-xkb-model.d.ts +0 -24
  218. package/dist/interfaces/i-xkb-model.js +0 -8
  219. package/dist/interfaces/index.d.ts +0 -25
  220. package/dist/interfaces/index.js +0 -8
  221. package/dist/krill/modules/add-user.d.ts +0 -20
  222. package/dist/krill/modules/add-user.js +0 -50
  223. package/dist/krill/modules/bootloader-config-arch.d.ts +0 -14
  224. package/dist/krill/modules/bootloader-config-arch.js +0 -37
  225. package/dist/krill/modules/bootloader-config-debian.d.ts +0 -10
  226. package/dist/krill/modules/bootloader-config-debian.js +0 -50
  227. package/dist/krill/modules/bootloader-config.d.ts +0 -10
  228. package/dist/krill/modules/bootloader-config.js +0 -16
  229. package/dist/krill/modules/bootloader.d.ts +0 -14
  230. package/dist/krill/modules/bootloader.js +0 -30
  231. package/dist/krill/modules/change-password.d.ts +0 -15
  232. package/dist/krill/modules/change-password.js +0 -18
  233. package/dist/krill/modules/del-live-user.d.ts +0 -14
  234. package/dist/krill/modules/del-live-user.js +0 -38
  235. package/dist/krill/modules/fstab.d.ts +0 -14
  236. package/dist/krill/modules/fstab.js +0 -121
  237. package/dist/krill/modules/grubcfg.d.ts +0 -17
  238. package/dist/krill/modules/grubcfg.js +0 -29
  239. package/dist/krill/modules/hostname.d.ts +0 -13
  240. package/dist/krill/modules/hostname.js +0 -50
  241. package/dist/krill/modules/initramfs-cfg.d.ts +0 -14
  242. package/dist/krill/modules/initramfs-cfg.js +0 -25
  243. package/dist/krill/modules/initramfs.d.ts +0 -13
  244. package/dist/krill/modules/initramfs.js +0 -48
  245. package/dist/krill/modules/locale-cfg.d.ts +0 -10
  246. package/dist/krill/modules/locale-cfg.js +0 -61
  247. package/dist/krill/modules/locale.d.ts +0 -13
  248. package/dist/krill/modules/locale.js +0 -48
  249. package/dist/krill/modules/m-keyboard.d.ts +0 -14
  250. package/dist/krill/modules/m-keyboard.js +0 -79
  251. package/dist/krill/modules/m-timezone.d.ts +0 -14
  252. package/dist/krill/modules/m-timezone.js +0 -22
  253. package/dist/krill/modules/machine-id.d.ts +0 -15
  254. package/dist/krill/modules/machine-id.js +0 -30
  255. package/dist/krill/modules/mkfs.d.ts +0 -13
  256. package/dist/krill/modules/mkfs.js +0 -48
  257. package/dist/krill/modules/mount-fs.d.ts +0 -17
  258. package/dist/krill/modules/mount-fs.js +0 -60
  259. package/dist/krill/modules/mount-vfs.d.ts +0 -17
  260. package/dist/krill/modules/mount-vfs.js +0 -40
  261. package/dist/krill/modules/network-cfg.d.ts +0 -19
  262. package/dist/krill/modules/network-cfg.js +0 -64
  263. package/dist/krill/modules/packages.d.ts +0 -14
  264. package/dist/krill/modules/packages.js +0 -98
  265. package/dist/krill/modules/partition.d.ts +0 -20
  266. package/dist/krill/modules/partition.js +0 -324
  267. package/dist/krill/modules/remove-installer-link.d.ts +0 -13
  268. package/dist/krill/modules/remove-installer-link.js +0 -35
  269. package/dist/krill/modules/umount.d.ts +0 -14
  270. package/dist/krill/modules/umount.js +0 -27
  271. package/dist/krill/modules/unpackfs.d.ts +0 -13
  272. package/dist/krill/modules/unpackfs.js +0 -19
  273. package/dist/krill/prepare.d.ts +0 -78
  274. package/dist/krill/prepare.js +0 -626
  275. package/dist/krill/sequence.d.ts +0 -157
  276. package/dist/krill/sequence.js +0 -665
  277. package/dist/lib/get_address.d.ts +0 -8
  278. package/dist/lib/get_address.js +0 -23
  279. package/dist/lib/get_dns.d.ts +0 -8
  280. package/dist/lib/get_dns.js +0 -23
  281. package/dist/lib/get_domain.d.ts +0 -8
  282. package/dist/lib/get_domain.js +0 -23
  283. package/dist/lib/get_gateway.d.ts +0 -8
  284. package/dist/lib/get_gateway.js +0 -23
  285. package/dist/lib/get_hostname.d.ts +0 -8
  286. package/dist/lib/get_hostname.js +0 -23
  287. package/dist/lib/get_netmask.d.ts +0 -8
  288. package/dist/lib/get_netmask.js +0 -23
  289. package/dist/lib/get_password.d.ts +0 -8
  290. package/dist/lib/get_password.js +0 -36
  291. package/dist/lib/get_userfullname.d.ts +0 -8
  292. package/dist/lib/get_userfullname.js +0 -23
  293. package/dist/lib/get_username.d.ts +0 -8
  294. package/dist/lib/get_username.js +0 -23
  295. package/dist/lib/kill_me_softly.d.ts +0 -11
  296. package/dist/lib/kill_me_softly.js +0 -61
  297. package/dist/lib/select_address_type.d.ts +0 -8
  298. package/dist/lib/select_address_type.js +0 -24
  299. package/dist/lib/select_filesystem_type.d.ts +0 -8
  300. package/dist/lib/select_filesystem_type.js +0 -45
  301. package/dist/lib/select_installation_device.d.ts +0 -8
  302. package/dist/lib/select_installation_device.js +0 -30
  303. package/dist/lib/select_installation_mode.d.ts +0 -8
  304. package/dist/lib/select_installation_mode.js +0 -24
  305. package/dist/lib/select_interface.d.ts +0 -8
  306. package/dist/lib/select_interface.js +0 -24
  307. package/dist/lib/select_keyboard_layout.d.ts +0 -11
  308. package/dist/lib/select_keyboard_layout.js +0 -36
  309. package/dist/lib/select_keyboard_model.d.ts +0 -11
  310. package/dist/lib/select_keyboard_model.js +0 -34
  311. package/dist/lib/select_keyboard_option.d.ts +0 -11
  312. package/dist/lib/select_keyboard_option.js +0 -34
  313. package/dist/lib/select_keyboard_variant.d.ts +0 -11
  314. package/dist/lib/select_keyboard_variant.js +0 -35
  315. package/dist/lib/select_languages.d.ts +0 -8
  316. package/dist/lib/select_languages.js +0 -28
  317. package/dist/lib/select_regions.d.ts +0 -8
  318. package/dist/lib/select_regions.js +0 -24
  319. package/dist/lib/select_user_swap_choice.d.ts +0 -8
  320. package/dist/lib/select_user_swap_choice.js +0 -34
  321. package/dist/lib/select_zones.d.ts +0 -8
  322. package/dist/lib/select_zones.js +0 -518
  323. package/dist/lib/utils.d.ts +0 -34
  324. package/dist/lib/utils.js +0 -79
@@ -1,699 +0,0 @@
1
- /**
2
- * ./src/classes/pacman.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 { execSync } from 'node:child_process';
9
- import fs from 'node:fs';
10
- // _dirname
11
- import path from 'node:path';
12
- import shx from 'shelljs';
13
- import { exec } from '../lib/utils.js';
14
- import Distro from './distro.js';
15
- import Alpine from './families/alpine.js';
16
- import Archlinux from './families/archlinux.js';
17
- import Debian from './families/debian.js';
18
- import Fedora from './families/fedora.js';
19
- import Settings from './settings.js';
20
- import Utils from './utils.js';
21
- const __dirname = path.dirname(new URL(import.meta.url).pathname);
22
- const config_file = '/etc/penguins-eggs.d/eggs.yaml';
23
- const config_tools = '/etc/penguins-eggs.d/tools.yaml';
24
- /**
25
- * Utils: general porpouse utils
26
- * @remarks all the utilities
27
- */
28
- export default class Pacman {
29
- static debs4calamares = ['calamares', 'qml-module-qtquick2', 'qml-module-qtquick-controls'];
30
- distro = {};
31
- remix = {};
32
- /**
33
- *
34
- * @param verbose
35
- */
36
- static async autocompleteInstall(verbose = false) {
37
- if (this.distro().familyId === 'debian') {
38
- if (Pacman.packageIsInstalled('bash-completion')) {
39
- if (fs.existsSync('/usr/share/bash-completion/completions/')) {
40
- await exec(`cp ${__dirname}/../../scripts/eggs.bash /usr/share/bash-completion/completions/`);
41
- }
42
- else if (fs.existsSync('/etc/bash_completion.d/')) {
43
- await exec(`cp ${__dirname}/../../scripts/eggs.bash /etc/bash_completion.d/`);
44
- }
45
- }
46
- }
47
- else if (this.distro().familyId === 'archlinux' && Pacman.packageIsInstalled('bash-completion')) {
48
- await exec(`cp ${__dirname}/../../scripts/eggs.bash /usr/share/bash-completion/completions/`);
49
- }
50
- }
51
- /**
52
- * return true if calamares is installed
53
- */
54
- static calamaresExists() {
55
- return this.commandIsInstalled('calamares');
56
- }
57
- /**
58
- *
59
- */
60
- static async calamaresInstall(verbose = false) {
61
- if (this.isInstalledGui()) {
62
- if (this.distro().familyId === 'debian') {
63
- await Debian.calamaresInstall(verbose);
64
- }
65
- else if (this.distro().familyId === 'fedora') {
66
- await Fedora.calamaresInstall(verbose);
67
- }
68
- else if (this.distro().familyId === 'archlinux') {
69
- if (this.distro().distroId === 'ManjaroLinux') {
70
- const cmd = `pacman -Sy --noconfirm calamares`;
71
- try {
72
- await exec(cmd, Utils.setEcho(true));
73
- }
74
- catch {
75
- Utils.error(`manjaro: ${cmd}`); // + e.error)
76
- }
77
- }
78
- else {
79
- await Archlinux.calamaresInstall(verbose);
80
- }
81
- }
82
- else if (this.distro().familyId === 'alpine') {
83
- await Alpine.calamaresInstall(verbose);
84
- }
85
- // remove others calamares links
86
- await exec('rm -f /usr/share/applications/calamares-eggs-debugging.desktop');
87
- await exec('rm -f /usr/share/applications/calamares-eggs.desktop');
88
- await exec('rm -f /usr/share/applications/calamares.desktop');
89
- }
90
- }
91
- /**
92
- * calamaresPolicies
93
- */
94
- static async calamaresPolicies() {
95
- if (this.distro().familyId === 'debian') {
96
- await Debian.calamaresPolicies();
97
- }
98
- else if (this.distro().familyId === 'fedora') {
99
- await Fedora.calamaresPolicies();
100
- }
101
- else if (this.distro().familyId === 'archlinux') {
102
- await Archlinux.calamaresPolicies();
103
- }
104
- else if (this.distro().familyId === 'alpine') {
105
- await Alpine.calamaresPolicies();
106
- }
107
- }
108
- /**
109
- *
110
- */
111
- static async calamaresRemove(verbose = true) {
112
- let retVal = false;
113
- if (this.distro().familyId === 'debian') {
114
- retVal = await Debian.calamaresRemove(verbose);
115
- }
116
- else if (this.distro().familyId === 'fedora') {
117
- retVal = await Fedora.calamaresRemove(verbose);
118
- }
119
- else if (this.distro().familyId === 'archlinux') {
120
- retVal = await Archlinux.calamaresRemove(verbose);
121
- }
122
- else if (this.distro().familyId === 'alpine') {
123
- retVal = await Alpine.calamaresRemove(verbose);
124
- }
125
- return retVal;
126
- }
127
- /**
128
- *
129
- * @param cmd
130
- */
131
- static commandIsInstalled(cmd) {
132
- let installed = false;
133
- // if (shx.exec(`command -V ${cmd} &>/dev/null`).code == 0) {
134
- // remove output
135
- if (shx.exec(`command -V ${cmd} >/dev/null 2>&1`).code == 0) {
136
- installed = true;
137
- }
138
- return installed;
139
- }
140
- /**
141
- * Restituisce VERO se i file di configurazione SONO presenti
142
- */
143
- static configurationCheck() {
144
- const confExists = fs.existsSync(config_file);
145
- return confExists;
146
- }
147
- /**
148
- *
149
- */
150
- static async configurationFresh() {
151
- const config = {};
152
- config.version = Utils.getPackageVersion();
153
- config.snapshot_dir = '/home/eggs';
154
- config.snapshot_prefix = '';
155
- config.snapshot_excludes = '/etc/penguins-eggs.d/exclude.list';
156
- config.snapshot_basename = ''; // before default was hostname
157
- config.user_opt = 'live';
158
- config.user_opt_passwd = 'evolution';
159
- config.root_passwd = 'evolution';
160
- config.theme = 'eggs';
161
- config.force_installer = true;
162
- config.make_efi = true;
163
- config.make_md5sum = false;
164
- config.make_isohybrid = true;
165
- config.compression = 'xz';
166
- config.ssh_pass = false;
167
- config.timezone = 'Europe/Rome';
168
- // config.locales_default = '__NOT_USED_MORE'
169
- // config.locales = ['__NOT_USED_MORE']
170
- // config.timezone = 'America/New_York'
171
- // const env = process.env
172
- // config.locales_default = env.LANG !== undefined ? env.LANG : 'en_US.UTF-8'
173
- // config.locales = config.locales_default === 'en_US.UTF-8' ? ['en_US.UTF-8'] : [config.locales_default, 'en_US.UTF-8']
174
- config.pmount_fixed = false;
175
- if (!this.calamaresExists()) {
176
- config.force_installer = false;
177
- console.log('Due the lacks of calamares package set force_installer = false');
178
- }
179
- if (!Pacman.isUefi() && Utils.uefiArch() !== 'i386') {
180
- config.make_efi = false;
181
- console.log('Due the lacks of grub-efi-' + Utils.uefiArch() + '-bin package set make_efi = false');
182
- }
183
- /**
184
- * Salvo la configurazione di eggs.yaml
185
- */
186
- config.machine_id = Utils.machineId();
187
- config.vmlinuz = Utils.vmlinuz();
188
- config.initrd_img = Utils.initrdImg();
189
- const settings = new Settings();
190
- await settings.save(config);
191
- }
192
- /**
193
- * Creazione del file di configurazione /etc/penguins-eggs
194
- */
195
- static async configurationInstall(links = true, verbose = true) {
196
- const confRoot = '/etc/penguins-eggs.d';
197
- if (!fs.existsSync(confRoot)) {
198
- execSync(`mkdir ${confRoot}`);
199
- }
200
- console.log('configurationInstall: ' + confRoot);
201
- const addons = `${confRoot}/addons`;
202
- if (fs.existsSync(addons)) {
203
- execSync(`rm -rf ${addons}`);
204
- }
205
- const distros = `${confRoot}/distros`;
206
- if (fs.existsSync(distros)) {
207
- execSync(`rm -rf ${distros}`);
208
- }
209
- execSync(`mkdir -p ${distros}`);
210
- /**
211
- * We use /etc/penguins-eggs.d/init for our init scripts:
212
- * # unattended.sh -> eggs install --unattended
213
- * # cuckoo -> eggs cuckoo
214
- */
215
- const init = `${confRoot}/init`;
216
- if (fs.existsSync(init)) {
217
- execSync(`rm -rf ${init}`);
218
- }
219
- execSync(`mkdir -p ${init}`);
220
- shx.ln('-s', path.resolve(__dirname, '../../addons'), addons);
221
- shx.cp(path.resolve(__dirname, '../../conf/README.md'), confRoot);
222
- shx.cp(path.resolve(__dirname, '../../conf/tools.yaml'), config_tools);
223
- shx.cp(path.resolve(__dirname, '../../conf/krill.yaml'), confRoot);
224
- shx.cp(path.resolve(__dirname, '../../conf/derivatives.yaml'), confRoot);
225
- shx.cp(path.resolve(__dirname, '../../conf/yolk.yaml'), confRoot);
226
- // init
227
- shx.cp(path.resolve(__dirname, '../../conf/init/unattended.sh'), '/etc/penguins-eggs.d/init');
228
- shx.chmod('+x', '/etc/penguins-eggs.d/init/unattended.sh');
229
- shx.cp(path.resolve(__dirname, '../../conf/init/cuckoo.sh'), '/etc/penguins-eggs.d/init');
230
- shx.chmod('+x', '/etc/penguins-eggs.d/init/cuckoo.sh');
231
- // creazione cartella exclude.list.d
232
- execSync(`mkdir -p /etc/penguins-eggs.d/exclude.list.d`);
233
- shx.cp(path.resolve(__dirname, '../../conf/exclude.list.d/*'), '/etc/penguins-eggs.d/exclude.list.d');
234
- await this.configurationFresh();
235
- }
236
- /**
237
- * Ritorna vero se machine-id è uguale
238
- */
239
- static async configurationMachineNew(verbose = false) {
240
- const settings = new Settings();
241
- await settings.load();
242
- const result = Utils.machineId() !== settings.config.machine_id;
243
- if (verbose && result) {
244
- console.log('configurationMachineNew: True');
245
- }
246
- return result;
247
- }
248
- /**
249
- * Rimozione dei file di configurazione
250
- */
251
- static async configurationRemove(verbose = true) {
252
- const echo = Utils.setEcho(verbose);
253
- if (fs.existsSync('/etc/penguins-eggs.d')) {
254
- await exec('rm /etc/penguins-eggs.d -rf', echo);
255
- }
256
- if (fs.existsSync('/etc/calamares')) {
257
- await exec('rm /etc/calamares -rf', echo);
258
- }
259
- }
260
- /**
261
- *
262
- * @returns
263
- */
264
- static distro() {
265
- return new Distro();
266
- }
267
- /**
268
- * distroTemplateCheck
269
- */
270
- static distroTemplateCheck() {
271
- const { codenameLikeId } = this.distro();
272
- return fs.existsSync(`/etc/penguins-eggs.d/distros/${codenameLikeId}`);
273
- }
274
- /**
275
- *
276
- */
277
- static async distroTemplateInstall(verbose = false) {
278
- if (verbose) {
279
- console.log('distroTemplateInstall');
280
- }
281
- const echo = Utils.setEcho(verbose);
282
- const rootPen = Utils.rootPenguin();
283
- await exec(`mkdir /etc/penguins-eggs.d/distros/${this.distro().codenameLikeId}`);
284
- /**
285
- * Debian 10 - Buster: è il master per tutte le distro
286
- */
287
- const buster = `${rootPen}/conf/distros/buster`;
288
- /**
289
- * Debian 8 jessie: eredita grub, isolinux e locales da buster, contiene krill al posto di calamares
290
- */
291
- if (this.distro().codenameLikeId === 'jessie') {
292
- const dest = '/etc/penguins-eggs.d/distros/jessie';
293
- await exec(`cp -r ${rootPen}/conf/distros/jessie/krill ${dest}/krill`, echo);
294
- /**
295
- * Debian 9 stretch: eredita grub, isolinux e locales da buster, contiene krill al posto di calamares
296
- */
297
- }
298
- else if (this.distro().codenameLikeId === 'stretch') {
299
- const dest = '/etc/penguins-eggs.d/distros/stretch';
300
- await exec(`cp -r ${rootPen}/conf/distros/jessie/krill ${dest}/krill`, echo);
301
- /**
302
- * Debian 10 buster: eredita tutto da buster
303
- */
304
- }
305
- else if (this.distro().codenameLikeId === 'buster') {
306
- const dest = '/etc/penguins-eggs.d/distros/buster';
307
- await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
308
- /**
309
- * Debian 11 bullseye: eredita tutto da buster
310
- */
311
- }
312
- else if (this.distro().codenameLikeId === 'bullseye') {
313
- const dest = '/etc/penguins-eggs.d/distros/bullseye';
314
- await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
315
- /**
316
- * Debian 12 bookworm: eredita tutto da buster
317
- */
318
- }
319
- else if (this.distro().codenameLikeId === 'bookworm') {
320
- const dest = '/etc/penguins-eggs.d/distros/bookworm';
321
- await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
322
- /**
323
- * Debian 13 trixie: eredita tutto da buster
324
- */
325
- }
326
- else if (this.distro().codenameLikeId === 'trixie') {
327
- const dest = '/etc/penguins-eggs.d/distros/trixie';
328
- await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
329
- /***********************************************************************************
330
- * Devuan
331
- **********************************************************************************/
332
- /**
333
- * Devuan beowulf: eredita tutto da buster
334
- */
335
- }
336
- else if (this.distro().codenameLikeId === 'beowulf') {
337
- const dest = '/etc/penguins-eggs.d/distros/beowulf';
338
- await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
339
- /**
340
- * Devuan chimaera: eredita tutto da buster
341
- */
342
- }
343
- else if (this.distro().codenameLikeId === 'chimaera') {
344
- const dest = '/etc/penguins-eggs.d/distros/chimaera';
345
- await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
346
- /**
347
- * Devuan daedalus: eredita tutto da buster
348
- */
349
- }
350
- else if (this.distro().codenameLikeId === 'daedalus') {
351
- const dest = '/etc/penguins-eggs.d/distros/daedalus';
352
- await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
353
- /***********************************************************************************
354
- * Ubuntu
355
- **********************************************************************************/
356
- /**
357
- * Ubuntu 10.04 bionic: eredita da bionic, focal grub ed isolinux, da buster i seguenti
358
- */
359
- }
360
- else if (this.distro().codenameLikeId === 'bionic') {
361
- const dest = '/etc/penguins-eggs.d/distros/bionic';
362
- const bionic = `${rootPen}/conf/distros/bionic`;
363
- await exec(`cp -r ${bionic}/* ${dest}`, echo);
364
- // Poi da buster
365
- await exec(`cp -r ${buster}/calamares/calamares-modules/cleanup ${dest}/calamares/calamares-modules/cleanup`, echo);
366
- await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
367
- await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-undo ${dest}/calamares/calamares-modules/sources-yolk-undo`, echo);
368
- await exec(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
369
- await exec(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
370
- await exec(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
371
- await exec(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
372
- /**
373
- * Ubuntu focal: eredita da noble e buster
374
- */
375
- }
376
- else if (this.distro().codenameLikeId === 'focal') {
377
- const dest = '/etc/penguins-eggs.d/distros/focal';
378
- const noble = `${rootPen}/conf/distros/noble`;
379
- await exec(`cp -r ${noble}/* ${dest}`, echo);
380
- // backport per focal e jammy: fstab, mount, users
381
- await exec(`cp ${noble}/calamares/modules/focal-jammy/* ${dest}/calamares/modules/`, echo);
382
- await exec(`cp -r ${buster}/calamares/calamares-modules/cleanup ${dest}/calamares/calamares-modules/cleanup`, echo);
383
- await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
384
- await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-undo ${dest}/calamares/calamares-modules/sources-yolk-undo`, echo);
385
- await exec(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
386
- await exec(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
387
- await exec(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
388
- await exec(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
389
- /**
390
- * Ubuntu 22.04 jammy: eredita da noble e buster
391
- */
392
- }
393
- else if (this.distro().codenameLikeId === 'jammy') {
394
- const dest = '/etc/penguins-eggs.d/distros/jammy';
395
- const noble = `${rootPen}/conf/distros/noble`;
396
- await exec(`cp -r ${noble}/* ${dest}`, echo);
397
- // backport per focal e jammy: fstab, mount, users
398
- await exec(`cp ${noble}/calamares/modules/focal-jammy/* ${dest}/calamares/modules/`, echo);
399
- await exec(`cp -r ${buster}/calamares/calamares-modules/cleanup ${dest}/calamares/calamares-modules/cleanup`, echo);
400
- await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
401
- await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-undo ${dest}/calamares/calamares-modules/sources-yolk-undo`, echo);
402
- await exec(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
403
- await exec(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
404
- await exec(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
405
- await exec(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
406
- /**
407
- * Ubuntu noble: e la nuova baseline per ubuntu
408
- *
409
- */
410
- }
411
- else if (this.distro().codenameLikeId === 'noble') {
412
- const dest = '/etc/penguins-eggs.d/distros/noble';
413
- const noble = `${rootPen}/conf/distros/noble`;
414
- await exec(`cp -r ${noble}/* ${dest}`, echo);
415
- await exec(`cp -r ${buster}/calamares/calamares-modules/cleanup ${dest}/calamares/calamares-modules/cleanup`, echo);
416
- await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
417
- await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-undo ${dest}/calamares/calamares-modules/sources-yolk-undo`, echo);
418
- await exec(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
419
- await exec(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
420
- await exec(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
421
- await exec(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
422
- /**
423
- * Ubuntu rhino: eredita da noble e buster
424
- *
425
- */
426
- }
427
- else if (this.distro().codenameLikeId === 'devel') {
428
- const dest = '/etc/penguins-eggs.d/distros/devel';
429
- const noble = `${rootPen}/conf/distros/noble`;
430
- await exec(`cp -r ${noble}/* ${dest}`, echo);
431
- await exec(`cp -r ${buster}/calamares/calamares-modules/cleanup ${dest}/calamares/calamares-modules/cleanup`, echo);
432
- await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
433
- await exec(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-undo ${dest}/calamares/calamares-modules/sources-yolk-undo`, echo);
434
- await exec(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
435
- await exec(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
436
- await exec(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
437
- await exec(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
438
- /***********************************************************************************
439
- * Fedora
440
- **********************************************************************************/
441
- /**
442
- * Fedora 35 ThirtyFive: eredita da ThirtyFive
443
- */
444
- }
445
- else if (this.distro().codenameLikeId === 'thirtyfive') {
446
- const dest = '/etc/penguins-eggs.d/distros/thirtyfive/';
447
- const thirtytive = `${rootPen}/conf/distros/thirtyfive/*`;
448
- await exec(`cp -r ${thirtytive} ${dest}`, echo);
449
- /***********************************************************************************
450
- * Arch Linux
451
- **********************************************************************************/
452
- /**
453
- * Endeavour rolling: eredita da rolling
454
- */
455
- }
456
- else if (this.distro().codenameLikeId === 'rolling') {
457
- const dest = '/etc/penguins-eggs.d/distros/rolling/';
458
- const rolling = `${rootPen}/conf/distros/rolling/*`;
459
- await exec(`cp -r ${rolling} ${dest}`, echo);
460
- /***********************************************************************************
461
- * Alpine
462
- **********************************************************************************/
463
- }
464
- else if (this.distro().codenameLikeId === 'alpine') {
465
- // Prende tutto da buster
466
- const dest = '/etc/penguins-eggs.d/distros/alpine/';
467
- await exec(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
468
- }
469
- }
470
- /**
471
- * Controlla se calamares è installabile
472
- * @returns
473
- */
474
- static isCalamaresAvailable() {
475
- let result = this.distro().isCalamaresAvailable;
476
- if (process.arch === 'arm' || process.arch === 'arm64') {
477
- result = false;
478
- }
479
- return result;
480
- }
481
- /**
482
- *
483
- * @returns true se GUI
484
- */
485
- static isInstalledGui() {
486
- return this.isInstalledXorg() || this.isInstalledWayland();
487
- }
488
- /**
489
- * check if it's installed wayland
490
- * @returns true if wayland
491
- */
492
- static isInstalledWayland() {
493
- let installed = false;
494
- if (this.distro().familyId === 'debian') {
495
- if (Debian.packageIsInstalled('xwayland')) {
496
- installed = true;
497
- }
498
- }
499
- else if (this.distro().familyId === 'fedora') {
500
- if (Fedora.packageIsInstalled('xorg-x11-server-Xwayland*')) {
501
- installed = true;
502
- }
503
- }
504
- else if (this.distro().familyId === 'archlinux') {
505
- if (Archlinux.packageIsInstalled('xwayland')) {
506
- installed = true;
507
- }
508
- }
509
- else if (this.distro().familyId === 'alpine' && Alpine.packageIsInstalled('xwayland*')) {
510
- installed = true;
511
- }
512
- return installed;
513
- }
514
- /**
515
- * check if it's installed xorg
516
- * @returns
517
- */
518
- static isInstalledXorg() {
519
- let installed = false;
520
- if (this.distro().familyId === 'debian') {
521
- if (Debian.packageIsInstalled('xserver-xorg-core')) {
522
- installed = true;
523
- }
524
- }
525
- else if (this.distro().familyId === 'fedora') {
526
- if (Fedora.packageIsInstalled('xorg-x11-server-Xorg.x86_64')) {
527
- installed = true;
528
- }
529
- }
530
- else if (this.distro().familyId === 'archlinux') {
531
- if (Archlinux.packageIsInstalled('xorg-server-common')) {
532
- installed = true;
533
- }
534
- }
535
- else if (this.distro().familyId === 'alpine' && Alpine.packageIsInstalled('xorg-server')) {
536
- installed = true;
537
- }
538
- return installed;
539
- }
540
- /**
541
- * Check if the system is just CLI
542
- */
543
- static isRunningCli() {
544
- return !this.isRunningGui();
545
- }
546
- /**
547
- * Check if the system is GUI able
548
- */
549
- static isRunningGui() {
550
- return this.isRunningXorg() || this.isRunningWayland();
551
- }
552
- /**
553
- * Constrolla se è operante wayland
554
- */
555
- static isRunningWayland() {
556
- return process.env.XDG_SESSION_TYPE === 'wayland';
557
- }
558
- /**
559
- * controlla se è operante xserver-xorg-core
560
- */
561
- static isRunningXorg() {
562
- return process.env.XDG_SESSION_TYPE === 'x11';
563
- }
564
- /**
565
- * Check se la macchina ha grub adatto ad efi
566
- * Forse conviene spostarlo in pacman
567
- */
568
- static isUefi() {
569
- let isUefi = false;
570
- if (this.distro().familyId === 'debian') {
571
- if (Utils.uefiArch() !== 'i386' && this.packageIsInstalled('grub-efi-' + Utils.uefiArch() + '-bin')) {
572
- isUefi = true;
573
- }
574
- }
575
- else if (Pacman.distro().familyId === 'fedora') {
576
- isUefi = true;
577
- }
578
- else if (Pacman.distro().familyId === 'archlinux') {
579
- isUefi = true;
580
- }
581
- else if (Pacman.distro().familyId === 'alpine') {
582
- isUefi = true;
583
- }
584
- return isUefi;
585
- }
586
- /**
587
- * Installa manPage
588
- */
589
- static async manPageInstall(verbose = false) {
590
- const manPageSrc = path.resolve(__dirname, '../../manpages/doc/man/eggs.roll.gz');
591
- if (fs.existsSync(manPageSrc)) {
592
- const man1Dir = '/usr/share/man/man1/';
593
- if (!fs.existsSync(man1Dir)) {
594
- exec(`mkdir ${man1Dir} -p`);
595
- }
596
- const manPageDest = man1Dir + 'eggs.1.gz';
597
- exec(`cp ${manPageSrc} ${manPageDest}`);
598
- if (shx.exec('which mandb', { silent: true }).stdout.trim() !== '') {
599
- await exec('mandb > /dev/null');
600
- if (verbose) {
601
- console.log('manPage eggs installed...');
602
- }
603
- }
604
- }
605
- }
606
- /**
607
- * restuisce VERO se il pacchetto è installato
608
- * @param debPackage
609
- */
610
- static async packageAptAvailable(packageName) {
611
- let available = false;
612
- if (this.distro().familyId === 'debian') {
613
- available = Debian.packageIsInstalled(packageName);
614
- }
615
- return available;
616
- }
617
- /**
618
- *
619
- * @param debPackage
620
- * @returns
621
- */
622
- static async packageAptLast(debPackage) {
623
- let version = '';
624
- if (this.distro().familyId === 'debian') {
625
- version = await Debian.packageAptLast(debPackage);
626
- }
627
- return version;
628
- }
629
- /**
630
- * Install the package packageName
631
- * @param packageName {string} Pacchetto Debian da installare
632
- * @returns {boolean} True if success
633
- */
634
- static async packageInstall(packageName) {
635
- let retVal = false;
636
- if (this.distro().familyId === 'debian') {
637
- retVal = await Debian.packageInstall(packageName);
638
- }
639
- else if (this.distro().familyId === 'archlinux') {
640
- retVal = await Archlinux.packageInstall(packageName);
641
- }
642
- else if (this.distro().familyId === 'fedora') {
643
- retVal = await Fedora.packageInstall(packageName);
644
- }
645
- else if (this.distro().familyId === 'alpine') {
646
- retVal = await Alpine.packageInstall(packageName);
647
- }
648
- return retVal;
649
- }
650
- /**
651
- * restuisce VERO se il pacchetto è installato
652
- * @param debPackage
653
- */
654
- static packageIsInstalled(packageName) {
655
- let installed = false;
656
- if (this.distro().familyId === 'debian') {
657
- installed = Debian.packageIsInstalled(packageName);
658
- }
659
- else if (this.distro().familyId === 'fedora') {
660
- installed = Fedora.packageIsInstalled(packageName);
661
- }
662
- else if (this.distro().familyId === 'archlinux') {
663
- installed = Archlinux.packageIsInstalled(packageName);
664
- }
665
- else if (this.distro().familyId === 'alpine') {
666
- installed = Alpine.packageIsInstalled(packageName);
667
- }
668
- return installed;
669
- }
670
- static async packageNpmLast(packageNpm = 'penguins-eggs') {
671
- return shx.exec('npm show ' + packageNpm + ' version', { silent: true }).stdout.trim();
672
- }
673
- /**
674
- *
675
- * @returns grub
676
- */
677
- static whichGrubIsInstalled() {
678
- let grubInstalled = '';
679
- if (this.distro().familyId === 'debian') {
680
- if (this.packageIsInstalled('grub-common')) {
681
- grubInstalled = 'grub';
682
- }
683
- }
684
- else if (this.distro().familyId === 'fedora') {
685
- if (this.packageIsInstalled('grub2-common.noarch')) {
686
- grubInstalled = 'grub2';
687
- }
688
- }
689
- else if (this.distro().familyId === 'archlinux') {
690
- if (this.packageIsInstalled('grub')) {
691
- grubInstalled = 'grub';
692
- }
693
- }
694
- else if (this.distro().familyId === 'alpine') {
695
- grubInstalled = 'grub';
696
- }
697
- return grubInstalled;
698
- }
699
- }