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.
Files changed (114) hide show
  1. package/.oclif.manifest.json +53 -41
  2. package/README.md +80 -36
  3. package/README.pdf +21575 -3241
  4. package/addons/eggs/theme/livecd/full.grub.main.cfg +39 -4
  5. package/addons/eggs/theme/livecd/full.isolinux.main.cfg +47 -4
  6. package/bin/run.js +11 -0
  7. package/conf/derivatives.yaml +4 -2
  8. package/conf/exclude.list.d/var.list +11 -6
  9. package/dist/appimage/dependency-manager.d.ts +31 -0
  10. package/dist/appimage/dependency-manager.js +292 -0
  11. package/dist/appimage/first-run-check.js +3 -3
  12. package/dist/bin/run.js +11 -0
  13. package/dist/classes/cli-autologin.js +78 -53
  14. package/dist/classes/compressors.d.ts +7 -10
  15. package/dist/classes/compressors.js +44 -31
  16. package/dist/classes/daddy.js +11 -11
  17. package/dist/classes/distro.js +2 -2
  18. package/dist/classes/diversions.js +2 -3
  19. package/dist/classes/incubation/fisherman-helper/initcpio.d.ts +4 -0
  20. package/dist/classes/incubation/fisherman-helper/initcpio.js +14 -4
  21. package/dist/classes/incubation/fisherman-helper/settings.js +1 -1
  22. package/dist/classes/incubation/fisherman.js +1 -3
  23. package/dist/classes/incubation/incubator.js +1 -1
  24. package/dist/classes/network.d.ts +1 -1
  25. package/dist/classes/ovary.d/create-xdg-autostart.js +1 -1
  26. package/dist/classes/ovary.d/edit-live-fs.d.ts +1 -12
  27. package/dist/classes/ovary.d/edit-live-fs.js +216 -186
  28. package/dist/classes/ovary.d/fertilization.js +1 -1
  29. package/dist/classes/ovary.d/make-dot-disk.js +1 -1
  30. package/dist/classes/ovary.d/produce.js +1 -1
  31. package/dist/classes/ovary.d/user-create-live.d.ts +4 -10
  32. package/dist/classes/ovary.d/user-create-live.js +82 -84
  33. package/dist/classes/ovary.d/users-remove.d.ts +5 -6
  34. package/dist/classes/ovary.d/users-remove.js +61 -31
  35. package/dist/classes/ovary.d/xorriso-command.js +1 -5
  36. package/dist/classes/ovary.d.ts +2 -2
  37. package/dist/classes/ovary.js +2 -2
  38. package/dist/classes/pacman.d/alpine.js +2 -2
  39. package/dist/classes/pacman.d/archlinux.js +2 -2
  40. package/dist/classes/pacman.d/debian.js +2 -3
  41. package/dist/classes/pacman.d/fedora.js +2 -3
  42. package/dist/classes/pacman.d/openmamba.js +2 -3
  43. package/dist/classes/pacman.d/opensuse.js +2 -3
  44. package/dist/classes/pacman.d.ts +21 -12
  45. package/dist/classes/pacman.js +55 -47
  46. package/dist/classes/pve-live.js +1 -1
  47. package/dist/classes/settings.js +1 -1
  48. package/dist/classes/sys-users.d.ts +76 -0
  49. package/dist/classes/sys-users.js +206 -0
  50. package/dist/classes/utils.d/kernel.js +3 -3
  51. package/dist/classes/utils.d.ts +16 -11
  52. package/dist/classes/utils.js +92 -56
  53. package/dist/classes/xdg.js +1 -1
  54. package/dist/classes/yolk.js +2 -4
  55. package/dist/commands/config.js +3 -14
  56. package/dist/commands/cuckoo.js +1 -1
  57. package/dist/commands/export/appimage.js +3 -3
  58. package/dist/commands/export/pkg.js +3 -3
  59. package/dist/commands/export/tarballs.js +3 -3
  60. package/dist/commands/krill.js +1 -1
  61. package/dist/commands/produce.js +9 -4
  62. package/dist/commands/{setup.d.ts → setup/install.d.ts} +1 -5
  63. package/dist/commands/setup/install.js +71 -0
  64. package/dist/commands/setup/purge.d.ts +17 -0
  65. package/dist/commands/setup/purge.js +71 -0
  66. package/dist/commands/tools/yolk.js +1 -1
  67. package/dist/commands/update.d.ts +15 -0
  68. package/dist/commands/update.js +74 -7
  69. package/dist/interfaces/i-exec.d.ts +1 -0
  70. package/dist/krill/classes/prepare.d/location.js +1 -1
  71. package/dist/krill/classes/prepare.d/partitions.js +1 -1
  72. package/dist/krill/classes/prepare.d/users.js +2 -2
  73. package/dist/krill/classes/prepare.js +5 -5
  74. package/dist/krill/classes/sequence.d/add_user.d.ts +3 -15
  75. package/dist/krill/classes/sequence.d/add_user.js +87 -57
  76. package/dist/krill/classes/sequence.d/change_password.d.ts +5 -7
  77. package/dist/krill/classes/sequence.d/change_password.js +25 -10
  78. package/dist/krill/classes/sequence.d/del_live_user.d.ts +5 -7
  79. package/dist/krill/classes/sequence.d/del_live_user.js +39 -25
  80. package/dist/krill/classes/sequence.d/fstab.js +1 -1
  81. package/dist/krill/classes/sequence.d/grubcfg.d.ts +3 -7
  82. package/dist/krill/classes/sequence.d/grubcfg.js +33 -13
  83. package/dist/krill/classes/sequence.d/mkfs.js +1 -2
  84. package/dist/krill/classes/sequence.d/unpackfs.d.ts +2 -4
  85. package/dist/krill/classes/sequence.d/unpackfs.js +8 -5
  86. package/dist/krill/classes/sequence.js +2 -3
  87. package/dist/krill/components/title.js +4 -4
  88. package/dist/krill/lib/select_installation_device.js +1 -1
  89. package/dist/krill/lib/select_replaced_partition.js +1 -1
  90. package/dist/lib/utils.d.ts +51 -19
  91. package/dist/lib/utils.js +225 -39
  92. package/manpages/doc/man/eggs.1.gz +0 -0
  93. package/manpages/doc/man/eggs.html +29 -17
  94. package/package.json +13 -14
  95. package/perrisbrewery/template/dependencies.yaml +1 -0
  96. package/scripts/_eggs +35 -7
  97. package/scripts/boot-encrypted-root.sh +220 -0
  98. package/scripts/eggs.bash +2 -1
  99. package/scripts/mount-encrypted-home.sh +324 -0
  100. package/dist/appimage/prerequisites.d.ts +0 -34
  101. package/dist/appimage/prerequisites.js +0 -350
  102. package/dist/commands/setup.js +0 -90
  103. package/dracut/create-symlink +0 -71
  104. package/dracut/dracut-log.txt +0 -3
  105. package/dracut/export +0 -4
  106. package/dracut/export-dracut-analysis +0 -51
  107. package/dracut/export-dracut-log +0 -2
  108. package/dracut/mkisofs +0 -10
  109. package/dracut/renew-initramfs +0 -17
  110. package/dracut/sbin2bin +0 -10
  111. package/dracut/update-dracut-conf-d +0 -2
  112. package/dracut/update-dracut-modules +0 -62
  113. package/scripts/appimage-build.sh +0 -152
  114. package/scripts/appimage-install.sh +0 -43
