penguins-eggs 25.11.12 → 25.11.29

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 (168) hide show
  1. package/.oclif.manifest.json +161 -140
  2. package/README.md +811 -4
  3. package/README.pdf +20763 -3833
  4. package/addons/eggs/adapt/applications/eggs-adapt.desktop +0 -0
  5. package/addons/eggs/pve/applications/eggs-pve.desktop +0 -0
  6. package/addons/eggs/rsupport/applications/eggs-rsupport.desktop +0 -0
  7. package/addons/eggs/theme/applications/install-system.desktop +0 -0
  8. package/addons/eggs/theme/livecd/full.grub.main.cfg +39 -4
  9. package/addons/eggs/theme/livecd/full.isolinux.main.cfg +47 -4
  10. package/assets/calamares/install-system.sh +0 -0
  11. package/assets/penguins-eggs.desktop +0 -0
  12. package/assets/penguins-krill.desktop +0 -0
  13. package/assets/penguins-links-add.desktop +0 -0
  14. package/assets/penguins-live-installer.desktop +0 -0
  15. package/bin/dev.js +0 -0
  16. package/bin/run.js +11 -0
  17. package/conf/derivatives.yaml +2 -1
  18. package/conf/distros/alpine/calamares/calamares-modules/machineid-openrc/machineid-openrc.sh +0 -0
  19. package/conf/distros/buster/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
  20. package/conf/distros/buster/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
  21. package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
  22. package/conf/distros/fedora/calamares/calamares-modules/bootloaderspecification/bootloaderspecification.sh +0 -0
  23. package/conf/distros/focal/calamares/calamares-modules/.keepit +0 -0
  24. package/conf/distros/focal/calamares/calamares-modules/cleanup/cleanup.sh +20 -0
  25. package/conf/distros/focal/calamares/calamares-modules/cleanup/module.yml +9 -0
  26. package/conf/distros/focal/calamares/calamares-modules/sources-yolk/module.yml +8 -0
  27. package/conf/distros/focal/calamares/calamares-modules/sources-yolk/sources-yolk.sh +50 -0
  28. package/conf/distros/focal/calamares/calamares-modules/sources-yolk-undo/module.yml +8 -0
  29. package/conf/distros/focal/calamares/libexec/.keepit +0 -0
  30. package/conf/distros/focal/calamares/libexec/README.md +5 -0
  31. package/conf/distros/focal/calamares/libexec/calamares-aptsources.sh +15 -0
  32. package/conf/distros/focal/calamares/libexec/calamares-l10n-helper.sh +38 -0
  33. package/conf/distros/focal/calamares/libexec/calamares-logs-helper.sh +34 -0
  34. package/conf/distros/focal/calamares/libexec/calamares-nomodeset.sh +19 -0
  35. package/conf/distros/focal/calamares/modules/after_bootloader_context.yml +26 -0
  36. package/conf/distros/focal/calamares/modules/before_bootloader_context.yml +12 -0
  37. package/conf/distros/focal/calamares/modules/bootloader.yml +86 -0
  38. package/conf/distros/focal/calamares/modules/bootloader.yml.old +35 -0
  39. package/conf/distros/focal/calamares/modules/displaymanager.yml +12 -0
  40. package/conf/distros/focal/calamares/modules/finished.yml +6 -0
  41. package/conf/distros/focal/calamares/modules/fstab.yml +63 -0
  42. package/conf/distros/focal/calamares/modules/grubcfg.yml +51 -0
  43. package/conf/distros/focal/calamares/modules/keyboard.yml +29 -0
  44. package/conf/distros/focal/calamares/modules/locale.yml +7 -0
  45. package/conf/distros/focal/calamares/modules/machineid.yml +10 -0
  46. package/conf/distros/focal/calamares/modules/mount.yml +20 -0
  47. package/conf/distros/focal/calamares/modules/netinstall.yml +5 -0
  48. package/conf/distros/focal/calamares/modules/packages.mustache +5 -0
  49. package/conf/distros/focal/calamares/modules/partition.yml +21 -0
  50. package/conf/distros/focal/calamares/modules/removeuser.mustache +3 -0
  51. package/conf/distros/focal/calamares/modules/shellprocess@aptsources.yml +11 -0
  52. package/conf/distros/focal/calamares/modules/shellprocess@boot_deploy.yml +9 -0
  53. package/conf/distros/focal/calamares/modules/shellprocess@boot_reconfigure.yml +15 -0
  54. package/conf/distros/focal/calamares/modules/shellprocess@install_translations.yml +8 -0
  55. package/conf/distros/focal/calamares/modules/shellprocess@logs.yml +8 -0
  56. package/conf/distros/focal/calamares/modules/shellprocess@mkinitramfs.yml +6 -0
  57. package/conf/distros/focal/calamares/modules/shellprocess@nomodeset.yml +12 -0
  58. package/conf/distros/focal/calamares/modules/umount.yml +4 -0
  59. package/conf/distros/focal/calamares/modules/unpackfs.mustache +6 -0
  60. package/conf/distros/focal/calamares/modules/users.yml +27 -0
  61. package/conf/distros/focal/calamares/modules/welcome.yml +24 -0
  62. package/conf/distros/focal/calamares/settings.yml +97 -0
  63. package/conf/distros/noble/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
  64. package/conf/distros/noble/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
  65. package/conf/distros/noble/calamares/libexec/calamares-aptsources.sh +0 -0
  66. package/conf/distros/noble/calamares/libexec/calamares-l10n-helper.sh +0 -0
  67. package/conf/distros/noble/calamares/libexec/calamares-logs-helper.sh +0 -0
  68. package/conf/distros/noble/calamares/libexec/calamares-nomodeset.sh +0 -0
  69. package/conf/distros/opensuse/calamares/calamares-modules/bootloaderspecification/bootloaderspecification.sh +0 -0
  70. package/conf/distros/opensuse/calamares/settings.yml +0 -0
  71. package/conf/distros/opensuse/calamares/zstd2lzo.sh +0 -0
  72. package/conf/distros/trixie/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
  73. package/conf/distros/trixie/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
  74. package/conf/distros/trixie/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
  75. package/conf/init/unattended.sh +0 -0
  76. package/dist/appimage/dependency-manager.d.ts +31 -0
  77. package/dist/appimage/dependency-manager.js +292 -0
  78. package/dist/appimage/first-run-check.d.ts +8 -0
  79. package/dist/appimage/first-run-check.js +13 -0
  80. package/dist/bin/dev.cmd +3 -0
  81. package/dist/bin/dev.js +6 -0
  82. package/dist/bin/run.cmd +3 -0
  83. package/dist/bin/run.js +16 -0
  84. package/dist/classes/cli-autologin.js +5 -5
  85. package/dist/classes/daddy.js +11 -11
  86. package/dist/classes/diversions.d.ts +5 -0
  87. package/dist/classes/diversions.js +23 -7
  88. package/dist/classes/incubation/fisherman-helper/initcpio.d.ts +7 -0
  89. package/dist/classes/incubation/fisherman-helper/initcpio.js +7 -0
  90. package/dist/classes/incubation/fisherman.js +0 -2
  91. package/dist/classes/network.d.ts +1 -1
  92. package/dist/classes/ovary.d/edit-live-fs.d.ts +1 -1
  93. package/dist/classes/ovary.d/edit-live-fs.js +129 -93
  94. package/dist/classes/ovary.d/fertilization.js +1 -1
  95. package/dist/classes/ovary.d/xorriso-command.js +1 -5
  96. package/dist/classes/pacman.d.ts +21 -7
  97. package/dist/classes/pacman.js +59 -39
  98. package/dist/classes/utils.d.ts +5 -5
  99. package/dist/classes/utils.js +30 -11
  100. package/dist/commands/calamares.js +1 -1
  101. package/dist/commands/config.js +3 -14
  102. package/dist/commands/cuckoo.js +1 -1
  103. package/dist/commands/{analyze.d.ts → export/appimage.d.ts} +10 -9
  104. package/dist/commands/export/appimage.js +76 -0
  105. package/dist/commands/export/iso.js +1 -1
  106. package/dist/commands/export/pkg.d.ts +1 -1
  107. package/dist/commands/export/pkg.js +2 -2
  108. package/dist/commands/{install.d.ts → krill.d.ts} +3 -4
  109. package/dist/commands/{install.js → krill.js} +5 -6
  110. package/dist/commands/produce.js +1 -1
  111. package/dist/commands/setup/install.d.ts +17 -0
  112. package/dist/commands/setup/install.js +71 -0
  113. package/dist/commands/setup/purge.d.ts +17 -0
  114. package/dist/commands/setup/purge.js +71 -0
  115. package/dist/commands/tools/repo.d.ts +0 -5
  116. package/dist/commands/tools/repo.js +205 -127
  117. package/dist/commands/update.d.ts +16 -1
  118. package/dist/commands/update.js +140 -63
  119. package/dist/krill/components/information.js +2 -2
  120. package/dist/krill/components/title.js +13 -13
  121. package/dist/lib/utils.d.ts +16 -0
  122. package/dist/lib/utils.js +5 -32
  123. package/dracut/create-symlink +0 -0
  124. package/dracut/export +0 -0
  125. package/dracut/export-dracut-analysis +0 -0
  126. package/dracut/export-dracut-log +0 -0
  127. package/dracut/mkisofs +0 -0
  128. package/dracut/modules.d/00debug-shell/debug-hook.sh +0 -0
  129. package/dracut/modules.d/00debug-shell/module-setup.sh +0 -0
  130. package/dracut/modules.d/90block/block-cmdline.sh +0 -0
  131. package/dracut/modules.d/90block/module-setup.sh +0 -0
  132. package/dracut/modules.d/95iso-scan/iso-scan-fallback.sh +0 -0
  133. package/dracut/modules.d/95iso-scan/iso-scan.sh +0 -0
  134. package/dracut/modules.d/95iso-scan/module-setup.sh +0 -0
  135. package/dracut/modules.d/95luks-loop/luks-loop.sh +0 -0
  136. package/dracut/modules.d/95luks-loop/module-setup.sh +0 -0
  137. package/dracut/renew-initramfs +0 -0
  138. package/dracut/sbin2bin +0 -0
  139. package/dracut/update-dracut-conf-d +0 -0
  140. package/dracut/update-dracut-modules +0 -0
  141. package/eui/eui-autostart-cinnamon.desktop +0 -0
  142. package/eui/eui-autostart-xfce.desktop +0 -0
  143. package/eui/eui-create-image.sh +0 -0
  144. package/eui/eui-start.sh +0 -0
  145. package/manpages/doc/man/eggs.1.gz +0 -0
  146. package/manpages/doc/man/eggs.html +594 -9
  147. package/package.json +124 -130
  148. package/perrisbrewery/scripts/postinst +0 -0
  149. package/perrisbrewery/scripts/postrm +0 -0
  150. package/perrisbrewery/scripts/preinst +0 -0
  151. package/perrisbrewery/scripts/prerm +0 -0
  152. package/perrisbrewery/template/dependencies.yaml +0 -5
  153. package/perrisbrewery/template/man.template.md +7 -0
  154. package/scripts/99clean +0 -0
  155. package/scripts/_eggs +56 -47
  156. package/scripts/adapt.sh +0 -0
  157. package/scripts/bros/waydroid-helper.sh +0 -0
  158. package/scripts/eggs.bash +4 -4
  159. package/scripts/lsb_release +0 -0
  160. package/scripts/mom.sh +0 -0
  161. package/scripts/pve-live.service +0 -0
  162. package/scripts/pve-live.sh +0 -0
  163. package/scripts/resy +0 -0
  164. package/dist/commands/analyze.js +0 -95
  165. package/dist/commands/pods.d.ts +0 -22
  166. package/dist/commands/pods.js +0 -92
  167. package/scripts/boot-encrypted-root.sh +0 -220
  168. package/scripts/mount-encrypted-home.sh +0 -324
