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.
- package/.oclif.manifest.json +161 -140
- package/README.md +811 -4
- package/README.pdf +20763 -3833
- package/addons/eggs/adapt/applications/eggs-adapt.desktop +0 -0
- package/addons/eggs/pve/applications/eggs-pve.desktop +0 -0
- package/addons/eggs/rsupport/applications/eggs-rsupport.desktop +0 -0
- package/addons/eggs/theme/applications/install-system.desktop +0 -0
- package/addons/eggs/theme/livecd/full.grub.main.cfg +39 -4
- package/addons/eggs/theme/livecd/full.isolinux.main.cfg +47 -4
- package/assets/calamares/install-system.sh +0 -0
- package/assets/penguins-eggs.desktop +0 -0
- package/assets/penguins-krill.desktop +0 -0
- package/assets/penguins-links-add.desktop +0 -0
- package/assets/penguins-live-installer.desktop +0 -0
- package/bin/dev.js +0 -0
- package/bin/run.js +11 -0
- package/conf/derivatives.yaml +2 -1
- package/conf/distros/alpine/calamares/calamares-modules/machineid-openrc/machineid-openrc.sh +0 -0
- package/conf/distros/buster/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
- package/conf/distros/buster/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
- package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
- package/conf/distros/fedora/calamares/calamares-modules/bootloaderspecification/bootloaderspecification.sh +0 -0
- package/conf/distros/focal/calamares/calamares-modules/.keepit +0 -0
- package/conf/distros/focal/calamares/calamares-modules/cleanup/cleanup.sh +20 -0
- package/conf/distros/focal/calamares/calamares-modules/cleanup/module.yml +9 -0
- package/conf/distros/focal/calamares/calamares-modules/sources-yolk/module.yml +8 -0
- package/conf/distros/focal/calamares/calamares-modules/sources-yolk/sources-yolk.sh +50 -0
- package/conf/distros/focal/calamares/calamares-modules/sources-yolk-undo/module.yml +8 -0
- package/conf/distros/focal/calamares/libexec/.keepit +0 -0
- package/conf/distros/focal/calamares/libexec/README.md +5 -0
- package/conf/distros/focal/calamares/libexec/calamares-aptsources.sh +15 -0
- package/conf/distros/focal/calamares/libexec/calamares-l10n-helper.sh +38 -0
- package/conf/distros/focal/calamares/libexec/calamares-logs-helper.sh +34 -0
- package/conf/distros/focal/calamares/libexec/calamares-nomodeset.sh +19 -0
- package/conf/distros/focal/calamares/modules/after_bootloader_context.yml +26 -0
- package/conf/distros/focal/calamares/modules/before_bootloader_context.yml +12 -0
- package/conf/distros/focal/calamares/modules/bootloader.yml +86 -0
- package/conf/distros/focal/calamares/modules/bootloader.yml.old +35 -0
- package/conf/distros/focal/calamares/modules/displaymanager.yml +12 -0
- package/conf/distros/focal/calamares/modules/finished.yml +6 -0
- package/conf/distros/focal/calamares/modules/fstab.yml +63 -0
- package/conf/distros/focal/calamares/modules/grubcfg.yml +51 -0
- package/conf/distros/focal/calamares/modules/keyboard.yml +29 -0
- package/conf/distros/focal/calamares/modules/locale.yml +7 -0
- package/conf/distros/focal/calamares/modules/machineid.yml +10 -0
- package/conf/distros/focal/calamares/modules/mount.yml +20 -0
- package/conf/distros/focal/calamares/modules/netinstall.yml +5 -0
- package/conf/distros/focal/calamares/modules/packages.mustache +5 -0
- package/conf/distros/focal/calamares/modules/partition.yml +21 -0
- package/conf/distros/focal/calamares/modules/removeuser.mustache +3 -0
- package/conf/distros/focal/calamares/modules/shellprocess@aptsources.yml +11 -0
- package/conf/distros/focal/calamares/modules/shellprocess@boot_deploy.yml +9 -0
- package/conf/distros/focal/calamares/modules/shellprocess@boot_reconfigure.yml +15 -0
- package/conf/distros/focal/calamares/modules/shellprocess@install_translations.yml +8 -0
- package/conf/distros/focal/calamares/modules/shellprocess@logs.yml +8 -0
- package/conf/distros/focal/calamares/modules/shellprocess@mkinitramfs.yml +6 -0
- package/conf/distros/focal/calamares/modules/shellprocess@nomodeset.yml +12 -0
- package/conf/distros/focal/calamares/modules/umount.yml +4 -0
- package/conf/distros/focal/calamares/modules/unpackfs.mustache +6 -0
- package/conf/distros/focal/calamares/modules/users.yml +27 -0
- package/conf/distros/focal/calamares/modules/welcome.yml +24 -0
- package/conf/distros/focal/calamares/settings.yml +97 -0
- package/conf/distros/noble/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
- package/conf/distros/noble/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
- package/conf/distros/noble/calamares/libexec/calamares-aptsources.sh +0 -0
- package/conf/distros/noble/calamares/libexec/calamares-l10n-helper.sh +0 -0
- package/conf/distros/noble/calamares/libexec/calamares-logs-helper.sh +0 -0
- package/conf/distros/noble/calamares/libexec/calamares-nomodeset.sh +0 -0
- package/conf/distros/opensuse/calamares/calamares-modules/bootloaderspecification/bootloaderspecification.sh +0 -0
- package/conf/distros/opensuse/calamares/settings.yml +0 -0
- package/conf/distros/opensuse/calamares/zstd2lzo.sh +0 -0
- package/conf/distros/trixie/calamares/calamares-modules/cleanup/cleanup.sh +0 -0
- package/conf/distros/trixie/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -0
- package/conf/distros/trixie/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -0
- package/conf/init/unattended.sh +0 -0
- package/dist/appimage/dependency-manager.d.ts +31 -0
- package/dist/appimage/dependency-manager.js +292 -0
- package/dist/appimage/first-run-check.d.ts +8 -0
- package/dist/appimage/first-run-check.js +13 -0
- package/dist/bin/dev.cmd +3 -0
- package/dist/bin/dev.js +6 -0
- package/dist/bin/run.cmd +3 -0
- package/dist/bin/run.js +16 -0
- package/dist/classes/cli-autologin.js +5 -5
- package/dist/classes/daddy.js +11 -11
- package/dist/classes/diversions.d.ts +5 -0
- package/dist/classes/diversions.js +23 -7
- package/dist/classes/incubation/fisherman-helper/initcpio.d.ts +7 -0
- package/dist/classes/incubation/fisherman-helper/initcpio.js +7 -0
- package/dist/classes/incubation/fisherman.js +0 -2
- package/dist/classes/network.d.ts +1 -1
- package/dist/classes/ovary.d/edit-live-fs.d.ts +1 -1
- package/dist/classes/ovary.d/edit-live-fs.js +129 -93
- package/dist/classes/ovary.d/fertilization.js +1 -1
- package/dist/classes/ovary.d/xorriso-command.js +1 -5
- package/dist/classes/pacman.d.ts +21 -7
- package/dist/classes/pacman.js +59 -39
- package/dist/classes/utils.d.ts +5 -5
- package/dist/classes/utils.js +30 -11
- package/dist/commands/calamares.js +1 -1
- package/dist/commands/config.js +3 -14
- package/dist/commands/cuckoo.js +1 -1
- package/dist/commands/{analyze.d.ts → export/appimage.d.ts} +10 -9
- package/dist/commands/export/appimage.js +76 -0
- package/dist/commands/export/iso.js +1 -1
- package/dist/commands/export/pkg.d.ts +1 -1
- package/dist/commands/export/pkg.js +2 -2
- package/dist/commands/{install.d.ts → krill.d.ts} +3 -4
- package/dist/commands/{install.js → krill.js} +5 -6
- package/dist/commands/produce.js +1 -1
- package/dist/commands/setup/install.d.ts +17 -0
- package/dist/commands/setup/install.js +71 -0
- package/dist/commands/setup/purge.d.ts +17 -0
- package/dist/commands/setup/purge.js +71 -0
- package/dist/commands/tools/repo.d.ts +0 -5
- package/dist/commands/tools/repo.js +205 -127
- package/dist/commands/update.d.ts +16 -1
- package/dist/commands/update.js +140 -63
- package/dist/krill/components/information.js +2 -2
- package/dist/krill/components/title.js +13 -13
- package/dist/lib/utils.d.ts +16 -0
- package/dist/lib/utils.js +5 -32
- package/dracut/create-symlink +0 -0
- package/dracut/export +0 -0
- package/dracut/export-dracut-analysis +0 -0
- package/dracut/export-dracut-log +0 -0
- package/dracut/mkisofs +0 -0
- package/dracut/modules.d/00debug-shell/debug-hook.sh +0 -0
- package/dracut/modules.d/00debug-shell/module-setup.sh +0 -0
- package/dracut/modules.d/90block/block-cmdline.sh +0 -0
- package/dracut/modules.d/90block/module-setup.sh +0 -0
- package/dracut/modules.d/95iso-scan/iso-scan-fallback.sh +0 -0
- package/dracut/modules.d/95iso-scan/iso-scan.sh +0 -0
- package/dracut/modules.d/95iso-scan/module-setup.sh +0 -0
- package/dracut/modules.d/95luks-loop/luks-loop.sh +0 -0
- package/dracut/modules.d/95luks-loop/module-setup.sh +0 -0
- package/dracut/renew-initramfs +0 -0
- package/dracut/sbin2bin +0 -0
- package/dracut/update-dracut-conf-d +0 -0
- package/dracut/update-dracut-modules +0 -0
- package/eui/eui-autostart-cinnamon.desktop +0 -0
- package/eui/eui-autostart-xfce.desktop +0 -0
- package/eui/eui-create-image.sh +0 -0
- package/eui/eui-start.sh +0 -0
- package/manpages/doc/man/eggs.1.gz +0 -0
- package/manpages/doc/man/eggs.html +594 -9
- package/package.json +124 -130
- package/perrisbrewery/scripts/postinst +0 -0
- package/perrisbrewery/scripts/postrm +0 -0
- package/perrisbrewery/scripts/preinst +0 -0
- package/perrisbrewery/scripts/prerm +0 -0
- package/perrisbrewery/template/dependencies.yaml +0 -5
- package/perrisbrewery/template/man.template.md +7 -0
- package/scripts/99clean +0 -0
- package/scripts/_eggs +56 -47
- package/scripts/adapt.sh +0 -0
- package/scripts/bros/waydroid-helper.sh +0 -0
- package/scripts/eggs.bash +4 -4
- package/scripts/lsb_release +0 -0
- package/scripts/mom.sh +0 -0
- package/scripts/pve-live.service +0 -0
- package/scripts/pve-live.sh +0 -0
- package/scripts/resy +0 -0
- package/dist/commands/analyze.js +0 -95
- package/dist/commands/pods.d.ts +0 -22
- package/dist/commands/pods.js +0 -92
- package/scripts/boot-encrypted-root.sh +0 -220
- 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,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
|
+
}
|
package/dist/bin/dev.cmd
ADDED
package/dist/bin/dev.js
ADDED
package/dist/bin/run.cmd
ADDED
package/dist/bin/run.js
ADDED
|
@@ -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
|
|
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
|
|
151
|
-
eggsMotd += ` --unattended : ${chalk.bold('sudo eggs
|
|
152
|
-
eggsMotd += ` --chroot : ${chalk.bold('sudo eggs
|
|
153
|
-
eggsMotd += ` --help : ${chalk.bold('sudo eggs
|
|
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 {
|
package/dist/classes/daddy.js
CHANGED
|
@@ -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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
|
|
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 = ['
|
|
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 = [
|
|
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 = [
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
* @param familyId
|
|
101
|
+
* @returns
|
|
102
|
+
*/
|
|
97
103
|
static bootloaders(familyId) {
|
|
98
|
-
|
|
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,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;
|