@@ -1,97 +1,95 @@
1
1
  /**
2
- * ./src/classes/ovary.d/create-user-live.ts
2
+ * src/classes/ovary.d/user-create-live.ts
3
3
  * penguins-eggs v.25.7.x / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
4
+ * * REFACTORED: Uses "The SysUser Master" class.
5
+ * Creates the live user directly in the merged filesystem safely.
7
6
  */
8
- // packages
9
7
  import fs from 'fs';
10
- import path from 'node:path';
11
- import yaml from 'js-yaml';
12
- // functions
8
+ import path from 'path';
13
9
  import { exec } from '../../lib/utils.js';
14
- import rexec from './rexec.js';
15
- import Utils from '../utils.js';
16
- // _dirname
17
- const __dirname = path.dirname(new URL(import.meta.url).pathname);
18
- /**
19
- * list degli utenti: grep -E 1[0-9]{3} /etc/passwd | sed s/:/\ / | awk '{print $1}'
20
- * create la home per user_opt
21
- * @param verbose
22
- */
23
- export async function userCreateLive() {
24
- if (this.verbose) {
25
- console.log('Ovary: userCreateLive');
10
+ import SysUsers from '../sys-users.js';
11
+ export default async function userCreateLive() {
12
+ // Target: la directory "merged" dell'overlayfs
13
+ let target = this.settings.work_dir.merged;
14
+ if (!target || !fs.existsSync(target)) {
15
+ console.error(`SysUsers Error: Target directory not found at: ${target}`);
16
+ return;
26
17
  }
27
- const cmds = [];
28
- cmds.push(await rexec('chroot ' + this.settings.work_dir.merged + ' rm /home/' + this.settings.config.user_opt + ' -rf', this.verbose));
29
- cmds.push(await rexec('chroot ' + this.settings.work_dir.merged + ' mkdir /home/' + this.settings.config.user_opt, this.verbose));
30
- // Create user using useradd
31
- cmds.push(await rexec('chroot ' + this.settings.work_dir.merged + ' useradd ' + this.settings.config.user_opt + ' --home-dir /home/' + this.settings.config.user_opt + ' --shell /bin/bash ', this.verbose));
32
- // live password
33
- cmds.push(await rexec('echo ' + this.settings.config.user_opt + ':' + this.settings.config.user_opt_passwd + ' | chroot ' + this.settings.work_dir.merged + ' /usr/sbin/chpasswd', this.verbose));
34
- // root password
35
- cmds.push(await rexec(' echo root:' + this.settings.config.root_passwd + ' | chroot ' + this.settings.work_dir.merged + ' /usr/sbin/chpasswd', this.verbose));
36
- // Alpine naked don't have /etc/skel
37
- if (fs.existsSync('/etc/skel')) {
38
- cmds.push(await rexec('chroot ' + this.settings.work_dir.merged + ' cp /etc/skel/. /home/' + this.settings.config.user_opt + ' -R', this.verbose));
18
+ const familyId = this.distro?.familyId || this.familyId;
19
+ console.log(`Creating LIVE user in snapshot at ${target} (Family: ${familyId})...`);
20
+ // 1. CARICAMENTO CONFIGURAZIONE ESISTENTE
21
+ const sysUsers = new SysUsers(target, familyId);
22
+ sysUsers.load();
23
+ // 2. DEFINIZIONE UTENTE LIVE
24
+ const username = this.settings.config.user_opt || 'live';
25
+ const password = 'evolution'; // Password default live
26
+ // Shell detection
27
+ let shell = '/bin/bash';
28
+ if (!fs.existsSync(path.join(target, 'bin/bash')) && fs.existsSync(path.join(target, 'bin/ash'))) {
29
+ shell = '/bin/ash';
39
30
  }
40
- // da problemi con il mount sshfs
41
- cmds.push(await rexec('chroot ' + this.settings.work_dir.merged + ' chown ' + this.settings.config.user_opt + ':users' + ' /home/' + this.settings.config.user_opt + ' -R', this.verbose));
42
- /**
43
- *
44
- */
45
- switch (this.familyId) {
46
- case 'alpine': {
47
- cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} usermod -aG wheel ${this.settings.config.user_opt}`, this.verbose));
48
- break;
49
- }
50
- case 'archlinux': {
51
- cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} gpasswd -a ${this.settings.config.user_opt} wheel`, this.verbose));
52
- // check or create group: autologin
53
- cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} getent group autologin || chroot ${this.settings.work_dir.merged} groupadd autologin`, this.verbose));
54
- cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} gpasswd -a ${this.settings.config.user_opt} autologin`, this.verbose));
55
- break;
56
- }
57
- case 'debian': {
58
- cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} usermod -aG sudo ${this.settings.config.user_opt}`, this.verbose));
59
- break;
60
- }
61
- case 'fedora': {
62
- cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} usermod -aG wheel ${this.settings.config.user_opt}`, this.verbose));
63
- break;
64
- }
65
- case 'openmamba': {
66
- cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} usermod -aG sysadmin ${this.settings.config.user_opt}`, this.verbose));
67
- cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} usermod -aG autologin ${this.settings.config.user_opt}`, this.verbose));
68
- break;
69
- }
70
- case 'opensuse': {
71
- cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} usermod -aG wheel ${this.settings.config.user_opt}`, this.verbose));
72
- break;
73
- }
74
- // No default
31
+ const liveUser = {
32
+ username: username,
33
+ password: 'x',
34
+ uid: '1000', // Live user è sempre 1000
35
+ gid: '1000',
36
+ gecos: 'Live User,,,',
37
+ home: `/home/${username}`,
38
+ shell: shell
39
+ };
40
+ // 3. CREAZIONE LOGICA (IN MEMORIA)
41
+ // Rimuove eventuali residui precedenti e aggiunge il nuovo
42
+ sysUsers.addUser(liveUser, password);
43
+ // Aggiungi ai gruppi amministrativi
44
+ let adminGroup = 'wheel';
45
+ if (['debian', 'ubuntu', 'linuxmint', 'pop', 'neon'].includes(familyId)) {
46
+ adminGroup = 'sudo';
75
47
  }
76
- /**
77
- * look to calamares/modules/users.conf for groups
78
- */
79
- let usersConf = '/etc/calamares/modules/users.conf';
80
- if (!fs.existsSync(usersConf)) {
81
- usersConf = '/etc/penguins-eggs.d/krill/modules/users.conf';
48
+ else if (familyId === 'openmamba') {
49
+ adminGroup = 'sysadmin';
82
50
  }
83
- if (fs.existsSync(usersConf)) {
84
- const o = yaml.load(fs.readFileSync(usersConf, 'utf8'));
85
- for (const group of o.defaultGroups) {
86
- const groupExists = await exec(`chroot ${this.settings.work_dir.merged} getent group ${group}`, { ignore: true });
87
- if (groupExists.code == 0) {
88
- cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} usermod -aG ${group} ${this.settings.config.user_opt} ${this.toNull}`, this.verbose));
89
- Utils.warning(`added ${this.settings.config.user_opt} to group ${group}`);
90
- }
91
- }
51
+ sysUsers.addUserToGroup(username, adminGroup);
52
+ // GRUPPO AUTOLOGIN (Fondamentale per la live!)
53
+ // Creiamo il gruppo se non esiste (logica semplificata: lo aggiungiamo a sysUsers se manca?)
54
+ // SysUsers.addUserToGroup fallisce silenziosamente se il gruppo non c'è.
55
+ // Per sicurezza su Fedora/Arch, autologin di solito esiste o va creato.
56
+ // Proviamo ad aggiungerlo:
57
+ sysUsers.addUserToGroup(username, 'autologin'); // <--- PUNTO E VIRGOLA FONDAMENTALE QUI!
58
+ // Aggiungiamo anche ai gruppi standard audio/video/network se esistono
59
+ ['video', 'audio', 'network', 'input', 'lp', 'storage', 'optical'].forEach(grp => {
60
+ sysUsers.addUserToGroup(username, grp);
61
+ });
62
+ // 4. SALVATAGGIO ATOMICO SU DISCO
63
+ await sysUsers.save();
64
+ // 5. CREAZIONE FISICA HOME DIRECTORY
65
+ const homeDir = path.join(target, 'home', username);
66
+ // Cleanup
67
+ if (fs.existsSync(homeDir))
68
+ await exec(`rm -rf ${homeDir}`, this.echo);
69
+ // Scheletro (/etc/skel)
70
+ const skelPath = path.join(target, 'etc', 'skel');
71
+ if (fs.existsSync(skelPath)) {
72
+ await exec(`mkdir -p ${homeDir}`, this.echo);
73
+ await exec(`cp -rT ${skelPath} ${homeDir}`, this.echo);
92
74
  }
