penguins-eggs 9.2.6 → 9.3.1

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 (331) hide show
  1. package/.oclif.manifest.json +1 -0
  2. package/README.md +53 -31
  3. package/conf/distros/kinetic/README.md +41 -0
  4. package/conf/tools.yaml +1 -1
  5. package/{lib → dist}/classes/bleach.js +0 -0
  6. package/{lib → dist}/classes/compressors.js +0 -0
  7. package/{lib → dist}/classes/daddy.js +0 -0
  8. package/{lib → dist}/classes/distro.js +14 -30
  9. package/{lib → dist}/classes/family/archlinux.js +0 -0
  10. package/{lib → dist}/classes/family/debian.js +0 -0
  11. package/{lib → dist}/classes/family/fedora.js +0 -0
  12. package/{lib → dist}/classes/family/suse.js +0 -0
  13. package/{lib → dist}/classes/incubation/branding.js +0 -0
  14. package/{lib → dist}/classes/incubation/distros/bionic.js +0 -0
  15. package/{lib → dist}/classes/incubation/distros/buster.js +0 -0
  16. package/{lib → dist}/classes/incubation/distros/focal.js +0 -0
  17. package/{lib → dist}/classes/incubation/distros/jessie.js +0 -0
  18. package/{lib → dist}/classes/incubation/distros/rolling.js +0 -0
  19. package/{lib → dist}/classes/incubation/fisherman-helper/displaymanager.js +0 -0
  20. package/{lib → dist}/classes/incubation/fisherman-helper/packages.js +0 -0
  21. package/{lib → dist}/classes/incubation/fisherman.js +0 -0
  22. package/{lib → dist}/classes/incubation/incubator.js +9 -19
  23. package/{lib → dist}/classes/incubation/installer.js +0 -0
  24. package/{lib → dist}/classes/initrd.js +0 -0
  25. package/{lib → dist}/classes/keyboards.js +0 -0
  26. package/{lib → dist}/classes/locales.js +0 -0
  27. package/{lib → dist}/classes/n8.js +0 -0
  28. package/dist/classes/network.js +99 -0
  29. package/{lib → dist}/classes/ovary.js +0 -0
  30. package/{lib → dist}/classes/pacman.js +16 -1
  31. package/{lib → dist}/classes/pve-live.js +0 -0
  32. package/dist/classes/pxe.js +337 -0
  33. package/{lib → dist}/classes/settings.js +0 -0
  34. package/{lib → dist}/classes/sources_list.js +0 -0
  35. package/{lib → dist}/classes/systemctl.js +0 -0
  36. package/{lib → dist}/classes/tailor.js +0 -0
  37. package/{lib → dist}/classes/tools.js +0 -0
  38. package/{lib → dist}/classes/users.js +0 -0
  39. package/{lib → dist}/classes/utils.js +82 -17
  40. package/{lib → dist}/classes/xdg.js +27 -26
  41. package/{lib → dist}/classes/yolk.js +0 -0
  42. package/{lib → dist}/commands/adapt.js +0 -0
  43. package/{lib → dist}/commands/analyze.js +0 -0
  44. package/{lib → dist}/commands/calamares.js +0 -0
  45. package/{lib → dist}/commands/config.js +0 -0
  46. package/dist/commands/cuckoo.js +63 -0
  47. package/{lib → dist}/commands/dad.js +0 -0
  48. package/{lib → dist}/commands/export/deb.js +0 -0
  49. package/{lib → dist}/commands/export/docs.js +0 -0
  50. package/{lib → dist}/commands/export/iso.js +0 -0
  51. package/{lib → dist}/commands/install.js +26 -5
  52. package/{lib → dist}/commands/kill.js +0 -0
  53. package/{lib → dist}/commands/mom.js +0 -0
  54. package/{lib → dist}/commands/produce.js +0 -0
  55. package/{lib → dist}/commands/status.js +0 -0
  56. package/{lib → dist}/commands/syncfrom.js +0 -0
  57. package/{lib → dist}/commands/syncto.js +0 -0
  58. package/{lib → dist}/commands/tools/clean.js +0 -0
  59. package/dist/commands/tools/ppa.js +82 -0
  60. package/{lib → dist}/commands/tools/skel.js +0 -0
  61. package/{lib → dist}/commands/tools/stat.js +0 -0
  62. package/{lib → dist}/commands/tools/yolk.js +0 -0
  63. package/{lib → dist}/commands/update.js +0 -0
  64. package/{lib → dist}/commands/wardrobe/get.js +0 -0
  65. package/{lib → dist}/commands/wardrobe/ironing.js +0 -0
  66. package/{lib → dist}/commands/wardrobe/list.js +0 -0
  67. package/{lib → dist}/commands/wardrobe/show.js +0 -0
  68. package/{lib → dist}/commands/wardrobe/wear.js +0 -0
  69. package/{lib → dist}/components/elements/information.js +0 -0
  70. package/{lib → dist}/components/elements/steps.js +0 -0
  71. package/{lib → dist}/components/elements/title.js +0 -0
  72. package/{lib → dist}/components/finished.js +0 -0
  73. package/{lib → dist}/components/install.js +0 -0
  74. package/{lib → dist}/components/keyboard.js +0 -0
  75. package/{lib → dist}/components/location.js +0 -0
  76. package/{lib → dist}/components/network.js +0 -0
  77. package/{lib → dist}/components/partitions.js +0 -0
  78. package/{lib → dist}/components/summary.js +2 -2
  79. package/{lib → dist}/components/users.js +0 -0
  80. package/{lib → dist}/components/welcome.js +0 -0
  81. package/dist/dhcpd/dhcpd.js +222 -0
  82. package/dist/dhcpd/index.js +7 -0
  83. package/dist/dhcpd/packet/converters.js +377 -0
  84. package/dist/dhcpd/packet/options.js +2 -0
  85. package/dist/dhcpd/packet/types.js +2 -0
  86. package/dist/dhcpd/packet.js +251 -0
  87. package/dist/dhcpd/proxy.js +152 -0
  88. package/dist/dhcpd/server.js +152 -0
  89. package/dist/dhcpd/sprintf.js +170 -0
  90. package/dist/dhcpd/utils.js +190 -0
  91. package/{lib → dist}/index.js +0 -0
  92. package/{lib → dist}/interfaces/i-addons.js +0 -0
  93. package/{lib → dist}/interfaces/i-analyze.js +0 -0
  94. package/{lib → dist}/interfaces/i-app.js +0 -0
  95. package/{lib → dist}/interfaces/i-branding.js +0 -0
  96. package/{lib → dist}/interfaces/i-config-tools.js +0 -0
  97. package/{lib → dist}/interfaces/i-devices.js +0 -0
  98. package/{lib → dist}/interfaces/i-distro.js +0 -0
  99. package/{lib → dist}/interfaces/i-drive-list.js +0 -0
  100. package/{lib → dist}/interfaces/i-eggs-config.js +0 -0
  101. package/{lib → dist}/interfaces/i-exec.js +0 -0
  102. package/{lib → dist}/interfaces/i-initrd.js +0 -0
  103. package/{lib → dist}/interfaces/i-install.js +0 -0
  104. package/{lib → dist}/interfaces/i-installer.js +0 -0
  105. package/{lib → dist}/interfaces/i-krill-config.js +0 -0
  106. package/{lib → dist}/interfaces/i-krill.js +0 -0
  107. package/{lib → dist}/interfaces/i-materia.js +0 -0
  108. package/{lib → dist}/interfaces/i-net.js +0 -0
  109. package/{lib → dist}/interfaces/i-packages.js +0 -0
  110. package/{lib → dist}/interfaces/i-partitions.js +0 -0
  111. package/{lib/interfaces/i-remix.js → dist/interfaces/i-pxe-options.js} +0 -0
  112. package/{lib/interfaces/i-settings.js → dist/interfaces/i-remix.js} +0 -0
  113. package/{lib/interfaces/i-user.js → dist/interfaces/i-settings.js} +0 -0
  114. package/{lib/interfaces/i-workdir.js → dist/interfaces/i-user.js} +0 -0
  115. package/{lib/interfaces/i-xkb-model.js → dist/interfaces/i-workdir.js} +0 -0
  116. package/{lib/interfaces/index.js → dist/interfaces/i-xkb-model.js} +0 -0
  117. package/dist/interfaces/index.js +2 -0
  118. package/{lib → dist}/krill/krill-prepare.js +20 -4
  119. package/{lib → dist}/krill/krill-sequence.js +64 -62
  120. package/{lib → dist}/krill/modules/add-user.js +0 -0
  121. package/{lib → dist}/krill/modules/bootloader-config-ubuntu.js +0 -0
  122. package/{lib → dist}/krill/modules/bootloader-config.js +1 -1
  123. package/{lib → dist}/krill/modules/bootloader.js +0 -5
  124. package/{lib → dist}/krill/modules/change-password.js +0 -0
  125. package/{lib → dist}/krill/modules/del-live-user.js +0 -0
  126. package/{lib → dist}/krill/modules/fstab.js +0 -0
  127. package/{lib → dist}/krill/modules/grubcfg.js +0 -0
  128. package/{lib → dist}/krill/modules/hostname.js +2 -2
  129. package/{lib → dist}/krill/modules/initramfs-cfg.js +0 -0
  130. package/{lib → dist}/krill/modules/initramfs.js +0 -0
  131. package/{lib → dist}/krill/modules/locale-cfg.js +0 -0
  132. package/{lib → dist}/krill/modules/locale.js +1 -1
  133. package/{lib/krill/modules/set-keyboard.js → dist/krill/modules/m-keyboard.js} +7 -3
  134. package/{lib/krill/modules/set-timezone.js → dist/krill/modules/m-timezone.js} +2 -2
  135. package/{lib → dist}/krill/modules/machine-id.js +0 -0
  136. package/{lib → dist}/krill/modules/mkfs.js +0 -0
  137. package/{lib → dist}/krill/modules/mount-fs.js +0 -0
  138. package/{lib → dist}/krill/modules/mount-vfs.js +0 -0
  139. package/{lib → dist}/krill/modules/network-cfg.js +0 -0
  140. package/{lib → dist}/krill/modules/packages.js +0 -0
  141. package/{lib → dist}/krill/modules/partition.js +1 -1
  142. package/{lib → dist}/krill/modules/remove-installer-link.js +0 -0
  143. package/{lib → dist}/krill/modules/umount.js +0 -0
  144. package/{lib → dist}/krill/modules/unpackfs.js +0 -0
  145. package/{lib → dist}/lib/cli-autologin.js +0 -0
  146. package/{lib → dist}/lib/dependencies.js +1 -0
  147. package/{lib → dist}/lib/get_address.js +0 -0
  148. package/{lib → dist}/lib/get_dns.js +0 -0
  149. package/{lib → dist}/lib/get_domain.js +0 -0
  150. package/{lib → dist}/lib/get_gateway.js +0 -0
  151. package/{lib → dist}/lib/get_hostname.js +0 -0
  152. package/{lib → dist}/lib/get_netmask.js +0 -0
  153. package/{lib → dist}/lib/get_password.js +0 -0
  154. package/{lib → dist}/lib/get_root_password.js +0 -0
  155. package/{lib → dist}/lib/get_userfullname.js +0 -0
  156. package/{lib → dist}/lib/get_username.js +0 -0
  157. package/{lib → dist}/lib/select_address_type.js +0 -0
  158. package/{lib → dist}/lib/select_filesystem_type.js +0 -0
  159. package/{lib → dist}/lib/select_installation_device.js +0 -0
  160. package/{lib → dist}/lib/select_installation_mode.js +0 -0
  161. package/{lib → dist}/lib/select_interface.js +0 -0
  162. package/{lib → dist}/lib/select_keyboard_layout.js +0 -0
  163. package/{lib → dist}/lib/select_keyboard_model.js +0 -0
  164. package/{lib → dist}/lib/select_keyboard_option.js +0 -0
  165. package/{lib → dist}/lib/select_keyboard_variant.js +0 -0
  166. package/{lib → dist}/lib/select_languages.js +0 -0
  167. package/{lib → dist}/lib/select_regions.js +0 -0
  168. package/{lib → dist}/lib/select_user_swap_choice.js +0 -0
  169. package/{lib → dist}/lib/select_zones.js +0 -0
  170. package/{lib → dist}/lib/utils.js +1 -2
  171. package/ipxe/ipxe.efi +0 -0
  172. package/package.json +21 -18
  173. package/scripts/_eggs +11 -7
  174. package/scripts/eggs.bash +2 -2
  175. package/lib/classes/bleach.d.ts +0 -40
  176. package/lib/classes/compressors.d.ts +0 -24
  177. package/lib/classes/daddy.d.ts +0 -11
  178. package/lib/classes/distro.d.ts +0 -31
  179. package/lib/classes/family/archlinux.d.ts +0 -69
  180. package/lib/classes/family/debian.d.ts +0 -68
  181. package/lib/classes/family/fedora.d.ts +0 -63
  182. package/lib/classes/family/suse.d.ts +0 -63
  183. package/lib/classes/incubation/branding.d.ts +0 -8
  184. package/lib/classes/incubation/distros/bionic.d.ts +0 -29
  185. package/lib/classes/incubation/distros/buster.d.ts +0 -31
  186. package/lib/classes/incubation/distros/focal.d.ts +0 -29
  187. package/lib/classes/incubation/distros/jessie.d.ts +0 -32
  188. package/lib/classes/incubation/distros/rolling.d.ts +0 -31
  189. package/lib/classes/incubation/fisherman-helper/displaymanager.d.ts +0 -7
  190. package/lib/classes/incubation/fisherman-helper/packages.d.ts +0 -19
  191. package/lib/classes/incubation/fisherman.d.ts +0 -77
  192. package/lib/classes/incubation/incubator.d.ts +0 -35
  193. package/lib/classes/incubation/installer.d.ts +0 -15
  194. package/lib/classes/initrd.d.ts +0 -42
  195. package/lib/classes/keyboards.d.ts +0 -43
  196. package/lib/classes/locales.d.ts +0 -14
  197. package/lib/classes/n8.d.ts +0 -16
  198. package/lib/classes/ovary.d.ts +0 -179
  199. package/lib/classes/pacman.d.ts +0 -164
  200. package/lib/classes/pve-live.d.ts +0 -42
  201. package/lib/classes/pxe.d.ts +0 -64
  202. package/lib/classes/pxe.js +0 -376
  203. package/lib/classes/settings.d.ts +0 -55
  204. package/lib/classes/sources_list.d.ts +0 -27
  205. package/lib/classes/systemctl.d.ts +0 -46
  206. package/lib/classes/tailor.d.ts +0 -43
  207. package/lib/classes/tools.d.ts +0 -29
  208. package/lib/classes/users.d.ts +0 -21
  209. package/lib/classes/utils.d.ts +0 -299
  210. package/lib/classes/xdg.d.ts +0 -44
  211. package/lib/classes/yolk.d.ts +0 -26
  212. package/lib/commands/adapt.d.ts +0 -9
  213. package/lib/commands/analyze.d.ts +0 -25
  214. package/lib/commands/calamares.d.ts +0 -26
  215. package/lib/commands/config.d.ts +0 -34
  216. package/lib/commands/cuckoo.d.ts +0 -24
  217. package/lib/commands/cuckoo.js +0 -70
  218. package/lib/commands/dad.d.ts +0 -17
  219. package/lib/commands/export/deb.d.ts +0 -14
  220. package/lib/commands/export/docs.d.ts +0 -8
  221. package/lib/commands/export/iso.d.ts +0 -13
  222. package/lib/commands/install.d.ts +0 -26
  223. package/lib/commands/kill.d.ts +0 -20
  224. package/lib/commands/mom.d.ts +0 -14
  225. package/lib/commands/produce.d.ts +0 -28
  226. package/lib/commands/status.d.ts +0 -18
  227. package/lib/commands/syncfrom.d.ts +0 -42
  228. package/lib/commands/syncto.d.ts +0 -67
  229. package/lib/commands/tools/clean.d.ts +0 -15
  230. package/lib/commands/tools/skel.d.ts +0 -17
  231. package/lib/commands/tools/stat.d.ts +0 -14
  232. package/lib/commands/tools/yolk.d.ts +0 -23
  233. package/lib/commands/update.d.ts +0 -46
  234. package/lib/commands/wardrobe/get.d.ts +0 -17
  235. package/lib/commands/wardrobe/ironing.d.ts +0 -18
  236. package/lib/commands/wardrobe/list.d.ts +0 -17
  237. package/lib/commands/wardrobe/show.d.ts +0 -19
  238. package/lib/commands/wardrobe/wear.d.ts +0 -21
  239. package/lib/components/elements/information.d.ts +0 -4
  240. package/lib/components/elements/steps.d.ts +0 -6
  241. package/lib/components/elements/title.d.ts +0 -4
  242. package/lib/components/finished.d.ts +0 -8
  243. package/lib/components/install.d.ts +0 -8
  244. package/lib/components/keyboard.d.ts +0 -12
  245. package/lib/components/location.d.ts +0 -12
  246. package/lib/components/network.d.ts +0 -12
  247. package/lib/components/partitions.d.ts +0 -9
  248. package/lib/components/summary.d.ts +0 -16
  249. package/lib/components/users.d.ts +0 -20
  250. package/lib/components/welcome.d.ts +0 -6
  251. package/lib/index.d.ts +0 -1
  252. package/lib/interfaces/i-addons.d.ts +0 -8
  253. package/lib/interfaces/i-analyze.d.ts +0 -13
  254. package/lib/interfaces/i-app.d.ts +0 -7
  255. package/lib/interfaces/i-branding.d.ts +0 -29
  256. package/lib/interfaces/i-config-tools.d.ts +0 -11
  257. package/lib/interfaces/i-devices.d.ts +0 -13
  258. package/lib/interfaces/i-distro.d.ts +0 -19
  259. package/lib/interfaces/i-drive-list.d.ts +0 -29
  260. package/lib/interfaces/i-eggs-config.d.ts +0 -24
  261. package/lib/interfaces/i-exec.d.ts +0 -4
  262. package/lib/interfaces/i-initrd.d.ts +0 -6
  263. package/lib/interfaces/i-install.d.ts +0 -9
  264. package/lib/interfaces/i-installer.d.ts +0 -20
  265. package/lib/interfaces/i-krill-config.d.ts +0 -26
  266. package/lib/interfaces/i-krill.d.ts +0 -35
  267. package/lib/interfaces/i-materia.d.ts +0 -36
  268. package/lib/interfaces/i-net.d.ts +0 -9
  269. package/lib/interfaces/i-packages.d.ts +0 -10
  270. package/lib/interfaces/i-partitions.d.ts +0 -9
  271. package/lib/interfaces/i-remix.d.ts +0 -14
  272. package/lib/interfaces/i-settings.d.ts +0 -10
  273. package/lib/interfaces/i-user.d.ts +0 -7
  274. package/lib/interfaces/i-workdir.d.ts +0 -8
  275. package/lib/interfaces/i-xkb-model.d.ts +0 -17
  276. package/lib/interfaces/index.d.ts +0 -17
  277. package/lib/krill/krill-prepare.d.ts +0 -60
  278. package/lib/krill/krill-sequence.d.ts +0 -150
  279. package/lib/krill/modules/add-user.d.ts +0 -15
  280. package/lib/krill/modules/bootloader-config-arch.d.ts +0 -9
  281. package/lib/krill/modules/bootloader-config-arch.js +0 -13
  282. package/lib/krill/modules/bootloader-config-ubuntu.d.ts +0 -9
  283. package/lib/krill/modules/bootloader-config.d.ts +0 -9
  284. package/lib/krill/modules/bootloader.d.ts +0 -10
  285. package/lib/krill/modules/change-password.d.ts +0 -10
  286. package/lib/krill/modules/del-live-user.d.ts +0 -9
  287. package/lib/krill/modules/fstab.d.ts +0 -14
  288. package/lib/krill/modules/grubcfg.d.ts +0 -17
  289. package/lib/krill/modules/hostname.d.ts +0 -13
  290. package/lib/krill/modules/initramfs-cfg.d.ts +0 -14
  291. package/lib/krill/modules/initramfs.d.ts +0 -13
  292. package/lib/krill/modules/locale-cfg.d.ts +0 -10
  293. package/lib/krill/modules/locale.d.ts +0 -13
  294. package/lib/krill/modules/machine-id.d.ts +0 -15
  295. package/lib/krill/modules/mkfs.d.ts +0 -13
  296. package/lib/krill/modules/mount-fs.d.ts +0 -17
  297. package/lib/krill/modules/mount-vfs.d.ts +0 -17
  298. package/lib/krill/modules/network-cfg.d.ts +0 -19
  299. package/lib/krill/modules/packages.d.ts +0 -14
  300. package/lib/krill/modules/partition.d.ts +0 -20
  301. package/lib/krill/modules/remove-installer-link.d.ts +0 -13
  302. package/lib/krill/modules/set-keyboard.d.ts +0 -10
  303. package/lib/krill/modules/set-timezone.d.ts +0 -14
  304. package/lib/krill/modules/umount.d.ts +0 -14
  305. package/lib/krill/modules/unpackfs.d.ts +0 -13
  306. package/lib/lib/cli-autologin.d.ts +0 -27
  307. package/lib/lib/dependencies.d.ts +0 -49
  308. package/lib/lib/get_address.d.ts +0 -1
  309. package/lib/lib/get_dns.d.ts +0 -1
  310. package/lib/lib/get_domain.d.ts +0 -1
  311. package/lib/lib/get_gateway.d.ts +0 -1
  312. package/lib/lib/get_hostname.d.ts +0 -1
  313. package/lib/lib/get_netmask.d.ts +0 -1
  314. package/lib/lib/get_password.d.ts +0 -1
  315. package/lib/lib/get_root_password.d.ts +0 -1
  316. package/lib/lib/get_userfullname.d.ts +0 -1
  317. package/lib/lib/get_username.d.ts +0 -1
  318. package/lib/lib/select_address_type.d.ts +0 -1
  319. package/lib/lib/select_filesystem_type.d.ts +0 -1
  320. package/lib/lib/select_installation_device.d.ts +0 -1
  321. package/lib/lib/select_installation_mode.d.ts +0 -1
  322. package/lib/lib/select_interface.d.ts +0 -1
  323. package/lib/lib/select_keyboard_layout.d.ts +0 -4
  324. package/lib/lib/select_keyboard_model.d.ts +0 -4
  325. package/lib/lib/select_keyboard_option.d.ts +0 -4
  326. package/lib/lib/select_keyboard_variant.d.ts +0 -4
  327. package/lib/lib/select_languages.d.ts +0 -1
  328. package/lib/lib/select_regions.d.ts +0 -1
  329. package/lib/lib/select_user_swap_choice.d.ts +0 -1
  330. package/lib/lib/select_zones.d.ts +0 -1
  331. package/lib/lib/utils.d.ts +0 -43