@@ -0,0 +1,292 @@
1
+ /**
2
+ * ./src/appimage/dependency-manager.ts
3
+ * penguins-eggs v.25.11.x / ecmascript 2020
4
+ * author: Piero Proietti
5
+ * email: piero.proietti@gmail.com
6
+ * license: MIT
7
+ */
8
+ import Distro from '../classes/distro.js';
9
+ import Diversions from '../classes/diversions.js';
10
+ import { execSync } from 'child_process';
11
+ import * as fs from 'fs';
12
+ import * as path from 'path';
13
+ const ALPINE_PACKAGES = [
14
+ 'alp-conf', 'apk-tools', 'bash', 'cryptsetup', 'curl', 'dosfstools',
15
+ 'e2fsprogs', 'efibootmgr', 'findutils', 'git', 'grub', 'grub-efi',
16
+ 'isolinux', 'jq', 'linux-firmware', 'lvm2', 'mtools', 'ncurses',
17
+ 'nodejs', 'openssl', 'parted', 'procps', 'py3-setuptools', 'rsync',
18
+ 'sfdisk', 'shadow', 'squashfs-tools', 'syslinux', 'tar', 'xorriso',
19
+ 'xz', 'zstd'
20
+ ].join(' ');
21
+ const META_PACKAGE_NAME = 'penguins-eggs-deps';
22
+ const ALPINE_VIRTUAL_PKG = '.penguins-eggs-deps'; // Nota il punto iniziale
23
+ export class DependencyManager {
24
+ appRoot;
25
+ distro;
26
+ familyId;
27
+ constructor() {
28
+ this.distro = new Distro();
29
+ this.familyId = this.distro.familyId;
30
+ // Gestione specifica per Manjaro (che si identifica come archlinux ma richiede tools diversi)
31
+ if (this.distro.familyId === 'archlinux' && Diversions.isManjaroBased(this.distro.distroLike)) {
32
+ this.familyId = 'manjaro';
33
+ }
34
+ // Definizione della root per cercare i pacchetti
35
+ if (process.env.APPDIR) {
36
+ // In AppImage, i file sono in $APPDIR/distro (o dove li hai configurati)
37
+ this.appRoot = path.join(process.env.APPDIR, 'distro-packages');
38
+ }
39
+ else {
40
+ // In sviluppo locale, cerchiamo nella cartella corrente o una di fallback
41
+ this.appRoot = process.cwd();
42
+ }
43
+ }
44
+ /**
45
+ * Verifica se i distro-meta-pacchetto sono già installati nel sistema.
46
+ * @returns true se installati, false altrimenti
47
+ */
48
+ isInstalled() {
49
+ try {
50
+ switch (this.familyId) {
51
+ case 'alpine':
52
+ // apk info -e esce con 0 se esiste, 1 se no
53
+ execSync(`apk info -e ${ALPINE_VIRTUAL_PKG}`, { stdio: 'ignore' });
54
+ return true;
55
+ case 'archlinux':
56
+ case 'manjaro':
57
+ // pacman -Q esce con 0 se trovato, 1 se no
58
+ execSync(`pacman -Q ${META_PACKAGE_NAME}`, { stdio: 'ignore' });
59
+ return true;
60
+ case 'debian':
61
+ // dpkg -s verifica lo stato del pacchetto
62
+ execSync(`dpkg -s ${META_PACKAGE_NAME}`, { stdio: 'ignore' });
63
+ return true;
64
+ case 'el9':
65
+ case 'fedora':
66
+ case 'opensuse':
67
+ // rpm -q funziona per tutte le distro RPM
68
+ execSync(`rpm -q ${META_PACKAGE_NAME}`, { stdio: 'ignore' });
69
+ return true;
70
+ default:
71
+ return false;
72
+ }
73
+ }
74
+ catch (e) {
75
+ // Se il comando fallisce (exit code != 0), il pacchetto non è installato
76
+ return false;
77
+ }
78
+ }
79
+ /**
80
+ * Reinstalla i distro-meta-pacchetti: Rimuove e poi Installa.
81
+ * Utile per forzare un aggiornamento delle dipendenze o riparare un'installazione.
82
+ */
83
+ reinstallDistroPackages() {
84
+ console.log(`[eggs] Reinstallazione distro meta-packages per: ${this.familyId}...`);
85
+ // Tentiamo la rimozione (ignoriamo errori se non era installato)
86
+ try {
87
+ this.removeDistroPackages();
88
+ }
89
+ catch (e) {
90
+ console.log(`[eggs] No previous versions found or removal not necessary.`);
91
+ }
92
+ // Procediamo con l'installazione pulita
93
+ return this.installDistroPackages();
94
+ }
95
+ /**
96
+ * Rimuove i distro meta-pacchetti e pulisce le dipendenze.
97
+ */
98
+ removeDistroPackages() {
99
+ console.log(`[eggs] Removing distro meta-packages for: ${this.familyId}...`);
100
+ try {
101
+ switch (this.familyId) {
102
+ // ==========================================
103
+ // ALPINE LINUX
104
+ // ==========================================
105
+ case 'alpine':
106
+ console.log('[eggs] Removing Alpine dependencies...');
107
+ execSync(`apk del ${ALPINE_VIRTUAL_PKG}`, { stdio: 'inherit' });
108
+ return true;
109
+ // ==========================================
110
+ // ARCHLINUX/MANJARO
111
+ // ==========================================
112
+ case 'archlinux':
113
+ console.log(`[eggs] Removing package ${META_PACKAGE_NAME} (Arch/Manjaro)...`);
114
+ // -Rns: Rimuove pacchetto, configurazioni e dipendenze non usate da altri
115
+ execSync(`pacman -Rns --noconfirm ${META_PACKAGE_NAME}`, { stdio: 'inherit' });
116
+ return true;
117
+ // ==========================================
118
+ // DEBIAN / UBUNTU FAMILY
119
+ // ==========================================
120
+ case 'debian':
121
+ console.log(`[eggs] Removing package ${META_PACKAGE_NAME} (Debian/Devuan/Ubuntu)...`);
122
+ // Purge rimuove anche i file di configurazione
123
+ // autoremove pulisce le dipendenze installate dal meta-pacchetto
124
+ execSync(`apt-get purge -y ${META_PACKAGE_NAME} && apt-get autoremove -y`, { stdio: 'inherit' });
125
+ return true;
126
+ // ==========================================
127
+ // RPM FAMILY (EL9 / FEDORA / OPENSUSE)
128
+ // ==========================================
129
+ case 'el9':
130
+ case 'fedora':
131
+ console.log(`[eggs] Removing package ${META_PACKAGE_NAME} (RPM/DNF)...`);
132
+ execSync(`dnf remove -y ${META_PACKAGE_NAME}`, { stdio: 'inherit' });
133
+ return true;
134
+ case 'opensuse':
135
+ console.log(`[eggs] Removing package ${META_PACKAGE_NAME} (Zypper)...`);
136
+ // -u (--clean-deps) rimuove anche le dipendenze non più necessarie
137
+ execSync(`zypper rm -y -u ${META_PACKAGE_NAME}`, { stdio: 'inherit' });
138
+ return true;
139
+ default:
140
+ console.warn(`[eggs] Removal not supported automatically for '${this.familyId}'.`);
141
+ return false;
142
+ }
143
+ }
144
+ catch (error) {
145
+ // Spesso la rimozione fallisce semplicemente perché il pacchetto non c'è.
146
+ // Logghiamo warning invece di errore fatale.
147
+ console.warn(`[eggs] Warning removing: ${error.message}`);
148
+ return false;
149
+ }
150
+ }
151
+ /**
152
+ * Installa i distro meta-pacchetti corretti in base alla distribuzione.
153
+ */
154
+ installDistroPackages() {
155
+ const depsBase = this.appRoot;
156
+ // CHECK AGGIUNTO: Se è già installato, evitiamo lavoro inutile?
157
+ // Se vuoi forzare l'installazione sempre, rimuovi questo blocco if.
158
+ if (this.isInstalled()) {
159
+ console.log(`[eggs] The meta-packages for ${this.familyId} are already installed.`);
160
+ return true;
161
+ }
162
+ try {
163
+ switch (this.familyId) {
164
+ // ==========================================
165
+ // ALPINE LINUX (Nativo)
166
+ // ==========================================
167
+ case 'alpine': {
168
+ console.log('[eggs] Alpine dependencies configuration (Virtual Package)...');
169
+ // --virtual crea un pacchetto fittizio rimuovibile che raggruppa le dipendenze
170
+ execSync(`apk add --no-cache --virtual ${ALPINE_VIRTUAL_PKG} ${ALPINE_PACKAGES}`, { stdio: 'inherit' });
171
+ return true;
172
+ }
173
+ // ==========================================
174
+ // ARCHLINUX
175
+ // ==========================================
176
+ case 'archlinux': {
177
+ const archFile = findPackage(path.join(depsBase, 'arch'), '.zst');
178
+ if (archFile) {
179
+ console.log(`[eggs] Installing the Arch Meta-Package: ${path.basename(archFile)}`);
180
+ execSync(`pacman -Sy --noconfirm && pacman -U --noconfirm "${archFile}"`, { stdio: 'inherit' });
181
+ return true;
182
+ }
183
+ break;
184
+ }
185
+ // ==========================================
186
+ // DEBIAN / UBUNTU FAMILY
187
+ // ==========================================
188
+ case 'debian': {
189
+ const debFile = findPackage(path.join(depsBase, 'debian'), '.deb');
190
+ if (debFile) {
191
+ console.log(`[eggs] Installing Debian Meta-Package: ${path.basename(debFile)}`);
192
+ // Gestione sicura per l'utente _apt copiando in /tmp
193
+ const tempDebPath = path.join('/tmp', path.basename(debFile));
194
+ try {
195
+ fs.copyFileSync(debFile, tempDebPath);
196
+ execSync(`apt-get update && apt-get install -y "${tempDebPath}"`, { stdio: 'inherit' });
197
+ }
198
+ finally {
199
+ // Assicuriamoci di pulire il file temporaneo anche in caso di errore
200
+ if (fs.existsSync(tempDebPath)) {
201
+ fs.unlinkSync(tempDebPath);
202
+ }
203
+ }
204
+ return true;
205
+ }
206
+ break;
207
+ }
208
+ // ==========================================
209
+ // RHEL / CENTOS / ALMA (RPM Family)
210
+ // ==========================================
211
+ case 'el9': {
212
+ // Cerca file contenente 'el9'
213
+ const elFile = findPackage(path.join(depsBase, 'rpm'), '.rpm', 'el9');
214
+ if (elFile) {
215
+ console.log(`[eggs] Installing EL9 Meta-Package: ${path.basename(elFile)}`);
216
+ execSync(`dnf install -y "${elFile}"`, { stdio: 'inherit' });
217
+ return true;
218
+ }
219
+ break;
220
+ }
221
+ // ==========================================
222
+ // FEDORA (RPM Family)
223
+ // ==========================================
224
+ case 'fedora': {
225
+ // Cerca file contenente 'fc42' o 'fc' dentro la cartella rpm
226
+ const fedoraFile = findPackage(path.join(depsBase, 'rpm'), '.rpm', 'fc42');
227
+ if (fedoraFile) {
228
+ console.log(`[eggs] Installing Fedora Meta-Package: ${path.basename(fedoraFile)}`);
229
+ execSync(`dnf install -y "${fedoraFile}"`, { stdio: 'inherit' });
230
+ return true;
231
+ }
232
+ break;
233
+ }
234
+ // ==========================================
235
+ // MANJARO (Variant: manjaro-tools-iso)
236
+ // ==========================================
237
+ case 'manjaro': {
238
+ const manjaroFile = findPackage(path.join(depsBase, 'manjaro'), '.zst');
239
+ if (manjaroFile) {
240
+ console.log(`[eggs] Installing Manjaro Meta-Package: ${path.basename(manjaroFile)}`);
241
+ execSync(`pacman -Sy --noconfirm && pacman -U --noconfirm "${manjaroFile}"`, { stdio: 'inherit' });
242
+ return true;
243
+ }
244
+ break;
245
+ }
246
+ // ==========================================
247
+ // OPENSUSE (RPM Family)
248
+ // ==========================================
249
+ case 'opensuse': {
250
+ const suseFile = findPackage(path.join(depsBase, 'rpm'), '.rpm', 'opensuse');
251
+ if (suseFile) {
252
+ console.log(`[eggs] Installing openSUSE Meta-Package: ${path.basename(suseFile)}`);
253
+ // --allow-unsigned-rpm è necessario perché i nostri pacchetti non sono firmati con GPG
254
+ execSync(`zypper install -y --allow-unsigned-rpm "${suseFile}"`, { stdio: 'inherit' });
255
+ return true;
256
+ }
257
+ break;
258
+ }
259
+ default:
260
+ console.warn(`[eggs] Distribuzione '${this.familyId}' non supportata dai meta-pacchetti automatici.`);
261
+ return false;
262
+ }
263
+ }
264
+ catch (error) {
265
+ console.error(`[eggs] FATAL ERROR installing dependencies: ${error.message}`);
266
+ // Rilanciamo l'errore per permettere al chiamante di decidere se uscire o continuare
267
+ throw error;
268
+ }
269
+ // Se siamo qui, non è stato trovato il file specifico
270
+ console.warn(`[eggs] No meta-package found for ${this.familyId} in ${depsBase}`);
271
+ return false;
272
+ }
273
+ }
274
+ /**
275
+ * Helper Function (fuori classe, come richiesto)
276
+ * Cerca un file pacchetto in una directory specifica.
277
+ */
278
+ function findPackage(dir, ext, pattern = '') {
279
+ try {
280
+ if (!fs.existsSync(dir)) {
281
+ // console.warn(`[DependencyManager] Directory non trovata: ${dir}`);
282
+ return null;
283
+ }
284
+ const files = fs.readdirSync(dir);
285
+ const found = files.find(file => file.endsWith(ext) && file.includes(pattern));
286
+ return found ? path.join(dir, found) : null;
287
+ }
288
+ catch (error) {
289
+ console.error(`[DependencyManager] Error reading directory ${dir}`, error);
290
+ return null;
291
+ }
292
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * ./src/appimage/first-run-check.ts
3
+ * penguins-eggs v.25.11.x / ecmascript 2020
4
+ * author: Piero Proietti
5
+ * email: piero.proietti@gmail.com
6
+ * license: MIT
7
+ */
8
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * ./src/appimage/first-run-check.ts
3
+ * penguins-eggs v.25.11.x / ecmascript 2020
4
+ * author: Piero Proietti
5
+ * email: piero.proietti@gmail.com
6
+ * license: MIT
7
+ */
8
+ import { DependencyManager } from "./dependency-manager.js";
9
+ const depsManager = new DependencyManager();
10
+ if (!depsManager.isInstalled()) {
11
+ console.log('WARNING: You need to setup penguins-eggs for full functionality.');
12
+ console.log('Run: sudo eggs setup');
13
+ }
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %*
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
2
+
3
+ // eslint-disable-next-line n/shebang
4
+ import {execute} from '@oclif/core'
5
+
6
+ await execute({development: true, dir: import.meta.url})
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\run" %*
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {execute} from '@oclif/core'
4
+
5
+ if (process.env.APPIMAGE && process.env.APPIMAGE.endsWith('.AppImage')) {
6
+ // process.argv contiene [node_path, script_path, ...argomenti_utente]
7
+ // Se la lunghezza è 2, significa che non ci sono argomenti utente.
8
+ if (process.argv.length === 2) {
9
+ console.log('AppImage launched without arguments: launching setup install...');
10
+ // We inject commands for Oclif
11
+ process.argv.push('setup');
12
+ process.argv.push('install');
13
+ }
14
+ }
15
+
16
+ await execute({dir: import.meta.url})
@@ -130,7 +130,7 @@ export default class CliAutologin {
130
130
  }
131
131
  async addMotd(distro, version, user, userPasswd, rootPasswd, chroot = '/') {
132
132
  const fileMotd = `${chroot}/etc/motd`;
133
- let installer = 'sudo eggs install';
133
+ let installer = 'sudo eggs krill';
134
134
  if (Pacman.calamaresExists()) {
135
135
  if (Pacman.packageIsInstalled('plasma-desktop')) {
136
136
  installer = 'startplasma-wayland to run GUI and launch calamares';
@@ -147,10 +147,10 @@ export default class CliAutologin {
147
147
  eggsMotd += startMessage + '\n';
148
148
  eggsMotd += Utils.flag() + '\n';
149
149
  eggsMotd += `You are logged as: ${chalk.bold(user)} your password is: ${chalk.bold(userPasswd)}, root password: ${chalk.bold(rootPasswd)}\n\n`;
150
- eggsMotd += `install : ${chalk.bold(installer)}\n`;
151
- eggsMotd += ` --unattended : ${chalk.bold('sudo eggs install --unattended')}\n`;
152
- eggsMotd += ` --chroot : ${chalk.bold('sudo eggs install --chroot')}\n`;
153
- eggsMotd += ` --help : ${chalk.bold('sudo eggs install --help')}\n\n`;
150
+ eggsMotd += `install system : ${chalk.bold(installer)}\n`;
151
+ eggsMotd += ` --unattended : ${chalk.bold('sudo eggs krill --unattended')}\n`;
152
+ eggsMotd += ` --chroot : ${chalk.bold('sudo eggs krill --chroot')}\n`;
153
+ eggsMotd += ` --help : ${chalk.bold('sudo eggs krill --help')}\n\n`;
154
154
  eggsMotd += stopMessage + '\n';
155
155
  // 🔧 [Change 9] - Same as above: safe write with error handling to improve reliability.
156
156
  try {
@@ -9,7 +9,6 @@ import inquirer from 'inquirer';
9
9
  import yaml from 'js-yaml';
10
10
  import fs from 'node:fs/promises';
11
11
  import path from 'node:path';
12
- import { exec } from '../lib/utils.js';
13
12
  import Pacman from '../classes/pacman.js';
14
13
  import Settings from '../classes/settings.js';
15
14
  import Utils from '../classes/utils.js';
@@ -147,17 +146,18 @@ export default class Daddy {
147
146
  * Apply reset or custom configuration
148
147
  */
149
148
  async applyResetOrCustomConfig(config, isCustom, fileCustom) {
150
- // Reset snapshot prefix if empty
151
149
  if (!config.snapshot_prefix) {
152
- let fstype = '';
153
- try {
154
- const { data } = await exec(`findmnt -n -o FSTYPE /`, { capture: true });
155
- fstype = data.trim() === 'ext4' ? '' : `${data.trim()}-`;
156
- }
157
- catch (err) {
158
- console.warn('Unable to detect FSTYPE:', err);
159
- }
160
- config.snapshot_prefix = Utils.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId) + fstype;
150
+ /**
151
+ * add fstype: btrfs, xfs, etc
152
+ */
153
+ // let fstype = '';
154
+ // try {
155
+ // const { data } = await exec(`findmnt -n -o FSTYPE /`, { capture: true });
156
+ // fstype = data.trim() === 'ext4' ? '' : `${data.trim()}-`;
157
+ // } catch (err) {
158
+ // console.warn('Unable to detect FSTYPE:', err);
159
+ // }
160
+ config.snapshot_prefix = Utils.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId);
161
161
  }
162
162
  // Apply custom YAML if needed
163
163
  if (isCustom && fileCustom) {
@@ -15,5 +15,10 @@ export default class Diversions {
15
15
  static kernelParameters(familyId: string, volid: string, fullCrypt?: boolean): string;
16
16
  static distro(): IDistro;
17
17
  static isManjaroBased(distro: string): boolean;
18
+ /**
19
+ *
20
+ * @param familyId
21
+ * @returns
22
+ */
18
23
  static bootloaders(familyId: string): string;
19
24
  }
@@ -7,6 +7,10 @@
7
7
  * NEW VERSION: Improved and cleaned with detailed comments and new changes
8
8
  */
9
9
  import Distro from './distro.js';
10
+ import path from 'path';
11
+ import Utils from './utils.js';
12
+ // _dirname
13
+ const __dirname = path.dirname(new URL(import.meta.url).pathname);
10
14
  export default class Diversions {
11
15
  // NEW CHANGE [1]
12
16
  // Made isSystemDBoot more readable by using direct return without extra variable.
@@ -18,21 +22,21 @@ export default class Diversions {
18
22
  // Simplified deluser function using array.includes and default value.
19
23
  // This makes adding new families easier and avoids long OR chains.
20
24
  static deluser(familyId) {
21
- const userdelFamilies = ['aldos', 'archlinux', 'fedora', 'openmamba', 'opensuse', 'voidlinux'];
25
+ const userdelFamilies = ['archlinux', 'fedora', 'openmamba', 'opensuse', 'voidlinux'];
22
26
  return userdelFamilies.includes(familyId) ? 'userdel' : 'deluser';
23
27
  }
24
28
  // NEW CHANGE [3]
25
29
  // Improved grubName using array.includes and direct return
26
30
  // Cleaner, easier to maintain if new families are added
27
31
  static grubName(familyId) {
28
- const grub2Families = ['aldos', 'fedora', 'opensuse'];
32
+ const grub2Families = [, 'fedora', 'opensuse'];
29
33
  return grub2Families.includes(familyId) ? 'grub2' : 'grub';
30
34
  }
31
35
  // NEW CHANGE [4]
32
36
  // Simplified grubForce function with array.includes
33
37
  // Provides explicit "--force" only for specific families
34
38
  static grubForce(familyId) {
35
- const forceFamilies = ['aldos', 'fedora'];
39
+ const forceFamilies = [, 'fedora'];
36
40
  return forceFamilies.includes(familyId) ? '--force' : '';
37
41
  }
38
42
  // NEW CHANGE [5]
@@ -91,10 +95,22 @@ export default class Diversions {
91
95
  const manjaroFamilies = ['Manjaro', 'Biglinux', 'Bigcommunity'];
92
96
  return manjaroFamilies.includes(distro);
93
97
  }
94
- // NEW CHANGE [8]
95
- // bootloaders path handling improved
96
- // Default path for debian, custom path for all other families
98
+ /**
99
+ *
100
+ * @param familyId
101
+ * @returns
102
+ */
97
103
  static bootloaders(familyId) {
98
- return familyId === 'debian' ? '/usr/lib/' : '/usr/lib/penguins-eggs/bootloaders/';
104
+ let pathBootloaders = '/usr/lib/';
105
+ if (familyId !== "debian") {
106
+ if (Utils.isAppImage()) {
107
+ const appImagePath = path.join(__dirname, '..', '..', 'bootloaders');
108
+ pathBootloaders = appImagePath;
109
+ }
110
+ else {
111
+ pathBootloaders = '/usr/lib/penguins-eggs/bootloaders/';
112
+ }
113
+ }
114
+ return pathBootloaders;
99
115
  }
100
116
  }
@@ -1 +1,8 @@
1
+ /**
2
+ * ./src/classes/incubation/fisherman-helper/initcpio.ts
3
+ * penguins-eggs v.25.7.x / ecmascript 2020
4
+ * author: Piero Proietti
5
+ * email: piero.proietti@gmail.com
6
+ * license: MIT
7
+ */
1
8
  export declare function initcpio(): Promise<string>;
@@ -1,3 +1,10 @@
1
+ /**
2
+ * ./src/classes/incubation/fisherman-helper/initcpio.ts
3
+ * penguins-eggs v.25.7.x / ecmascript 2020
4
+ * author: Piero Proietti
5
+ * email: piero.proietti@gmail.com
6
+ * license: MIT
7
+ */
1
8
  import { exec } from 'child_process';
2
9
  import { promisify } from 'util';
3
10
  import { access } from 'fs/promises';
@@ -90,8 +90,6 @@ export default class Fisherman {
90
90
  * and end in:
91
91
  * /etc/calamares/modules/partition.conf
92
92
  *
93
- * And we solve the issue of Sebastien who need btrfs
94
- *
95
93
  */
96
94
  if (vendor !== 'eggs') {
97
95
  let customModuleSource = path.resolve(__dirname, `../../../addons/${vendor}/theme/calamares/modules/${name}.yml`);
@@ -23,7 +23,7 @@ export default class Network {
23
23
  constructor();
24
24
  base(): string;
25
25
  bitmask(): void;
26
- broadcast(): string;
26
+ broadcast(): string | undefined;
27
27
  contains(): (address: string | Netmask | number) => boolean;
28
28
  first(): string;
29
29
  forEach(): (cb: (ip: string, long: number, index: number) => void) => void;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * ./src/classes/ovary.d/edit-live-fs.ts
3
- * penguins-eggs v.25.7.x / ecmascript 2020
3
+ * penguins-eggs v.25.11.x / ecmascript 2020
4
4
  * author: Piero Proietti
5
5
  * email: piero.proietti@gmail.com
6
6
  * license: MIT