penguins-eggs 9.8.1 → 10.0.0
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 +242 -242
- package/README.md +43 -40
- package/bin/dev.cmd +1 -1
- package/bin/dev.js +6 -6
- package/bin/run.js +3 -5
- package/conf/tools.yaml +1 -1
- package/dist/classes/bleach.d.ts +37 -0
- package/dist/classes/bleach.js +43 -91
- package/dist/classes/cfs.d.ts +17 -0
- package/dist/classes/cfs.js +15 -12
- package/dist/classes/compressors.d.ts +53 -0
- package/dist/classes/compressors.js +42 -47
- package/dist/classes/daddy.d.ts +18 -0
- package/dist/classes/daddy.js +92 -98
- package/dist/classes/distro.d.ts +26 -0
- package/dist/classes/distro.js +36 -37
- package/dist/classes/families/archlinux.d.ts +61 -0
- package/dist/classes/families/archlinux.js +52 -107
- package/dist/classes/families/debian.d.ts +65 -0
- package/dist/classes/families/debian.js +67 -142
- package/dist/classes/families/fedora.d.ts +52 -0
- package/dist/classes/families/fedora.js +42 -98
- package/dist/classes/families/mockup.d.ts +60 -0
- package/dist/classes/families/mockup.js +27 -46
- package/dist/classes/families/suse.d.ts +52 -0
- package/dist/classes/families/suse.js +44 -96
- package/dist/classes/incubation/branding.d.ts +17 -0
- package/dist/classes/incubation/branding.js +32 -36
- package/dist/classes/incubation/distros/bionic.d.ts +32 -0
- package/dist/classes/incubation/distros/bionic.js +11 -16
- package/dist/classes/incubation/distros/buster.d.ts +32 -0
- package/dist/classes/incubation/distros/buster.js +13 -18
- package/dist/classes/incubation/distros/focal.d.ts +32 -0
- package/dist/classes/incubation/distros/focal.js +11 -16
- package/dist/classes/incubation/distros/jessie.d.ts +31 -0
- package/dist/classes/incubation/distros/jessie.js +8 -13
- package/dist/classes/incubation/distros/rolling.d.ts +32 -0
- package/dist/classes/incubation/distros/rolling.js +11 -16
- package/dist/classes/incubation/fisherman-helper/displaymanager.d.ts +11 -0
- package/dist/classes/incubation/fisherman-helper/displaymanager.js +8 -9
- package/dist/classes/incubation/fisherman-helper/packages.d.ts +20 -0
- package/dist/classes/incubation/fisherman-helper/packages.js +17 -20
- package/dist/classes/incubation/fisherman-helper/settings.d.ts +15 -0
- package/dist/classes/incubation/fisherman-helper/settings.js +30 -28
- package/dist/classes/incubation/fisherman.d.ts +77 -0
- package/dist/classes/incubation/fisherman.js +135 -131
- package/dist/classes/incubation/incubator.d.ts +40 -0
- package/dist/classes/incubation/incubator.js +90 -89
- package/dist/classes/incubation/installer.d.ts +13 -0
- package/dist/classes/incubation/installer.js +27 -12
- package/dist/classes/initrd.d.ts +41 -0
- package/dist/classes/initrd.js +40 -42
- package/dist/classes/keyboards.d.ts +50 -0
- package/dist/classes/keyboards.js +108 -105
- package/dist/classes/locales.d.ts +21 -0
- package/dist/classes/locales.js +30 -34
- package/dist/classes/n8.d.ts +17 -0
- package/dist/classes/n8.js +16 -22
- package/dist/classes/network.d.ts +37 -0
- package/dist/classes/network.js +14 -18
- package/dist/classes/ovary.d.ts +205 -0
- package/dist/classes/ovary.js +1281 -1294
- package/dist/classes/pacman.d.ts +149 -0
- package/dist/classes/pacman.js +344 -418
- package/dist/classes/pve-live.d.ts +17 -0
- package/dist/classes/pve-live.js +22 -24
- package/dist/classes/pxe.d.ts +65 -0
- package/dist/classes/pxe.js +204 -206
- package/dist/classes/settings.d.ts +53 -0
- package/dist/classes/settings.js +91 -94
- package/dist/classes/sources_list.d.ts +28 -0
- package/dist/classes/sources_list.js +35 -39
- package/dist/classes/systemctl.d.ts +47 -0
- package/dist/classes/systemctl.js +34 -38
- package/dist/classes/tailor.d.ts +46 -0
- package/dist/classes/tailor.js +223 -239
- package/dist/classes/tools.d.ts +30 -0
- package/dist/classes/tools.js +18 -22
- package/dist/classes/users.d.ts +28 -0
- package/dist/classes/users.js +18 -22
- package/dist/classes/utils.d.ts +318 -0
- package/dist/classes/utils.js +78 -78
- package/dist/classes/xdg.d.ts +45 -0
- package/dist/classes/xdg.js +129 -133
- package/dist/classes/yolk.d.ts +33 -0
- package/dist/classes/yolk.js +53 -57
- package/dist/commands/adapt.d.ts +17 -0
- package/dist/commands/adapt.js +17 -21
- package/dist/commands/analyze.d.ts +26 -0
- package/dist/commands/analyze.js +56 -67
- package/dist/commands/calamares.d.ts +29 -0
- package/dist/commands/calamares.js +44 -48
- package/dist/commands/config.d.ts +36 -0
- package/dist/commands/config.js +115 -137
- package/dist/commands/cuckoo.d.ts +16 -0
- package/dist/commands/cuckoo.js +20 -24
- package/dist/commands/dad.d.ts +19 -0
- package/dist/commands/dad.js +20 -24
- package/dist/commands/export/deb.d.ts +19 -0
- package/dist/commands/export/deb.js +19 -23
- package/dist/commands/export/iso.d.ts +19 -0
- package/dist/commands/export/iso.js +19 -23
- package/dist/commands/install.d.ts +37 -0
- package/dist/commands/install.js +46 -50
- package/dist/commands/kill.d.ts +24 -0
- package/dist/commands/kill.js +25 -29
- package/dist/commands/mom.d.ts +16 -0
- package/dist/commands/mom.js +16 -18
- package/dist/commands/produce.d.ts +33 -0
- package/dist/commands/produce.js +64 -66
- package/dist/commands/status.d.ts +23 -0
- package/dist/commands/status.js +10 -14
- package/dist/commands/syncfrom.d.ts +45 -0
- package/dist/commands/syncfrom.js +85 -89
- package/dist/commands/syncto.d.ts +40 -0
- package/dist/commands/syncto.js +91 -95
- package/dist/commands/tools/clean.d.ts +18 -0
- package/dist/commands/tools/clean.js +17 -21
- package/dist/commands/tools/ppa.d.ts +26 -0
- package/dist/commands/tools/ppa.js +41 -45
- package/dist/commands/tools/skel.d.ts +18 -0
- package/dist/commands/tools/skel.js +22 -26
- package/dist/commands/tools/stat.d.ts +31 -0
- package/dist/commands/tools/stat.js +15 -19
- package/dist/commands/tools/yolk.d.ts +24 -0
- package/dist/commands/tools/yolk.js +19 -23
- package/dist/commands/update.d.ts +47 -0
- package/dist/commands/update.js +62 -66
- package/dist/commands/wardrobe/get.d.ts +23 -0
- package/dist/commands/wardrobe/get.js +19 -23
- package/dist/commands/wardrobe/list.d.ts +24 -0
- package/dist/commands/wardrobe/list.js +61 -60
- package/dist/commands/wardrobe/show.d.ts +25 -0
- package/dist/commands/wardrobe/show.js +50 -47
- package/dist/commands/wardrobe/wear.d.ts +26 -0
- package/dist/commands/wardrobe/wear.js +32 -36
- package/dist/components/finished.d.ts +15 -0
- package/dist/components/finished.js +37 -42
- package/dist/components/information.d.ts +8 -0
- package/dist/components/information.js +155 -0
- package/dist/components/install.d.ts +15 -0
- package/dist/components/install.js +31 -35
- package/dist/components/keyboard.d.ts +16 -0
- package/dist/components/keyboard.js +37 -40
- package/dist/components/location.d.ts +16 -0
- package/dist/components/location.js +38 -38
- package/dist/components/network.d.ts +19 -0
- package/dist/components/network.js +47 -48
- package/dist/components/partitions.d.ts +16 -0
- package/dist/components/partitions.js +47 -51
- package/dist/components/steps.d.ts +13 -0
- package/dist/components/steps.js +148 -0
- package/dist/components/summary.d.ts +24 -0
- package/dist/components/summary.js +50 -54
- package/dist/components/title.d.ts +12 -0
- package/dist/components/title.js +35 -0
- package/dist/components/users.d.ts +24 -0
- package/dist/components/users.js +43 -43
- package/dist/components/welcome.d.ts +13 -0
- package/dist/components/welcome.js +37 -38
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -5
- package/dist/interfaces/i-addons.d.ts +13 -0
- package/dist/interfaces/i-addons.js +8 -3
- package/dist/interfaces/i-analyze.d.ts +17 -0
- package/dist/interfaces/i-analyze.js +7 -10
- package/dist/interfaces/i-app.d.ts +14 -0
- package/dist/interfaces/i-app.js +8 -2
- package/dist/interfaces/i-branding.d.ts +36 -0
- package/dist/interfaces/i-branding.js +8 -2
- package/dist/interfaces/i-calamares-partition.d.ts +18 -0
- package/dist/interfaces/i-calamares-partition.js +3 -4
- package/dist/interfaces/i-config-tools.d.ts +18 -0
- package/dist/interfaces/i-config-tools.js +8 -2
- package/dist/interfaces/i-devices.d.ts +20 -0
- package/dist/interfaces/i-devices.js +8 -2
- package/dist/interfaces/i-distro.d.ts +27 -0
- package/dist/interfaces/i-distro.js +3 -4
- package/dist/interfaces/i-drive-list.d.ts +33 -0
- package/dist/interfaces/i-drive-list.js +3 -4
- package/dist/interfaces/i-eggs-config.d.ts +32 -0
- package/dist/interfaces/i-eggs-config.js +3 -4
- package/dist/interfaces/i-excludes.d.ts +14 -0
- package/dist/interfaces/i-excludes.js +8 -2
- package/dist/interfaces/i-exec.d.ts +11 -0
- package/dist/interfaces/i-exec.js +3 -4
- package/dist/interfaces/i-initrd.d.ts +13 -0
- package/dist/interfaces/i-initrd.js +8 -2
- package/dist/interfaces/i-install.d.ts +16 -0
- package/dist/interfaces/i-install.js +8 -2
- package/dist/interfaces/i-installer.d.ts +17 -0
- package/dist/interfaces/i-installer.js +8 -2
- package/dist/interfaces/i-krill-config.d.ts +33 -0
- package/dist/interfaces/i-krill-config.js +3 -4
- package/dist/interfaces/i-krill.d.ts +42 -0
- package/dist/interfaces/i-krill.js +8 -2
- package/dist/interfaces/i-materia.d.ts +41 -0
- package/dist/interfaces/i-materia.js +8 -2
- package/dist/interfaces/i-net.d.ts +16 -0
- package/dist/interfaces/i-net.js +8 -2
- package/dist/interfaces/i-packages.d.ts +29 -0
- package/dist/interfaces/i-packages.js +3 -4
- package/dist/interfaces/i-partitions.d.ts +16 -0
- package/dist/interfaces/i-partitions.js +8 -2
- package/dist/interfaces/i-pxe.d.ts +21 -0
- package/dist/interfaces/i-pxe.js +8 -39
- package/dist/interfaces/i-remix.d.ts +21 -0
- package/dist/interfaces/i-remix.js +3 -4
- package/dist/interfaces/i-settings.d.ts +39 -0
- package/dist/interfaces/i-settings.js +8 -2
- package/dist/interfaces/i-user.d.ts +14 -0
- package/dist/interfaces/i-user.js +8 -2
- package/dist/interfaces/i-workdir.d.ts +14 -0
- package/dist/interfaces/i-workdir.js +8 -2
- package/dist/interfaces/i-xkb-model.d.ts +24 -0
- package/dist/interfaces/i-xkb-model.js +8 -2
- package/dist/interfaces/index.d.ts +25 -0
- package/dist/interfaces/index.js +3 -4
- package/dist/krill/modules/add-user.d.ts +20 -0
- package/dist/krill/modules/add-user.js +11 -15
- package/dist/krill/modules/bootloader-config-arch.d.ts +14 -0
- package/dist/krill/modules/bootloader-config-arch.js +15 -11
- package/dist/krill/modules/bootloader-config-debian.d.ts +10 -0
- package/dist/krill/modules/bootloader-config-debian.js +20 -16
- package/dist/krill/modules/bootloader-config.d.ts +10 -0
- package/dist/krill/modules/bootloader-config.js +3 -6
- package/dist/krill/modules/bootloader.d.ts +14 -0
- package/dist/krill/modules/bootloader.js +9 -13
- package/dist/krill/modules/change-password.d.ts +15 -0
- package/dist/krill/modules/change-password.js +5 -8
- package/dist/krill/modules/del-live-user.d.ts +14 -0
- package/dist/krill/modules/del-live-user.js +8 -12
- package/dist/krill/modules/fstab.d.ts +14 -0
- package/dist/krill/modules/fstab.js +33 -37
- package/dist/krill/modules/grubcfg.d.ts +17 -0
- package/dist/krill/modules/grubcfg.js +8 -17
- package/dist/krill/modules/hostname.d.ts +13 -0
- package/dist/krill/modules/hostname.js +11 -17
- package/dist/krill/modules/initramfs-cfg.d.ts +14 -0
- package/dist/krill/modules/initramfs-cfg.js +6 -15
- package/dist/krill/modules/initramfs.d.ts +13 -0
- package/dist/krill/modules/initramfs.js +17 -19
- package/dist/krill/modules/locale-cfg.d.ts +10 -0
- package/dist/krill/modules/locale-cfg.js +8 -12
- package/dist/krill/modules/locale.d.ts +13 -0
- package/dist/krill/modules/locale.js +7 -11
- package/dist/krill/modules/m-keyboard.d.ts +14 -0
- package/dist/krill/modules/m-keyboard.js +14 -18
- package/dist/krill/modules/m-timezone.d.ts +14 -0
- package/dist/krill/modules/m-timezone.js +8 -12
- package/dist/krill/modules/machine-id.d.ts +15 -0
- package/dist/krill/modules/machine-id.js +6 -10
- package/dist/krill/modules/mkfs.d.ts +13 -0
- package/dist/krill/modules/mkfs.js +10 -13
- package/dist/krill/modules/mount-fs.d.ts +17 -0
- package/dist/krill/modules/mount-fs.js +20 -26
- package/dist/krill/modules/mount-vfs.d.ts +17 -0
- package/dist/krill/modules/mount-vfs.js +16 -21
- package/dist/krill/modules/network-cfg.d.ts +19 -0
- package/dist/krill/modules/network-cfg.js +16 -20
- package/dist/krill/modules/packages.d.ts +14 -0
- package/dist/krill/modules/packages.js +17 -21
- package/dist/krill/modules/partition.d.ts +20 -0
- package/dist/krill/modules/partition.js +78 -84
- package/dist/krill/modules/remove-installer-link.d.ts +13 -0
- package/dist/krill/modules/remove-installer-link.js +7 -11
- package/dist/krill/modules/umount.d.ts +14 -0
- package/dist/krill/modules/umount.js +9 -13
- package/dist/krill/modules/unpackfs.d.ts +13 -0
- package/dist/krill/modules/unpackfs.js +7 -11
- package/dist/krill/prepare.d.ts +77 -0
- package/dist/krill/{krill-prepare.js → prepare.js} +118 -124
- package/dist/krill/sequence.d.ts +156 -0
- package/dist/krill/{krill-sequence.js → sequence.js} +166 -170
- package/dist/lib/cli-autologin.d.ts +43 -0
- package/dist/lib/cli-autologin.js +88 -92
- package/dist/lib/get_address.d.ts +8 -0
- package/dist/lib/get_address.js +9 -11
- package/dist/lib/get_dns.d.ts +8 -0
- package/dist/lib/get_dns.js +9 -11
- package/dist/lib/get_domain.d.ts +8 -0
- package/dist/lib/get_domain.js +9 -11
- package/dist/lib/get_gateway.d.ts +8 -0
- package/dist/lib/get_gateway.js +9 -11
- package/dist/lib/get_hostname.d.ts +8 -0
- package/dist/lib/get_hostname.js +9 -11
- package/dist/lib/get_netmask.d.ts +8 -0
- package/dist/lib/get_netmask.js +9 -11
- package/dist/lib/get_password.d.ts +8 -0
- package/dist/lib/get_password.js +10 -13
- package/dist/lib/get_userfullname.d.ts +8 -0
- package/dist/lib/get_userfullname.js +9 -11
- package/dist/lib/get_username.d.ts +8 -0
- package/dist/lib/get_username.js +9 -12
- package/dist/lib/kill_me_softly.d.ts +11 -0
- package/dist/lib/kill_me_softly.js +19 -24
- package/dist/lib/select_address_type.d.ts +8 -0
- package/dist/lib/select_address_type.js +9 -12
- package/dist/lib/select_filesystem_type.d.ts +8 -0
- package/dist/lib/select_filesystem_type.js +15 -18
- package/dist/lib/select_installation_device.d.ts +8 -0
- package/dist/lib/select_installation_device.js +11 -15
- package/dist/lib/select_installation_mode.d.ts +8 -0
- package/dist/lib/select_installation_mode.js +9 -11
- package/dist/lib/select_interface.d.ts +8 -0
- package/dist/lib/select_interface.js +9 -12
- package/dist/lib/select_keyboard_layout.d.ts +11 -0
- package/dist/lib/select_keyboard_layout.js +11 -15
- package/dist/lib/select_keyboard_model.d.ts +11 -0
- package/dist/lib/select_keyboard_model.js +11 -15
- package/dist/lib/select_keyboard_option.d.ts +11 -0
- package/dist/lib/select_keyboard_option.js +11 -15
- package/dist/lib/select_keyboard_variant.d.ts +11 -0
- package/dist/lib/select_keyboard_variant.js +11 -15
- package/dist/lib/select_languages.d.ts +8 -0
- package/dist/lib/select_languages.js +11 -15
- package/dist/lib/select_regions.d.ts +8 -0
- package/dist/lib/select_regions.js +9 -11
- package/dist/lib/select_user_swap_choice.d.ts +8 -0
- package/dist/lib/select_user_swap_choice.js +13 -17
- package/dist/lib/select_zones.d.ts +8 -0
- package/dist/lib/select_zones.js +9 -11
- package/dist/lib/utils.d.ts +34 -0
- package/dist/lib/utils.js +24 -14
- package/manpages/doc/man/eggs.1.gz +0 -0
- package/manpages/doc/man/eggs.html +10 -10
- package/package.json +49 -70
- package/LICENSE +0 -339
- package/bin/dev +0 -17
- package/bin/run +0 -5
- package/dist/components/elements/information.js +0 -194
- package/dist/components/elements/steps.js +0 -152
- package/dist/components/elements/title.js +0 -36
- package/dist/lib/dependencies.js +0 -121
package/dist/classes/cfs.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ./src/classes/families/cfs.ts (custom final steps)
|
|
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 yaml from 'js-yaml';
|
|
9
|
+
import fs from 'node:fs';
|
|
10
|
+
import Pacman from './pacman.js';
|
|
7
11
|
/**
|
|
8
12
|
* cfs
|
|
9
13
|
*/
|
|
10
|
-
class CFS {
|
|
14
|
+
export default class CFS {
|
|
11
15
|
/**
|
|
12
16
|
* steps
|
|
13
17
|
* @returns
|
|
@@ -15,13 +19,13 @@ class CFS {
|
|
|
15
19
|
async steps() {
|
|
16
20
|
const cfs = [];
|
|
17
21
|
let configRoot = '/etc/penguins-eggs.d/krill/';
|
|
18
|
-
if (
|
|
22
|
+
if (Pacman.calamaresExists()) {
|
|
19
23
|
configRoot = '/etc/calamares/';
|
|
20
24
|
}
|
|
21
25
|
// solo se esiste settings.conf CALAMARES
|
|
22
|
-
if (
|
|
23
|
-
const settingsVar =
|
|
24
|
-
const settingsYaml =
|
|
26
|
+
if (fs.existsSync(`${configRoot}settings.conf`)) {
|
|
27
|
+
const settingsVar = fs.readFileSync(`${configRoot}settings.conf`, 'utf8');
|
|
28
|
+
const settingsYaml = yaml.load(settingsVar);
|
|
25
29
|
const execSequence = settingsYaml.sequence[1];
|
|
26
30
|
const steps = execSequence.exec;
|
|
27
31
|
for (const step of steps) {
|
|
@@ -33,4 +37,3 @@ class CFS {
|
|
|
33
37
|
return cfs;
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
|
-
exports.default = CFS;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/classes/compressors.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
|
+
export default class Compressors {
|
|
9
|
+
dest: string;
|
|
10
|
+
isEnabled: {
|
|
11
|
+
error: boolean;
|
|
12
|
+
gzip: boolean;
|
|
13
|
+
lz4: boolean;
|
|
14
|
+
lzma: boolean;
|
|
15
|
+
lzo: boolean;
|
|
16
|
+
xz: boolean;
|
|
17
|
+
zstd: boolean;
|
|
18
|
+
};
|
|
19
|
+
source: string;
|
|
20
|
+
/**
|
|
21
|
+
* fast
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
fast(): string;
|
|
25
|
+
/**
|
|
26
|
+
* max
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
max(): string;
|
|
30
|
+
/**
|
|
31
|
+
* populate
|
|
32
|
+
*/
|
|
33
|
+
populate(): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* standard
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
standard(): string;
|
|
39
|
+
/**
|
|
40
|
+
* check mksquashfs exists
|
|
41
|
+
* @param compressor
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
44
|
+
private check;
|
|
45
|
+
/**
|
|
46
|
+
* prepareCheck
|
|
47
|
+
*/
|
|
48
|
+
private prepareCheck;
|
|
49
|
+
/**
|
|
50
|
+
* removeCheck
|
|
51
|
+
*/
|
|
52
|
+
private removeCheck;
|
|
53
|
+
}
|
|
@@ -1,40 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
1
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
* ./src/classes/compressors.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 shx from 'shelljs';
|
|
9
|
+
export default class Compressors {
|
|
10
|
+
dest = '/tmp/eggs-mksquash-dest';
|
|
14
11
|
isEnabled = {
|
|
15
12
|
error: false,
|
|
16
13
|
gzip: true,
|
|
14
|
+
lz4: false,
|
|
17
15
|
lzma: false,
|
|
18
16
|
lzo: false,
|
|
19
|
-
lz4: false,
|
|
20
17
|
xz: false,
|
|
21
18
|
zstd: false,
|
|
22
19
|
};
|
|
23
20
|
source = '/tmp/eggs-mksquash-test';
|
|
24
|
-
dest = '/tmp/eggs-mksquash-dest';
|
|
25
|
-
/**
|
|
26
|
-
* populate
|
|
27
|
-
*/
|
|
28
|
-
async populate() {
|
|
29
|
-
await this.prepareCheck();
|
|
30
|
-
this.isEnabled.error = await this.check('error');
|
|
31
|
-
this.isEnabled.lzma = await this.check('lzma');
|
|
32
|
-
this.isEnabled.lzo = await this.check('lzo');
|
|
33
|
-
this.isEnabled.lz4 = await this.check('lz4');
|
|
34
|
-
this.isEnabled.xz = await this.check('xz');
|
|
35
|
-
this.isEnabled.zstd = await this.check('zstd');
|
|
36
|
-
await this.removeCheck();
|
|
37
|
-
}
|
|
38
21
|
/**
|
|
39
22
|
* fast
|
|
40
23
|
* @returns
|
|
@@ -49,14 +32,6 @@ class Compressors {
|
|
|
49
32
|
}
|
|
50
33
|
return comp;
|
|
51
34
|
}
|
|
52
|
-
/**
|
|
53
|
-
* standard
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
standard() {
|
|
57
|
-
let comp = 'xz -b 1M';
|
|
58
|
-
return comp;
|
|
59
|
-
}
|
|
60
35
|
/**
|
|
61
36
|
* max
|
|
62
37
|
* @returns
|
|
@@ -66,26 +41,33 @@ class Compressors {
|
|
|
66
41
|
if (process.arch === 'arm64') {
|
|
67
42
|
filter = 'arm';
|
|
68
43
|
}
|
|
69
|
-
|
|
44
|
+
const options = '-b 1M -no-duplicates -no-recovery -always-use-fragments';
|
|
70
45
|
if (process.arch === 'ia32') {
|
|
71
46
|
// options = '-b 1M'
|
|
72
47
|
}
|
|
73
|
-
|
|
48
|
+
const comp = `xz -Xbcj ${filter} ${options}`;
|
|
74
49
|
return comp;
|
|
75
50
|
}
|
|
76
51
|
/**
|
|
77
|
-
*
|
|
52
|
+
* populate
|
|
78
53
|
*/
|
|
79
|
-
async
|
|
80
|
-
|
|
81
|
-
|
|
54
|
+
async populate() {
|
|
55
|
+
await this.prepareCheck();
|
|
56
|
+
this.isEnabled.error = await this.check('error');
|
|
57
|
+
this.isEnabled.lzma = await this.check('lzma');
|
|
58
|
+
this.isEnabled.lzo = await this.check('lzo');
|
|
59
|
+
this.isEnabled.lz4 = await this.check('lz4');
|
|
60
|
+
this.isEnabled.xz = await this.check('xz');
|
|
61
|
+
this.isEnabled.zstd = await this.check('zstd');
|
|
62
|
+
await this.removeCheck();
|
|
82
63
|
}
|
|
83
64
|
/**
|
|
84
|
-
*
|
|
65
|
+
* standard
|
|
66
|
+
* @returns
|
|
85
67
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
68
|
+
standard() {
|
|
69
|
+
const comp = 'xz -b 1M';
|
|
70
|
+
return comp;
|
|
89
71
|
}
|
|
90
72
|
/**
|
|
91
73
|
* check mksquashfs exists
|
|
@@ -94,11 +76,24 @@ class Compressors {
|
|
|
94
76
|
*/
|
|
95
77
|
async check(compressor) {
|
|
96
78
|
let result = false;
|
|
97
|
-
const stderr =
|
|
79
|
+
const { stderr } = shx.exec('mksquashfs ' + this.source + ' ' + this.dest + ' -comp ' + compressor + ' -ef ' + this.dest, { silent: true });
|
|
98
80
|
if (stderr === '') {
|
|
99
81
|
result = true;
|
|
100
82
|
}
|
|
101
83
|
return result;
|
|
102
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* prepareCheck
|
|
87
|
+
*/
|
|
88
|
+
async prepareCheck() {
|
|
89
|
+
shx.exec('rm -rf ' + this.source, { silent: true });
|
|
90
|
+
shx.exec('mkdir ' + this.source, { silent: true });
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* removeCheck
|
|
94
|
+
*/
|
|
95
|
+
async removeCheck() {
|
|
96
|
+
shx.exec('rm -rf ' + this.source, { silent: true });
|
|
97
|
+
shx.exec('rm -f ' + this.dest, { silent: true });
|
|
98
|
+
}
|
|
103
99
|
}
|
|
104
|
-
exports.default = Compressors;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ./src/classes/daddy.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 Settings from '../classes/settings.js';
|
|
9
|
+
import { IEggsConfig } from '../interfaces/i-eggs-config.js';
|
|
10
|
+
export default class Daddy {
|
|
11
|
+
settings: Settings;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param c
|
|
15
|
+
*/
|
|
16
|
+
editConfig(c: IEggsConfig): Promise<string>;
|
|
17
|
+
helpMe(loadDefault?: boolean, verbose?: boolean): Promise<void>;
|
|
18
|
+
}
|
package/dist/classes/daddy.js
CHANGED
|
@@ -1,87 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
1
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
* ./src/classes/daddy.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 chalk from 'chalk';
|
|
9
|
+
import inquirer from 'inquirer';
|
|
10
|
+
// _dirname
|
|
11
|
+
import path from 'node:path';
|
|
12
|
+
import Pacman from '../classes/pacman.js';
|
|
13
|
+
import Settings from '../classes/settings.js';
|
|
14
|
+
import Utils from '../classes/utils.js';
|
|
15
|
+
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
16
|
+
export default class Daddy {
|
|
17
17
|
settings = {};
|
|
18
|
-
async helpMe(loadDefault = false, verbose = false) {
|
|
19
|
-
// Controllo configurazione
|
|
20
|
-
if (!pacman_1.default.configurationCheck()) {
|
|
21
|
-
console.log('- creating configuration dir...');
|
|
22
|
-
await pacman_1.default.configurationInstall(verbose);
|
|
23
|
-
}
|
|
24
|
-
// Controllo prerequisites
|
|
25
|
-
if (!(await pacman_1.default.prerequisitesCheck())) {
|
|
26
|
-
console.log('- installing prerequisites...');
|
|
27
|
-
await pacman_1.default.prerequisitesInstall(verbose);
|
|
28
|
-
}
|
|
29
|
-
// Templates
|
|
30
|
-
if (!pacman_1.default.distroTemplateCheck()) {
|
|
31
|
-
console.log('- distro template install...');
|
|
32
|
-
await pacman_1.default.distroTemplateInstall(verbose);
|
|
33
|
-
}
|
|
34
|
-
// show and edit configuration
|
|
35
|
-
this.settings = new settings_1.default();
|
|
36
|
-
let config = {};
|
|
37
|
-
if (await this.settings.load()) {
|
|
38
|
-
config = this.settings.config;
|
|
39
|
-
let jsonConf;
|
|
40
|
-
if (!loadDefault) {
|
|
41
|
-
jsonConf = await this.editConfig(config);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
if (config.snapshot_prefix === '') {
|
|
45
|
-
config.snapshot_prefix = utils_1.default.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId);
|
|
46
|
-
config.compression = 'fast';
|
|
47
|
-
}
|
|
48
|
-
jsonConf = JSON.stringify(config);
|
|
49
|
-
}
|
|
50
|
-
const newConf = JSON.parse(jsonConf);
|
|
51
|
-
// salvo le modifiche
|
|
52
|
-
config.snapshot_basename = newConf.snapshot_basename;
|
|
53
|
-
config.snapshot_prefix = newConf.snapshot_prefix;
|
|
54
|
-
config.user_opt = newConf.user_opt;
|
|
55
|
-
config.user_opt_passwd = newConf.user_opt_passwd;
|
|
56
|
-
config.root_passwd = newConf.root_passwd;
|
|
57
|
-
config.theme = newConf.theme;
|
|
58
|
-
await this.settings.save(config);
|
|
59
|
-
console.log();
|
|
60
|
-
console.log(chalk_1.default.cyan('Your configuration was saved on: /etc/penguins-eggs.d'));
|
|
61
|
-
console.log();
|
|
62
|
-
console.log(chalk_1.default.cyan(`You can create a clean ISO with: `) + chalk_1.default.white(`sudo eggs produce`));
|
|
63
|
-
console.log(chalk_1.default.cyan(`or a full personal clone: `) + chalk_1.default.white(`sudo eggs produce --clone`));
|
|
64
|
-
console.log();
|
|
65
|
-
console.log(chalk_1.default.cyan(`If you don't have enough space to remaster, you can mount`));
|
|
66
|
-
console.log(chalk_1.default.cyan(`some remote or local space. Follow the samples:`));
|
|
67
|
-
console.log(chalk_1.default.cyan(`- first, create an hidden mountpoint under the nest:`));
|
|
68
|
-
console.log(chalk_1.default.white(`sudo mkdir /home/eggs/.mnt -p`));
|
|
69
|
-
console.log(chalk_1.default.cyan(`- then, mount remote space:`));
|
|
70
|
-
console.log(chalk_1.default.white(`sudo sshfs -o allow_other root@192.168.1.2:/zfs/iso /home/eggs/.mnt`));
|
|
71
|
-
console.log(chalk_1.default.cyan('- or, mount a local partition:'));
|
|
72
|
-
console.log(chalk_1.default.white(`sudo mount /dev/sdx1 /home/eggs/.mnt`));
|
|
73
|
-
console.log();
|
|
74
|
-
console.log(chalk_1.default.cyan('More help? ') + chalk_1.default.white('eggs mom'));
|
|
75
|
-
// await exec(`cat /etc/penguins-eggs.d/eggs.yaml`)
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
18
|
/**
|
|
79
19
|
*
|
|
80
20
|
* @param c
|
|
81
21
|
*/
|
|
82
22
|
editConfig(c) {
|
|
83
23
|
// Utils.titles('dad')
|
|
84
|
-
console.log(
|
|
24
|
+
console.log(chalk.cyan('Edit and save Live system parameters'));
|
|
85
25
|
console.log();
|
|
86
26
|
let compressionOpt = 0;
|
|
87
27
|
if (c.compression === 'xz') {
|
|
@@ -91,52 +31,106 @@ class Daddy {
|
|
|
91
31
|
compressionOpt = 2;
|
|
92
32
|
}
|
|
93
33
|
if (c.snapshot_prefix === '') {
|
|
94
|
-
c.snapshot_prefix =
|
|
34
|
+
c.snapshot_prefix = Utils.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId);
|
|
95
35
|
}
|
|
96
|
-
return new Promise(
|
|
36
|
+
return new Promise((resolve) => {
|
|
97
37
|
const questions = [
|
|
98
38
|
{
|
|
99
|
-
type: 'input',
|
|
100
|
-
name: 'snapshot_prefix',
|
|
101
|
-
message: 'LiveCD iso prefix: ',
|
|
102
39
|
default: c.snapshot_prefix,
|
|
40
|
+
message: 'LiveCD iso prefix: ',
|
|
41
|
+
name: 'snapshot_prefix',
|
|
42
|
+
type: 'input',
|
|
103
43
|
},
|
|
104
44
|
{
|
|
105
|
-
type: 'input',
|
|
106
|
-
name: 'snapshot_basename',
|
|
107
|
-
message: 'LiveCD iso basename: ',
|
|
108
45
|
default: c.snapshot_basename,
|
|
46
|
+
message: 'LiveCD iso basename: ',
|
|
47
|
+
name: 'snapshot_basename',
|
|
48
|
+
type: 'input',
|
|
109
49
|
},
|
|
110
50
|
{
|
|
111
|
-
type: 'input',
|
|
112
|
-
name: 'user_opt',
|
|
113
|
-
message: 'LiveCD user:',
|
|
114
51
|
default: c.user_opt,
|
|
52
|
+
message: 'LiveCD user:',
|
|
53
|
+
name: 'user_opt',
|
|
54
|
+
type: 'input',
|
|
115
55
|
},
|
|
116
56
|
{
|
|
117
|
-
type: 'input',
|
|
118
|
-
name: 'user_opt_passwd',
|
|
119
|
-
message: 'LiveCD user password: ',
|
|
120
57
|
default: c.user_opt_passwd,
|
|
58
|
+
message: 'LiveCD user password: ',
|
|
59
|
+
name: 'user_opt_passwd',
|
|
60
|
+
type: 'input',
|
|
121
61
|
},
|
|
122
62
|
{
|
|
123
|
-
type: 'input',
|
|
124
|
-
name: 'root_passwd',
|
|
125
|
-
message: 'LiveCD root password: ',
|
|
126
63
|
default: c.root_passwd,
|
|
64
|
+
message: 'LiveCD root password: ',
|
|
65
|
+
name: 'root_passwd',
|
|
66
|
+
type: 'input',
|
|
127
67
|
},
|
|
128
68
|
{
|
|
129
|
-
type: 'list',
|
|
130
|
-
name: 'compression',
|
|
131
|
-
message: 'LiveCD compression: ',
|
|
132
69
|
choices: ['fast', 'max'],
|
|
133
70
|
default: compressionOpt,
|
|
71
|
+
message: 'LiveCD compression: ',
|
|
72
|
+
name: 'compression',
|
|
73
|
+
type: 'list',
|
|
134
74
|
},
|
|
135
75
|
];
|
|
136
|
-
inquirer.prompt(questions).then(
|
|
76
|
+
inquirer.prompt(questions).then((options) => {
|
|
137
77
|
resolve(JSON.stringify(options));
|
|
138
78
|
});
|
|
139
79
|
});
|
|
140
80
|
}
|
|
81
|
+
async helpMe(loadDefault = false, verbose = false) {
|
|
82
|
+
// Controllo configurazione
|
|
83
|
+
if (!Pacman.configurationCheck()) {
|
|
84
|
+
console.log('- creating configuration dir...');
|
|
85
|
+
await Pacman.configurationInstall(verbose);
|
|
86
|
+
}
|
|
87
|
+
// Templates
|
|
88
|
+
if (!Pacman.distroTemplateCheck()) {
|
|
89
|
+
console.log('- distro template install...');
|
|
90
|
+
await Pacman.distroTemplateInstall(verbose);
|
|
91
|
+
}
|
|
92
|
+
// show and edit configuration
|
|
93
|
+
this.settings = new Settings();
|
|
94
|
+
let config = {};
|
|
95
|
+
if (await this.settings.load()) {
|
|
96
|
+
config = this.settings.config;
|
|
97
|
+
let jsonConf;
|
|
98
|
+
if (loadDefault) {
|
|
99
|
+
if (config.snapshot_prefix === '') {
|
|
100
|
+
config.snapshot_prefix = Utils.snapshotPrefix(this.settings.distro.distroId, this.settings.distro.codenameId);
|
|
101
|
+
config.compression = 'fast';
|
|
102
|
+
}
|
|
103
|
+
jsonConf = JSON.stringify(config);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
jsonConf = await this.editConfig(config);
|
|
107
|
+
}
|
|
108
|
+
const newConf = JSON.parse(jsonConf);
|
|
109
|
+
// salvo le modifiche
|
|
110
|
+
config.snapshot_basename = newConf.snapshot_basename;
|
|
111
|
+
config.snapshot_prefix = newConf.snapshot_prefix;
|
|
112
|
+
config.user_opt = newConf.user_opt;
|
|
113
|
+
config.user_opt_passwd = newConf.user_opt_passwd;
|
|
114
|
+
config.root_passwd = newConf.root_passwd;
|
|
115
|
+
config.theme = newConf.theme;
|
|
116
|
+
await this.settings.save(config);
|
|
117
|
+
console.log();
|
|
118
|
+
console.log(chalk.cyan('Your configuration was saved on: /etc/penguins-eggs.d'));
|
|
119
|
+
console.log();
|
|
120
|
+
console.log(chalk.cyan(`You can create a clean ISO with: `) + chalk.white(`sudo eggs produce`));
|
|
121
|
+
console.log(chalk.cyan(`or a full personal clone: `) + chalk.white(`sudo eggs produce --clone`));
|
|
122
|
+
console.log();
|
|
123
|
+
console.log(chalk.cyan(`If you don't have enough space to remaster, you can mount`));
|
|
124
|
+
console.log(chalk.cyan(`some remote or local space. Follow the samples:`));
|
|
125
|
+
console.log(chalk.cyan(`- first, create an hidden mountpoint under the nest:`));
|
|
126
|
+
console.log(chalk.white(`sudo mkdir /home/eggs/.mnt -p`));
|
|
127
|
+
console.log(chalk.cyan(`- then, mount remote space:`));
|
|
128
|
+
console.log(chalk.white(`sudo sshfs -o allow_other root@192.168.1.2:/zfs/iso /home/eggs/.mnt`));
|
|
129
|
+
console.log(chalk.cyan('- or, mount a local partition:'));
|
|
130
|
+
console.log(chalk.white(`sudo mount /dev/sdx1 /home/eggs/.mnt`));
|
|
131
|
+
console.log();
|
|
132
|
+
console.log(chalk.cyan('More help? ') + chalk.white('eggs mom'));
|
|
133
|
+
// await exec(`cat /etc/penguins-eggs.d/eggs.yaml`)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
141
136
|
}
|
|
142
|
-
exports.default = Daddy;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IDistro, IRemix } from '../interfaces/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Classe
|
|
4
|
+
*/
|
|
5
|
+
declare class Distro implements IDistro {
|
|
6
|
+
bugReportUrl: string;
|
|
7
|
+
codenameId: string;
|
|
8
|
+
codenameLikeId: string;
|
|
9
|
+
distroId: string;
|
|
10
|
+
distroLike: string;
|
|
11
|
+
familyId: string;
|
|
12
|
+
homeUrl: string;
|
|
13
|
+
isCalamaresAvailable: boolean;
|
|
14
|
+
isolinuxPath: string;
|
|
15
|
+
liveMediumPath: string;
|
|
16
|
+
memdiskPath: string;
|
|
17
|
+
pxelinuxPath: string;
|
|
18
|
+
releaseId: string;
|
|
19
|
+
releaseLike: string;
|
|
20
|
+
squashfs: string;
|
|
21
|
+
supportUrl: string;
|
|
22
|
+
syslinuxPath: string;
|
|
23
|
+
usrLibPath: string;
|
|
24
|
+
constructor(remix?: IRemix);
|
|
25
|
+
}
|
|
26
|
+
export default Distro;
|
package/dist/classes/distro.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
1
|
/**
|
|
3
2
|
* penguins-eggs
|
|
4
3
|
* class: distro.ts
|
|
@@ -7,35 +6,35 @@
|
|
|
7
6
|
* license: MIT
|
|
8
7
|
*/
|
|
9
8
|
'use strict';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
9
|
+
import yaml from 'js-yaml';
|
|
10
|
+
import fs from 'node:fs';
|
|
11
|
+
import path from 'node:path';
|
|
12
|
+
import shell from 'shelljs';
|
|
13
|
+
import Utils from './utils.js';
|
|
14
|
+
// _dirname
|
|
15
|
+
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
|
17
16
|
/**
|
|
18
17
|
* Classe
|
|
19
18
|
*/
|
|
20
19
|
class Distro {
|
|
21
|
-
|
|
22
|
-
distroId;
|
|
23
|
-
distroLike;
|
|
20
|
+
bugReportUrl;
|
|
24
21
|
codenameId;
|
|
25
22
|
codenameLikeId;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
distroId;
|
|
24
|
+
distroLike;
|
|
25
|
+
familyId;
|
|
26
|
+
homeUrl;
|
|
27
|
+
isCalamaresAvailable;
|
|
29
28
|
isolinuxPath;
|
|
30
|
-
syslinuxPath;
|
|
31
|
-
pxelinuxPath;
|
|
32
|
-
memdiskPath;
|
|
33
29
|
liveMediumPath;
|
|
30
|
+
memdiskPath;
|
|
31
|
+
pxelinuxPath;
|
|
32
|
+
releaseId;
|
|
33
|
+
releaseLike;
|
|
34
34
|
squashfs;
|
|
35
|
-
homeUrl;
|
|
36
35
|
supportUrl;
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
syslinuxPath;
|
|
37
|
+
usrLibPath;
|
|
39
38
|
constructor(remix = {}) {
|
|
40
39
|
this.familyId = 'debian';
|
|
41
40
|
this.distroId = '';
|
|
@@ -57,8 +56,8 @@ class Distro {
|
|
|
57
56
|
this.isCalamaresAvailable = true;
|
|
58
57
|
const file = '/etc/os-release';
|
|
59
58
|
let data;
|
|
60
|
-
if (
|
|
61
|
-
data =
|
|
59
|
+
if (fs.existsSync(file)) {
|
|
60
|
+
data = fs.readFileSync(file, 'utf8');
|
|
62
61
|
}
|
|
63
62
|
// inizio
|
|
64
63
|
let info;
|
|
@@ -73,13 +72,13 @@ class Distro {
|
|
|
73
72
|
os[info.BUG_REPORT_URL] = 'BUG_REPORT_URL=';
|
|
74
73
|
for (const temp in data) {
|
|
75
74
|
if (!data[temp].search(os[info.HOME_URL])) {
|
|
76
|
-
this.homeUrl = data[temp].slice(os[info.HOME_URL].length).
|
|
75
|
+
this.homeUrl = data[temp].slice(os[info.HOME_URL].length).replaceAll('"', '');
|
|
77
76
|
}
|
|
78
77
|
if (!data[temp].search(os[info.SUPPORT_URL])) {
|
|
79
|
-
this.supportUrl = data[temp].slice(os[info.SUPPORT_URL].length).
|
|
78
|
+
this.supportUrl = data[temp].slice(os[info.SUPPORT_URL].length).replaceAll('"', '');
|
|
80
79
|
}
|
|
81
80
|
if (!data[temp].search(os[info.BUG_REPORT_URL])) {
|
|
82
|
-
this.bugReportUrl = data[temp].slice(os[info.BUG_REPORT_URL].length).
|
|
81
|
+
this.bugReportUrl = data[temp].slice(os[info.BUG_REPORT_URL].length).replaceAll('"', '');
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
84
|
/**
|
|
@@ -87,9 +86,9 @@ class Distro {
|
|
|
87
86
|
* lsb_release -is per distribuzione
|
|
88
87
|
* lsb_release -rs per release
|
|
89
88
|
*/
|
|
90
|
-
this.codenameId =
|
|
91
|
-
this.releaseId =
|
|
92
|
-
this.distroId =
|
|
89
|
+
this.codenameId = shell.exec('lsb_release -cs', { silent: true }).stdout.toString().trim();
|
|
90
|
+
this.releaseId = shell.exec('lsb_release -rs', { silent: true }).stdout.toString().trim();
|
|
91
|
+
this.distroId = shell.exec('lsb_release -is', { silent: true }).stdout.toString().trim();
|
|
93
92
|
/**
|
|
94
93
|
* releaseLike = releaseId
|
|
95
94
|
*/
|
|
@@ -217,12 +216,12 @@ class Distro {
|
|
|
217
216
|
* patch per Roy VERIFICARE
|
|
218
217
|
*/
|
|
219
218
|
let found = false;
|
|
220
|
-
let file =
|
|
221
|
-
if (
|
|
219
|
+
let file = path.resolve(__dirname, '../../conf/derivatives.yaml');
|
|
220
|
+
if (fs.existsSync('/etc/penguins-eggs.d/derivatives.yaml')) {
|
|
222
221
|
file = '/etc/penguins-eggs.d/derivatives.yaml';
|
|
223
222
|
}
|
|
224
|
-
const content =
|
|
225
|
-
const distros =
|
|
223
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
224
|
+
const distros = yaml.load(content);
|
|
226
225
|
for (const distro of distros) {
|
|
227
226
|
if (distro.ids !== undefined) {
|
|
228
227
|
for (let n = 0; n < distro.ids.length; n++) {
|
|
@@ -255,7 +254,7 @@ class Distro {
|
|
|
255
254
|
this.syslinuxPath = '/usr/lib/syslinux/modules/bios/';
|
|
256
255
|
this.pxelinuxPath = '/usr/lib/PXELINUX/';
|
|
257
256
|
this.memdiskPath = '/usr/lib/syslinux/';
|
|
258
|
-
this.usrLibPath = '/usr/lib/' +
|
|
257
|
+
this.usrLibPath = '/usr/lib/' + Utils.usrLibPath();
|
|
259
258
|
break;
|
|
260
259
|
}
|
|
261
260
|
case 'archlinux': {
|
|
@@ -272,9 +271,9 @@ class Distro {
|
|
|
272
271
|
* if lsb-release exists
|
|
273
272
|
*/
|
|
274
273
|
const lsbConfig = '/etc/lsb-release';
|
|
275
|
-
if (
|
|
276
|
-
this.distroId =
|
|
277
|
-
this.codenameId =
|
|
274
|
+
if (fs.existsSync(lsbConfig)) {
|
|
275
|
+
this.distroId = Utils.searchOnFile(lsbConfig, `DISTRIB_ID`);
|
|
276
|
+
this.codenameId = Utils.searchOnFile(lsbConfig, `DISTRIB_CODENAME`);
|
|
278
277
|
}
|
|
279
278
|
/**
|
|
280
279
|
* ManjaroLinux and BigLinux
|
|
@@ -285,4 +284,4 @@ class Distro {
|
|
|
285
284
|
}
|
|
286
285
|
}
|
|
287
286
|
}
|
|
288
|
-
|
|
287
|
+
export default Distro;
|