93
75
  else {
94
- console.log(`il file ${usersConf} non esiste!`);
95
- await Utils.pressKeyToExit();
76
+ await exec(`mkdir -p ${homeDir}`, this.echo);
77
+ }
78
+ // Permessi
79
+ await exec(`chown -R 1000:1000 ${homeDir}`, this.echo);
80
+ // Per la live va bene anche 755, ma 700 è più sicuro. Lasciamo standard.
81
+ await exec(`chmod 755 ${homeDir}`, this.echo);
82
+ // 6. FIX SELINUX SPECIFICO PER HOME LIVE
83
+ if (['fedora', 'rhel', 'centos', 'almalinux', 'rocky'].includes(familyId)) {
84
+ try {
85
+ await exec(`chcon -R -t user_home_t ${homeDir}`, { echo: false }).catch(() => { });
86
+ // Nota: .autorelabel nella root della live potrebbe rallentare il boot,
87
+ // ma è meglio averlo se i contesti sono dubbi.
88
+ // await exec(`touch ${target}/.autorelabel`, { echo: false })
89
+ }
90
+ catch (e) {
91
+ console.error('SELinux home fix warning:', e);
92
+ }
96
93
  }
94
+ console.log(`Live user '${username}' created successfully via SysUser Master.`);
97
95
  }
