penguins-eggs 10.0.50 → 10.0.52
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 +1 -1
- package/README.md +29 -29
- package/addons/eggs/theme/livecd/isolinux.main.simple.cfg +25 -11
- package/conf/distros/aldos/calamares/modules/bootloader.yml +85 -0
- package/conf/distros/aldos/calamares/modules/displaymanager.yml +22 -0
- package/conf/distros/aldos/calamares/modules/finished.yml +5 -0
- package/conf/distros/aldos/calamares/modules/fstab.yml +12 -0
- package/conf/distros/aldos/calamares/modules/locale.yml +97 -0
- package/conf/distros/aldos/calamares/modules/luksopenswaphookcfg.yml +5 -0
- package/conf/distros/aldos/calamares/modules/machineid.yml +17 -0
- package/conf/distros/aldos/calamares/modules/mount.yml +56 -0
- package/conf/distros/aldos/calamares/modules/packages.yml +6 -0
- package/conf/distros/aldos/calamares/modules/partition.yml +242 -0
- package/conf/distros/aldos/calamares/modules/removeuser.yml +15 -0
- package/conf/distros/aldos/calamares/modules/unpackfs.yml +6 -0
- package/conf/distros/aldos/calamares/modules/users.yml +19 -0
- package/conf/distros/aldos/calamares/modules/welcome.yml +19 -0
- package/conf/distros/aldos/calamares/settings.yml +124 -0
- package/conf/distros/fedora/calamares/modules/bootloader.conf +85 -0
- package/conf/distros/fedora/calamares/modules/bootloader.yml +5 -5
- package/conf/distros/fedora/calamares/modules/displaymanager.yml +1 -1
- package/conf/distros/fedora/calamares/modules/packages.yml +2 -2
- package/conf/distros/fedora/calamares/modules/partition.yml +1 -1
- package/conf/distros/fedora/calamares/settings.yml +4 -10
- package/conf/distros/openmamba/calamares/modules/bootloader.yml +83 -0
- package/conf/distros/openmamba/calamares/modules/displaymanager.yml +22 -0
- package/conf/distros/openmamba/calamares/modules/finished.yml +47 -0
- package/conf/distros/openmamba/calamares/modules/fstab.yml +37 -0
- package/conf/distros/openmamba/calamares/modules/grubcfg.yml +51 -0
- package/conf/distros/openmamba/calamares/modules/keyboard.yml +33 -0
- package/conf/distros/openmamba/calamares/modules/locale.yml +131 -0
- package/conf/distros/openmamba/calamares/modules/luksopenswaphookcfg.yml +7 -0
- package/conf/distros/openmamba/calamares/modules/machineid.yml +56 -0
- package/conf/distros/openmamba/calamares/modules/mount.yml +121 -0
- package/conf/distros/openmamba/calamares/modules/openrcdmcryptcfg.yml +5 -0
- package/conf/distros/openmamba/calamares/modules/packages.yml +6 -0
- package/conf/distros/openmamba/calamares/modules/partition.yml +318 -0
- package/conf/distros/openmamba/calamares/modules/removeuser.yml +13 -0
- package/conf/distros/openmamba/calamares/modules/services-systemd.yml +54 -0
- package/conf/distros/openmamba/calamares/modules/umount.yml +14 -0
- package/conf/distros/openmamba/calamares/modules/unpackfs.yml +93 -0
- package/conf/distros/openmamba/calamares/modules/users.yml +272 -0
- package/conf/distros/openmamba/calamares/modules/welcome.yml +138 -0
- package/conf/distros/openmamba/calamares/settings.yml +228 -0
- package/conf/distros/opensuse/calamares/modules/bootloader.conf +86 -0
- package/conf/distros/opensuse/calamares/modules/bootloader.yml +5 -5
- package/conf/distros/opensuse/calamares/modules/displaymanager.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/finished.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/fstab.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/locale.yml +1 -0
- package/conf/distros/opensuse/calamares/modules/luksopenswaphookcfg.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/machineid.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/mount.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/packages.yml +2 -2
- package/conf/distros/opensuse/calamares/modules/partition.yml +1 -1
- package/conf/distros/opensuse/calamares/modules/removeuser.yml +1 -1
- package/conf/distros/opensuse/calamares/settings.yml +4 -10
- package/dist/classes/bleach.js +21 -35
- package/dist/classes/distro.js +204 -176
- package/dist/classes/diversions.d.ts +38 -0
- package/dist/classes/diversions.js +107 -0
- package/dist/classes/incubation/branding.js +6 -10
- package/dist/classes/incubation/fisherman.d.ts +2 -2
- package/dist/classes/incubation/fisherman.js +2 -35
- package/dist/classes/incubation/incubator.d/openmamba.d.ts +32 -0
- package/dist/classes/incubation/incubator.d/openmamba.js +81 -0
- package/dist/classes/incubation/incubator.d/opensuse.d.ts +32 -0
- package/dist/classes/incubation/incubator.d/opensuse.js +81 -0
- package/dist/classes/incubation/{distros → incubator.d}/rolling.js +1 -3
- package/dist/classes/incubation/incubator.d.ts +3 -3
- package/dist/classes/incubation/incubator.js +118 -119
- package/dist/classes/incubation/installer.js +5 -12
- package/dist/classes/ovary.d.ts +1 -6
- package/dist/classes/ovary.js +26 -68
- package/dist/classes/pacman.d/aldos.d.ts +47 -0
- package/dist/classes/pacman.d/aldos.js +93 -0
- package/dist/classes/pacman.d/openmamba.d.ts +47 -0
- package/dist/classes/pacman.d/openmamba.js +93 -0
- package/dist/classes/pacman.d.ts +0 -5
- package/dist/classes/pacman.js +211 -192
- package/dist/classes/tailor.js +2 -0
- package/dist/classes/utils.js +12 -1
- package/dist/classes/xdg.js +9 -1
- package/dist/krill/modules/bootloader.js +13 -5
- package/package.json +3 -3
- package/conf/distros/alpine/calamares/calamares-modules/bootloader-config/bootloader-config.sh +0 -40
- package/conf/distros/alpine/calamares/calamares-modules/bootloader-config/module.yml +0 -9
- package/conf/distros/alpine/calamares/calamares-modules/cleanup/cleanup.sh +0 -13
- package/conf/distros/alpine/calamares/calamares-modules/cleanup/module.yml +0 -9
- package/conf/distros/alpine/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -13
- package/conf/distros/alpine/calamares/calamares-modules/dpkg-unsafe-io/module.yml +0 -6
- package/conf/distros/alpine/calamares/calamares-modules/dpkg-unsafe-io-undo/module.yml +0 -6
- package/conf/distros/alpine/calamares/calamares-modules/sources-yolk/module.yml +0 -8
- package/conf/distros/alpine/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -50
- package/conf/distros/alpine/calamares/calamares-modules/sources-yolk-undo/module.yml +0 -8
- package/conf/distros/fedora/calamares/calamares-modules/bootloader-config/bootloader-config.sh +0 -40
- package/conf/distros/fedora/calamares/calamares-modules/bootloader-config/module.yml +0 -9
- package/conf/distros/fedora/calamares/calamares-modules/cleanup/cleanup.sh +0 -13
- package/conf/distros/fedora/calamares/calamares-modules/cleanup/module.yml +0 -9
- package/conf/distros/fedora/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -13
- package/conf/distros/fedora/calamares/calamares-modules/dpkg-unsafe-io/module.yml +0 -6
- package/conf/distros/fedora/calamares/calamares-modules/dpkg-unsafe-io-undo/module.yml +0 -6
- package/conf/distros/fedora/calamares/calamares-modules/sources-yolk/module.yml +0 -8
- package/conf/distros/fedora/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -50
- package/conf/distros/fedora/calamares/calamares-modules/sources-yolk-undo/module.yml +0 -8
- package/conf/distros/opensuse/calamares/calamares-modules/bootloader-config/bootloader-config.sh +0 -40
- package/conf/distros/opensuse/calamares/calamares-modules/bootloader-config/module.yml +0 -9
- package/conf/distros/opensuse/calamares/calamares-modules/cleanup/cleanup.sh +0 -13
- package/conf/distros/opensuse/calamares/calamares-modules/cleanup/module.yml +0 -9
- package/conf/distros/opensuse/calamares/calamares-modules/dpkg-unsafe-io/dpkg-unsafe-io.sh +0 -13
- package/conf/distros/opensuse/calamares/calamares-modules/dpkg-unsafe-io/module.yml +0 -6
- package/conf/distros/opensuse/calamares/calamares-modules/dpkg-unsafe-io-undo/module.yml +0 -6
- package/conf/distros/opensuse/calamares/calamares-modules/sources-yolk/module.yml +0 -8
- package/conf/distros/opensuse/calamares/calamares-modules/sources-yolk/sources-yolk.sh +0 -50
- package/conf/distros/opensuse/calamares/calamares-modules/sources-yolk-undo/module.yml +0 -8
- /package/dist/classes/incubation/{distros → incubator.d}/alpine.d.ts +0 -0
- /package/dist/classes/incubation/{distros → incubator.d}/alpine.js +0 -0
- /package/dist/classes/incubation/{distros → incubator.d}/bionic.d.ts +0 -0
- /package/dist/classes/incubation/{distros → incubator.d}/bionic.js +0 -0
- /package/dist/classes/incubation/{distros → incubator.d}/buster.d.ts +0 -0
- /package/dist/classes/incubation/{distros → incubator.d}/buster.js +0 -0
- /package/dist/classes/incubation/{distros → incubator.d}/jessie.d.ts +0 -0
- /package/dist/classes/incubation/{distros → incubator.d}/jessie.js +0 -0
- /package/dist/classes/incubation/{distros → incubator.d}/noble.d.ts +0 -0
- /package/dist/classes/incubation/{distros → incubator.d}/noble.js +0 -0
- /package/dist/classes/incubation/{distros → incubator.d}/rolling.d.ts +0 -0
- /package/dist/classes/{families → pacman.d}/alpine.d.ts +0 -0
- /package/dist/classes/{families → pacman.d}/alpine.js +0 -0
- /package/dist/classes/{families → pacman.d}/archlinux.d.ts +0 -0
- /package/dist/classes/{families → pacman.d}/archlinux.js +0 -0
- /package/dist/classes/{families → pacman.d}/debian.d.ts +0 -0
- /package/dist/classes/{families → pacman.d}/debian.js +0 -0
- /package/dist/classes/{families → pacman.d}/fedora.d.ts +0 -0
- /package/dist/classes/{families → pacman.d}/fedora.js +0 -0
- /package/dist/classes/{families → pacman.d}/opensuse.d.ts +0 -0
- /package/dist/classes/{families → pacman.d}/opensuse.js +0 -0
- /package/dist/classes/{families → pacman.d}/voidlinux.d.ts +0 -0
- /package/dist/classes/{families → pacman.d}/voidlinux.js +0 -0
package/dist/classes/ovary.js
CHANGED
|
@@ -27,6 +27,7 @@ import PveLive from './pve-live.js';
|
|
|
27
27
|
import Settings from './settings.js';
|
|
28
28
|
import Systemctl from './systemctl.js';
|
|
29
29
|
import Users from './users.js';
|
|
30
|
+
import Diversions from './diversions.js';
|
|
30
31
|
// classes
|
|
31
32
|
import Utils from './utils.js';
|
|
32
33
|
import Xdg from './xdg.js';
|
|
@@ -205,10 +206,7 @@ export default class Ovary {
|
|
|
205
206
|
ignore: false
|
|
206
207
|
});
|
|
207
208
|
const users = result.data.split('\n');
|
|
208
|
-
let deluser =
|
|
209
|
-
if (this.familyId === 'archlinux' || this.familyId === 'fedora' || this.familyId === 'opensuse' || this.familyId === 'voidlinux') {
|
|
210
|
-
deluser = 'userdel';
|
|
211
|
-
}
|
|
209
|
+
let deluser = Diversions.deluser(this.familyId);
|
|
212
210
|
for (let i = 0; i < users.length - 1; i++) {
|
|
213
211
|
cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} ${deluser} ${users[i]}`, this.verbose));
|
|
214
212
|
}
|
|
@@ -262,6 +260,11 @@ export default class Ovary {
|
|
|
262
260
|
cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} usermod -aG wheel ${this.settings.config.user_opt}`, this.verbose));
|
|
263
261
|
break;
|
|
264
262
|
}
|
|
263
|
+
case 'openmamba': {
|
|
264
|
+
cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} usermod -aG sysadmin ${this.settings.config.user_opt}`, this.verbose));
|
|
265
|
+
cmds.push(await rexec(`chroot ${this.settings.work_dir.merged} usermod -aG autologin ${this.settings.config.user_opt}`, this.verbose));
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
265
268
|
// No default
|
|
266
269
|
}
|
|
267
270
|
/**
|
|
@@ -759,7 +762,7 @@ export default class Ovary {
|
|
|
759
762
|
}
|
|
760
763
|
}
|
|
761
764
|
/**
|
|
762
|
-
* dracut() Fedora/Opensuse/Voidlinux
|
|
765
|
+
* dracut() Fedora/Openmamba/Opensuse/Voidlinux
|
|
763
766
|
*/
|
|
764
767
|
async initrdDracut() {
|
|
765
768
|
Utils.warning(`creating ${path.basename(this.settings.initrdImg)} using dracut on ISO/live`);
|
|
@@ -804,7 +807,7 @@ export default class Ovary {
|
|
|
804
807
|
Utils.warning('Cannot find: ' + isolinuxTemplate);
|
|
805
808
|
process.exit();
|
|
806
809
|
}
|
|
807
|
-
const kernel_parameters = this.kernelParameters()
|
|
810
|
+
const kernel_parameters = Diversions.kernelParameters(this.familyId, this.volid); // this.kernelParameters()
|
|
808
811
|
const template = fs.readFileSync(isolinuxTemplate, 'utf8');
|
|
809
812
|
const view = {
|
|
810
813
|
fullname: this.settings.remix.fullname.toUpperCase(),
|
|
@@ -847,41 +850,6 @@ export default class Ovary {
|
|
|
847
850
|
process.exit(1);
|
|
848
851
|
}
|
|
849
852
|
}
|
|
850
|
-
/**
|
|
851
|
-
*
|
|
852
|
-
* @returns kernelParameters
|
|
853
|
-
*/
|
|
854
|
-
kernelParameters() {
|
|
855
|
-
// GRUB_CMDLINE_LINUX='ipv6.disable=1'
|
|
856
|
-
const { distroId } = this.settings.distro;
|
|
857
|
-
let kp = "";
|
|
858
|
-
if (this.familyId === 'alpine') {
|
|
859
|
-
kp += `alpinelivelabel=${this.volid} alpinelivesquashfs=/mnt/live/filesystem.squashfs`;
|
|
860
|
-
}
|
|
861
|
-
else if (this.familyId === 'archlinux') {
|
|
862
|
-
kp += `boot=live components locales=${process.env.LANG}`;
|
|
863
|
-
if (isMiso(distroId)) {
|
|
864
|
-
kp += ` misobasedir=manjaro misolabel=${this.volid}`;
|
|
865
|
-
shx.exec(`mkdir -p ${this.settings.iso_work}.miso`);
|
|
866
|
-
}
|
|
867
|
-
else {
|
|
868
|
-
kp += ` archisobasedir=arch archisolabel=${this.volid}`;
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
else if (this.familyId === 'debian') {
|
|
872
|
-
kp += `boot=live components locales=${process.env.LANG} cow_spacesize=2G`;
|
|
873
|
-
}
|
|
874
|
-
else if (this.familyId === 'fedora') {
|
|
875
|
-
kp += `root=live:CDLABEL=${this.volid} rd.live.image rd.live.dir=/live rd.live.squashimg=filesystem.squashfs selinux=0`; // rd.shell rd.debug log_buf_len=1M
|
|
876
|
-
}
|
|
877
|
-
else if (this.familyId === 'opensuse') {
|
|
878
|
-
kp += `root=live:CDLABEL=${this.volid} rd.live.image rd.live.dir=/live rd.live.squashimg=filesystem.squashfs apparmor=0`;
|
|
879
|
-
}
|
|
880
|
-
else if (this.familyId === 'voidlinux') {
|
|
881
|
-
kp += `root=live:CDLABEL=${this.volid} rd.live.image rd.live.dir=/live rd.live.squashimg=filesystem.squashfs rd.debug`;
|
|
882
|
-
}
|
|
883
|
-
return kp;
|
|
884
|
-
}
|
|
885
853
|
/**
|
|
886
854
|
* Crea la struttura della workdir
|
|
887
855
|
*/
|
|
@@ -974,7 +942,7 @@ export default class Ovary {
|
|
|
974
942
|
/**
|
|
975
943
|
* il pachetto grub/grub2 DEVE essere presente
|
|
976
944
|
*/
|
|
977
|
-
const grubName =
|
|
945
|
+
const grubName = Diversions.grubName(this.familyId);
|
|
978
946
|
if (grubName === '') {
|
|
979
947
|
Utils.error('Something went wrong! Cannot find grub! Run lsb_release -a and check the result');
|
|
980
948
|
process.exit(1);
|
|
@@ -1133,7 +1101,7 @@ export default class Ovary {
|
|
|
1133
1101
|
Utils.warning('Cannot find: ' + grubTemplate);
|
|
1134
1102
|
process.exit();
|
|
1135
1103
|
}
|
|
1136
|
-
const kernel_parameters = this.kernelParameters()
|
|
1104
|
+
const kernel_parameters = Diversions.kernelParameters(this.familyId, this.volid); // this.kernelParameters()
|
|
1137
1105
|
const grubDest = `${isoDir}/boot/grub/grub.cfg`;
|
|
1138
1106
|
const template = fs.readFileSync(grubTemplate, 'utf8');
|
|
1139
1107
|
const view = {
|
|
@@ -1486,31 +1454,21 @@ export default class Ovary {
|
|
|
1486
1454
|
/**
|
|
1487
1455
|
* differents initfs for different families
|
|
1488
1456
|
*/
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
break;
|
|
1505
|
-
}
|
|
1506
|
-
case 'debian': {
|
|
1507
|
-
await this.initrdDebian();
|
|
1508
|
-
break;
|
|
1509
|
-
}
|
|
1510
|
-
case 'voidlinux': {
|
|
1511
|
-
await this.initrdDracut();
|
|
1512
|
-
break;
|
|
1513
|
-
}
|
|
1457
|
+
if (this.familyId === 'alpine') {
|
|
1458
|
+
await this.initrdAlpine();
|
|
1459
|
+
}
|
|
1460
|
+
else if (this.familyId === 'archlinux') {
|
|
1461
|
+
await this.initrdArch();
|
|
1462
|
+
}
|
|
1463
|
+
else if (this.familyId === 'debian') {
|
|
1464
|
+
await this.initrdDebian();
|
|
1465
|
+
}
|
|
1466
|
+
else if (this.familyId === 'aldos' ||
|
|
1467
|
+
this.familyId === 'fedora' ||
|
|
1468
|
+
this.familyId === 'openmamba' ||
|
|
1469
|
+
this.familyId === 'opensuse' ||
|
|
1470
|
+
this.familyId === 'voidlinux') {
|
|
1471
|
+
await this.initrdDracut();
|
|
1514
1472
|
}
|
|
1515
1473
|
if (this.settings.config.make_efi) {
|
|
1516
1474
|
await this.makeEfi(this.theme);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/classes/families/aldos.ts
|
|
3
|
+
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Utils: general porpourse utils
|
|
10
|
+
* @remarks all the utilities
|
|
11
|
+
*/
|
|
12
|
+
export default class Aldos {
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
static calamaresInstall(verbose?: boolean): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
static calamaresRemove(verbose?: boolean): Promise<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* check if it's installed wayland
|
|
23
|
+
* @returns true if wayland
|
|
24
|
+
*/
|
|
25
|
+
static isInstalledWayland(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* check if it's installed xorg
|
|
28
|
+
* @returns true if xorg is installed
|
|
29
|
+
*/
|
|
30
|
+
static isInstalledXorg(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* restuisce VERO se il pacchetto è installato
|
|
33
|
+
* @param packageName
|
|
34
|
+
*/
|
|
35
|
+
static packageAvailable(packageName: string): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Install the package packageName
|
|
38
|
+
* @param packageName {string} Pacchetto da installare
|
|
39
|
+
* @returns {boolean} True if success
|
|
40
|
+
*/
|
|
41
|
+
static packageInstall(packageName: string): Promise<boolean>;
|
|
42
|
+
/**
|
|
43
|
+
* restuisce VERO se il pacchetto è installato
|
|
44
|
+
* @param packageName
|
|
45
|
+
*/
|
|
46
|
+
static packageIsInstalled(packageName: string): boolean;
|
|
47
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/classes/families/aldos.ts
|
|
3
|
+
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
7
|
+
*/
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import shx from 'shelljs';
|
|
10
|
+
import { exec } from '../../lib/utils.js';
|
|
11
|
+
import Utils from '../utils.js';
|
|
12
|
+
/**
|
|
13
|
+
* Utils: general porpourse utils
|
|
14
|
+
* @remarks all the utilities
|
|
15
|
+
*/
|
|
16
|
+
export default class Aldos {
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
static async calamaresInstall(verbose = true) {
|
|
21
|
+
const echo = Utils.setEcho(verbose);
|
|
22
|
+
try {
|
|
23
|
+
await exec(`yum install -y calamares}`, echo);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
Utils.error(`aldos.calamaresInstall()`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
static async calamaresRemove(verbose = true) {
|
|
33
|
+
const echo = Utils.setEcho(verbose);
|
|
34
|
+
const retVal = false;
|
|
35
|
+
if (fs.existsSync('/etc/calamares')) {
|
|
36
|
+
await exec('rm /etc/calamares -rf', echo);
|
|
37
|
+
}
|
|
38
|
+
await exec('yum remove -y calamares', echo);
|
|
39
|
+
return retVal;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* check if it's installed wayland
|
|
43
|
+
* @returns true if wayland
|
|
44
|
+
*/
|
|
45
|
+
static isInstalledWayland() {
|
|
46
|
+
return this.packageIsInstalled('xorg-x11-server-Xwayland*');
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* check if it's installed xorg
|
|
50
|
+
* @returns true if xorg is installed
|
|
51
|
+
*/
|
|
52
|
+
static isInstalledXorg() {
|
|
53
|
+
return this.packageIsInstalled('xorg-x11-server-Xorg.x86_64');
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* restuisce VERO se il pacchetto è installato
|
|
57
|
+
* @param packageName
|
|
58
|
+
*/
|
|
59
|
+
static async packageAvailable(packageName) {
|
|
60
|
+
let available = false;
|
|
61
|
+
const cmd = `/usr/bin/yum list --available ${packageName} | grep Package:`;
|
|
62
|
+
const stdout = shx.exec(cmd, { silent: true }).stdout.trim();
|
|
63
|
+
if (stdout.includes(packageName)) {
|
|
64
|
+
available = true;
|
|
65
|
+
}
|
|
66
|
+
return available;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Install the package packageName
|
|
70
|
+
* @param packageName {string} Pacchetto da installare
|
|
71
|
+
* @returns {boolean} True if success
|
|
72
|
+
*/
|
|
73
|
+
static async packageInstall(packageName) {
|
|
74
|
+
let retVal = false;
|
|
75
|
+
if (shx.exec(`/usr/bin/yum install ${packageName}`, { silent: true }) === '0') {
|
|
76
|
+
retVal = true;
|
|
77
|
+
}
|
|
78
|
+
return retVal;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* restuisce VERO se il pacchetto è installato
|
|
82
|
+
* @param packageName
|
|
83
|
+
*/
|
|
84
|
+
static packageIsInstalled(packageName) {
|
|
85
|
+
let installed = false;
|
|
86
|
+
const cmd = `/usr/bin/yum list --installed ${packageName}`;
|
|
87
|
+
const stdout = shx.exec(cmd, { silent: true }).stdout.trim();
|
|
88
|
+
if (stdout.includes(packageName)) {
|
|
89
|
+
installed = true;
|
|
90
|
+
}
|
|
91
|
+
return installed;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/classes/families/openmamba.ts
|
|
3
|
+
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Utils: general porpourse utils
|
|
10
|
+
* @remarks all the utilities
|
|
11
|
+
*/
|
|
12
|
+
export default class Openmamba {
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
static calamaresInstall(verbose?: boolean): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
static calamaresRemove(verbose?: boolean): Promise<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* check if it's installed wayland
|
|
23
|
+
* @returns true if wayland
|
|
24
|
+
*/
|
|
25
|
+
static isInstalledWayland(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* check if it's installed xorg
|
|
28
|
+
* @returns true if xorg is installed
|
|
29
|
+
*/
|
|
30
|
+
static isInstalledXorg(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* restuisce VERO se il pacchetto è installato
|
|
33
|
+
* @param packageName
|
|
34
|
+
*/
|
|
35
|
+
static packageAvailable(packageName: string): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Install the package packageName
|
|
38
|
+
* @param packageName {string} Pacchetto da installare
|
|
39
|
+
* @returns {boolean} True if success
|
|
40
|
+
*/
|
|
41
|
+
static packageInstall(packageName: string): Promise<boolean>;
|
|
42
|
+
/**
|
|
43
|
+
* restuisce VERO se il pacchetto è installato
|
|
44
|
+
* @param packageName
|
|
45
|
+
*/
|
|
46
|
+
static packageIsInstalled(packageName: string): boolean;
|
|
47
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/classes/families/openmamba.ts
|
|
3
|
+
* penguins-eggs v.10.0.0 / ecmascript 2020
|
|
4
|
+
* author: Piero Proietti
|
|
5
|
+
* email: piero.proietti@gmail.com
|
|
6
|
+
* license: MIT
|
|
7
|
+
*/
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import shx from 'shelljs';
|
|
10
|
+
import { exec } from '../../lib/utils.js';
|
|
11
|
+
import Utils from '../utils.js';
|
|
12
|
+
/**
|
|
13
|
+
* Utils: general porpourse utils
|
|
14
|
+
* @remarks all the utilities
|
|
15
|
+
*/
|
|
16
|
+
export default class Openmamba {
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
static async calamaresInstall(verbose = true) {
|
|
21
|
+
const echo = Utils.setEcho(verbose);
|
|
22
|
+
try {
|
|
23
|
+
await exec('dnf install calamares -y', echo);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
Utils.error(`openmamba.calamaresInstall()`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
static async calamaresRemove(verbose = true) {
|
|
33
|
+
const echo = Utils.setEcho(verbose);
|
|
34
|
+
const retVal = false;
|
|
35
|
+
if (fs.existsSync('/etc/calamares')) {
|
|
36
|
+
await exec('rm /etc/calamares -rf', echo);
|
|
37
|
+
}
|
|
38
|
+
await exec('dnf remove calamares', echo);
|
|
39
|
+
return retVal;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* check if it's installed wayland
|
|
43
|
+
* @returns true if wayland
|
|
44
|
+
*/
|
|
45
|
+
static isInstalledWayland() {
|
|
46
|
+
return this.packageIsInstalled('xorg-x11-server-Xwayland*');
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* check if it's installed xorg
|
|
50
|
+
* @returns true if xorg is installed
|
|
51
|
+
*/
|
|
52
|
+
static isInstalledXorg() {
|
|
53
|
+
return this.packageIsInstalled('xorg-x11-server-Xorg.x86_64');
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* restuisce VERO se il pacchetto è installato
|
|
57
|
+
* @param packageName
|
|
58
|
+
*/
|
|
59
|
+
static async packageAvailable(packageName) {
|
|
60
|
+
let available = false;
|
|
61
|
+
const cmd = `/usr/bin/dnf list --available ${packageName} | grep Package:`;
|
|
62
|
+
const stdout = shx.exec(cmd, { silent: true }).stdout.trim();
|
|
63
|
+
if (stdout.includes(packageName)) {
|
|
64
|
+
available = true;
|
|
65
|
+
}
|
|
66
|
+
return available;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Install the package packageName
|
|
70
|
+
* @param packageName {string} Pacchetto da installare
|
|
71
|
+
* @returns {boolean} True if success
|
|
72
|
+
*/
|
|
73
|
+
static async packageInstall(packageName) {
|
|
74
|
+
let retVal = false;
|
|
75
|
+
if (shx.exec(`/usr/bin/dnf install ${packageName}`, { silent: false }) === '0') {
|
|
76
|
+
retVal = true;
|
|
77
|
+
}
|
|
78
|
+
return retVal;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* restuisce VERO se il pacchetto è installato
|
|
82
|
+
* @param packageName
|
|
83
|
+
*/
|
|
84
|
+
static packageIsInstalled(packageName) {
|
|
85
|
+
let installed = false;
|
|
86
|
+
const cmd = `/usr/bin/dnf list --installed ${packageName}`;
|
|
87
|
+
const stdout = shx.exec(cmd, { silent: true }).stdout.trim();
|
|
88
|
+
if (stdout.includes(packageName)) {
|
|
89
|
+
installed = true;
|
|
90
|
+
}
|
|
91
|
+
return installed;
|
|
92
|
+
}
|
|
93
|
+
}
|
package/dist/classes/pacman.d.ts
CHANGED