penguins-eggs 25.11.21 → 25.12.7
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 +53 -41
- package/README.md +80 -36
- package/README.pdf +21575 -3241
- package/addons/eggs/theme/livecd/full.grub.main.cfg +39 -4
- package/addons/eggs/theme/livecd/full.isolinux.main.cfg +47 -4
- package/bin/run.js +11 -0
- package/conf/derivatives.yaml +4 -2
- package/conf/exclude.list.d/var.list +11 -6
- package/dist/appimage/dependency-manager.d.ts +31 -0
- package/dist/appimage/dependency-manager.js +292 -0
- package/dist/appimage/first-run-check.js +3 -3
- package/dist/bin/run.js +11 -0
- package/dist/classes/cli-autologin.js +78 -53
- package/dist/classes/compressors.d.ts +7 -10
- package/dist/classes/compressors.js +44 -31
- package/dist/classes/daddy.js +11 -11
- package/dist/classes/distro.js +2 -2
- package/dist/classes/diversions.js +2 -3
- package/dist/classes/incubation/fisherman-helper/initcpio.d.ts +4 -0
- package/dist/classes/incubation/fisherman-helper/initcpio.js +14 -4
- package/dist/classes/incubation/fisherman-helper/settings.js +1 -1
- package/dist/classes/incubation/fisherman.js +1 -3
- package/dist/classes/incubation/incubator.js +1 -1
- package/dist/classes/network.d.ts +1 -1
- package/dist/classes/ovary.d/create-xdg-autostart.js +1 -1
- package/dist/classes/ovary.d/edit-live-fs.d.ts +1 -12
- package/dist/classes/ovary.d/edit-live-fs.js +216 -186
- package/dist/classes/ovary.d/fertilization.js +1 -1
- package/dist/classes/ovary.d/make-dot-disk.js +1 -1
- package/dist/classes/ovary.d/produce.js +1 -1
- package/dist/classes/ovary.d/user-create-live.d.ts +4 -10
- package/dist/classes/ovary.d/user-create-live.js +82 -84
- package/dist/classes/ovary.d/users-remove.d.ts +5 -6
- package/dist/classes/ovary.d/users-remove.js +61 -31
- package/dist/classes/ovary.d/xorriso-command.js +1 -5
- package/dist/classes/ovary.d.ts +2 -2
- package/dist/classes/ovary.js +2 -2
- package/dist/classes/pacman.d/alpine.js +2 -2
- package/dist/classes/pacman.d/archlinux.js +2 -2
- package/dist/classes/pacman.d/debian.js +2 -3
- package/dist/classes/pacman.d/fedora.js +2 -3
- package/dist/classes/pacman.d/openmamba.js +2 -3
- package/dist/classes/pacman.d/opensuse.js +2 -3
- package/dist/classes/pacman.d.ts +21 -12
- package/dist/classes/pacman.js +55 -47
- package/dist/classes/pve-live.js +1 -1
- package/dist/classes/settings.js +1 -1
- package/dist/classes/sys-users.d.ts +76 -0
- package/dist/classes/sys-users.js +206 -0
- package/dist/classes/utils.d/kernel.js +3 -3
- package/dist/classes/utils.d.ts +16 -11
- package/dist/classes/utils.js +92 -56
- package/dist/classes/xdg.js +1 -1
- package/dist/classes/yolk.js +2 -4
- package/dist/commands/config.js +3 -14
- package/dist/commands/cuckoo.js +1 -1
- package/dist/commands/export/appimage.js +3 -3
- package/dist/commands/export/pkg.js +3 -3
- package/dist/commands/export/tarballs.js +3 -3
- package/dist/commands/krill.js +1 -1
- package/dist/commands/produce.js +9 -4
- package/dist/commands/{setup.d.ts → setup/install.d.ts} +1 -5
- 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/yolk.js +1 -1
- package/dist/commands/update.d.ts +15 -0
- package/dist/commands/update.js +74 -7
- package/dist/interfaces/i-exec.d.ts +1 -0
- package/dist/krill/classes/prepare.d/location.js +1 -1
- package/dist/krill/classes/prepare.d/partitions.js +1 -1
- package/dist/krill/classes/prepare.d/users.js +2 -2
- package/dist/krill/classes/prepare.js +5 -5
- package/dist/krill/classes/sequence.d/add_user.d.ts +3 -15
- package/dist/krill/classes/sequence.d/add_user.js +87 -57
- package/dist/krill/classes/sequence.d/change_password.d.ts +5 -7
- package/dist/krill/classes/sequence.d/change_password.js +25 -10
- package/dist/krill/classes/sequence.d/del_live_user.d.ts +5 -7
- package/dist/krill/classes/sequence.d/del_live_user.js +39 -25
- package/dist/krill/classes/sequence.d/fstab.js +1 -1
- package/dist/krill/classes/sequence.d/grubcfg.d.ts +3 -7
- package/dist/krill/classes/sequence.d/grubcfg.js +33 -13
- package/dist/krill/classes/sequence.d/mkfs.js +1 -2
- package/dist/krill/classes/sequence.d/unpackfs.d.ts +2 -4
- package/dist/krill/classes/sequence.d/unpackfs.js +8 -5
- package/dist/krill/classes/sequence.js +2 -3
- package/dist/krill/components/title.js +4 -4
- package/dist/krill/lib/select_installation_device.js +1 -1
- package/dist/krill/lib/select_replaced_partition.js +1 -1
- package/dist/lib/utils.d.ts +51 -19
- package/dist/lib/utils.js +225 -39
- package/manpages/doc/man/eggs.1.gz +0 -0
- package/manpages/doc/man/eggs.html +29 -17
- package/package.json +13 -14
- package/perrisbrewery/template/dependencies.yaml +1 -0
- package/scripts/_eggs +35 -7
- package/scripts/boot-encrypted-root.sh +220 -0
- package/scripts/eggs.bash +2 -1
- package/scripts/mount-encrypted-home.sh +324 -0
- package/dist/appimage/prerequisites.d.ts +0 -34
- package/dist/appimage/prerequisites.js +0 -350
- package/dist/commands/setup.js +0 -90
- package/dracut/create-symlink +0 -71
- package/dracut/dracut-log.txt +0 -3
- package/dracut/export +0 -4
- package/dracut/export-dracut-analysis +0 -51
- package/dracut/export-dracut-log +0 -2
- package/dracut/mkisofs +0 -10
- package/dracut/renew-initramfs +0 -17
- package/dracut/sbin2bin +0 -10
- package/dracut/update-dracut-conf-d +0 -2
- package/dracut/update-dracut-modules +0 -62
- package/scripts/appimage-build.sh +0 -152
- package/scripts/appimage-install.sh +0 -43
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ./src/appimage/prerequisites.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 { execSync } from 'node:child_process';
|
|
9
|
-
import Utils from '../classes/utils.js';
|
|
10
|
-
import Distro from '../classes/distro.js';
|
|
11
|
-
import Diversions from '../classes/diversions.js';
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
export class Prerequisites {
|
|
16
|
-
distro;
|
|
17
|
-
constructor() {
|
|
18
|
-
this.distro = new Distro();
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* install
|
|
22
|
-
* @returns
|
|
23
|
-
*/
|
|
24
|
-
async install(force = false) {
|
|
25
|
-
const packages = this.getPackagesForDistro();
|
|
26
|
-
if (packages.length === 0) {
|
|
27
|
-
console.log('ERROR: Unsupported distribution for automatic setup');
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
let missing = packages.filter(pkg => !this.isPackageInstalled(pkg));
|
|
31
|
-
if (force) {
|
|
32
|
-
missing = packages;
|
|
33
|
-
}
|
|
34
|
-
console.log('');
|
|
35
|
-
console.log('The following packages will be installed/reinstalled:');
|
|
36
|
-
console.log(`${missing.join(', ')}`);
|
|
37
|
-
console.log('');
|
|
38
|
-
if (await Utils.customConfirm('Select yes to continue...')) {
|
|
39
|
-
const installCmd = this.getInstallCommand(missing, force);
|
|
40
|
-
Utils.titles(installCmd);
|
|
41
|
-
try {
|
|
42
|
-
console.log('Installing packages (this may take a few minutes)...');
|
|
43
|
-
//execSync(installCmd, { stdio: 'inherit' })
|
|
44
|
-
execSync(installCmd, { stdio: 'ignore' });
|
|
45
|
-
console.log('');
|
|
46
|
-
console.log('SUCCESS: Prerequisites installed successfully!');
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
console.log('');
|
|
51
|
-
console.log('ERROR: Failed to install prerequisites');
|
|
52
|
-
console.log('Error details:', error instanceof Error ? error.message : 'Unknown error');
|
|
53
|
-
console.log('');
|
|
54
|
-
console.log('Please check your system and try again.');
|
|
55
|
-
console.log('You can also install prerequisites manually using your package manager.');
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* @returns
|
|
64
|
-
*/
|
|
65
|
-
check() {
|
|
66
|
-
try {
|
|
67
|
-
const packages = this.getPackagesForDistro();
|
|
68
|
-
if (packages.length === 0) {
|
|
69
|
-
console.log('WARNING: Unsupported distribution - cannot check prerequisites');
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
const missing = packages.filter(pkg => !this.isPackageInstalled(pkg));
|
|
73
|
-
if (missing.length > 0) {
|
|
74
|
-
console.log(`MISSING: ${missing.length} of ${packages.length} packages`);
|
|
75
|
-
console.log(`${missing.join(', ')}`);
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
console.log(`SUCCESS: All ${packages.length} packages are installed`);
|
|
79
|
-
return true;
|
|
80
|
-
}
|
|
81
|
-
catch (error) {
|
|
82
|
-
console.log('ERROR: Failed to check prerequisites');
|
|
83
|
-
console.log('Error details:', error instanceof Error ? error.message : 'Unknown error');
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
*
|
|
89
|
-
* @param packages
|
|
90
|
-
* @returns
|
|
91
|
-
*/
|
|
92
|
-
getInstallCommand(packages, forceReinstall = false) {
|
|
93
|
-
const packagesStr = packages.join(' ');
|
|
94
|
-
switch (this.distro.familyId) {
|
|
95
|
-
case 'debian':
|
|
96
|
-
// apt richiede il flag --reinstall per forzare la sovrascrittura
|
|
97
|
-
const aptCmd = forceReinstall ? 'install --reinstall' : 'install';
|
|
98
|
-
return `sudo apt-get update && sudo apt-get ${aptCmd} -y ${packagesStr}`;
|
|
99
|
-
case 'archlinux':
|
|
100
|
-
// Pacman -S reinstalla di default.
|
|
101
|
-
// (Se volessimo evitare reinstallazioni su Arch useremmo --needed, ma qui va bene così)
|
|
102
|
-
return `sudo pacman -S --noconfirm ${packagesStr}`;
|
|
103
|
-
case 'fedora':
|
|
104
|
-
// dnf ha un comando specifico 'reinstall'
|
|
105
|
-
const dnfCmd = forceReinstall ? 'reinstall' : 'install';
|
|
106
|
-
return `sudo dnf ${dnfCmd} -y ${packagesStr}`;
|
|
107
|
-
default:
|
|
108
|
-
return `echo "Unsupported distribution: ${this.distro.familyId}"`;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
*
|
|
113
|
-
* @param pkg
|
|
114
|
-
* @returns
|
|
115
|
-
*/
|
|
116
|
-
isPackageInstalled(pkg) {
|
|
117
|
-
try {
|
|
118
|
-
switch (this.distro.familyId) {
|
|
119
|
-
case 'debian':
|
|
120
|
-
// Verifica se il pacchetto è installato
|
|
121
|
-
execSync(`dpkg -s ${pkg}`, { stdio: 'ignore' });
|
|
122
|
-
return true;
|
|
123
|
-
case 'archlinux':
|
|
124
|
-
// Verifica se il pacchetto è installato su Arch
|
|
125
|
-
execSync(`pacman -Q ${pkg}`, { stdio: 'ignore' });
|
|
126
|
-
return true;
|
|
127
|
-
case 'fedora':
|
|
128
|
-
// Verifica se il pacchetto è installato su fedora/Fedora
|
|
129
|
-
execSync(`rpm -q ${pkg}`, { stdio: 'ignore' });
|
|
130
|
-
return true;
|
|
131
|
-
default:
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
catch {
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
*
|
|
141
|
-
* @returns
|
|
142
|
-
*/
|
|
143
|
-
getPackagesForDistro() {
|
|
144
|
-
/**
|
|
145
|
-
* normalize as packageList
|
|
146
|
-
*/
|
|
147
|
-
let packagesList = this.distro.familyId;
|
|
148
|
-
if (this.distro.familyId === 'el9') {
|
|
149
|
-
packagesList = 'fedora';
|
|
150
|
-
}
|
|
151
|
-
if (this.distro.familyId === 'archlinux' && Diversions.isManjaroBased(this.distro.distroLike)) {
|
|
152
|
-
packagesList = 'manjaro';
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* we select from packageList
|
|
156
|
-
*/
|
|
157
|
-
if (packagesList === 'alpine') {
|
|
158
|
-
return [
|
|
159
|
-
'alpine-conf',
|
|
160
|
-
'apk-tools',
|
|
161
|
-
'bash',
|
|
162
|
-
'bash-completion',
|
|
163
|
-
'cryptsetup',
|
|
164
|
-
'curl',
|
|
165
|
-
'device-mapper-libs',
|
|
166
|
-
'dosfstools',
|
|
167
|
-
// 'fuse',
|
|
168
|
-
'git',
|
|
169
|
-
'grub-bios',
|
|
170
|
-
'grub-efi',
|
|
171
|
-
'jq',
|
|
172
|
-
'lsblk',
|
|
173
|
-
'lvm2',
|
|
174
|
-
'mkinitfs',
|
|
175
|
-
'musl-locales',
|
|
176
|
-
// 'nodejs',
|
|
177
|
-
'parted',
|
|
178
|
-
'polkit',
|
|
179
|
-
'rsync',
|
|
180
|
-
'shadow',
|
|
181
|
-
'squashfs-tools',
|
|
182
|
-
'sshfs',
|
|
183
|
-
'xorriso',
|
|
184
|
-
'zstd',
|
|
185
|
-
'libc6-compat',
|
|
186
|
-
];
|
|
187
|
-
}
|
|
188
|
-
else if (packagesList === 'archlinux') {
|
|
189
|
-
return [
|
|
190
|
-
'arch-install-scripts',
|
|
191
|
-
'cryptsetup',
|
|
192
|
-
'curl',
|
|
193
|
-
'dosfstools',
|
|
194
|
-
'efibootmgr',
|
|
195
|
-
'erofs-utils',
|
|
196
|
-
'findutils',
|
|
197
|
-
// 'fuse2',
|
|
198
|
-
'git',
|
|
199
|
-
'gnupg',
|
|
200
|
-
'grub',
|
|
201
|
-
'jq',
|
|
202
|
-
'libarchive',
|
|
203
|
-
'libisoburn',
|
|
204
|
-
'lvm2',
|
|
205
|
-
'mkinitcpio-archiso',
|
|
206
|
-
'mkinitcpio-nfs-utils',
|
|
207
|
-
'mtools',
|
|
208
|
-
'nbd',
|
|
209
|
-
// 'nodejs',
|
|
210
|
-
'pacman-contrib',
|
|
211
|
-
'parted',
|
|
212
|
-
'polkit',
|
|
213
|
-
'procps-ng',
|
|
214
|
-
'pv',
|
|
215
|
-
'python',
|
|
216
|
-
'rsync',
|
|
217
|
-
'squashfs-tools',
|
|
218
|
-
'sshfs',
|
|
219
|
-
'syslinux',
|
|
220
|
-
'wget',
|
|
221
|
-
'xdg-utils',
|
|
222
|
-
];
|
|
223
|
-
}
|
|
224
|
-
else if (packagesList === 'debian') {
|
|
225
|
-
let debianPackages = [
|
|
226
|
-
'cryptsetup',
|
|
227
|
-
'curl',
|
|
228
|
-
'dosfstools',
|
|
229
|
-
'dpkg-dev',
|
|
230
|
-
'git',
|
|
231
|
-
'gnupg',
|
|
232
|
-
'grub-efi-amd64-bin',
|
|
233
|
-
'grub-pc-bin',
|
|
234
|
-
'grub2-common',
|
|
235
|
-
'ipxe',
|
|
236
|
-
'isolinux',
|
|
237
|
-
'jq',
|
|
238
|
-
'live-boot',
|
|
239
|
-
'live-boot-initramfs-tools',
|
|
240
|
-
'live-config',
|
|
241
|
-
'lvm2',
|
|
242
|
-
'parted',
|
|
243
|
-
'rsync',
|
|
244
|
-
'squashfs-tools',
|
|
245
|
-
'sshfs',
|
|
246
|
-
'syslinux-common',
|
|
247
|
-
'syslinux',
|
|
248
|
-
'xorriso',
|
|
249
|
-
];
|
|
250
|
-
if (Utils.isSystemd()) {
|
|
251
|
-
debianPackages.push('live-config-systemd');
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
debianPackages.push('live-config-sysvinit');
|
|
255
|
-
}
|
|
256
|
-
debianPackages.sort();
|
|
257
|
-
return debianPackages;
|
|
258
|
-
}
|
|
259
|
-
else if (packagesList === 'fedora') {
|
|
260
|
-
return [
|
|
261
|
-
'cryptsetup',
|
|
262
|
-
'curl',
|
|
263
|
-
'device-mapper',
|
|
264
|
-
'dosfstools',
|
|
265
|
-
'dracut-live',
|
|
266
|
-
'dracut',
|
|
267
|
-
'efibootmgr',
|
|
268
|
-
// 'fuse',
|
|
269
|
-
'git',
|
|
270
|
-
'jq',
|
|
271
|
-
'lvm2',
|
|
272
|
-
// 'nodejs',
|
|
273
|
-
'nvme-cli',
|
|
274
|
-
'parted',
|
|
275
|
-
'polkit',
|
|
276
|
-
'rsync',
|
|
277
|
-
'squashfs-tools',
|
|
278
|
-
'sshfs',
|
|
279
|
-
'wget',
|
|
280
|
-
'xdg-utils',
|
|
281
|
-
'xorriso',
|
|
282
|
-
'zstd',
|
|
283
|
-
];
|
|
284
|
-
}
|
|
285
|
-
else if (packagesList === 'manjaro') {
|
|
286
|
-
return [
|
|
287
|
-
'arch-install-scripts',
|
|
288
|
-
'curl',
|
|
289
|
-
'dosfstools',
|
|
290
|
-
'efibootmgr',
|
|
291
|
-
'erofs-utils',
|
|
292
|
-
'findutils',
|
|
293
|
-
// 'fuse2',
|
|
294
|
-
'git',
|
|
295
|
-
'gnupg',
|
|
296
|
-
'grub',
|
|
297
|
-
'jq',
|
|
298
|
-
'libarchive',
|
|
299
|
-
'libisoburn',
|
|
300
|
-
'lvm2',
|
|
301
|
-
'manjaro-tools-iso',
|
|
302
|
-
'mkinitcpio-nfs-utils',
|
|
303
|
-
'mtools',
|
|
304
|
-
'nbd',
|
|
305
|
-
// 'nodejs',
|
|
306
|
-
'pacman-contrib',
|
|
307
|
-
'parted',
|
|
308
|
-
'polkit',
|
|
309
|
-
'procps-ng',
|
|
310
|
-
'pv',
|
|
311
|
-
'python',
|
|
312
|
-
'rsync',
|
|
313
|
-
'squashfs-tools',
|
|
314
|
-
'sshfs',
|
|
315
|
-
'wget',
|
|
316
|
-
'xdg-utils',
|
|
317
|
-
];
|
|
318
|
-
}
|
|
319
|
-
else if (packagesList === 'opensuse') {
|
|
320
|
-
return [
|
|
321
|
-
'cryptsetup',
|
|
322
|
-
'curl',
|
|
323
|
-
'device-mapper',
|
|
324
|
-
'dosfstools',
|
|
325
|
-
'dracut-kiwi-live',
|
|
326
|
-
'dracut',
|
|
327
|
-
'efibootmgr',
|
|
328
|
-
// 'fuse-sshfs',
|
|
329
|
-
// 'fuse',
|
|
330
|
-
'git',
|
|
331
|
-
'jq',
|
|
332
|
-
'lvm2',
|
|
333
|
-
// 'nodejs',
|
|
334
|
-
'nvme-cli',
|
|
335
|
-
'parted',
|
|
336
|
-
'polkit',
|
|
337
|
-
'rsync',
|
|
338
|
-
'squashfs-tools',
|
|
339
|
-
'wget',
|
|
340
|
-
'xdg-utils',
|
|
341
|
-
'xorriso',
|
|
342
|
-
'zstd',
|
|
343
|
-
];
|
|
344
|
-
}
|
|
345
|
-
else {
|
|
346
|
-
console.log(`This distro ${this.distro.distroId}/${this.distro.codenameId} is not yet recognized!`);
|
|
347
|
-
return [];
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
package/dist/commands/setup.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ./src/commands/setup.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 Utils from '../classes/utils.js';
|
|
10
|
-
import Pacman from '../classes/pacman.js';
|
|
11
|
-
import { Prerequisites } from '../appimage/prerequisites.js';
|
|
12
|
-
import { Command, Flags } from '@oclif/core';
|
|
13
|
-
export default class Setup extends Command {
|
|
14
|
-
static description = 'Automatically check and install system prerequisites';
|
|
15
|
-
static flags = {
|
|
16
|
-
check: Flags.boolean({ char: 'c', description: 'check status only, do not install' }),
|
|
17
|
-
force: Flags.boolean({ char: 'f', description: 'force installation even if already installed' }),
|
|
18
|
-
};
|
|
19
|
-
static examples = [
|
|
20
|
-
'sudo eggs setup # install prerequisites',
|
|
21
|
-
'sudo eggs setup --check # check prerequisites presence',
|
|
22
|
-
'sudo eggs setup --force # force prerequisites install',
|
|
23
|
-
];
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
async run() {
|
|
29
|
-
Utils.titles(this.id + ' ' + this.argv);
|
|
30
|
-
/**
|
|
31
|
-
* continue only on AppImage
|
|
32
|
-
*/
|
|
33
|
-
if (!Utils.isAppImage()) {
|
|
34
|
-
console.log("The eggs setup command is only applicable on the AppImage version.");
|
|
35
|
-
process.exit();
|
|
36
|
-
}
|
|
37
|
-
const distro = new Distro();
|
|
38
|
-
const osInfo = Utils.getOsRelease();
|
|
39
|
-
const codenameId = osInfo.VERSION_CODENAME;
|
|
40
|
-
const releaseId = osInfo.VERSION_ID;
|
|
41
|
-
const distroId = osInfo.ID;
|
|
42
|
-
console.log(`AppImage running on: ${distroId}/${codenameId} compatible: ${distro.distroLike}/${distro.distroUniqueId} family: ${distro.familyId}`);
|
|
43
|
-
const { flags } = await this.parse(Setup);
|
|
44
|
-
const prerequisites = new Prerequisites();
|
|
45
|
-
if (Utils.isRoot()) {
|
|
46
|
-
// Install autocomplete e manPages
|
|
47
|
-
await Pacman.autocompleteInstall();
|
|
48
|
-
await Pacman.manPageInstall();
|
|
49
|
-
if (flags.check) {
|
|
50
|
-
this.log('Checking system prerequisites...');
|
|
51
|
-
const allInstalled = prerequisites.check();
|
|
52
|
-
if (allInstalled) {
|
|
53
|
-
this.log('SUCCESS: All prerequisites are installed');
|
|
54
|
-
this.log('Your system is ready for penguins-eggs!');
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
this.log('WARNING: Some prerequisites are missing');
|
|
58
|
-
this.log('Run: eggs setup (without --check) to install them automatically');
|
|
59
|
-
}
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
// Setup automatico: check + install
|
|
63
|
-
this.log('Checking current system status...');
|
|
64
|
-
const allInstalled = prerequisites.check();
|
|
65
|
-
// Se tutto è installato esce, e non --force
|
|
66
|
-
if (allInstalled && !flags.force) {
|
|
67
|
-
this.log('SUCCESS: All prerequisites are already installed');
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
// reinstalla
|
|
71
|
-
if (allInstalled && flags.force) {
|
|
72
|
-
this.log('Reinstalling prerequisites.');
|
|
73
|
-
}
|
|
74
|
-
const success = await prerequisites.install(flags.force);
|
|
75
|
-
if (success) {
|
|
76
|
-
this.log('');
|
|
77
|
-
this.log('SUCCESS: penguins-eggs setup completed!');
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
this.log('');
|
|
81
|
-
this.log('ERROR: Setup failed');
|
|
82
|
-
this.log('Please check your system and try again.');
|
|
83
|
-
this.log('You can also install prerequisites manually using your package manager.');
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
Utils.useRoot(this.id);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
package/dracut/create-symlink
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
# Script per creare symlink dei moduli Penguins-Eggs in /usr/lib/dracut/modules.d
|
|
4
|
-
# Questo è necessario perché Dracut 106 su Debian non legge dracutmodules_dirs con --confdir
|
|
5
|
-
#
|
|
6
|
-
|
|
7
|
-
set -e
|
|
8
|
-
|
|
9
|
-
CUSTOM_DIR="/usr/lib/penguins-eggs/dracut/modules.d"
|
|
10
|
-
SYSTEM_DIR="/usr/lib/dracut/modules.d"
|
|
11
|
-
|
|
12
|
-
echo "=== Creazione Symlink Moduli Dracut ==="
|
|
13
|
-
echo ""
|
|
14
|
-
|
|
15
|
-
# Verifica di essere root
|
|
16
|
-
if [ "$EUID" -ne 0 ]; then
|
|
17
|
-
echo "ERRORE: Esegui come root (sudo)"
|
|
18
|
-
exit 1
|
|
19
|
-
fi
|
|
20
|
-
|
|
21
|
-
# Verifica directory
|
|
22
|
-
if [ ! -d "$CUSTOM_DIR" ]; then
|
|
23
|
-
echo "ERRORE: $CUSTOM_DIR non esiste"
|
|
24
|
-
exit 1
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
if [ ! -d "$SYSTEM_DIR" ]; then
|
|
28
|
-
echo "ERRORE: $SYSTEM_DIR non esiste"
|
|
29
|
-
exit 1
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
# Lista moduli
|
|
33
|
-
MODULES=(
|
|
34
|
-
"00debug-shell"
|
|
35
|
-
"90block"
|
|
36
|
-
"95iso-scan"
|
|
37
|
-
"95luks"
|
|
38
|
-
"95luks-loop"
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
echo "Creazione symlink..."
|
|
42
|
-
for module in "${MODULES[@]}"; do
|
|
43
|
-
SOURCE="$CUSTOM_DIR/$module"
|
|
44
|
-
TARGET="$SYSTEM_DIR/$module"
|
|
45
|
-
|
|
46
|
-
if [ ! -d "$SOURCE" ]; then
|
|
47
|
-
echo " [SKIP] $module - non trovato"
|
|
48
|
-
continue
|
|
49
|
-
fi
|
|
50
|
-
|
|
51
|
-
# Rimuovi esistente
|
|
52
|
-
if [ -e "$TARGET" ] || [ -L "$TARGET" ]; then
|
|
53
|
-
rm -rf "$TARGET"
|
|
54
|
-
fi
|
|
55
|
-
|
|
56
|
-
# Crea symlink
|
|
57
|
-
ln -sf "$SOURCE" "$TARGET"
|
|
58
|
-
echo " [OK] $module"
|
|
59
|
-
done
|
|
60
|
-
|
|
61
|
-
echo ""
|
|
62
|
-
echo "Verifica symlink creati:"
|
|
63
|
-
ls -la "$SYSTEM_DIR" | grep -E "(debug-shell|90block|iso-scan|95luks)"
|
|
64
|
-
|
|
65
|
-
echo ""
|
|
66
|
-
echo "Test dracut --list-modules:"
|
|
67
|
-
dracut --list-modules 2>&1 | grep -E "(debug-shell|90block|iso-scan|95luks)" || echo " ATTENZIONE: moduli non ancora visibili"
|
|
68
|
-
|
|
69
|
-
echo ""
|
|
70
|
-
echo "=== Completato ==="
|
|
71
|
-
|
package/dracut/dracut-log.txt
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
dracut[I]: Executing: /usr/bin/dracut --force --confdir /usr/lib/penguins-eggs/dracut/dracut.conf.d --kmoddir /lib/modules/6.12.48+deb13-amd64 /home/eggs/iso/live/initrd.img-6.12.48+deb13-amd64 6.12.48+deb13-amd64
|
|
2
|
-
dracut[I]: 62bluetooth: Could not find any command of '/usr/lib/bluetooth/bluetoothd /usr/libexec/bluetooth/bluetoothd'!
|
|
3
|
-
dracut[E]: Module '90block' cannot be found.
|
package/dracut/export
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
./export-dracut-analysis /usr/lib/penguins-eggs/dracut/modules.d /usr/lib/penguins-eggs/dracut/dracut.conf.d
|
|
2
|
-
scp dracut-analisys.txt artisan@192.168.1.2:/home/artisan
|
|
3
|
-
scp /home/eggs/iso/egg-of_debian-trixie-* artisan@192.168.1.2:/home/artisan/dracut-log.txt
|
|
4
|
-
rm dracut-analisys.txt
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Script per consolidare il contenuto di più directory di configurazione Dracut
|
|
4
|
-
# in un unico file di testo.
|
|
5
|
-
|
|
6
|
-
# --- Impostazioni ---
|
|
7
|
-
OUTPUT_FILE="dracut-analysis.txt"
|
|
8
|
-
|
|
9
|
-
# --- Logica dello Script ---
|
|
10
|
-
|
|
11
|
-
# Controlla se è stato fornito almeno un percorso come argomento
|
|
12
|
-
if [ "$#" -eq 0 ]; then
|
|
13
|
-
echo "ERRORE: Devi specificare almeno un percorso di directory."
|
|
14
|
-
echo "Uso: $0 <percorso_dir_1> [<percorso_dir_2> ...]"
|
|
15
|
-
echo "Esempio: $0 ./modules.d ./dracut.conf.d"
|
|
16
|
-
exit 1
|
|
17
|
-
fi
|
|
18
|
-
|
|
19
|
-
# Pulisce il file di output se esiste già e scrive l'intestazione
|
|
20
|
-
echo "--- INIZIO ANALISI CONFIGURAZIONE DRACUT ---" > "$OUTPUT_FILE"
|
|
21
|
-
echo "" >> "$OUTPUT_FILE"
|
|
22
|
-
|
|
23
|
-
# Itera su tutte le directory passate come argomenti
|
|
24
|
-
for TARGET_DIR in "$@"; do
|
|
25
|
-
# Controlla se il percorso fornito è una directory valida
|
|
26
|
-
if [ ! -d "$TARGET_DIR" ]; then
|
|
27
|
-
echo "ATTENZIONE: '$TARGET_DIR' non è una directory valida o non esiste. Verrà saltata."
|
|
28
|
-
continue # Salta questo argomento e passa al successivo
|
|
29
|
-
fi
|
|
30
|
-
|
|
31
|
-
# Aggiunge un'intestazione per la directory corrente nel file di output
|
|
32
|
-
echo "##################################################" >> "$OUTPUT_FILE"
|
|
33
|
-
echo "### CONTENUTO DIRECTORY: ${TARGET_DIR}" >> "$OUTPUT_FILE"
|
|
34
|
-
echo "##################################################" >> "$OUTPUT_FILE"
|
|
35
|
-
echo "" >> "$OUTPUT_FILE"
|
|
36
|
-
|
|
37
|
-
# Trova tutti i file nella directory corrente e aggiunge il loro contenuto al file
|
|
38
|
-
find "$TARGET_DIR" -type f | sort | while read -r filepath; do
|
|
39
|
-
echo "==================================================" >> "$OUTPUT_FILE"
|
|
40
|
-
echo "### FILE: ${filepath}" >> "$OUTPUT_FILE"
|
|
41
|
-
echo "==================================================" >> "$OUTPUT_FILE"
|
|
42
|
-
echo '```' >> "$OUTPUT_FILE"
|
|
43
|
-
cat "$filepath" >> "$OUTPUT_FILE"
|
|
44
|
-
echo '```' >> "$OUTPUT_FILE"
|
|
45
|
-
echo "" >> "$OUTPUT_FILE"
|
|
46
|
-
done
|
|
47
|
-
done
|
|
48
|
-
|
|
49
|
-
echo "--- FINE ANALISI CONFIGURAZIONE DRACUT ---" >> "$OUTPUT_FILE"
|
|
50
|
-
|
|
51
|
-
echo "✅ Fatto! L'analisi combinata è stata salvata nel file: $OUTPUT_FILE"
|
package/dracut/export-dracut-log
DELETED
package/dracut/mkisofs
DELETED
package/dracut/renew-initramfs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
if [[ $(id -u) -ne 0 ]]; then
|
|
4
|
-
echo "Errore: Questo script deve essere eseguito come root o con sudo." >&2
|
|
5
|
-
exit 1
|
|
6
|
-
fi
|
|
7
|
-
|
|
8
|
-
LOG="./dracut-log.txt"
|
|
9
|
-
CONFDIR="/usr/lib/penguins-eggs/dracut/dracut.conf.d"
|
|
10
|
-
LIVE="/home/eggs/iso/live"
|
|
11
|
-
|
|
12
|
-
dracut --force \
|
|
13
|
-
--confdir $CONFDIR \
|
|
14
|
-
--kmoddir /lib/modules/6.12.48+deb13-amd64 \
|
|
15
|
-
$LIVE/initrd.img-6.12.48+deb13-amd64 6.12.48+deb13-amd64 2>&1| tee $LOG
|
|
16
|
-
|
|
17
|
-
scp $LOG artisan@192.168.1.2:/home/artisan
|
package/dracut/sbin2bin
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Crea i collegamenti simbolici
|
|
2
|
-
sudo ln -s /usr/sbin/cryptsetup /usr/bin/cryptsetup
|
|
3
|
-
sudo ln -s /usr/sbin/losetup /usr/bin/losetup
|
|
4
|
-
#sudo ln -s /usr/sbin/lsblk /usr/bin/lsblk già esiste
|
|
5
|
-
|
|
6
|
-
# Nota: il log mostra anche altri comandi, potrebbero servire anche questi
|
|
7
|
-
#sudo ln -s /bin/mount /usr/bin/mount # mount potrebbe essere in /bin
|
|
8
|
-
#sudo ln -s /bin/umount /usr/bin/umount # umount potrebbe essere in /bin
|
|
9
|
-
#sudo ln -s /usr/bin/find /usr/bin/find # find è già al posto giusto, di solito
|
|
10
|
-
#sudo ln -s /bin/cat /usr/bin/cat # cat è già al posto giusto, di solito
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
MODULES_TO_REPLACE=("00debug-shell" "90block" "95iso-scan" "95luks" "95luks-loop")
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
DRACUT_MODULES_DIR="/usr/lib/penguins-eggs/dracut/modules.d"
|
|
7
|
-
SOURCE_MODULES_DIR="$(dirname "$0")/modules.d"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# --- FUNZIONE PRINCIPALE ---
|
|
11
|
-
main() {
|
|
12
|
-
echo "ATTENZIONE: adesso aggiorn $DRACUT_MODULES_DIR"
|
|
13
|
-
|
|
14
|
-
# 1. Controllo dei permessi
|
|
15
|
-
# Lo script deve essere eseguito come root per poter scrivere in /usr/lib
|
|
16
|
-
if [[ $(id -u) -ne 0 ]]; then
|
|
17
|
-
echo "Errore: Questo script deve essere eseguito come root o con sudo." >&2
|
|
18
|
-
exit 1
|
|
19
|
-
fi
|
|
20
|
-
|
|
21
|
-
# 2. Verifica che la cartella di origine esista
|
|
22
|
-
if [[ ! -d "$SOURCE_MODULES_DIR" ]]; then
|
|
23
|
-
echo "Errore: La directory di origine '$SOURCE_MODULES_DIR' non è stata trovata." >&2
|
|
24
|
-
exit 1
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
echo "Avvio della sostituzione dei moduli Dracut..."
|
|
28
|
-
|
|
29
|
-
# 3. Ciclo for per ogni modulo nell'array
|
|
30
|
-
for module_name in "${MODULES_TO_REPLACE[@]}"; do
|
|
31
|
-
local dest_path="$DRACUT_MODULES_DIR/$module_name"
|
|
32
|
-
local source_path="$SOURCE_MODULES_DIR/$module_name"
|
|
33
|
-
|
|
34
|
-
echo "--- Elaborazione del modulo: $module_name ---"
|
|
35
|
-
|
|
36
|
-
# Controlla se il modulo di origine esiste prima di procedere
|
|
37
|
-
if [[ ! -d "$source_path" ]]; then
|
|
38
|
-
echo "Attenzione: Il modulo '$source_path' non esiste nella cartella di origine. Salto."
|
|
39
|
-
continue
|
|
40
|
-
fi
|
|
41
|
-
|
|
42
|
-
# Rimuovi la vecchia versione del modulo, se esiste
|
|
43
|
-
if [[ -d "$dest_path" ]]; then
|
|
44
|
-
echo "Rimuovendo la vecchia versione: $dest_path"
|
|
45
|
-
rm -rf "$dest_path"
|
|
46
|
-
fi
|
|
47
|
-
|
|
48
|
-
# Copia la nuova versione del modulo
|
|
49
|
-
echo "Copiando la nuova versione da: $source_path"
|
|
50
|
-
cp -r "$source_path" "$DRACUT_MODULES_DIR/"
|
|
51
|
-
|
|
52
|
-
echo "Modulo '$module_name' aggiornato con successo."
|
|
53
|
-
echo "------------------------------------"
|
|
54
|
-
done
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
echo "Operazione completata."
|
|
58
|
-
echo "Ricorda di rigenerare l'initramfs con 'dracut -f' o un comando simile."
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
# Esegui la funzione principale
|
|
62
|
-
main
|