@@ -1,9 +1,8 @@
1
1
  /**
2
- * ./src/classes/ovary.d/users-remove.ts
2
+ * src/classes/ovary.d/users-remove.ts
3
3
  * penguins-eggs v.25.7.x / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
4
+ * * REFACTORED: Uses "The SysUser Master" class.
5
+ * Cleans up host users from the ISO filesystem safely.
7
6
  */
8
- import Ovary from './../ovary.js';
9
- export declare function usersRemove(this: Ovary): Promise<void>;
7
+ import Ovary from '../ovary.js';
8
+ export default function usersRemove(this: Ovary): Promise<void>;
@@ -1,38 +1,68 @@
1
1
  /**
2
- * ./src/classes/ovary.d/users-remove.ts
2
+ * src/classes/ovary.d/users-remove.ts
3
3
  * penguins-eggs v.25.7.x / ecmascript 2020
4
- * author: Piero Proietti
5
- * email: piero.proietti@gmail.com
6
- * license: MIT
4
+ * * REFACTORED: Uses "The SysUser Master" class.
5
+ * Cleans up host users from the ISO filesystem safely.
7
6
  */
8
- // packages
9
- import path from 'node:path';
10
- // backup
11
- // interfaces
12
- // libraries
7
+ import fs from 'fs';
8
+ import path from 'path';
13
9
  import { exec } from '../../lib/utils.js';