@@ -1,64 +0,0 @@
1
- /**
2
- * penguins-eggs: pxe.ts
3
- * author: Piero Proietti
4
- * mail: piero.proietti@gmail.com
5
- */
6
- import Settings from '../classes/settings';
7
- /**
8
- * Pxe:
9
- */
10
- export default class Pxe {
11
- verbose: boolean;
12
- echo: {};
13
- settings: Settings;
14
- bootLabel: string;
15
- pxeRoot: string;
16
- isoRoot: string;
17
- vmlinuz: string;
18
- initrd: string;
19
- isos: string[];
20
- /**
21
- * fertilization()
22
- */
23
- fertilization(): Promise<void>;
24
- /**
25
- * build
26
- */
27
- build(): Promise<void>;
28
- /**
29
- * configure PXE bios
30
- */
31
- bios(): Promise<void>;
32
- /**
33
- * configure PXE UEFI
34
- */
35
- uefi(): Promise<void>;
36
- /**
37
- * configure PXE html
38
- */
39
- html(): Promise<void>;
40
- /**
41
- *
42
- * @param real
43
- */
44
- dhcp(real?: boolean, dnsmasq?: boolean): Promise<void>;
45
- /**
46
- *
47
- */
48
- private nodeDhcp;
49
- /**
50
- *
51
- * @param real
52
- */
53
- private dnsmasq;
54
- /**
55
- * start http server for images
56
- *
57
- */
58
- httpStart(): Promise<void>;
59
- /**
60
- *
61
- * @param cmd
62
- */
63
- tryCatch(cmd?: string): Promise<void>;
64
- }
@@ -1,376 +0,0 @@
1
- "use strict";
2
- /**
3
- * penguins-eggs: pxe.ts
4
- * author: Piero Proietti
5
- * mail: piero.proietti@gmail.com
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- const tslib_1 = require("tslib");
9
- const fs_1 = tslib_1.__importDefault(require("fs"));
10
- const netmask_1 = require("netmask");
11
- const node_static_1 = tslib_1.__importDefault(require("node-static"));
12
- const http_1 = tslib_1.__importDefault(require("http"));
13
- const node_path_1 = tslib_1.__importDefault(require("node:path"));
14
- const utils_1 = tslib_1.__importDefault(require("../classes/utils"));
15
- const settings_1 = tslib_1.__importDefault(require("../classes/settings"));
16
- const utils_2 = require("../lib/utils");
17
- /**
18
- * Pxe:
19
- */
20
- class Pxe {
21
- constructor() {
22
- this.verbose = false;
23
- this.echo = {};
24
- this.settings = {};
25
- this.bootLabel = '';
26
- this.pxeRoot = '';
27
- this.isoRoot = '';
28
- this.vmlinuz = '';
29
- this.initrd = '';
30
- this.isos = [];
31
- }
32
- /**
33
- * fertilization()
34
- */
35
- async fertilization() {
36
- this.settings = new settings_1.default();
37
- await this.settings.load();
38
- if (utils_1.default.isLive()) {
39
- this.isoRoot = this.settings.distro.liveMediumPath;
40
- }
41
- else {
42
- this.isoRoot = node_path_1.default.dirname(this.settings.work_dir.path) + '/ovarium/iso/';
43
- }
44
- if (!utils_1.default.isLive() && !fs_1.default.existsSync(this.settings.work_dir.path)) {
45
- console.log('no image available, build an image with: sudo eggs produce');
46
- process.exit();
47
- }
48
- /**
49
- * se pxeRoot non esiste viene creato
50
- */
51
- this.pxeRoot = node_path_1.default.dirname(this.settings.work_dir.path) + '/pxe/';
52
- if (!fs_1.default.existsSync(this.pxeRoot)) {
53
- await (0, utils_2.exec)(`mkdir ${this.pxeRoot} -p`);
54
- }
55
- /**
56
- * Ricerca delle immagini ISO
57
- */
58
- let isos = [];
59
- if (!utils_1.default.isLive()) {
60
- let isos = fs_1.default.readdirSync(node_path_1.default.dirname(this.settings.work_dir.path));
61
- for (const iso of isos) {
62
- if (node_path_1.default.extname(iso) === ".iso") {
63
- this.isos.push(iso);
64
- }
65
- }
66
- }
67
- /**
68
- * installed: /home/eggs/ovarium/iso/live
69
- * live: this.iso/live
70
- */
71
- let pathFiles = this.isoRoot + '/live';
72
- let files = fs_1.default.readdirSync(pathFiles);
73
- for (const file of files) {
74
- if (node_path_1.default.basename(file).substring(0, 7) === 'vmlinuz') {
75
- this.vmlinuz = node_path_1.default.basename(file);
76
- }
77
- if (node_path_1.default.basename(file).substring(0, 6) === 'initrd') {
78
- this.initrd = node_path_1.default.basename(file);
79
- }
80
- }
81
- /**
82
- * bootLabel
83
- */
84
- const a = fs_1.default.readFileSync(this.isoRoot + '/.disk/mkisofs', "utf-8");
85
- const b = a.substring(a.indexOf('-o ') + 3);
86
- const c = b.substring(0, b.indexOf(' '));
87
- this.bootLabel = c.substring(c.lastIndexOf('/') + 1);
88
- }
89
- /**
90
- * build
91
- */
92
- async build() {
93
- if (fs_1.default.existsSync(this.pxeRoot)) {
94
- await this.tryCatch(`rm ${this.pxeRoot} -rf`);
95
- }
96
- let cmd = `mkdir -p ${this.pxeRoot}`;
97
- await this.tryCatch(cmd);
98
- await this.tryCatch(`mkdir ${this.pxeRoot} -p`);
99
- await this.tryCatch(`ln -s ${this.isoRoot}live ${this.pxeRoot}/live`);
100
- await this.tryCatch(`ln -s ${this.isoRoot}.disk ${this.pxeRoot}/.disk`);
101
- // Qua copio vmlinuz e initrd per renderli scrivibili
102
- await this.tryCatch(`cp ${this.isoRoot}live/${this.vmlinuz} ${this.pxeRoot}/vmlinuz`);
103
- await this.tryCatch(`chmod 777 ${this.pxeRoot}/vmlinuz`);
104
- await this.tryCatch(`cp ${this.isoRoot}live/${this.initrd} ${this.pxeRoot}/initrd`);
105
- await this.tryCatch(`chmod 777 ${this.pxeRoot}/initrd`);
106
- // link iso images in pxe
107
- for (const iso of this.isos) {
108
- await this.tryCatch(`ln /home/eggs/${iso} ${this.pxeRoot}/${iso}`);
109
- }
110
- await this.bios();
111
- await this.uefi();
112
- await this.html();
113
- }
114
- /**
115
- * configure PXE bios
116
- */
117
- async bios() {
118
- // isolinux.theme.cfg, splash.png MUST to be on root
119
- await this.tryCatch(`ln -s ${this.isoRoot}isolinux/isolinux.theme.cfg ${this.pxeRoot}/isolinux.theme.cfg`);
120
- await this.tryCatch(`ln -s ${this.isoRoot}isolinux/splash.png ${this.pxeRoot}/splash.png`);
121
- // pxe
122
- const distro = this.settings.distro;
123
- await this.tryCatch(`ln ${distro.pxelinuxPath}pxelinux.0 ${this.pxeRoot}/pxelinux.0`);
124
- await this.tryCatch(`ln ${distro.pxelinuxPath}lpxelinux.0 ${this.pxeRoot}/lpxelinux.0`);
125
- // syslinux
126
- await this.tryCatch(`ln ${distro.syslinuxPath}ldlinux.c32 ${this.pxeRoot}/ldlinux.c32`);
127
- await this.tryCatch(`ln ${distro.syslinuxPath}vesamenu.c32 ${this.pxeRoot}/vesamenu.c32`);
128
- await this.tryCatch(`ln ${distro.syslinuxPath}libcom32.c32 ${this.pxeRoot}/libcom32.c32`);
129
- await this.tryCatch(`ln ${distro.syslinuxPath}libutil.c32 ${this.pxeRoot}/libutil.c32`);
130
- await this.tryCatch(`ln /usr/lib/syslinux/memdisk ${this.pxeRoot}/memdisk`);
131
- await this.tryCatch(`mkdir ${this.pxeRoot}/pxelinux.cfg`);
132
- let content = ``;
133
- content += `# eggs: pxelinux.cfg/default\n`;
134
- content += `# search path for the c32 support libraries (libcom32, libutil etc.)\n`;
135
- content += `path\n`;
136
- content += `include isolinux.theme.cfg\n`;
137
- content += `UI vesamenu.c32\n`;
138
- content += `\n`;
139
- content += `menu title Penguin's eggs - Perri's brewery edition - ${utils_1.default.address()}\n`;
140
- content += `PROMPT 0\n`;
141
- content += `TIMEOUT 0\n`;
142
- content += `\n`;
143
- content += `LABEL http\n`;
144
- content += `MENU LABEL ${this.bootLabel}\n`;
145
- content += `MENU DEFAULT\n`;
146
- let clid = this.settings.distro.codenameLikeId;
147
- if (clid === 'bionic' || clid === 'stretch' || clid === 'jessie') {
148
- content += `KERNEL vmlinuz\n`;
149
- content += `APPEND initrd=initrd boot=live config noswap noprompt fetch=http://${utils_1.default.address()}/live/filesystem.squashfs\n`;
150
- }
151
- else {
152
- content += `KERNEL http://${utils_1.default.address()}/vmlinuz\n`;
153
- content += `APPEND initrd=http://${utils_1.default.address()}/initrd boot=live config noswap noprompt fetch=http://${utils_1.default.address()}/live/filesystem.squashfs\n`;
154
- }
155
- content += `SYSAPPEND 3\n`;
156
- content += `\n`;
157
- if (this.isos.length > 0) {
158
- content += `MENU SEPARATOR\n`;
159
- for (const iso of this.isos) {
160
- content += `\n`;
161
- content += `LABEL isos\n`;
162
- content += `MENU LABEL memdisk ${iso}\n`;
163
- content += `KERNEL memdisk\n`;
164
- content += `APPEND iso initrd=http://${utils_1.default.address()}/${iso}\n`;
165
- }
166
- }
167
- let file = `${this.pxeRoot}/pxelinux.cfg/default`;
168
- fs_1.default.writeFileSync(file, content);
169
- }
170
- /**
171
- * configure PXE UEFI
172
- */
173
- async uefi() {
174
- await this.tryCatch(`mkdir ${this.pxeRoot}/grub`);
175
- if (fs_1.default.existsSync('/usr/share/grub/unicode.pf2')) {
176
- await this.tryCatch(`ln -s /usr/share/grub/unicode.pf2 ${this.pxeRoot}grub/font.pf2`);
177
- }
178
- // Copia spash.png, theme.cfg in /grub
179
- await this.tryCatch(`ln -s ${this.isoRoot}boot/grub/splash.png ${this.pxeRoot}/grub/splash.png`);
180
- await this.tryCatch(`ln -s ${this.isoRoot}boot/grub/theme.cfg ${this.pxeRoot}/grub/theme.cfg`);
181
- // UEFI: /usr/lib/shim/shimx64.efi.signed
182
- await this.tryCatch(`ln -s /usr/lib/shim/shimx64.efi.signed ${this.pxeRoot}/bootx64.efi`);
183
- // UEFI: /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed
184
- await this.tryCatch(`ln -s /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed ${this.pxeRoot}/grubx64.efi`);
185
- /**
186
- * creating /grub/grub.cfg
187
- */
188
- let grubContent = '';
189
- grubContent += `set default="0"\n`;
190
- grubContent += `set timeout=-1\n`;
191
- grubContent += `\n`;
192
- grubContent += `if loadfont unicode ; then\n`;
193
- grubContent += ` set gfxmode=auto\n`;
194
- grubContent += ` set locale_dir=$prefix/locale\n`;
195
- grubContent += ` set lang=en_US\n`;
196
- grubContent += `fi\n`;
197
- grubContent += `terminal_output gfxterm\n`;
198
- grubContent += `\n`;
199
- grubContent += `set menu_color_normal=white/black\n`;
200
- grubContent += `set menu_color_highlight=black/light-gray\n`;
201
- grubContent += `if background_color 44,0,30; then\n`;
202
- grubContent += ` clear\n`;
203
- grubContent += `fi\n`;
204
- grubContent += `\n`;
205
- grubContent += `function gfxmode {\n`;
206
- grubContent += `\n`;
207
- grubContent += ` set gfxpayload="${1}"\n`;
208
- grubContent += ` if [ "${1}" = "keep" ]; then\n`;
209
- grubContent += ` set vt_handoff=vt.handoff=7\n`;
210
- grubContent += ` else\n`;
211
- grubContent += ` set vt_handoff=\n`;
212
- grubContent += ` fi\n`;
213
- grubContent += `}\n`;
214
- grubContent += `set linux_gfx_mode=keep\n`;
215
- grubContent += `\n`;
216
- grubContent += `export linux_gfx_mode\n`;
217
- grubContent += `\n`;
218
- grubContent += `if loadfont $prefix/font.pf2 ; then\n`;
219
- grubContent += ` set gfxmode=640x480\n`;
220
- grubContent += ` insmod efi_gop\n`;
221
- grubContent += ` insmod efi_uga\n`;
222
- grubContent += ` insmod video_bochs\n`;
223
- grubContent += ` insmod video_cirrus\n`;
224
- grubContent += ` insmod gfxterm\n`;
225
- grubContent += ` insmod jpeg\n`;
226
- grubContent += ` insmod png\n`;
227
- grubContent += ` terminal_output gfxterm\n`;
228
- grubContent += `fi\n`;
229
- grubContent += `set theme=/grub/theme.cfg\n`;
230
- grubContent += `menuentry '${this.bootLabel}' {\n`;
231
- grubContent += ` gfxmode $linux_gfx_mode\n`;
232
- grubContent += ` linuxefi vmlinuz boot=live config noswap noprompt fetch=http://${utils_1.default.address()}/live/filesystem.squashfs quiet splash sysappend 0x40000\n`;
233
- grubContent += ` initrdefi initrd\n`;
234
- grubContent += `}\n`;
235
- let grubFile = `${this.pxeRoot}grub/grub.cfg`;
236
- fs_1.default.writeFileSync(grubFile, grubContent);
237
- }
238
- /**
239
- * configure PXE html
240
- */
241
- async html() {
242
- let file = `${this.pxeRoot}/index.html`;
243
- let content = ``;
244
- content += `<html><title>Penguin's eggs PXE server</title>`;
245
- content += `<div style="background-image:url('/splash.png');background-repeat:no-repeat;width: 640;height:480;padding:5px;border:1px solid black;">`;
246
- content += `<h1>Penguin's eggs PXE server</h1>`;
247
- content += `<body>address: <a href=http://${utils_1.default.address()}>${utils_1.default.address()}</a><br/>`;
248
- if (!utils_1.default.isLive()) {
249
- content += `download: <a href='http://${utils_1.default.address()}/${this.isos[0]}'>${this.isos[0]}</a><br/>`;
250
- }
251
- else {
252
- content += `started from live iso image<br/>`;
253
- }
254
- content += `<br/>`;
255
- content += `source: <a href='https://github.com/pieroproietti/penguins-eggs'>https://github.com/pieroproietti/penguins-eggs</a><br/>`;
256
- content += `manual: <a href='https://penguins-eggs.net/book/italiano9.2.html'>italiano</a>, <a href='https://penguins--eggs-net.translate.goog/book/italiano9.2?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en'>translated</a><br/>`;
257
- content += `discuss: <a href='https://t.me/penguins_eggs'>Telegram group<br/></body</html>`;
258
- fs_1.default.writeFileSync(file, content);
259
- }
260
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
261
- //
262
- // dncp: actually install and configure dnsmaq
263
- //
264
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
265
- /**
266
- *
267
- * @param real
268
- */
269
- async dhcp(real = false, dnsmasq = true) {
270
- if (dnsmasq) {
271
- await this.dnsmasq(real);
272
- }
273
- else {
274
- await this.nodeDhcp(real);
275
- }
276
- }
277
- /**
278
- *
279
- */
280
- async nodeDhcp(real = false) {
281
- console.log('to do!');
282
- process.exit();
283
- }
284
- /**
285
- *
286
- * @param real
287
- */
288
- async dnsmasq(real = false) {
289
- if (utils_1.default.isSystemd()) {
290
- await (0, utils_2.exec)(`systemctl stop dnsmasq.service`);
291
- }
292
- else {
293
- await (0, utils_2.exec)(`service dnsmasq stop`);
294
- }
295
- let domain = `penguins-eggs.lan`;
296
- let n = new netmask_1.Netmask(`${utils_1.default.address()}/${utils_1.default.netmask()}`);
297
- let content = ``;
298
- content += `# cuckoo.conf\n`;
299
- content += `port=0\n`;
300
- content += `interface=${await utils_1.default.iface()}\n`;
301
- content += `bind-interfaces\n`;
302
- content += `domain=${domain}\n`;
303
- content += `dhcp-no-override\n`;
304
- content += `dhcp-option=option:router,${n.first}\n`;
305
- content += `dhcp-option=option:dns-server,${n.first}\n`;
306
- content += `dhcp-option=option:dns-server,8.8.8.8\n`;
307
- content += `dhcp-option=option:dns-server,8.8.4.4\n`;
308
- content += `enable-tftp\n`;
309
- content += `tftp-root=${this.pxeRoot}\n`;
310
- content += `# boot config for BIOS\n`;
311
- content += `dhcp-match=set:bios-x86,option:client-arch,0\n`;
312
- content += `dhcp-boot=tag:bios-x86,lpxelinux.0\n`;
313
- content += `# boot config for UEFI\n`;
314
- content += `dhcp-match=set:efi-x86_64,option:client-arch,7\n`;
315
- content += `dhcp-match=set:efi-x86_64,option:client-arch,9\n`;
316
- content += `dhcp-boot=tag:efi-x86_64,/bootx64.efi\n`;
317
- // Here we are OK Starting grub
318
- /**
319
- * https://thekelleys.org.uk/dnsmasq/CHANGELOG
320
- *
321
- * Don't do any PXE processing, even for clients with the
322
- * correct vendorclass, unless at least one pxe-prompt or
323
- * pxe-service option is given. This stops dnsmasq
324
- * interfering with proxy PXE subsystems when it is just
325
- * the DHCP server. Thanks to Spencer Clark for spotting this.
326
- */
327
- const addZero = this.settings.distro.codenameId !== 'jessie';
328
- if (addZero) {
329
- content += `pxe-service=X86PC,"penguin's eggs cuckoo",lpxelinux.0\n`;
330
- }
331
- else {
332
- content += `pxe-service=X86PC,"penguin's eggs cuckoo",lpxelinux\n`;
333
- }
334
- if (real) {
335
- content += `dhcp-range=${await utils_1.default.iface()},${n.first},${n.last},${n.mask},8h\n`;
336
- }
337
- else {
338
- content += `dhcp-range=${await utils_1.default.iface()},${n.base},proxy,${n.mask},${n.broadcast} # dhcp proxy\n`;
339
- }
340
- let file = '/etc/dnsmasq.d/cuckoo.conf';
341
- fs_1.default.writeFileSync(file, content);
342
- // console.log(content)
343
- if (utils_1.default.isSystemd()) {
344
- await (0, utils_2.exec)(`systemctl start dnsmasq.service`);
345
- }
346
- else {
347
- await (0, utils_2.exec)(`service dnsmasq start`);
348
- }
349
- }
350
- /**
351
- * start http server for images
352
- *
353
- */
354
- async httpStart() {
355
- const port = 80;
356
- const httpRoot = this.pxeRoot + "/";
357
- var file = new (node_static_1.default.Server)(httpRoot);
358
- http_1.default.createServer(function (req, res) {
359
- file.serve(req, res);
360
- }).listen(port);
361
- }
362
- /**
363
- *
364
- * @param cmd
365
- */
366
- async tryCatch(cmd = '') {
367
- try {
368
- await (0, utils_2.exec)(cmd, this.echo);
369
- }
370
- catch (error) {
371
- console.log(`Error: ${error}`);
372
- await utils_1.default.pressKeyToExit(cmd);
373
- }
374
- }
375
- }
376
- exports.default = Pxe;
@@ -1,55 +0,0 @@
1
- /**
2
- * penguins-eggs: ovary.ts VERSIONE DEBIAN-LIVE
3
- * author: Piero Proietti
4
- * mail: piero.proietti@gmail.com
5
- *
6
- */
7
- import { IRemix, IDistro, IApp, IWorkDir } from '../interfaces';
8
- import Incubator from './incubation/incubator';
9
- import { IEggsConfig } from '../interfaces';
10
- /**
11
- * Setting
12
- */
13
- export default class Settings {
14
- app: IApp;
15
- config: IEggsConfig;
16
- remix: IRemix;
17
- work_dir: IWorkDir;
18
- distro: IDistro;
19
- incubator: Incubator;
20
- i686: boolean;
21
- isLive: boolean;
22
- efi_work: string;
23
- kernel_image: string;
24
- initrd_image: string;
25
- vmlinuz: string;
26
- initrdImg: string;
27
- session_excludes: string;
28
- isoFilename: string;
29
- constructor(compression?: string);
30
- /**
31
- *
32
- * @param config
33
- */
34
- save(config: IEggsConfig): Promise<void>;
35
- /**
36
- * Load configuration from config_file
37
- * @returns {boolean} Success
38
- */
39
- load(): Promise<boolean>;
40
- /**
41
- * showSettings
42
- */
43
- show(): Promise<void>;
44
- /**
45
- * Calculate and show free space on the disk
46
- * @returns {void}
47
- */
48
- listFreeSpace(): Promise<void>;
49
- /**
50
- *
51
- * @param basename
52
- * @param theme
53
- */
54
- loadRemix(basename?: string, theme?: string): Promise<void>;
55
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * penguins-eggs: tailor.ts
3
- * author: Piero Proietti
4
- * mail: piero.proietti@gmail.com
5
- *
6
- */
7
- /**
8
- *
9
- */
10
- export default class SourcesList {
11
- /**
12
- *
13
- * @param repos
14
- * @returns
15
- */
16
- distribution(distributions: string[]): Promise<boolean>;
17
- /**
18
- *
19
- * @param repos
20
- * @returns
21
- */
22
- components(components: string[]): Promise<boolean>;
23
- /**
24
- *
25
- */
26
- private get;
27
- }
@@ -1,46 +0,0 @@
1
- /**
2
- * penguins-eggs-v7
3
- * author: Piero Proietti
4
- * email: piero.proietti@gmail.com
5
- * license: MIT
6
- * gestione systemd
7
- * Presa da https://github.com/VolantisDev/node-systemctl
8
- */
9
- export default class SistemdCtl {
10
- echo: {};
11
- constructor(verbose?: boolean);
12
- /**
13
- *
14
- */
15
- reload(service: string): Promise<void>;
16
- /**
17
- *
18
- */
19
- disable(service: string, chroot?: string, report?: boolean): Promise<void>;
20
- /**
21
- *
22
- */
23
- enable(service: string): Promise<void>;
24
- /**
25
- *
26
- */
27
- restart(service: string): Promise<void>;
28
- /**
29
- *
30
- */
31
- start(service: string): Promise<void>;
32
- /**
33
- *
34
- */
35
- stop(service: string): Promise<void>;
36
- /**
37
- *
38
- * @param service
39
- * @returns
40
- */
41
- isActive(service: string): Promise<unknown>;
42
- /**
43
- *
44
- */
45
- isEnabled(service: string): Promise<unknown>;
46
- }
@@ -1,43 +0,0 @@
1
- import { IMateria } from '../interfaces';
2
- /**
3
- *
4
- */
5
- export default class Tailor {
6
- private verbose;
7
- private echo;
8
- private costume;
9
- private wardrobe;
10
- private category;
11
- materials: IMateria;
12
- /**
13
- * @param wardrobe
14
- * @param costume
15
- */
16
- constructor(costume: string, category?: string);
17
- /**
18
- *
19
- */
20
- prepare(verbose?: boolean, no_accessories?: boolean, no_firmwares?: boolean): Promise<void>;
21
- /**
22
- *
23
- * @param packages
24
- * @param verbose
25
- * @param section
26
- * @returns
27
- */
28
- helperExists(packages: string[], verbose?: boolean, section?: string): Promise<string[]>;
29
- /**
30
- * - check if every package if installed
31
- * - if find any packages to install, install it
32
- */
33
- helperInstall(packages: string[], comment?: string, cmd?: string): Promise<void>;
34
- /**
35
- * hostname and hosts
36
- */
37
- private hostname;
38
- /**
39
- *
40
- * @param command
41
- */
42
- titles(command?: string): void;
43
- }
@@ -1,29 +0,0 @@
1
- /**
2
- * tools
3
- * author: Piero Proietti
4
- * email: piero.proietti@gmail.com
5
- * license: MIT
6
- */
7
- interface IEggsConfigTools {
8
- remoteHost: string;
9
- remoteUser: string;
10
- remotePathDeb: string;
11
- remotePathDoc: string;
12
- remotePathIso: string;
13
- localPathDeb: string;
14
- localPathDoc: string;
15
- localPathIso: string;
16
- filterDeb: string;
17
- }
18
- /**
19
- * Utils: general porpourse utils
20
- * @remarks all the utilities
21
- */
22
- export default class Tools {
23
- tools_yaml: string;
24
- snapshot_dir: string;
25
- snapshot_name: string;
26
- config: IEggsConfigTools;
27
- loadSettings(): Promise<boolean>;
28
- }
29
- export {};
@@ -1,21 +0,0 @@
1
- /**
2
- *
3
- */
4
- export default class Users {
5
- login: string;
6
- password: string;
7
- uid: string;
8
- gid: string;
9
- gecos: string;
10
- home: string;
11
- shell: string;
12
- size: number;
13
- hasHome: boolean;
14
- saveIt: boolean;
15
- constructor(login: string, password: string, uid: string, gid: string, gecos: string, home: string, shell: string);
16
- /**
17
- * getSize
18
- * @param verbose
19
- */
20
- getValues(): Promise<void>;
21
- }