penguins-eggs 8.1.3 → 9.0.16
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/README.md +332 -168
- package/addons/README.md +78 -84
- package/addons/{pve → blissos}/theme/applications/install-debian.desktop +0 -0
- package/addons/{deblinux → blissos}/theme/artwork/install-debian.png +0 -0
- package/addons/blissos/theme/calamares/branding/blissos-logo.png +0 -0
- package/addons/{guadalinex → blissos}/theme/calamares/branding/branding.desc +0 -0
- package/addons/blissos/theme/calamares/branding/languages.png +0 -0
- package/addons/blissos/theme/calamares/branding/show.qml +75 -0
- package/addons/blissos/theme/calamares/branding/slide1.png +0 -0
- package/addons/blissos/theme/calamares/branding/slide2.png +0 -0
- package/addons/blissos/theme/calamares/branding/slide3.png +0 -0
- package/addons/blissos/theme/calamares/branding/welcome.png +0 -0
- package/addons/{guadalinex → blissos}/theme/calamares/modules/partition.yml +1 -1
- package/{conf/distros/buster/grub/theme.cfg → addons/blissos/theme/livecd/grub.theme.cfg} +10 -9
- package/{conf/distros/buster/isolinux/stdmenu.template.cfg → addons/blissos/theme/livecd/isolinux.theme.cfg} +4 -0
- package/addons/blissos/theme/livecd/splash.png +0 -0
- package/addons/eggs/adapt/applications/eggs-adapt.desktop +1 -1
- package/addons/eggs/theme/calamares/branding/show.qml +1 -1
- package/addons/eggs/theme/livecd/README.md +19 -6
- package/addons/eggs/theme/livecd/{theme.cfg → grub.theme.cfg} +13 -12
- package/addons/eggs/theme/livecd/isolinux.theme.cfg +46 -0
- package/addons/eggs/theme/livecd/splash.png +0 -0
- package/addons/{ufficiozero/theme/livecd/theme.cfg → neon/theme/livecd/grub.theme.cfg} +13 -12
- package/addons/neon/theme/livecd/isolinux.theme.cfg +46 -0
- package/addons/neon/theme/livecd/splash.png +0 -0
- package/addons/templates/grub.template +28 -0
- package/addons/templates/isolinux.template +29 -0
- package/addons/ufficiozero/theme/applications/install-debian.desktop +17 -2
- package/bin/dev +17 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +2 -4
- package/conf/distros/bionic/calamares/settings.yml +5 -5
- package/conf/distros/bookworm/README.md +9 -0
- package/conf/distros/bullseye/README.md +6 -8
- package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.sh +1 -1
- package/conf/distros/buster/calamares/calamares-modules/sources-yolk/sources-yolk.working.sh +1 -1
- package/conf/distros/buster/calamares/modules/shellprocess_eggs-cleanup.yml +6 -0
- package/conf/distros/buster/calamares/settings.yml +14 -3
- package/conf/distros/chimaera/README.md +3 -0
- package/conf/distros/daedalus/README.md +3 -0
- package/conf/distros/focal/calamares/settings.yml +2 -2
- package/conf/distros/hirsute/README.md +1 -1
- package/conf/distros/impish/README.md +9 -0
- package/conf/distros/jammy/README.md +9 -0
- package/conf/distros/jessie/krill/krill-modules/sources-yolk/sources-yolk.sh +1 -1
- package/conf/distros/rolling/README.md +3 -0
- package/conf/distros/rolling/calamares/calamares-modules/remove-link/module.yml +9 -0
- package/conf/distros/rolling/calamares/calamares-modules/remove-link/remove-link.sh +3 -0
- package/conf/distros/rolling/calamares/modules/displaymanager.yml +22 -0
- package/conf/distros/rolling/calamares/modules/finished.yml +6 -0
- package/conf/distros/rolling/calamares/modules/fstab.yml +13 -0
- package/conf/distros/rolling/calamares/modules/locale.yml +97 -0
- package/conf/distros/rolling/calamares/modules/luksopenswaphookcfg.yml +6 -0
- package/conf/distros/rolling/calamares/modules/mount.yml +38 -0
- package/conf/distros/rolling/calamares/modules/packages.yml +8 -0
- package/conf/distros/rolling/calamares/modules/removeuser.yml +15 -0
- package/conf/distros/rolling/calamares/modules/unpackfs.yml +7 -0
- package/conf/distros/rolling/calamares/modules/users.yml +20 -0
- package/conf/distros/rolling/calamares/modules/welcome.yml +19 -0
- package/conf/distros/{bullseye → rolling}/calamares/settings.yml +17 -12
- package/conf/distros/thirtyfive/README.md +3 -0
- package/conf/distros/tumbleweed/README.md +3 -0
- package/conf/eggs.yaml +3 -3
- package/conf/exclude.list +12 -7
- package/conf/tools.yaml +1 -1
- package/lib/classes/basket.js +24 -20
- package/lib/classes/bleach.js +19 -19
- package/lib/classes/compressors.js +15 -14
- package/lib/classes/daddy.js +44 -31
- package/lib/classes/distro.d.ts +3 -2
- package/lib/classes/distro.js +314 -175
- package/lib/classes/family/archlinux.d.ts +69 -0
- package/lib/classes/family/archlinux.js +182 -0
- package/lib/classes/family/debian.d.ts +64 -0
- package/lib/classes/family/debian.js +227 -0
- package/lib/classes/family/fedora.d.ts +63 -0
- package/lib/classes/family/fedora.js +169 -0
- package/lib/classes/family/suse.d.ts +63 -0
- package/lib/classes/family/suse.js +169 -0
- package/lib/classes/i18n.js +16 -16
- package/lib/classes/incubation/branding.js +5 -4
- package/lib/classes/incubation/distros/bionic.js +1 -2
- package/lib/classes/incubation/distros/buster.js +2 -2
- package/lib/classes/incubation/distros/focal.js +3 -2
- package/lib/classes/incubation/distros/jessie.js +1 -25
- package/lib/classes/incubation/distros/{bullseye.d.ts → rolling.d.ts} +3 -3
- package/lib/classes/incubation/distros/{bullseye.js → rolling.js} +15 -16
- package/lib/classes/incubation/fisherman-helper/displaymanager.js +2 -7
- package/lib/classes/incubation/fisherman-helper/packages.js +31 -32
- package/lib/classes/incubation/fisherman.d.ts +17 -17
- package/lib/classes/incubation/fisherman.js +84 -71
- package/lib/classes/incubation/incubator.js +116 -74
- package/lib/classes/incubation/installer.d.ts +2 -2
- package/lib/classes/incubation/installer.js +6 -20
- package/lib/classes/initrd.d.ts +1 -1
- package/lib/classes/initrd.js +37 -30
- package/lib/classes/krill_install.d.ts +4 -4
- package/lib/classes/krill_install.js +166 -162
- package/lib/classes/krill_prepare.d.ts +6 -2
- package/lib/classes/krill_prepare.js +73 -60
- package/lib/classes/n8.js +6 -11
- package/lib/classes/ovary.d.ts +34 -25
- package/lib/classes/ovary.js +771 -688
- package/lib/classes/pacman.d.ts +55 -56
- package/lib/classes/pacman.js +524 -436
- package/lib/classes/pve-live.js +6 -6
- package/lib/classes/settings.js +47 -56
- package/lib/classes/systemctl.d.ts +6 -6
- package/lib/classes/systemctl.js +7 -7
- package/lib/classes/tools.d.ts +1 -1
- package/lib/classes/tools.js +10 -10
- package/lib/classes/users.d.ts +21 -0
- package/lib/classes/users.js +129 -0
- package/lib/classes/utils.d.ts +10 -13
- package/lib/classes/utils.js +128 -107
- package/lib/classes/xdg.js +112 -91
- package/lib/classes/yolk.js +38 -31
- package/lib/commands/adapt.d.ts +3 -3
- package/lib/commands/adapt.js +12 -12
- package/lib/commands/analyze.d.ts +25 -0
- package/lib/commands/analyze.js +74 -0
- package/lib/commands/bro.d.ts +14 -0
- package/lib/commands/bro.js +31 -0
- package/lib/commands/calamares.d.ts +7 -7
- package/lib/commands/calamares.js +22 -54
- package/lib/commands/config.d.ts +5 -5
- package/lib/commands/config.js +69 -79
- package/lib/commands/dad.d.ts +5 -5
- package/lib/commands/dad.js +11 -11
- package/lib/commands/export/deb.d.ts +8 -8
- package/lib/commands/export/deb.js +16 -16
- package/lib/commands/export/docs.d.ts +2 -2
- package/lib/commands/export/docs.js +9 -9
- package/lib/commands/export/iso.d.ts +4 -4
- package/lib/commands/export/iso.js +12 -17
- package/lib/commands/info.d.ts +9 -3
- package/lib/commands/info.js +14 -164
- package/lib/commands/install.d.ts +5 -5
- package/lib/commands/install.js +28 -42
- package/lib/commands/kill.d.ts +3 -3
- package/lib/commands/kill.js +11 -13
- package/lib/commands/mom.d.ts +2 -2
- package/lib/commands/mom.js +8 -8
- package/lib/commands/produce.d.ts +14 -14
- package/lib/commands/produce.js +48 -46
- package/lib/commands/remove.d.ts +5 -5
- package/lib/commands/remove.js +46 -57
- package/lib/commands/syncfrom.d.ts +37 -0
- package/lib/commands/syncfrom.js +156 -0
- package/lib/commands/syncto.d.ts +48 -0
- package/lib/commands/syncto.js +219 -0
- package/lib/commands/tools/clean.d.ts +3 -3
- package/lib/commands/tools/clean.js +10 -12
- package/lib/commands/tools/locales.d.ts +4 -4
- package/lib/commands/tools/locales.js +8 -8
- package/lib/commands/tools/skel.d.ts +4 -4
- package/lib/commands/tools/skel.js +10 -15
- package/lib/commands/tools/stat.d.ts +7 -4
- package/lib/commands/tools/stat.js +20 -13
- package/lib/commands/tools/yolk.d.ts +3 -3
- package/lib/commands/tools/yolk.js +13 -13
- package/lib/commands/update.d.ts +5 -10
- package/lib/commands/update.js +56 -72
- package/lib/components/elements/information.d.ts +4 -0
- package/lib/components/elements/information.js +166 -0
- package/lib/components/elements/steps.js +1 -1
- package/lib/components/elements/title.js +7 -10
- package/lib/components/finished.js +5 -5
- package/lib/components/install.js +5 -5
- package/lib/components/keyboard.js +5 -5
- package/lib/components/location.js +5 -5
- package/lib/components/network.js +5 -5
- package/lib/components/partitions.d.ts +2 -1
- package/lib/components/partitions.js +9 -7
- package/lib/components/summary.js +5 -5
- package/lib/components/users.js +6 -6
- package/lib/components/welcome.js +6 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/interfaces/i-analyze.d.ts +13 -0
- package/lib/interfaces/i-analyze.js +18 -0
- package/lib/interfaces/i-distro.d.ts +3 -2
- package/lib/interfaces/i-krill.d.ts +1 -0
- package/lib/interfaces/i-settings.d.ts +2 -2
- package/lib/lib/cli-autologin.d.ts +19 -2
- package/lib/lib/cli-autologin.js +114 -39
- package/lib/lib/dependencies.d.ts +9 -6
- package/lib/lib/dependencies.js +22 -13
- package/lib/lib/get_address.js +2 -2
- package/lib/lib/get_dns.js +2 -2
- package/lib/lib/get_domain.js +2 -2
- package/lib/lib/get_gateway.js +2 -2
- package/lib/lib/get_hostname.js +2 -2
- package/lib/lib/get_netmask.js +2 -2
- package/lib/lib/get_password.js +3 -2
- package/lib/lib/get_root_password.js +2 -2
- package/lib/lib/get_userfullname.js +2 -2
- package/lib/lib/get_username.js +2 -2
- package/lib/lib/select_address_type.js +2 -5
- package/lib/lib/select_filesystem_type.js +5 -14
- package/lib/lib/select_installation_device.js +3 -3
- package/lib/lib/select_interface.js +1 -1
- package/lib/lib/select_keyboard_layout.js +2 -10
- package/lib/lib/select_languages.js +2 -2
- package/lib/lib/select_regions.js +1 -12
- package/lib/lib/select_user_swap_choice.js +4 -4
- package/lib/lib/select_zones.js +483 -62
- package/manpages/doc/man/eggs.html +508 -0
- package/manpages/doc/man/eggs.roll.gz +0 -0
- package/oclif.manifest.json +1 -1
- package/package.json +115 -107
- package/scripts/_eggs +275 -0
- package/scripts/bros/waydroid-helper.sh +92 -0
- package/scripts/eggs.bash +68 -19
- package/scripts/mom-cli.sh +6 -5
- package/scripts/not-used/eggs-cleanup.sh +7 -0
- package/scripts/not-used/install-eggs-ppa.sh +2 -0
- package/scripts/{mkinitramfs → not-used/mkinitramfs} +0 -0
- package/scripts/{pve-live.sh → not-used/pve-live.sh} +0 -0
- package/addons/debian/theme/applications/install-debian.desktop +0 -13
- package/addons/debian/theme/artwork/install-debian.png +0 -0
- package/addons/debian/theme/branding/branding.desc +0 -27
- package/addons/debian/theme/branding/debian-logo.png +0 -0
- package/addons/debian/theme/branding/show.qml +0 -51
- package/addons/debian/theme/branding/slide1.png +0 -0
- package/addons/debian/theme/branding/welcome.png +0 -0
- package/addons/deblinux/theme/README.md +0 -16
- package/addons/deblinux/theme/applications/install-debian.desktop +0 -13
- package/addons/deblinux/theme/calamares/branding/branding.desc +0 -23
- package/addons/deblinux/theme/calamares/branding/deblinux-logo.png +0 -0
- package/addons/deblinux/theme/calamares/branding/show.qml +0 -46
- package/addons/deblinux/theme/calamares/branding/slide1.png +0 -0
- package/addons/deblinux/theme/calamares/branding/welcome.png +0 -0
- package/addons/deblinux/theme/calamares/modules/partition.yml +0 -233
- package/addons/eggs/theme/calamares/branding/4tation.png +0 -0
- package/addons/eggs/theme/livecd/grub.template.cfg +0 -60
- package/addons/eggs/theme/livecd/menu.template.cfg +0 -54
- package/addons/guadalinex/theme/README.md +0 -9
- package/addons/guadalinex/theme/applications/install-debian.desktop +0 -28
- package/addons/guadalinex/theme/artwork/install-debian.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/guadalinex-logo.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/show.qml +0 -85
- package/addons/guadalinex/theme/calamares/branding/slide1.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/slide2.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/slide3.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/slide4.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/slide5.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/slide6.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/slide7.png +0 -0
- package/addons/guadalinex/theme/calamares/branding/welcome.png +0 -0
- package/addons/guadalinex/theme/livecd/menu.template.cfg +0 -54
- package/addons/guadalinex/theme/livecd/splash.png +0 -0
- package/addons/guadalinex/theme/livecd/theme.cfg +0 -42
- package/addons/openos/theme/applications/Install-OpenOS-Neon_RLTS-Desktop.png +0 -0
- package/addons/openos/theme/applications/install-debian.desktop +0 -24
- package/addons/openos/theme/artwork/install-debian.png +0 -0
- package/addons/openos/theme/calamares/branding/branding.desc +0 -28
- package/addons/openos/theme/calamares/branding/openos-logo.png +0 -0
- package/addons/openos/theme/calamares/branding/show.qml +0 -203
- package/addons/openos/theme/calamares/branding/slide1.png +0 -0
- package/addons/openos/theme/calamares/branding/slide10.png +0 -0
- package/addons/openos/theme/calamares/branding/slide11.png +0 -0
- package/addons/openos/theme/calamares/branding/slide12.png +0 -0
- package/addons/openos/theme/calamares/branding/slide13.png +0 -0
- package/addons/openos/theme/calamares/branding/slide14.png +0 -0
- package/addons/openos/theme/calamares/branding/slide15.png +0 -0
- package/addons/openos/theme/calamares/branding/slide16.png +0 -0
- package/addons/openos/theme/calamares/branding/slide2.png +0 -0
- package/addons/openos/theme/calamares/branding/slide3.png +0 -0
- package/addons/openos/theme/calamares/branding/slide4.png +0 -0
- package/addons/openos/theme/calamares/branding/slide5.png +0 -0
- package/addons/openos/theme/calamares/branding/slide6.png +0 -0
- package/addons/openos/theme/calamares/branding/slide7.png +0 -0
- package/addons/openos/theme/calamares/branding/slide8.png +0 -0
- package/addons/openos/theme/calamares/branding/slide9.png +0 -0
- package/addons/openos/theme/calamares/branding/welcome.png +0 -0
- package/addons/openos/theme/calamares/branding.desc +0 -24
- package/addons/openos/theme/calamares/lang/calamares-default_ar.qm +0 -0
- package/addons/openos/theme/calamares/lang/calamares-default_en.qm +0 -0
- package/addons/openos/theme/calamares/lang/calamares-default_eo.qm +0 -0
- package/addons/openos/theme/calamares/lang/calamares-default_fr.qm +0 -0
- package/addons/openos/theme/calamares/lang/calamares-default_nl.qm +0 -0
- package/addons/openos/theme/calamares/modules/partition.yml +0 -233
- package/addons/openos/theme/livecd/grub.template.cfg +0 -60
- package/addons/openos/theme/livecd/menu.template.cfg +0 -54
- package/addons/openos/theme/livecd/splash.png +0 -0
- package/addons/openos/theme/livecd/theme.cfg +0 -42
- package/addons/pve/theme/applications/penguins-pve.desktop +0 -24
- package/addons/pve/theme/artwork/install-debian.png +0 -0
- package/addons/pve/theme/calamares/branding/branding.desc +0 -1
- package/addons/pve/theme/calamares/branding/pve-logo.png +0 -0
- package/addons/pve/theme/calamares/branding/show.qml +0 -227
- package/addons/pve/theme/calamares/branding/slide1.png +0 -0
- package/addons/pve/theme/calamares/branding/slide2.png +0 -0
- package/addons/pve/theme/calamares/branding/slide3.png +0 -0
- package/addons/pve/theme/calamares/branding/slide4.png +0 -0
- package/addons/pve/theme/calamares/branding/slide5.png +0 -0
- package/addons/pve/theme/calamares/branding/slide6.png +0 -0
- package/addons/pve/theme/calamares/branding/slide7.png +0 -0
- package/addons/pve/theme/calamares/branding/slide8.png +0 -0
- package/addons/pve/theme/calamares/branding/slide9.png +0 -0
- package/addons/pve/theme/calamares/branding/welcome.png +0 -0
- package/addons/pve/theme/calamares/modules/partition.yml +0 -233
- package/addons/pve/theme/livecd/README.md +0 -8
- package/addons/pve/theme/livecd/grub.template.cfg +0 -60
- package/addons/pve/theme/livecd/menu.template.cfg +0 -54
- package/addons/pve/theme/livecd/splash.png +0 -0
- package/addons/pve/theme/livecd/theme.cfg +0 -42
- package/addons/ufficiozero/theme/artwork/install-debian.png +0 -0
- package/addons/ufficiozero/theme/livecd/README.md +0 -8
- package/addons/ufficiozero/theme/livecd/grub.template.cfg +0 -60
- package/addons/ufficiozero/theme/livecd/menu.template.cfg +0 -54
- package/conf/distros/bullseye/calamares/calamares-modules/bootloader-config/bootloader-config.sh +0 -28
- package/conf/distros/bullseye/calamares/calamares-modules/bootloader-config/module.yml +0 -8
- package/conf/distros/buster/grub/grub.template.cfg +0 -58
- package/conf/distros/buster/grub/loopback.cfg +0 -1
- package/conf/distros/buster/isolinux/isolinux.template.cfg +0 -8
- package/conf/distros/buster/isolinux/menu.template.cfg +0 -56
- package/conf/distros/focal/grub/grub.template.cfg +0 -67
- package/conf/distros/focal/isolinux/menu.template.cfg +0 -54
- package/lib/classes/incubation/distros/beowulf.d.ts +0 -30
- package/lib/classes/incubation/distros/beowulf.js +0 -69
- package/manpages/doc/man/eggs.1.gz +0 -0
package/lib/classes/pacman.js
CHANGED
|
@@ -7,15 +7,18 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const tslib_1 = require("tslib");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
10
|
+
const node_fs_1 = (0, tslib_1.__importDefault)(require("node:fs"));
|
|
11
|
+
const node_path_1 = (0, tslib_1.__importDefault)(require("node:path"));
|
|
12
|
+
const shelljs_1 = (0, tslib_1.__importDefault)(require("shelljs"));
|
|
13
|
+
const utils_1 = (0, tslib_1.__importDefault)(require("./utils"));
|
|
14
|
+
const distro_1 = (0, tslib_1.__importDefault)(require("./distro"));
|
|
15
|
+
const settings_1 = (0, tslib_1.__importDefault)(require("./settings"));
|
|
16
|
+
const node_child_process_1 = require("node:child_process");
|
|
17
|
+
const utils_2 = require("../lib/utils");
|
|
18
|
+
const debian_1 = (0, tslib_1.__importDefault)(require("./family/debian"));
|
|
19
|
+
const fedora_1 = (0, tslib_1.__importDefault)(require("./family/fedora"));
|
|
20
|
+
const archlinux_1 = (0, tslib_1.__importDefault)(require("./family/archlinux"));
|
|
21
|
+
const suse_1 = (0, tslib_1.__importDefault)(require("./family/suse"));
|
|
19
22
|
const config_file = '/etc/penguins-eggs.d/eggs.yaml';
|
|
20
23
|
const config_tools = '/etc/penguins-eggs.d/tools.yaml';
|
|
21
24
|
/**
|
|
@@ -23,179 +26,193 @@ const config_tools = '/etc/penguins-eggs.d/tools.yaml';
|
|
|
23
26
|
* @remarks all the utilities
|
|
24
27
|
*/
|
|
25
28
|
class Pacman {
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
29
|
constructor() {
|
|
30
30
|
this.distro = {};
|
|
31
31
|
this.remix = {};
|
|
32
|
-
this.settings = {};
|
|
33
|
-
const versionLike = this.distro.versionLike;
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
34
|
*
|
|
37
35
|
* @returns
|
|
38
36
|
*/
|
|
39
|
-
static
|
|
37
|
+
static distro() {
|
|
40
38
|
const remix = {};
|
|
41
39
|
const distro = new distro_1.default(remix);
|
|
42
|
-
return distro
|
|
40
|
+
return distro;
|
|
41
|
+
}
|
|
42
|
+
static whichGrubIsInstalled() {
|
|
43
|
+
let grubInstalled = '';
|
|
44
|
+
if (this.distro().familyId === 'debian') {
|
|
45
|
+
if (this.packageIsInstalled('grub-common')) {
|
|
46
|
+
grubInstalled = 'grub';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else if (this.distro().familyId === 'fedora') {
|
|
50
|
+
if (this.packageIsInstalled('grub2-common.noarch')) {
|
|
51
|
+
grubInstalled = 'grub2';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
55
|
+
if (this.packageIsInstalled('grub')) {
|
|
56
|
+
grubInstalled = 'grub';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else if (this.distro().familyId === 'suse' && this.packageIsInstalled('grub2')) {
|
|
60
|
+
grubInstalled = 'grub2';
|
|
61
|
+
}
|
|
62
|
+
return grubInstalled;
|
|
43
63
|
}
|
|
44
64
|
/**
|
|
45
|
-
*
|
|
65
|
+
* check if it's installed xorg
|
|
66
|
+
* @returns true if xorg is installed
|
|
46
67
|
*/
|
|
47
|
-
static
|
|
48
|
-
|
|
68
|
+
static isInstalledXorg() {
|
|
69
|
+
let installed = false;
|
|
70
|
+
if (this.distro().familyId === 'debian') {
|
|
71
|
+
if (debian_1.default.isInstalledXorg()) {
|
|
72
|
+
installed = true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else if (this.distro().familyId === 'fedora') {
|
|
76
|
+
if (fedora_1.default.isInstalledXorg()) {
|
|
77
|
+
installed = true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
81
|
+
if (archlinux_1.default.isInstalledXorg()) {
|
|
82
|
+
installed = true;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else if (this.distro().familyId === 'suse' && suse_1.default.isInstalledXorg()) {
|
|
86
|
+
installed = true;
|
|
87
|
+
}
|
|
88
|
+
return installed;
|
|
49
89
|
}
|
|
50
90
|
/**
|
|
51
|
-
*
|
|
91
|
+
* check if it's installed wayland
|
|
92
|
+
* @returns true if wayland
|
|
52
93
|
*/
|
|
53
|
-
static
|
|
54
|
-
|
|
94
|
+
static isInstalledWayland() {
|
|
95
|
+
let installed = false;
|
|
96
|
+
if (this.distro().familyId === 'debian') {
|
|
97
|
+
if (debian_1.default.isInstalledWayland()) {
|
|
98
|
+
installed = true;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else if (this.distro().familyId === 'fedora') {
|
|
102
|
+
if (fedora_1.default.isInstalledWayland()) {
|
|
103
|
+
installed = true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
107
|
+
if (archlinux_1.default.isInstalledWayland()) {
|
|
108
|
+
installed = true;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else if (this.distro().familyId === 'suse' && suse_1.default.isInstalledWayland()) {
|
|
112
|
+
installed = true;
|
|
113
|
+
}
|
|
114
|
+
return installed;
|
|
55
115
|
}
|
|
56
116
|
/**
|
|
57
|
-
* Check
|
|
117
|
+
* Check se la macchina ha grub adatto ad efi
|
|
118
|
+
* Forse conviene spostarlo in pacman
|
|
119
|
+
*/
|
|
120
|
+
static isUefi() {
|
|
121
|
+
let isUefi = false;
|
|
122
|
+
if (this.distro().familyId === 'debian') {
|
|
123
|
+
if (utils_1.default.machineArch() !== 'i386' && this.packageIsInstalled('grub-efi-' + utils_1.default.machineArch() + '-bin')) {
|
|
124
|
+
isUefi = true;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else if (Pacman.distro().familyId === 'fedora') {
|
|
128
|
+
isUefi = true;
|
|
129
|
+
}
|
|
130
|
+
else if (Pacman.distro().familyId === 'archlinux') {
|
|
131
|
+
isUefi = true;
|
|
132
|
+
}
|
|
133
|
+
else if (Pacman.distro().familyId === 'suse') {
|
|
134
|
+
isUefi = true;
|
|
135
|
+
}
|
|
136
|
+
return isUefi;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
*
|
|
140
|
+
* @returns true se GUI
|
|
141
|
+
*/
|
|
142
|
+
static isInstalledGui() {
|
|
143
|
+
return this.isInstalledXorg() || this.isInstalledWayland();
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* controlla se è operante xserver-xorg-core
|
|
147
|
+
*/
|
|
148
|
+
static isRunningXorg() {
|
|
149
|
+
return process.env.XDG_SESSION_TYPE === 'x11';
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Constrolla se è operante wayland
|
|
58
153
|
*/
|
|
59
|
-
static
|
|
60
|
-
return
|
|
154
|
+
static isRunningWayland() {
|
|
155
|
+
return process.env.XDG_SESSION_TYPE === 'wayland';
|
|
61
156
|
}
|
|
62
157
|
/**
|
|
63
158
|
* Check if the system is GUI able
|
|
64
159
|
*/
|
|
65
|
-
static
|
|
66
|
-
return
|
|
160
|
+
static isRunningGui() {
|
|
161
|
+
return this.isRunningXorg() || this.isRunningWayland();
|
|
67
162
|
}
|
|
68
163
|
/**
|
|
69
|
-
*
|
|
70
|
-
* @returns
|
|
164
|
+
* Check if the system is just CLI
|
|
71
165
|
*/
|
|
72
|
-
static
|
|
73
|
-
|
|
74
|
-
if (process.env.DISPLAY === '') {
|
|
75
|
-
enabled = false;
|
|
76
|
-
}
|
|
77
|
-
return enabled;
|
|
166
|
+
static isRunningCli() {
|
|
167
|
+
return !this.isRunningGui();
|
|
78
168
|
}
|
|
79
169
|
/**
|
|
80
170
|
* Crea array packages dei pacchetti da installare
|
|
81
171
|
*/
|
|
82
|
-
static packages(verbose = false) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
172
|
+
static packages(remove = false, verbose = false) {
|
|
173
|
+
let packages = [];
|
|
174
|
+
if (this.distro().familyId === 'debian') {
|
|
175
|
+
packages = debian_1.default.packages(remove, verbose);
|
|
176
|
+
}
|
|
177
|
+
else if (this.distro().familyId === 'fedora') {
|
|
178
|
+
packages = fedora_1.default.packages(remove, verbose);
|
|
179
|
+
}
|
|
180
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
181
|
+
packages = archlinux_1.default.packages(remove, verbose);
|
|
182
|
+
}
|
|
183
|
+
else if (this.distro().familyId === 'suse') {
|
|
184
|
+
packages = suse_1.default.packages(remove, verbose);
|
|
185
|
+
}
|
|
96
186
|
return packages;
|
|
97
|
-
/**
|
|
98
|
-
* Attualmente escluse, sembrerebbe non servire in mx
|
|
99
|
-
*/
|
|
100
|
-
const initType = shx.exec('ps --no-headers -o comm 1', { silent: !verbose }).trim();
|
|
101
|
-
dependencies_1.depInit.forEach((dep) => {
|
|
102
|
-
if (dep.init.includes(initType)) {
|
|
103
|
-
packages.push(dep.package);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
187
|
}
|
|
107
188
|
/**
|
|
108
189
|
* Restituisce VERO se i prerequisiti sono installati
|
|
109
190
|
*/
|
|
110
191
|
static async prerequisitesCheck(verbose = false) {
|
|
111
192
|
let installed = true;
|
|
112
|
-
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
dependencies_1.depCommon.forEach(dep => {
|
|
116
|
-
if (!this.packageIsInstalled(dep)) {
|
|
117
|
-
installed = false;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
if (installed) {
|
|
121
|
-
// controllo depArch
|
|
122
|
-
const arch = utils_1.default.machineArch();
|
|
123
|
-
dependencies_1.depArch.forEach((dep) => {
|
|
124
|
-
if (dep.arch.includes(arch)) {
|
|
125
|
-
if (!this.packageIsInstalled(dep.package)) {
|
|
126
|
-
installed = false;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
// Controlli da effettuare SEMPRE version e init
|
|
133
|
-
if (installed) {
|
|
134
|
-
const version = Pacman.versionLike();
|
|
135
|
-
dependencies_1.depVersions.forEach((dep) => {
|
|
136
|
-
if (dep.versions.includes(version)) {
|
|
137
|
-
if (!this.packageIsInstalled(dep.package)) {
|
|
138
|
-
installed = false;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
});
|
|
193
|
+
const packages = this.packages(false, verbose);
|
|
194
|
+
if (packages.length > 0) {
|
|
195
|
+
installed = false;
|
|
142
196
|
}
|
|
143
197
|
return installed;
|
|
144
|
-
/**
|
|
145
|
-
* Attualmente escluse, sembrerebbe non servire in mx
|
|
146
|
-
*/
|
|
147
|
-
if (installed) {
|
|
148
|
-
const initType = shx.exec('ps --no-headers -o comm 1', { silent: !verbose }).trim();
|
|
149
|
-
dependencies_1.depInit.forEach((dep) => {
|
|
150
|
-
if (dep.init.includes(initType)) {
|
|
151
|
-
if (!this.packageIsInstalled(dep.package)) {
|
|
152
|
-
installed = false;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
198
|
}
|
|
158
199
|
/**
|
|
159
200
|
*
|
|
160
201
|
*/
|
|
161
202
|
static async prerequisitesInstall(verbose = true) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
//apt install --yes ' + array2spaced(packages))
|
|
166
|
-
// console.log(`apt-get install --yes ${array2spaced(this.packages(verbose))}`)
|
|
167
|
-
await exec(`apt-get install --yes ${dependencies_1.array2spaced(this.packages(verbose))}`, echo);
|
|
168
|
-
// localization
|
|
169
|
-
if ((versionLike === 'buster') || (versionLike === 'beowulf') || (versionLike === 'bullseye') || (versionLike === 'stretch') || (versionLike === 'jessie')) {
|
|
170
|
-
await exec(`apt-get install --yes --no-install-recommends ${dependencies_1.array2spaced(this.packagesLocalisation(verbose))}`, echo);
|
|
171
|
-
}
|
|
172
|
-
if (await Pacman.isCli()) {
|
|
173
|
-
/**
|
|
174
|
-
* live-config-getty-generator
|
|
175
|
-
*
|
|
176
|
-
* Viene rimosso in naked, altrimenti non funziona il login
|
|
177
|
-
* generando un errore getty.
|
|
178
|
-
* Sarebbe utile individuarne le ragioni, forse rompe anche sul desktop
|
|
179
|
-
* non permettendo di cambiare terminale e loggarsi
|
|
180
|
-
*
|
|
181
|
-
* A che serve?
|
|
182
|
-
*/
|
|
183
|
-
await exec(`rm /lib/systemd/system-generators/live-config-getty-generator`);
|
|
203
|
+
let retVal = false;
|
|
204
|
+
if (this.distro().familyId === 'debian') {
|
|
205
|
+
retVal = await debian_1.default.prerequisitesInstall(verbose);
|
|
184
206
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const versionLike = Pacman.versionLike();
|
|
194
|
-
await exec(`apt-get purge --yes ${dependencies_1.array2spaced(this.excludeInstalled(this.packages(verbose)))}`, echo);
|
|
195
|
-
if ((versionLike === 'buster') || (versionLike === 'beowulf')) {
|
|
196
|
-
await exec(`apt-get purge --yes ${dependencies_1.array2spaced(this.excludeInstalled(this.packagesLocalisation(verbose)))}`, echo);
|
|
207
|
+
else if (this.distro().familyId === 'fedora') {
|
|
208
|
+
retVal = await fedora_1.default.prerequisitesInstall(verbose);
|
|
209
|
+
}
|
|
210
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
211
|
+
retVal = await archlinux_1.default.prerequisitesInstall(verbose);
|
|
212
|
+
}
|
|
213
|
+
else if (this.distro().familyId === 'suse') {
|
|
214
|
+
retVal = await suse_1.default.prerequisitesInstall(verbose);
|
|
197
215
|
}
|
|
198
|
-
await exec('apt-get autoremove --yes', echo);
|
|
199
216
|
return retVal;
|
|
200
217
|
}
|
|
201
218
|
/**
|
|
@@ -203,11 +220,17 @@ class Pacman {
|
|
|
203
220
|
*/
|
|
204
221
|
static async calamaresCheck() {
|
|
205
222
|
let installed = true;
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
223
|
+
if (this.distro().familyId === 'debian') {
|
|
224
|
+
installed = await debian_1.default.calamaresCheck();
|
|
225
|
+
}
|
|
226
|
+
else if (this.distro().familyId === 'fedora') {
|
|
227
|
+
installed = await fedora_1.default.calamaresCheck();
|
|
228
|
+
}
|
|
229
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
230
|
+
installed = await archlinux_1.default.calamaresCheck();
|
|
231
|
+
}
|
|
232
|
+
else if (this.distro().familyId === 'suse') {
|
|
233
|
+
installed = await suse_1.default.calamaresCheck();
|
|
211
234
|
}
|
|
212
235
|
return installed;
|
|
213
236
|
}
|
|
@@ -215,10 +238,8 @@ class Pacman {
|
|
|
215
238
|
* Controlla se calamares è installabile
|
|
216
239
|
* @returns
|
|
217
240
|
*/
|
|
218
|
-
static
|
|
219
|
-
|
|
220
|
-
const distro = new distro_1.default(remix);
|
|
221
|
-
let result = distro.calamaresAble;
|
|
241
|
+
static isCalamaresAvailable() {
|
|
242
|
+
let result = this.distro().isCalamaresAvailable;
|
|
222
243
|
if (process.arch === 'armel' || process.arch === 'arm64') {
|
|
223
244
|
result = false;
|
|
224
245
|
}
|
|
@@ -228,50 +249,64 @@ class Pacman {
|
|
|
228
249
|
*
|
|
229
250
|
*/
|
|
230
251
|
static async calamaresInstall(verbose = true) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
await exec('apt-get update --yes', echo);
|
|
252
|
+
if (this.isInstalledGui()) {
|
|
253
|
+
if (this.distro().familyId === 'debian') {
|
|
254
|
+
await debian_1.default.calamaresInstall(verbose);
|
|
235
255
|
}
|
|
236
|
-
|
|
237
|
-
|
|
256
|
+
else if (this.distro().familyId === 'fedora') {
|
|
257
|
+
await fedora_1.default.calamaresInstall(verbose);
|
|
238
258
|
}
|
|
239
|
-
|
|
240
|
-
await
|
|
259
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
260
|
+
await archlinux_1.default.calamaresInstall(verbose);
|
|
241
261
|
}
|
|
242
|
-
|
|
243
|
-
|
|
262
|
+
else if (this.distro().familyId === 'suse') {
|
|
263
|
+
await suse_1.default.calamaresInstall(verbose);
|
|
244
264
|
}
|
|
245
|
-
/**
|
|
246
|
-
* Abilita calamares all'utilizzo senza la richiesta di password
|
|
247
|
-
*/
|
|
248
|
-
const policyFile = '/usr/share/polkit-1/actions/com.github.calamares.calamares.policy';
|
|
249
|
-
await exec(`sed -i 's/auth_admin/yes/' ${policyFile}`);
|
|
250
265
|
}
|
|
251
|
-
|
|
252
|
-
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* calamaresPolicies
|
|
269
|
+
*/
|
|
270
|
+
static async calamaresPolicies() {
|
|
271
|
+
if (this.distro().familyId === 'debian') {
|
|
272
|
+
await debian_1.default.calamaresPolicies();
|
|
273
|
+
}
|
|
274
|
+
else if (this.distro().familyId === 'fedora') {
|
|
275
|
+
await fedora_1.default.calamaresPolicies();
|
|
276
|
+
}
|
|
277
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
278
|
+
await archlinux_1.default.calamaresPolicies();
|
|
279
|
+
}
|
|
280
|
+
else if (this.distro().familyId === 'suse') {
|
|
281
|
+
await suse_1.default.calamaresPolicies();
|
|
253
282
|
}
|
|
254
283
|
}
|
|
255
284
|
/**
|
|
256
285
|
*
|
|
257
286
|
*/
|
|
258
287
|
static async calamaresRemove(verbose = true) {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
288
|
+
let retVal = false;
|
|
289
|
+
if (this.distro().familyId === 'debian') {
|
|
290
|
+
retVal = await debian_1.default.calamaresRemove(verbose);
|
|
291
|
+
}
|
|
292
|
+
else if (this.distro().familyId === 'fedora') {
|
|
293
|
+
retVal = await fedora_1.default.calamaresRemove(verbose);
|
|
294
|
+
}
|
|
295
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
296
|
+
retVal = await archlinux_1.default.calamaresRemove(verbose);
|
|
297
|
+
}
|
|
298
|
+
else if (this.distro().familyId === 'suse') {
|
|
299
|
+
retVal = await suse_1.default.calamaresRemove(verbose);
|
|
263
300
|
}
|
|
264
|
-
await exec(`apt-get remove --purge --yes calamares`, echo);
|
|
265
|
-
await exec('apt-get autoremove --yes', echo);
|
|
266
301
|
return retVal;
|
|
267
302
|
}
|
|
268
303
|
/**
|
|
269
304
|
* Restituisce VERO se i file di configurazione SONO presenti
|
|
270
305
|
*/
|
|
271
306
|
static configurationCheck() {
|
|
272
|
-
const confExists =
|
|
273
|
-
const listExists =
|
|
274
|
-
return
|
|
307
|
+
const confExists = node_fs_1.default.existsSync(config_file);
|
|
308
|
+
const listExists = node_fs_1.default.existsSync('/usr/local/share/penguins-eggs/exclude.list');
|
|
309
|
+
return confExists && listExists;
|
|
275
310
|
}
|
|
276
311
|
/**
|
|
277
312
|
* Ritorna vero se machine-id è uguale
|
|
@@ -280,10 +315,8 @@ class Pacman {
|
|
|
280
315
|
const settings = new settings_1.default();
|
|
281
316
|
await settings.load();
|
|
282
317
|
const result = utils_1.default.machineId() !== settings.config.machine_id;
|
|
283
|
-
if (verbose) {
|
|
284
|
-
|
|
285
|
-
console.log('configurationMachineNew: True');
|
|
286
|
-
}
|
|
318
|
+
if (verbose && result) {
|
|
319
|
+
console.log('configurationMachineNew: True');
|
|
287
320
|
}
|
|
288
321
|
return result;
|
|
289
322
|
}
|
|
@@ -310,23 +343,13 @@ class Pacman {
|
|
|
310
343
|
config.timezone = 'Europe/Rome';
|
|
311
344
|
config.pmount_fixed = false;
|
|
312
345
|
const env = process.env;
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
else {
|
|
317
|
-
config.locales_default = 'en_US.UTF-8';
|
|
318
|
-
}
|
|
319
|
-
if (config.locales_default === 'en_US.UTF-8') {
|
|
320
|
-
config.locales = ['en_US.UTF-8'];
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
config.locales = [config.locales_default, 'en_US.UTF-8'];
|
|
324
|
-
}
|
|
346
|
+
config.locales_default = env.LANG !== undefined ? env.LANG : 'en_US.UTF-8';
|
|
347
|
+
config.locales = config.locales_default === 'en_US.UTF-8' ? ['en_US.UTF-8'] : [config.locales_default, 'en_US.UTF-8'];
|
|
325
348
|
if (!this.packageIsInstalled('calamares')) {
|
|
326
349
|
config.force_installer = false;
|
|
327
|
-
console.log(
|
|
350
|
+
console.log('Due the lacks of calamares package set force_installer = false');
|
|
328
351
|
}
|
|
329
|
-
if (!
|
|
352
|
+
if (!Pacman.isUefi()) {
|
|
330
353
|
config.make_efi = false;
|
|
331
354
|
console.log('Due the lacks of grub-efi-' + utils_1.default.machineArch() + '-bin package set make_efi = false');
|
|
332
355
|
}
|
|
@@ -344,240 +367,346 @@ class Pacman {
|
|
|
344
367
|
*/
|
|
345
368
|
static async configurationInstall(links = true, verbose = true) {
|
|
346
369
|
const confRoot = '/etc/penguins-eggs.d';
|
|
347
|
-
if (!
|
|
348
|
-
|
|
370
|
+
if (!node_fs_1.default.existsSync(confRoot)) {
|
|
371
|
+
(0, node_child_process_1.execSync)(`mkdir ${confRoot}`);
|
|
349
372
|
}
|
|
350
373
|
const addons = `${confRoot}/addons`;
|
|
351
374
|
const distros = `${confRoot}/distros`;
|
|
352
|
-
if (
|
|
353
|
-
|
|
375
|
+
if (node_fs_1.default.existsSync(addons)) {
|
|
376
|
+
(0, node_child_process_1.execSync)(`rm -rf ${addons}`);
|
|
354
377
|
}
|
|
355
|
-
if (
|
|
356
|
-
|
|
378
|
+
if (node_fs_1.default.existsSync(distros)) {
|
|
379
|
+
(0, node_child_process_1.execSync)(`rm -rf ${distros}`);
|
|
357
380
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
381
|
+
(0, node_child_process_1.execSync)(`mkdir -p ${distros}`);
|
|
382
|
+
shelljs_1.default.ln('-s', node_path_1.default.resolve(__dirname, '../../addons'), addons);
|
|
383
|
+
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/README.md'), '/etc/penguins-eggs.d/');
|
|
384
|
+
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/tools.yaml'), config_tools);
|
|
362
385
|
// creazione del file delle esclusioni
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
await
|
|
386
|
+
shelljs_1.default.mkdir('-p', '/usr/local/share/penguins-eggs/');
|
|
387
|
+
shelljs_1.default.cp(node_path_1.default.resolve(__dirname, '../../conf/exclude.list'), '/usr/local/share/penguins-eggs');
|
|
388
|
+
await this.configurationFresh();
|
|
366
389
|
}
|
|
367
390
|
/**
|
|
368
391
|
* Rimozione dei file di configurazione
|
|
369
392
|
*/
|
|
370
393
|
static async configurationRemove(verbose = true) {
|
|
371
394
|
const echo = utils_1.default.setEcho(verbose);
|
|
372
|
-
if (
|
|
373
|
-
await exec('rm /etc/penguins-eggs.d -rf', echo);
|
|
395
|
+
if (node_fs_1.default.existsSync('/etc/penguins-eggs.d')) {
|
|
396
|
+
await (0, utils_2.exec)('rm /etc/penguins-eggs.d -rf', echo);
|
|
374
397
|
}
|
|
375
|
-
if (
|
|
376
|
-
await exec('rm /usr/local/share/penguins-eggs/exclude.list', echo);
|
|
377
|
-
}
|
|
378
|
-
if (fs.existsSync('/etc/calamares')) {
|
|
379
|
-
await exec('rm /etc/calamares -rf', echo);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
*
|
|
384
|
-
*/
|
|
385
|
-
static distroTemplateCheck() {
|
|
386
|
-
const versionLike = Pacman.versionLike();
|
|
387
|
-
return fs.existsSync(`/etc/penguins-eggs.d/distros/${versionLike}`);
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
*
|
|
391
|
-
*/
|
|
392
|
-
static async distroTemplateInstall(verbose = false) {
|
|
393
|
-
if (verbose) {
|
|
394
|
-
console.log('installDistroTemplate');
|
|
398
|
+
if (node_fs_1.default.existsSync('/usr/local/share/penguins-eggs/exclude.list')) {
|
|
399
|
+
await (0, utils_2.exec)('rm /usr/local/share/penguins-eggs/exclude.list', echo);
|
|
395
400
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
if (utils_1.default.isDebPackage()) {
|
|
399
|
-
await Pacman.links4Debs(false, verbose);
|
|
401
|
+
if (node_fs_1.default.existsSync('/etc/calamares')) {
|
|
402
|
+
await (0, utils_2.exec)('rm /etc/calamares -rf', echo);
|
|
400
403
|
}
|
|
401
|
-
// L = follow links è OK da source, ora il problema è copiare i link da npm o rifarli
|
|
402
|
-
const cmd = `cp -rL ${rootPen}/conf/distros/${versionLike} /etc/penguins-eggs.d/distros`;
|
|
403
|
-
child_process_1.execSync(cmd);
|
|
404
404
|
}
|
|
405
405
|
/**
|
|
406
406
|
*
|
|
407
407
|
* @param verbose
|
|
408
408
|
*/
|
|
409
409
|
static async autocompleteInstall(verbose = false) {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
410
|
+
if (this.distro().familyId === 'debian') {
|
|
411
|
+
if (Pacman.packageIsInstalled('bash-completion')) {
|
|
412
|
+
if (node_fs_1.default.existsSync('/usr/share/bash-completion/completions/')) {
|
|
413
|
+
await (0, utils_2.exec)(`cp ${__dirname}/../../scripts/eggs.bash /usr/share/bash-completion/completions/`);
|
|
414
|
+
}
|
|
415
|
+
else if (node_fs_1.default.existsSync('/etc/bash_completion.d/')) {
|
|
416
|
+
await (0, utils_2.exec)(`cp ${__dirname}/../../scripts/eggs.bash /etc/bash_completion.d/`);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
421
|
+
if (Pacman.packageIsInstalled('bash-completion')) {
|
|
422
|
+
await (0, utils_2.exec)(`cp ${__dirname}/../../scripts/eggs.bash /usr/share/bash-completion/completions/`);
|
|
423
|
+
}
|
|
413
424
|
}
|
|
414
425
|
}
|
|
415
426
|
/**
|
|
416
|
-
|
|
417
|
-
|
|
427
|
+
* Installa manPage
|
|
428
|
+
*/
|
|
418
429
|
static async manPageInstall(verbose = false) {
|
|
419
|
-
const
|
|
420
|
-
if (
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
430
|
+
const manPageSrc = node_path_1.default.resolve(__dirname, '../../manpages/doc/man/eggs.roll.gz');
|
|
431
|
+
if (node_fs_1.default.existsSync(manPageSrc)) {
|
|
432
|
+
const man1Dir = '/usr/share/man/man1/';
|
|
433
|
+
if (!node_fs_1.default.existsSync(man1Dir)) {
|
|
434
|
+
(0, utils_2.exec)(`mkdir ${man1Dir} -p`);
|
|
435
|
+
}
|
|
436
|
+
const manPageDest = man1Dir + 'eggs.1.gz';
|
|
437
|
+
(0, utils_2.exec)(`cp ${manPageSrc} ${manPageDest}`);
|
|
438
|
+
if (shelljs_1.default.exec('which mandb', { silent: true }).stdout.trim() !== '') {
|
|
439
|
+
await (0, utils_2.exec)('mandb > /dev/null');
|
|
440
|
+
if (verbose) {
|
|
441
|
+
console.log('manPage eggs installed...');
|
|
442
|
+
}
|
|
431
443
|
}
|
|
432
444
|
}
|
|
433
445
|
}
|
|
434
446
|
/**
|
|
435
|
-
*
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
const rootPen = utils_1.default.rootPenguin();
|
|
441
|
-
// Debian 10 - Buster
|
|
442
|
-
const buster = `${rootPen}/conf/distros/buster`;
|
|
443
|
-
// Debian 11 - bullseye
|
|
444
|
-
const bullseye = `${rootPen}/conf/distros/bullseye`;
|
|
445
|
-
await this.ln(`${buster}/grub`, `${bullseye}/grub`, remove, verbose);
|
|
446
|
-
await this.ln(`${buster}/isolinux`, `${bullseye}/isolinux`, remove, verbose);
|
|
447
|
-
await this.ln(`${buster}/locales`, `${bullseye}/locales`, remove, verbose);
|
|
448
|
-
await this.ln(`${buster}/calamares/calamares-modules/remove-link`, `${bullseye}/calamares/calamares-modules/remove-link`, remove, verbose);
|
|
449
|
-
await this.ln(`${buster}/calamares/calamares-modules/sources-yolk`, `${bullseye}/calamares/calamares-modules/sources-yolk`, remove, verbose);
|
|
450
|
-
await this.ln(`${buster}/calamares/calamares-modules/sources-yolk-unmount`, `${bullseye}/calamares/calamares-modules/sources-yolk-unmount`, remove, verbose);
|
|
451
|
-
await this.ln(`${buster}/calamares/modules`, `${bullseye}/calamares/modules`, remove, verbose);
|
|
452
|
-
// Debian 8 - jessie
|
|
453
|
-
const jessie = `${rootPen}/conf/distros/jessie`;
|
|
454
|
-
await this.ln(`${buster}/grub`, `${jessie}/grub`, remove, verbose);
|
|
455
|
-
await this.ln(`${buster}/isolinux`, `${jessie}/isolinux`, remove, verbose);
|
|
456
|
-
await this.ln(`${buster}/locales`, `${jessie}/locales`, remove, verbose);
|
|
457
|
-
// Debian 9 - stretch
|
|
458
|
-
const stretch = `${rootPen}/conf/distros/stretch`;
|
|
459
|
-
await this.ln(`${buster}/grub`, `${stretch}/grub`, remove, verbose);
|
|
460
|
-
await this.ln(`${buster}/isolinux`, `${stretch}/isolinux`, remove, verbose);
|
|
461
|
-
await this.ln(`${buster}/locales`, `${stretch}/locales`, remove, verbose);
|
|
462
|
-
await this.ln(`${jessie}/krill`, `${stretch}/krill`, remove, verbose);
|
|
463
|
-
// Devuan beowulf
|
|
464
|
-
const beowulf = `${rootPen}/conf/distros/beowulf`;
|
|
465
|
-
await this.ln(`${buster}/grub`, `${beowulf}/grub`, remove, verbose);
|
|
466
|
-
await this.ln(`${buster}/isolinux`, `${beowulf}/isolinux`, remove, verbose);
|
|
467
|
-
await this.ln(`${buster}/locales`, `${beowulf}/locales`, remove, verbose);
|
|
468
|
-
await this.ln(`${buster}/calamares`, `${beowulf}/calamares`, remove, verbose);
|
|
469
|
-
// Ubuntu 20.04 - focal
|
|
470
|
-
const focal = `${rootPen}/conf/distros/focal`;
|
|
471
|
-
await this.ln(`${buster}/grub/loopback.cfg`, `${focal}/grub/loopback.cfg`, remove, verbose);
|
|
472
|
-
await this.ln(`${buster}/grub/theme.cfg`, `${focal}/grub/theme.cfg`, remove, verbose);
|
|
473
|
-
await this.ln(`${buster}/isolinux/isolinux.template.cfg`, `${focal}/isolinux/isolinux.template.cfg`, remove, verbose);
|
|
474
|
-
await this.ln(`${buster}/isolinux/stdmenu.template.cfg`, `${focal}/isolinux/stdmenu.template.cfg`, remove, verbose);
|
|
475
|
-
await this.ln(`${buster}/calamares/calamares-modules/remove-link`, `${focal}/calamares/calamares-modules/remove-link`, remove, verbose);
|
|
476
|
-
await this.ln(`${buster}/calamares/calamares-modules/sources-yolk`, `${focal}/calamares/calamares-modules/sources-yolk`, remove, verbose);
|
|
477
|
-
await this.ln(`${buster}/calamares/calamares-modules/sources-yolk-unmount`, `${focal}/calamares/calamares-modules/sources-yolk-unmount`, remove, verbose);
|
|
478
|
-
await this.ln(`${buster}/calamares/modules/packages.yml`, `${focal}/calamares/modules/packages.yml`, remove, verbose);
|
|
479
|
-
await this.ln(`${buster}/calamares/modules/removeuser.yml`, `${focal}/calamares/modules/removeuser.yml`, remove, verbose);
|
|
480
|
-
await this.ln(`${buster}/calamares/modules/displaymanager.yml`, `${focal}/calamares/modules/displaymanager.yml`, remove, verbose);
|
|
481
|
-
// Patch a colori
|
|
482
|
-
// await this.ln(`${buster}/calamares/calamares-modules/bootloader-config`, `${focal}/calamares/calamares-modules/bootloader-config`, remove, verbose)
|
|
483
|
-
// Ubuntu 18.04 - bionic
|
|
484
|
-
const bionic = `${rootPen}/conf/distros/bionic`;
|
|
485
|
-
await this.ln(`${focal}/grub`, `${bionic}/grub`, remove, verbose);
|
|
486
|
-
await this.ln(`${focal}/isolinux`, `${bionic}/isolinux`, remove, verbose);
|
|
487
|
-
await this.ln(`${buster}/calamares/calamares-modules/remove-link`, `${bionic}/calamares/calamares-modules/remove-link`, remove, verbose);
|
|
488
|
-
await this.ln(`${buster}/calamares/calamares-modules/sources-yolk`, `${bionic}/calamares/calamares-modules/sources-yolk`, remove, verbose);
|
|
489
|
-
await this.ln(`${buster}/calamares/calamares-modules/sources-yolk-unmount`, `${bionic}/calamares/calamares-modules/sources-yolk-unmount`, remove, verbose);
|
|
490
|
-
await this.ln(`${buster}/calamares/modules/packages.yml`, `${bionic}/calamares/modules/packages.yml`, remove, verbose);
|
|
491
|
-
await this.ln(`${buster}/calamares/modules/removeuser.yml`, `${bionic}/calamares/modules/removeuser.yml`, remove, verbose);
|
|
492
|
-
await this.ln(`${buster}/calamares/modules/unpackfs.yml`, `${bionic}/calamares/modules/unpackfs.yml`, remove, verbose);
|
|
493
|
-
await this.ln(`${buster}/calamares/modules/displaymanager.yml`, `${bionic}/calamares/modules/displaymanager.yml`, remove, verbose);
|
|
494
|
-
// Ubuntu 20.10 groovy
|
|
495
|
-
const groovy = `${rootPen}/conf/distros/groovy`;
|
|
496
|
-
await this.ln(`${focal}/calamares`, `${groovy}/calamares`, remove, verbose);
|
|
497
|
-
await this.ln(`${focal}/grub`, `${groovy}/grub`, remove, verbose);
|
|
498
|
-
await this.ln(`${focal}/isolinux`, `${groovy}/isolinux`, remove, verbose);
|
|
499
|
-
await this.ln(`${focal}/locale.gen.template`, `${groovy}/locale.gen.template`, remove, verbose);
|
|
500
|
-
await this.ln(`${buster}/calamares/modules/displaymanager.yml`, `${groovy}/calamares/modules/displaymanager.yml`, remove, verbose);
|
|
501
|
-
// Ubuntu 21.04 hirsute
|
|
502
|
-
const hirsute = `${rootPen}/conf/distros/hirsute`;
|
|
503
|
-
await this.ln(`${focal}/calamares`, `${hirsute}/calamares`, remove, verbose);
|
|
504
|
-
await this.ln(`${focal}/grub`, `${hirsute}/grub`, remove, verbose);
|
|
505
|
-
await this.ln(`${focal}/isolinux`, `${hirsute}/isolinux`, remove, verbose);
|
|
506
|
-
await this.ln(`${focal}/locale.gen.template`, `${hirsute}/locale.gen.template`, remove, verbose);
|
|
507
|
-
await this.ln(`${buster}/calamares/modules/displaymanager.yml`, `${hirsute}/calamares/modules/displaymanager.yml`, remove, verbose);
|
|
508
|
-
}
|
|
447
|
+
* distroTemplateCheck
|
|
448
|
+
*/
|
|
449
|
+
static distroTemplateCheck() {
|
|
450
|
+
const versionLike = this.distro().versionLike;
|
|
451
|
+
return node_fs_1.default.existsSync(`/etc/penguins-eggs.d/distros/${versionLike}`);
|
|
509
452
|
}
|
|
510
453
|
/**
|
|
511
454
|
*
|
|
512
|
-
* @param mode
|
|
513
|
-
* @param src
|
|
514
|
-
* @param dest
|
|
515
|
-
* @param verbose
|
|
516
455
|
*/
|
|
517
|
-
static async
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
}
|
|
534
|
-
|
|
456
|
+
static async distroTemplateInstall(verbose = false) {
|
|
457
|
+
if (verbose) {
|
|
458
|
+
console.log('distroTemplateInstall');
|
|
459
|
+
}
|
|
460
|
+
const echo = utils_1.default.setEcho(verbose);
|
|
461
|
+
const rootPen = utils_1.default.rootPenguin();
|
|
462
|
+
await (0, utils_2.exec)(`mkdir /etc/penguins-eggs.d/distros/${this.distro().versionLike}`);
|
|
463
|
+
/**
|
|
464
|
+
* Debian 10 - Buster: è il master per tutte le distro
|
|
465
|
+
*/
|
|
466
|
+
const buster = `${rootPen}/conf/distros/buster`;
|
|
467
|
+
/**
|
|
468
|
+
* Debian 8 jessie: eredita grub, isolinux e locales da buster, contiene krill al posto di calamares
|
|
469
|
+
*/
|
|
470
|
+
if (this.distro().versionLike === 'jessie') {
|
|
471
|
+
const dest = '/etc/penguins-eggs.d/distros/jessie';
|
|
472
|
+
await (0, utils_2.exec)(`cp -r ${buster}/locales ${dest}/locales`, echo);
|
|
473
|
+
await (0, utils_2.exec)(`cp -r ${rootPen}/conf/distros/jessie/krill ${dest}/krill`, echo);
|
|
474
|
+
/**
|
|
475
|
+
* Debian 9 stretch: eredita grub, isolinux e locales da buster, contiene krill al posto di calamares
|
|
476
|
+
*/
|
|
477
|
+
}
|
|
478
|
+
else if (this.distro().versionLike === 'stretch') {
|
|
479
|
+
const dest = '/etc/penguins-eggs.d/distros/stretch';
|
|
480
|
+
await (0, utils_2.exec)(`cp -r ${buster}/locales ${dest}/locales`, echo);
|
|
481
|
+
await (0, utils_2.exec)(`cp -r ${rootPen}/conf/distros/jessie/krill ${dest}/krill`, echo);
|
|
482
|
+
/**
|
|
483
|
+
* Debian 10 buster: eredita tutto da buster
|
|
484
|
+
*/
|
|
485
|
+
}
|
|
486
|
+
else if (this.distro().versionLike === 'buster') {
|
|
487
|
+
const dest = '/etc/penguins-eggs.d/distros/buster';
|
|
488
|
+
await (0, utils_2.exec)(`cp -r ${buster}/locales ${dest}/locales`, echo);
|
|
489
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
490
|
+
/**
|
|
491
|
+
* Debian 11 bullseye: eredita tutto da buster
|
|
492
|
+
*/
|
|
493
|
+
}
|
|
494
|
+
else if (this.distro().versionLike === 'bullseye') {
|
|
495
|
+
const dest = '/etc/penguins-eggs.d/distros/bullseye';
|
|
496
|
+
await (0, utils_2.exec)(`cp -r ${buster}/locales ${dest}/locales`, echo);
|
|
497
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
498
|
+
/**
|
|
499
|
+
* Debian 12 bookworm: eredita tutto da buster
|
|
500
|
+
*/
|
|
501
|
+
}
|
|
502
|
+
else if (this.distro().versionLike === 'bookworm') {
|
|
503
|
+
const dest = '/etc/penguins-eggs.d/distros/bookworm';
|
|
504
|
+
await (0, utils_2.exec)(`cp -r ${buster}/locales ${dest}/locales`, echo);
|
|
505
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
506
|
+
/***********************************************************************************
|
|
507
|
+
* Devuan
|
|
508
|
+
**********************************************************************************/
|
|
509
|
+
/**
|
|
510
|
+
* Devuan beowulf: eredita tutto da buster
|
|
511
|
+
*/
|
|
512
|
+
}
|
|
513
|
+
else if (this.distro().versionLike === 'beowulf') {
|
|
514
|
+
const dest = '/etc/penguins-eggs.d/distros/beowulf';
|
|
515
|
+
await (0, utils_2.exec)(`cp -r ${buster}/locales ${dest}/locales`, echo);
|
|
516
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
517
|
+
/**
|
|
518
|
+
* Devuan chimaera: eredita tutto da buster
|
|
519
|
+
*/
|
|
520
|
+
}
|
|
521
|
+
else if (this.distro().versionLike === 'chimaera') {
|
|
522
|
+
const dest = '/etc/penguins-eggs.d/distros/chimaera';
|
|
523
|
+
await (0, utils_2.exec)(`cp -r ${buster}/locales ${dest}/locales`, echo);
|
|
524
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
525
|
+
/**
|
|
526
|
+
* Devuan daedalus: eredita tutto da buster
|
|
527
|
+
*/
|
|
528
|
+
}
|
|
529
|
+
else if (this.distro().versionLike === 'daedalus') {
|
|
530
|
+
const dest = '/etc/penguins-eggs.d/distros/daedalus';
|
|
531
|
+
await (0, utils_2.exec)(`cp -r ${buster}/locales ${dest}/locales`, echo);
|
|
532
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares ${dest}/calamares`, echo);
|
|
533
|
+
/***********************************************************************************
|
|
534
|
+
* Ubuntu
|
|
535
|
+
**********************************************************************************/
|
|
536
|
+
/**
|
|
537
|
+
* Ubuntu 10.04 bionic: eredita da bionic, focal grub ed isolinux, da buster i seguenti
|
|
538
|
+
*/
|
|
539
|
+
}
|
|
540
|
+
else if (this.distro().versionLike === 'bionic') {
|
|
541
|
+
const dest = '/etc/penguins-eggs.d/distros/bionic';
|
|
542
|
+
const bionic = `${rootPen}/conf/distros/bionic/*`;
|
|
543
|
+
await (0, utils_2.exec)(`cp -r ${bionic} ${dest}`, echo);
|
|
544
|
+
// quindi da focal
|
|
545
|
+
const focal = `${rootPen}/conf/distros/focal/*`;
|
|
546
|
+
await (0, utils_2.exec)(`cp -r ${focal} ${dest}`, echo);
|
|
547
|
+
// Poi da buster
|
|
548
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/remove-link ${dest}/calamares/calamares-modules/remove-link`, echo);
|
|
549
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
|
|
550
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-unmount ${dest}/calamares/calamares-modules/sources-yolk-unmount`, echo);
|
|
551
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
|
|
552
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
|
|
553
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
|
|
554
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
|
|
555
|
+
/**
|
|
556
|
+
* Ubuntu focal: eredita da focal e buster
|
|
557
|
+
*/
|
|
558
|
+
}
|
|
559
|
+
else if (this.distro().versionLike === 'focal') {
|
|
560
|
+
const dest = '/etc/penguins-eggs.d/distros/focal';
|
|
561
|
+
const focal = `${rootPen}/conf/distros/focal/*`;
|
|
562
|
+
await (0, utils_2.exec)(`cp -r ${focal} ${dest}`, echo);
|
|
563
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/remove-link ${dest}/calamares/calamares-modules/remove-link`, echo);
|
|
564
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
|
|
565
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-unmount ${dest}/calamares/calamares-modules/sources-yolk-unmount`, echo);
|
|
566
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
|
|
567
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
|
|
568
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
|
|
569
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
|
|
570
|
+
/**
|
|
571
|
+
* Ubuntu 20.10 groovy: eredita da focal e buster
|
|
572
|
+
*/
|
|
573
|
+
}
|
|
574
|
+
else if (this.distro().versionLike === 'groovy') {
|
|
575
|
+
const dest = '/etc/penguins-eggs.d/distros/groovy';
|
|
576
|
+
const focal = `${rootPen}/conf/distros/focal/*`;
|
|
577
|
+
await (0, utils_2.exec)(`cp -r ${focal} ${dest}`, echo);
|
|
578
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/remove-link ${dest}/calamares/calamares-modules/remove-link`, echo);
|
|
579
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
|
|
580
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-unmount ${dest}/calamares/calamares-modules/sources-yolk-unmount`, echo);
|
|
581
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
|
|
582
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
|
|
583
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
|
|
584
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
|
|
585
|
+
/**
|
|
586
|
+
* Ubuntu 21.04 hirsute: eredita da focal e buster
|
|
587
|
+
*/
|
|
588
|
+
}
|
|
589
|
+
else if (this.distro().versionLike === 'hirsute') {
|
|
590
|
+
const dest = '/etc/penguins-eggs.d/distros/hirsute';
|
|
591
|
+
const focal = `${rootPen}/conf/distros/focal/*`;
|
|
592
|
+
await (0, utils_2.exec)(`cp -r ${focal} ${dest}`, echo);
|
|
593
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/remove-link ${dest}/calamares/calamares-modules/remove-link`, echo);
|
|
594
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
|
|
595
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-unmount ${dest}/calamares/calamares-modules/sources-yolk-unmount`, echo);
|
|
596
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
|
|
597
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
|
|
598
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
|
|
599
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
|
|
600
|
+
/**
|
|
601
|
+
* Ubuntu 21.10 impish: eredita da focal e buster
|
|
602
|
+
*/
|
|
603
|
+
}
|
|
604
|
+
else if (this.distro().versionLike === 'impish') {
|
|
605
|
+
const dest = '/etc/penguins-eggs.d/distros/impish';
|
|
606
|
+
const focal = `${rootPen}/conf/distros/focal/*`;
|
|
607
|
+
await (0, utils_2.exec)(`cp -r ${focal} ${dest}`, echo);
|
|
608
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/remove-link ${dest}/calamares/calamares-modules/remove-link`, echo);
|
|
609
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
|
|
610
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-unmount ${dest}/calamares/calamares-modules/sources-yolk-unmount`, echo);
|
|
611
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
|
|
612
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
|
|
613
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
|
|
614
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
|
|
615
|
+
/**
|
|
616
|
+
* Ubuntu 22.04 jammy: eredita da focal e buster
|
|
617
|
+
*/
|
|
618
|
+
}
|
|
619
|
+
else if (this.distro().versionLike === 'jammy') {
|
|
620
|
+
const dest = '/etc/penguins-eggs.d/distros/jammy';
|
|
621
|
+
const focal = `${rootPen}/conf/distros/focal/*`;
|
|
622
|
+
await (0, utils_2.exec)(`cp -r ${focal} ${dest}`, echo);
|
|
623
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/remove-link ${dest}/calamares/calamares-modules/remove-link`, echo);
|
|
624
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/sources-yolk ${dest}/calamares/calamares-modules/sources-yolk`, echo);
|
|
625
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/calamares-modules/sources-yolk-unmount ${dest}/calamares/calamares-modules/sources-yolk-unmount`, echo);
|
|
626
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/packages.yml ${dest}/calamares/modules/packages.yml`, echo);
|
|
627
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/removeuser.yml ${dest}/calamares/modules/removeuser.yml`, echo);
|
|
628
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/unpackfs.yml ${dest}/calamares/modules/unpackfs.yml`, echo);
|
|
629
|
+
await (0, utils_2.exec)(`cp -r ${buster}/calamares/modules/displaymanager.yml ${dest}/calamares/modules/displaymanager.yml`, echo);
|
|
630
|
+
/***********************************************************************************
|
|
631
|
+
* Fedora
|
|
632
|
+
**********************************************************************************/
|
|
633
|
+
/**
|
|
634
|
+
* Fedora 35 ThirtyFive: eredita da ThirtyFive
|
|
635
|
+
*/
|
|
636
|
+
}
|
|
637
|
+
else if (this.distro().versionLike === 'thirtyfive') {
|
|
638
|
+
const dest = '/etc/penguins-eggs.d/distros/thirtyfive/';
|
|
639
|
+
const thirtytive = `${rootPen}/conf/distros/thirtyfive/*`;
|
|
640
|
+
await (0, utils_2.exec)(`cp -r ${thirtytive} ${dest}`, echo);
|
|
641
|
+
/***********************************************************************************
|
|
642
|
+
* Arch Linux
|
|
643
|
+
**********************************************************************************/
|
|
644
|
+
/**
|
|
645
|
+
* Endeavour rolling: eredita da rolling
|
|
646
|
+
*/
|
|
647
|
+
}
|
|
648
|
+
else if (this.distro().versionLike === 'rolling') {
|
|
649
|
+
const dest = '/etc/penguins-eggs.d/distros/rolling/';
|
|
650
|
+
const rolling = `${rootPen}/conf/distros/rolling/*`;
|
|
651
|
+
await (0, utils_2.exec)(`cp -r ${rolling} ${dest}`, echo);
|
|
652
|
+
/***********************************************************************************
|
|
653
|
+
* openSuse
|
|
654
|
+
**********************************************************************************/
|
|
655
|
+
/**
|
|
656
|
+
* openSUSE tumbleweed: eredita da tumbleweed
|
|
657
|
+
*/
|
|
658
|
+
}
|
|
659
|
+
else if (this.distro().versionLike === 'tumbleweed') {
|
|
660
|
+
const dest = '/etc/penguins-eggs.d/distros/tumbleweed/';
|
|
661
|
+
const tumbleweed = `${rootPen}/conf/distros/tumbleweed/*`;
|
|
662
|
+
await (0, utils_2.exec)(`cp -r ${tumbleweed} ${dest}`, echo);
|
|
535
663
|
}
|
|
536
664
|
}
|
|
537
665
|
/**
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
static packageIsInstalled(
|
|
666
|
+
* restuisce VERO se il pacchetto è installato
|
|
667
|
+
* @param debPackage
|
|
668
|
+
*/
|
|
669
|
+
static packageIsInstalled(packageName) {
|
|
542
670
|
let installed = false;
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
671
|
+
if (this.distro().familyId === 'debian') {
|
|
672
|
+
installed = debian_1.default.packageIsInstalled(packageName);
|
|
673
|
+
}
|
|
674
|
+
else if (this.distro().familyId === 'fedora') {
|
|
675
|
+
installed = fedora_1.default.packageIsInstalled(packageName);
|
|
676
|
+
}
|
|
677
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
678
|
+
installed = archlinux_1.default.packageIsInstalled(packageName);
|
|
679
|
+
}
|
|
680
|
+
else if (this.distro().familyId === 'suse') {
|
|
681
|
+
installed = suse_1.default.packageIsInstalled(packageName);
|
|
547
682
|
}
|
|
548
|
-
//console.log(debPackage + ' ' + installed)
|
|
549
683
|
return installed;
|
|
550
684
|
}
|
|
551
685
|
/**
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
static async packageAptAvailable(
|
|
556
|
-
let
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
const stdout = shx.exec(cmd, { silent: true }).stdout.trim();
|
|
560
|
-
// console.log('===================================')
|
|
561
|
-
// console.log('[' + stdout + ']')
|
|
562
|
-
// console.log('[' + test + ']')
|
|
563
|
-
// console.log('===================================')
|
|
564
|
-
if (stdout === test) {
|
|
565
|
-
disponible = true;
|
|
686
|
+
* restuisce VERO se il pacchetto è installato
|
|
687
|
+
* @param debPackage
|
|
688
|
+
*/
|
|
689
|
+
static async packageAptAvailable(packageName) {
|
|
690
|
+
let available = false;
|
|
691
|
+
if (this.distro().familyId === 'debian') {
|
|
692
|
+
available = debian_1.default.packageIsInstalled(packageName);
|
|
566
693
|
}
|
|
567
|
-
return
|
|
694
|
+
return available;
|
|
568
695
|
}
|
|
696
|
+
/**
|
|
697
|
+
*
|
|
698
|
+
* @param debPackage
|
|
699
|
+
* @returns
|
|
700
|
+
*/
|
|
569
701
|
static async packageAptLast(debPackage) {
|
|
570
702
|
let version = '';
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
// console.log('===================================')
|
|
575
|
-
// console.log('[' + version + ']')
|
|
576
|
-
// console.log('===================================')
|
|
703
|
+
if (this.distro().familyId === 'debian') {
|
|
704
|
+
version = await debian_1.default.packageAptLast(debPackage);
|
|
705
|
+
}
|
|
577
706
|
return version;
|
|
578
707
|
}
|
|
579
708
|
static async packageNpmLast(packageNpm = 'penguins-eggs') {
|
|
580
|
-
return
|
|
709
|
+
return shelljs_1.default.exec('npm show ' + packageNpm + ' version', { silent: true }).stdout.trim();
|
|
581
710
|
}
|
|
582
711
|
/**
|
|
583
712
|
*
|
|
@@ -585,7 +714,7 @@ class Pacman {
|
|
|
585
714
|
*/
|
|
586
715
|
static async commandIsInstalled(cmd) {
|
|
587
716
|
let installed = false;
|
|
588
|
-
const stdout =
|
|
717
|
+
const stdout = shelljs_1.default.exec(`command -v ${cmd}`, { silent: true }).stdout.trim();
|
|
589
718
|
if (stdout !== '') {
|
|
590
719
|
installed = true;
|
|
591
720
|
}
|
|
@@ -595,79 +724,38 @@ class Pacman {
|
|
|
595
724
|
return installed;
|
|
596
725
|
}
|
|
597
726
|
/**
|
|
598
|
-
* Install the package
|
|
599
|
-
* @param
|
|
727
|
+
* Install the package packageName
|
|
728
|
+
* @param packageName {string} Pacchetto Debian da installare
|
|
600
729
|
* @returns {boolean} True if success
|
|
601
730
|
*/
|
|
602
|
-
static async packageInstall(
|
|
731
|
+
static async packageInstall(packageName) {
|
|
603
732
|
let retVal = false;
|
|
604
|
-
if (
|
|
605
|
-
retVal =
|
|
733
|
+
if (this.distro().familyId === 'debian') {
|
|
734
|
+
retVal = await debian_1.default.packageInstall(packageName);
|
|
735
|
+
}
|
|
736
|
+
else if (this.distro().familyId === 'archlinux') {
|
|
737
|
+
retVal = await archlinux_1.default.packageInstall(packageName);
|
|
738
|
+
}
|
|
739
|
+
else if (this.distro().familyId === 'fedora') {
|
|
740
|
+
retVal = await fedora_1.default.packageInstall(packageName);
|
|
606
741
|
}
|
|
607
742
|
return retVal;
|
|
608
743
|
}
|
|
609
744
|
/**
|
|
610
745
|
*
|
|
611
746
|
* @param packages array packages
|
|
612
|
-
*/
|
|
613
|
-
static excludeInstalled(packages) {
|
|
614
|
-
let notInstalled = [];
|
|
615
|
-
for (const i in packages) {
|
|
616
|
-
if (!Pacman.packageIsInstalled(packages[i])) {
|
|
617
|
-
notInstalled.push(packages[i]);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
return notInstalled;
|
|
621
|
-
}
|
|
622
|
-
/**
|
|
623
|
-
* @param remove
|
|
624
|
-
* @param verbose
|
|
625
747
|
*
|
|
626
|
-
*
|
|
748
|
+
* Probabilmente da rimuovere, viene usata solo da prerequisitesRemove
|
|
749
|
+
*
|
|
627
750
|
*/
|
|
628
|
-
static
|
|
629
|
-
const
|
|
630
|
-
const packages
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
const locales = settings.config.locales;
|
|
634
|
-
if ((versionLike === 'jessie') ||
|
|
635
|
-
(versionLike === 'stretch') ||
|
|
636
|
-
(versionLike === 'buster') ||
|
|
637
|
-
versionLike === 'bullseye' ||
|
|
638
|
-
(versionLike === 'beowulf')) {
|
|
639
|
-
for (let i = 0; i < locales.length; i++) {
|
|
640
|
-
if (locales[i] === process.env.LANG) {
|
|
641
|
-
continue;
|
|
642
|
-
}
|
|
643
|
-
if (locales[i] === `it_IT.UTF-8`) {
|
|
644
|
-
packages.push('task-italian');
|
|
645
|
-
}
|
|
646
|
-
else if (locales[i] === `en_US.UTF-8`) {
|
|
647
|
-
packages.push('task-english');
|
|
648
|
-
}
|
|
649
|
-
else if (locales[i] === `es_PE.UTF-8`) {
|
|
650
|
-
packages.push('task-spanish');
|
|
651
|
-
}
|
|
652
|
-
else if (locales[i] === `pt_BR.UTF-8`) {
|
|
653
|
-
packages.push('task-brazilian-portuguese');
|
|
654
|
-
}
|
|
655
|
-
else if (locales[i] === `fr_FR.UTF-8`) {
|
|
656
|
-
packages.push('task-french');
|
|
657
|
-
}
|
|
658
|
-
else if (locales[i] === `de_DE.UTF-8`) {
|
|
659
|
-
packages.push('task-german');
|
|
660
|
-
}
|
|
661
|
-
else if (locales[i] === `pl_PL.UTF-8`) {
|
|
662
|
-
packages.push('task-polish');
|
|
663
|
-
}
|
|
664
|
-
else if (locales[i] === `de_DE.UTF-8`) {
|
|
665
|
-
packages.push('task-russian');
|
|
666
|
-
}
|
|
751
|
+
static filterInstalled(packages) {
|
|
752
|
+
const installed = [];
|
|
753
|
+
for (const i in packages) {
|
|
754
|
+
if (Pacman.packageIsInstalled(packages[i])) {
|
|
755
|
+
installed.push(packages[i]);
|
|
667
756
|
}
|
|
668
|
-
packages.push('live-task-localisation');
|
|
669
757
|
}
|
|
670
|
-
return
|
|
758
|
+
return installed;
|
|
671
759
|
}
|
|
672
760
|
}
|
|
673
761
|
exports.default = Pacman;
|