14
- import rexec from './rexec.js';
15
- import Diversions from './../diversions.js';
16
- // _dirname
17
- const __dirname = path.dirname(new URL(import.meta.url).pathname);
18
- //async cleanUsersAccounts() {
19
- export async function usersRemove() {
20
- if (this.verbose) {
21
- console.log('Ovary: cleanUsersAccounts');
10
+ import SysUsers from '../sys-users.js';
11
+ export default async function usersRemove() {
12
+ // Il target corretto in Ovary è la directory "merged" dell'overlayfs
13
+ let target = this.settings.work_dir.merged;
14
+ // Assicuriamoci che il target esista per sicurezza
15
+ if (!target || !fs.existsSync(target)) {
16
+ console.error(`SysUsers Error: Merged target directory not found at: ${target}`);
17
+ return;
22
18
  }
23
- /**
24
- * delete all user in chroot
25
- */
26
- const cmds = [];
27
- const cmd = `chroot ${this.settings.work_dir.merged} getent passwd {1000..60000} |awk -F: '{print $1}'`;
28
- const result = await exec(cmd, {
29
- capture: true,
30
- echo: this.verbose,
31
- ignore: false
32
- });
33
- const users = result.data.split('\n');
34
- let deluser = Diversions.deluser(this.familyId);
35
- for (let i = 0; i < users.length - 1; i++) {
36
- cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} ${deluser} ${users[i]}`, this.verbose));
19
+ // Nota: verifica se in Ovary hai 'this.familyId' diretto o 'this.distro.familyId'.
20
+ // Solitamente è this.distro.familyId, ma se hai un getter va bene così.
21
+ const familyId = this.distro?.familyId || this.familyId;
22
+ console.log(`Cleaning host users from ISO snapshot at ${target} (Family: ${familyId})...`);
23
+ // 2. CARICAMENTO CONFIGURAZIONE
24
+ const sysUsers = new SysUsers(target, familyId);
25
+ sysUsers.load();
26
+ // 3. IDENTIFICAZIONE UTENTI DA RIMUOVERE
27
+ // Dobbiamo leggere il file passwd raw per decidere chi rimuovere
28
+ // (rimuoviamo UID >= 1000 tranne 'nobody' e 'root')
29
+ const usersToDelete = [];
30
+ const passwdPath = path.join(target, 'etc/passwd');
31
+ if (fs.existsSync(passwdPath)) {
32
+ const lines = fs.readFileSync(passwdPath, 'utf8').split('\n');
33
+ for (const line of lines) {
34
+ const parts = line.split(':');
35
+ if (parts.length > 2) {
36
+ const uid = parseInt(parts[2]);
37
+ const username = parts[0];
38
+ // Logica di rimozione standard di eggs
39
+ if (uid >= 1000 && username !== 'nobody') {
40
+ usersToDelete.push(username);
41
+ }
42
+ }
43
+ }
44
+ }
45
+ // 4. ESECUZIONE RIMOZIONE (IN MEMORIA)
46
+ for (const username of usersToDelete) {
47
+ console.log(`- Removing user: ${username}`);
48
+ sysUsers.removeUser(username);
49
+ // Pulizia File Fisici (Home, Mail) - Operazioni FS dirette
50
+ const homeDir = path.join(target, 'home', username);
51
+ if (fs.existsSync(homeDir)) {
52
+ await exec(`rm -rf ${homeDir}`, this.echo);
53
+ }
54
+ const mailFile = path.join(target, 'var/mail', username);
55
+ if (fs.existsSync(mailFile)) {
56
+ fs.unlinkSync(mailFile);
57
+ }
58
+ }
59
+ // 5. SALVATAGGIO ATOMICO SU DISCO
60
+ if (usersToDelete.length > 0) {
61
+ // Scrive passwd, shadow, group, gshadow, subuid... e ripara SELinux
62
+ await sysUsers.save();
63
+ console.log("User cleanup completed via SysUsers Master.");
64
+ }
65
+ else {
66
+ console.log("No users needed to be removed.");
37
67
  }
38
68
  }
@@ -38,13 +38,9 @@ export async function xorrisoCommand(clone = false, homecrypt = false, fullcrypt
38
38
  }
39
39
  // postfix (data)
40
40
  const postfix = Utils.getPostfix();
41
- console.log('prefix:', prefix);
42
- console.log('prefix:', this.volid);
43
- console.log('arch:', Utils.uefiArch());
44
- console.log('typology:', typology);
45
41
  console.log('postfix:', postfix);
46
42
  this.settings.isoFilename = prefix + this.volid + '_' + Utils.uefiArch() + typology + postfix;
47
- // node della ISO
43
+ console.log('isoFilename:', this.settings.isoFilename);
48
44
  const output = this.settings.config.snapshot_mnt + this.settings.isoFilename;
49
45
  let command = '';
50
46
  // const appid = `-appid "${this.settings.distro.distroId}" `
@@ -21,9 +21,9 @@ import { createXdgAutostart } from './ovary.d/create-xdg-autostart.js';
21
21
  import { copied, merged, mergedAndOverlay } from './ovary.d/merged.js';
22
22
  import { makeIso } from './ovary.d/make-iso.js';
23
23
  import { initrdAlpine, initrdArch, initrdDebian, initrdDracut } from './ovary.d/initrd.js';
24
- import { userCreateLive } from './ovary.d/user-create-live.js';
24
+ import userCreateLive from './ovary.d/user-create-live.js';
25
25
  import { syslinux } from './ovary.d/syslinux.js';
26
- import { usersRemove } from './ovary.d/users-remove.js';
26
+ import usersRemove from './ovary.d/users-remove.js';
27
27
  import { makeDotDisk } from './ovary.d/make-dot-disk.js';
28
28
  import { kernelCopy } from './ovary.d/kernel-copy.js';
29
29
  import { liveCreateStructure } from './ovary.d/live-create-structure.js';
@@ -22,9 +22,9 @@ import { createXdgAutostart } from './ovary.d/create-xdg-autostart.js';
22
22
  import { copied, merged, mergedAndOverlay } from './ovary.d/merged.js';
23
23
  import { makeIso } from './ovary.d/make-iso.js';
24
24
  import { initrdAlpine, initrdArch, initrdDebian, initrdDracut } from './ovary.d/initrd.js';
25
- import { userCreateLive } from './ovary.d/user-create-live.js';
25
+ import userCreateLive from './ovary.d/user-create-live.js';
26
26
  import { syslinux } from './ovary.d/syslinux.js';
27
- import { usersRemove } from './ovary.d/users-remove.js';
27
+ import usersRemove from './ovary.d/users-remove.js';
28
28
  import { makeDotDisk } from './ovary.d/make-dot-disk.js';
29
29
  import { kernelCopy } from './ovary.d/kernel-copy.js';
30
30
  import { liveCreateStructure } from './ovary.d/live-create-structure.js';
@@ -5,7 +5,7 @@
5
5
  * email: piero.proietti@gmail.com
6
6
  * license: MIT
7
7
  */
8
- import shx from 'shelljs';
8
+ import { shx } from '../../lib/utils.js';
9
9
  import { exec } from '../../lib/utils.js';
10
10
  import Utils from '../utils.js';
11
11
  /**
@@ -131,7 +131,7 @@ export default class Alpine {
131
131
  */
132
132
  static async packageInstall(packageName) {
133
133
  let retVal = false;
134
- if (shx.exec(`/sbin/apk add ${packageName}`, { silent: true }) === '0') {
134
+ if (shx.exec('/sbin/apk add ' + packageName, { silent: true }).code === 0) {
135
135
  retVal = true;
136
136
  }
137
137
  return retVal;
@@ -6,7 +6,7 @@
6
6
  * license: MIT
7
7
  */
8
8
  import fs from 'node:fs';
9
- import shx from 'shelljs';
9
+ import { shx } from '../../lib/utils.js';
10
10
  import { exec } from '../../lib/utils.js';
11
11
  import Utils from '../utils.js';
12
12
  /**
@@ -77,7 +77,7 @@ export default class Archlinux {
77
77
  */
78
78
  static async packageInstall(packageName) {
79
79
  let retVal = false;
80
- if (shx.exec(`/usr/bin/pacman -Si ${packageName}`, { silent: true }) === '0') {
80
+ if (shx.exec('/usr/bin/pacman -Si ' + packageName, { silent: true }).code === 0) {
81
81
  retVal = true;
82
82
  }
83
83
  return retVal;
@@ -6,8 +6,7 @@
6
6
  * license: MIT
7
7
  */
8
8
  import fs from 'node:fs';
9
- import shx from 'shelljs';
10
- import { exec } from '../../lib/utils.js';
9
+ import { exec, shx } from '../../lib/utils.js';
11
10
  import Utils from '../utils.js';
12
11
  /**
13
12
  * Debian
@@ -116,7 +115,7 @@ export default class Debian {
116
115
  */
117
116
  static async packageInstall(packageName) {
118
117
  let retVal = false;
119
- if (shx.exec(`/usr/bin/apt-get install -y ${packageName}`, { silent: true }) === '0') {
118
+ if (shx.exec('/usr/bin/apt-get install -y ' + packageName, { silent: true }).code === 0) {
120
119
  retVal = true;
121
120
  }
122
121
  return retVal;
@@ -6,8 +6,7 @@
6
6
  * license: MIT
7
7
  */
8
8
  import fs from 'node:fs';
9
- import shx from 'shelljs';
10
- import { exec } from '../../lib/utils.js';
9
+ import { exec, shx } from '../../lib/utils.js';
11
10
  import Utils from '../utils.js';
12
11
  /**
13
12
  * Utils: general porpourse utils
@@ -86,7 +85,7 @@ export default class Fedora {
86
85
  */
87
86
  static async packageInstall(packageName) {
88
87
  let retVal = false;
89
- if (shx.exec(`/usr/bin/dnf install ${packageName}`, { silent: true }) === '0') {
88
+ if (shx.exec('/usr/bin/dnf install ' + packageName, { silent: true }).code === 0) {
90
89
  retVal = true;
91
90
  }
92
91
  return retVal;
@@ -6,8 +6,7 @@
6
6
  * license: MIT
7
7
  */
8
8
  import fs from 'node:fs';
9
- import shx from 'shelljs';
10
- import { exec } from '../../lib/utils.js';
9
+ import { exec, shx } from '../../lib/utils.js';
11
10
  import Utils from '../utils.js';
12
11
  /**
13
12
  * Utils: general porpourse utils
@@ -85,7 +84,7 @@ export default class Openmamba {
85
84
  */
86
85
  static async packageInstall(packageName) {
87
86
  let retVal = false;
88
- if (shx.exec(`/usr/bin/dnf install ${packageName}`, { silent: false }) === '0') {
87
+ if (shx.exec('/usr/bin/dnf install ' + packageName, { silent: false }).code === 0) {
89
88
  retVal = true;
90
89
  }
91
90
  return retVal;
@@ -6,8 +6,7 @@
6
6
  * license: MIT
7
7
  */
8
8
  import fs from 'node:fs';
9
- import shx from 'shelljs';
10
- import { exec } from '../../lib/utils.js';
9
+ import { exec, shx } from '../../lib/utils.js';
11
10
  import Utils from '../utils.js';
12
11
  /**
13
12
  * Utils: general porpourse utils
@@ -88,7 +87,7 @@ export default class Opensuse {
88
87
  */
89
88
  static async packageInstall(packageName) {
90
89
  let retVal = false;
91
- if (shx.exec(`/usr/bin/zypper install ${packageName}`, { silent: true }) === '0') {
90
+ if (shx.exec('/usr/bin/zypper install ' + packageName, { silent: true }).code === 0) {
92
91
  retVal = true;
93
92
  }
94
93
  return retVal;
@@ -15,10 +15,15 @@ export default class Pacman {
15
15
  distro: IDistro;
16
16
  remix: IRemix;
17
17
  /**
18
- *
18
+ * autocompleteInstall()
19
+ * @param verbose
20
+ */
21
+ static autocompleteInstall(): Promise<void>;
22
+ /**
23
+ * autocompleteRemove
19
24
  * @param verbose
20
25
  */
21
- static autocompleteInstall(verbose?: boolean): Promise<void>;
26
+ static autocompleteRemove(verbose?: boolean): Promise<void>;
22
27
  /**
23
28
  * return true if calamares is installed
24
29
  */
@@ -35,11 +40,6 @@ export default class Pacman {
35
40
  *
36
41
  */
37
42
  static calamaresRemove(verbose?: boolean): Promise<boolean>;
38
- /**
39
- *
40
- * @param cmd
41
- */
42
- static commandIsInstalled(cmd: string): boolean;
43
43
  /**
44
44
  * Restituisce VERO se i file di configurazione SONO presenti
45
45
  */
@@ -52,14 +52,14 @@ export default class Pacman {
52
52
  * Creazione del file di configurazione /etc/penguins-eggs
53
53
  */
54
54
  static configurationInstall(links?: boolean, verbose?: boolean): Promise<void>;
55
- /**
56
- * Ritorna vero se machine-id è uguale
57
- */
58
- static configurationMachineNew(verbose?: boolean): Promise<boolean>;
59
55
  /**
60
56
  * Rimozione dei file di configurazione
61
57
  */
62
58
  static configurationRemove(verbose?: boolean): Promise<void>;
59
+ /**
60
+ * Ritorna vero se machine-id è uguale
61
+ */
62
+ static configurationMachineNew(verbose?: boolean): Promise<boolean>;
63
63
  /**
64
64
  *
65
65
  * @returns
@@ -117,7 +117,11 @@ export default class Pacman {
117
117
  /**
118
118
  * Installa manPage
119
119
  */
120
- static manPageInstall(verbose?: boolean): Promise<void>;
120
+ static manpageInstall(): Promise<void>;
121
+ /**
122
+ * manpageRemove
123
+ */
124
+ static manpageRemove(): Promise<void>;
121
125
  /**
122
126
  *
123
127
  * @param debPackage
@@ -135,5 +139,10 @@ export default class Pacman {
135
139
  * @param debPackage
136
140
  */
137
141
  static packageIsInstalled(packageName: string): boolean;
142
+ /**
143
+ *
144
+ * @param packageNpm
145
+ * @returns
146
+ */
138
147
  static packageNpmLast(packageNpm?: string): Promise<string>;
139
148
  }